Order validation error, crawler can't read price modifiers

Hi, here is my button that adds the product with correct price to the cart. but on checkout the crawler tries to match it with data-item-price=‘3390’ and ignores custom field price modifiers. you can check it yourself to place an order on this link:

Summary

This text will be hidden

<button class="snipcart-add-item"
  id="arte"
  data-item-id='arte'
  data-item-url='/shop/dining-tables/arte'
  data-item-price='3390'
  :data-item-name='"Arte " + stoneChoice.name'
  data-item-categories='Dining Tables'
  data-item-custom1-name='Stone:'
  data-item-custom1-options='Carrara|Arabescato[+900]|Volakas[+700]|Crema Marfil|Caliza Paloma|Calacatta Viola[+1500]|Nero Marquina|Coralito|Emperador|Verde Alpi[+900]|Verde Guatemala'
  :data-item-custom1-value='stoneChoice.name'
  data-item-custom1-type='readonly'
  data-item-custom2-name='Size:'
  data-item-custom2-options='180 x 90 x 72 cm|200 x 90 x 72 cm[+100]|220 x 90 x 72 cm[+200]|240 x 90 x 72 cm[+300]|240 x 100 x 72 cm[+350]|240 x 110 x 72 cm[+400]'
  :data-item-custom2-value='sizeChoice.name'
  data-item-custom2-type='readonly'
  data-item-custom3-name='Finish:'
  data-item-custom3-options='Polished|Matt[+100]'
  :data-item-custom3-value='finishChoice.name'
  data-item-custom3-type='readonly'
  data-item-custom4-name='Top Edge:'
  data-item-custom4-options='Normal|Rounded[+150]'
  :data-item-custom4-value='edgeChoice.name'
  data-item-custom4-type='readonly'
  data-item-has-taxes-included='true'
  >{{ $t( 'product.buy' ) }}</button>

On console I get this error:
snipcart.js:1 A ‘cart-confirmation’ error occured in Snipcart.

Reason: ‘product-crawling-failed’

— Item 1 —
[Item ID] arte
[Item Unique ID] 8a50815b-781b-4e6b-9de2-556230932a8c
[Item Name] Arte Carrara
[Url] MAWRBLE
[Status] NotFound
[Price in cart] 3390
[Crawled prices] []

[Details] We have not been able to find item with id ‘arte’ at ‘MAWRBLE’. Please make sure the product is correctly defined. We suggest you take a look at this section of our documentation: http://docs.snipcart.com/configuration/product-definition

Hi @Kian, thanks for reaching out.

Looks like youre using an SPA, so in your HTML there is no product data:


Our HTML validation only reads the raw HTML, we do not run JS.
In those cases you need to use the JSON Crawler for product validation

Let me know if you have further questions.

Thanks.

@nelitow Thanks for the info.
I followed the instruction but couldn’t solve the issue.

I have my data in mongo db and i’m providing an array of products in JSON when a GET request sent to this public API(no auth): *************
On postman I receive the JSON successfully but snipcart JSON crawler nor fetch products in snipcart dashboard can get it. I have also added this domain to " OTHER DOMAINS & SUBDOMAINS " but no luck!

Am i missing something ?

Nevermind, I passed price value as string in mongodb and it solved my issue.

1 Like