Extension list

Skip to main content

List of all our extensions

Create an account

Product JSON-LD breaks on quotes in the description

Product JSON-LD breaks on quotes in the description was created by keep2000

Posted 2 days 23 minutes ago #1220
Hi,

in VM UIKit X 10.51, dynamic/templates/product_addtocart.php prints the product description straight into the JSON-LD script. It only runs strip_tags and replaces @. Quotes and line breaks are not escaped.

If the description contains a " or a newline, the JSON is invalid. Google Search Console reports: Parsing error: Missing ',' or '}'.

Name, category, sku and brand are printed the same way. Several reviews also become repeated "review" keys instead of an array.

I think building the object in PHP and passing it through json_encode would fix this.

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.324 seconds
Powered by Kunena Forum