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.
The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024