klaviyo / magento2-klaviyo

37 stars 51 forks source link

You need to escape string #15

Closed jefflenz closed 5 years ago

jefflenz commented 6 years ago

/vendor/klaviyo/magento2-extension/view/frontend/templates/product/viewed.phtml

Does not escape the product name, produces js error if product has double quote in name.

var item = { ProductID: "<?php echo $_product->getId(); ?>", Name: "<?php echo $_product->getName(); ?>", SKU: "<?php echo $_product->getSku(); ?>", URL: "<?php echo $_product->getProductUrl(); ?>", Price: <?php echo number_format($price, 2); ?>, FinalPrice: <?php echo number_format($final_price, 2); ?>, <?php if ($_product_image_url) { ?>ImageURL: "<?php echo $_product_image_url; ?>", <?php } ?> Categories: <?php echo $this->getProductCategoriesAsJson(); ?> };

remstone7 commented 5 years ago

just resolved this with latest release