I’ve created a page from scratch. I inserted a Section and a Code Block. The code block contains the following PHP code:
<?php
if (function_exists('WC')) {
echo WC()->cart->get_cart_total();
}
?>
This seems quite legitimate. However, I’m unable to save the page due to the following error:
Publishing failed. Unexpected token 'E', "Error: Cal"... is not valid JSON
EDIT:
The code in the header returns a Cwicly error but the frontend display is ok with the correct amount and format.
Environment info
- WordPress version: 6.2.2
- Cwicly Plugin version: 1.2.9.7.2.1