Order couldn't be processed/Price of products in the cart may have changed

Since products are defined directly in the HTML markup, it could be pretty easy for a malicious customer to use their developer tools to manipulate product data and process fraudulent orders. To prevent that, we implemented an order validation mechanism.

It’s important to consider this when developing a project with Snipcart. If you get this error:

You get this error because order validation fails. You will find more information on the product causing the error in de developer logs and in the developer console of your browser.

Make sure the data-item-url points to the page with the Snipcart button if you are using the HTML crawler or to the product definition if you are using the JSON crawler.

If you are using a relative URL, make sure you set up the default domain. This URL needs to be publicly accessible. If you want to test in local development, you can use a tool like ngrok.

If you are creating the buttons dynamically, the crawler will not work since it doesn’t execute javascript. In this case, you will probably need to use the JSON crawler.

I want to love this product, but I keep getting this dreaded error. I’ve checked the logs and see:

Found 0 snipcart-add-item elements with ids []

I hardcoded the HTML from the starry night example for the button and even created a page called “/paintings/starry-night” just to test but no joy.

Nevermind. I got it. I am using Cloudflare to serve my site and it thought SnipCart was a bot and was blocking access.

1 Like

For me, I got this error because I was specifying product URLs without a trailing slash, but my NextJS app was automatically redirecting to the same URL with a trailing slash. Hopefully this will help someone else.

1 Like

I’m using Infinity Free web hosting and they are blocking some bots, but not Search Engine crawlers: Ensuring only web browsers can access your website - Docs - InfinityFree Forum
Could it be the reason for the Product crawling error? I double-checked everything else. The Domain is set, I have simple one page with data-item-url="/", there is only one product on that page. And I’m still getting the error.

Validating item with id ‘001’ located at ‘/’ on domain ‘inmt-snipcart.great-site.net’.
Found 0 snipcart-add-item elements with ids []

I moved to another web hosting, and it works, so the problem really was the blocking of the Snipcart bot.