Hi there.
I’m building a client ecommerce site. I’ve built the UI in Webflow, and I’m using Airtable as the product database/inventory. I’m pulling the products in via the API and product pages are populated via the API as is the Snipcart add to cart button. I’ve integrated Snipcart and it works well when adding a product to cart and pulling all of the data through.
The pricing validation was failing on payment which I understand is because the cart button is being dynamically populated so Snipcart’s HTML crawler can’t see the data. So I’ve instead changed the data-item-url
to an endpoint for my products Airtable, which only returns JSON, however it’s still failing.
Having checked the endpoint in Postman I can see it’s returning the following:
{
"id": "rec123",
"fields": {
"id": "rec123",
"price": "129.99",
"url": "https://mysite.com/product?product-id=rec123"
},
"createdTime": "2021-12-22T13:29:19.000Z"
}
The only thing I can think that is happening is Snipcart’s JSON crawler is looking for id
, price
and url
but it’s not finding them because they’re within fields
. Is this correct? And if so, how might I tell the crawler to look within there?
I’ve tried various parameters on my API calls to Airtable and can’t find a way to dig down within fields
, so it always shows in the response.
Thanks!