In Snipcart's v2.0, we added some useful logs directly in the browser developer tools to help developers debug their integration while integrating Snipcart to a website.
If you don't know how to use developer tools, we highly suggest you take a look at your browser documentation. We included links below for the three major browsers:
Please note that we're going to use Chrome for the following examples.
All the logs that will come from our script will be prefixed by
Snipcart:, for instance:
Snipcart: This item is missing the mandatory
data-item-idattribute. Please refer to the following part of our documentation to see which attributes are required: http://docs.snipcart.com/configuration/product-definition
When defining your buy buttons,
data-item-url are mandatory fields. It will be impossible to add items to a cart if any of those is missing.
If you hit your buy button and we notice that some fields are missing, we'll show some logs in the console that will help you debug the application.
Below is an example of a product without
One of the most common errors we see is when we do our crawling validation. We suggest you start by reading our Security section to understand how that works.
If the product URL is not on an allowed domain, you'll see an error like the following:
Snipcart: The item at URL
https://example.com/invalid-domainis not on an allowed domain. Please take a look at the Security section of our documentation (http://docs.snipcart.com/getting-started/security) to understand how it works.
This is only one example, but we'll have multiple other messages to help you figure out what are the issues with your integration.
We also provide developer logs directly in our dashboard. If you have issues with shipping providers, payment gateways anything else we suggest you start by looking at the developer logs. It might be helpful to figure out what's going on.