Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

richSnippet SKU with double-quote #38

Open
perryholden opened this issue Nov 23, 2022 · 0 comments
Open

richSnippet SKU with double-quote #38

perryholden opened this issue Nov 23, 2022 · 0 comments

Comments

@perryholden
Copy link

Issue description

When configurable product SKUs have double-quotes in them (although I realize double-quotes in SKUs are not ideal, that is what exists), then the richSnippet JS breaks. See screenshot below.

I think the most ideal solution would be to replace the double-quotes in the SKU data attribute in \Reviewscouk\Reviews\Block\Richsnippet::getRichSnippet with "template literals" (backticks). This is already done with the description.

If this is an acceptable solution, I can create a PR. Thanks.

Steps to reproduce the issue

  1. Create a configurable product with a SKU that contains a double-quote.
  2. Navigate to that PDP.

What's the expected result?

  • No JS errors

What's the actual result?

  • The following JS error shows in the console:
Uncaught SyntaxError: Unexpected token ';' (at sample-url:2347:323)

Additional details / screenshot

  • Screenshot
  • Screenshot 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant