All things Shopify and commerce
Hello. I, for the life of me, can't figure this out. Can I please get some direction?
Hi @AvyCoffee That indicates something is wrong with the built in structured_data filter that was recently added.
assuming the "product" object being used is an actual product object and not some sort of accidental incorrect variable assignment.
If you've customized the code of your theme first try a fresh install of the theme to see if the issue persists in an unmodified theme.
If an unmodified theme does not have the same issue there is something wrong with any code changes done to the theme.
If your using a shopify supported theme such as Dawn contact shopify support directy to report a bug
https://help.shopify.com/en/support/support-type
The interim alternative is to create your own /ld+json schema and replace that liquid filter.
For dawn the structured_data filter was added in these pull requests:
https://github.com/Shopify/dawn/pull/3507
https://github.com/Shopify/dawn/pull/3380
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hey @AvyCoffee
The issue is that you have an if statement inside the script tag which isn't valid and then if it's not found, the text "product not found" wouldn't be valid either. Once you pull the if statement outside of the script tag, your error should go away.
Thank you. Are you saying I should delete the highlighted code? (line 718)
Your entire if statements need to be outside the script tag. So if you want the if statement it should roughly look like:
if product
script open
product structured data
script closed
end if
I can't tell if you're on a product file or not. If you are, you shouldn't need the if statement at all.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024