Hello everyone, I have a situation I need to address.
Situation:
I am building a store that sells jackets. The price and shipping weight for each product change based on which size the customer chooses.
Problem:
My checkout workflow fails whenever the customer attempts to purchase a size different from the default size listed on the product’s details page.
Assumptions:
I know the failure is caused by the HTML crawler seeing data attribute values in the DOM that don’t match the customer’s selections. More specifically, these data attribute values are related to weight, which directly affects the price.
The only solution I can think of is to set up a unique REST API that serves JSON data for every possible variant/size/weight/price combination so that Snipcart can validate products in the checkout workflow using the JSON crawler instead.
Building an API just for product validation would be an astronomical amount of work on top of an already tight deadline with this client.
I imagine this problem has been addressed before in a more efficient manner, so I was hoping someone might share some insight.
Also, for the record, this site uses the Contentful CMS to hold my data models and product listings. I could use their API, but I would still run into the same problem of producing a JSON representation of every possible variation.
Here’s a test hosting of the site :
That said, the store is still in test mode, so you can attempt to make purchases using Snipcart’s test credit card … i.e., 4242 4242 4242 … etc.
Thank you so much!