Multiple Products On One Page No longer Validate

Multiple buy buttons on the same page are no longer validating as of 5th July or thereabouts.

Client needs multiple variants of each SKU with different IDs for accounting purposes. To accomplish this, each page has multiple buy buttons with the correct button shown as the user makes a variant selection. All buttons have correct product data-item-id and data-item-url set and no data-item-ids are duplicated. This was working perfectly up until July 5th (ish).

Now, when user checks out, we get the ‘Price of products in cart may have changed’ error for all payment gateways (Stripe & PayPal Express) on any of these pages. However, for pages with only one buy button (one variant) orders go through OK.

Is anyone else seeing this or have any potential solutions?

Any help greatly appreciated.

1. Fix your current setup

If you’re using a Single Page Application (SPA) framework like Next.js, make sure you’re using Server-Side Rendering (SSR) to ensure that all Snipcart-related data is present when the page is initially loaded.

It’s critical that the Snipcart product data is not loaded via JavaScript after the initial page load. If your content is only hydrated client-side, the Snipcart crawler won’t be able to detect the product data, and validation will fail.

Quick test:
Turn off JavaScript in your browser and load your website. If you don’t see the product data in the raw HTML, then Snipcart’s crawler won’t see it either. Fixing this will also improve your site’s SEO.

2. Use Snipcart’s JSON Crawler

If SSR isn’t an option, or you’re facing issues beyond JavaScript rendering, you can switch to using Snipcart’s JSON crawler.

This allows you to define a URL that returns a JSON object containing your product data, which Snipcart will use to validate the basket instead of relying on HTML.

:link: JSON Crawler Docs:

This approach decouples product validation from your front-end rendering and gives you full control over the data.

Bonus Tip:

Check the developer logs in your Snipcart dashboard — they often contain useful error messages or clues about why product validation is failing.