Hi,
I have the product recommendations feature turned on, but it doesn’t seem to be showing. It will show for a second and then disappear; I assume something is wrong with the code. How can I fix this?
My website is: https://raidednz.com/
Product recommendations briefly appear on product pages, then disappear. The feature is enabled, so the issue is likely code-related rather than settings.
Key findings: malformed theme code is present. There’s a nested (invalid HTML/JS) used for a Facebook Pixel call and multiple tags, which can confuse the browser and break scripts. The recommendations’ code seems to be removed by JavaScript conflicts.
Suggested fixes:
Status: unresolved/ongoing. Next step is code cleanup and conflict isolation. Code snippets are central to the issue.
Hi,
I have the product recommendations feature turned on, but it doesn’t seem to be showing. It will show for a second and then disappear; I assume something is wrong with the code. How can I fix this?
My website is: https://raidednz.com/
Do you have a previous copy of your theme?
Something crazy is going on in this one, like this – you can’t nest script and this way of calling Facebook pixel is wrong.
<script><script>
fbq('track', 'AddToCart', {
contents: [
{
quantity: 1
}
],
});
</script>;<script>
Besides – last <script> opens another Javascript element, but …
There are also 2 pairs of <body> and </body> tags.
These need to be sorted out – browser gets confused
I do, but it’s mad old and I can’t be bothered updating the entire thing again
@raidednz was it working before and stopped after you made an edit or update or added any app? the code been removed from the page which suggests it can happen due to javascript conflicts, do you remember any change to the site?
Ok, at least try to remove the last <script> in the snippet I’ve copied from your side.
Or remove it entirely, as it would not work properly anyway.
Should be in your layouts/theme.liquid, probably first thing after <body> tag.
I remember it did work at some point, but I’m unsure on what app, edit, or update could of disturbed it
You can try to add recommendation section in product.liquid file and check