empty JSON causes javascript error
-
First of all, thanks for the great plugin!
I hereby want to report a bug.
/woocommerce-google-dynamic-retargeting-tag/wgdr.php (line 312)
ecomm_totalvalue: <?php echo $woocommerce->cart->cart_contents_total; ?>
When the variable $woocommerce->cart->cart_contents_total is empty a javascript error is triggered.
The variable should be enclosed in quotes to make it safe.
ecomm_totalvalue: '<?php echo $woocommerce->cart->cart_contents_total; ?>'
You could also force a variable type, e.g. floatval.
https://www.ads-software.com/plugins/woocommerce-google-dynamic-retargeting-tag/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘empty JSON causes javascript error’ is closed to new replies.