A critical JavaScript error is preventing the add-to-cart functionality from working on a Shopify store using the Ride theme. When customers attempt to add products, the page continuously loads without completing the action.
Root Cause Identified:
The issue stems from a syntax error in the layouts/theme.liquid file—specifically, an extra closing curly brace (}) located just above a </script> tag in the window.accessibilityStrings code block.
Recommended Solution:
Remove the stray } character from the theme.liquid file
This JavaScript error is visible in the browser console and blocks the theme’s core functionality
Current Status:
The site is ready to launch but blocked by this bug. The store owner has already attempted updating to the latest theme version and verified that installed apps aren’t interfering with the product page.
Summarized with AI on October 30.
AI used: claude-sonnet-4-5-20250929.
Morning,
About to make this website live and we have noticed every time you try adding something to the cart it just spins and spins and never loads or makes it way to the cart successfully.
I am using the ride theme, I have tried updating it to the latest version and the same thing is happening.
Any help in sorting it would be appreciated.
I’ve checked my apps which are in the store too and none of them touch the product page or side of things at all.
At the bottom of your layouts/theme.liquid you have this code:
window.accessibilityStrings = {
imageAvailable: `Image [index] is now available in gallery view`,
shareSuccess: `Link copied to clipboard`,
pauseSlideshow: `Pause slideshow`,
playSlideshow: `Play slideshow`,
recipientFormExpanded: `Gift card recipient form expanded`,
recipientFormCollapsed: `Gift card recipient form collapsed`,
countrySelectorSearchCount: `[count] countries/regions found`,
};
}
{%- if settings.predictive_search_enabled -%}
{%- endif -%}
The line above the tag should be deleted – this is a single extra curly brace which causes the JS error in console, as mentioned by @devcoders and prevents your theme JS from working properly.