Hello I have been beating my head against the wall trying to figure out how to get snipcart to pick u the dimensions of products so it can calculate shipping.
Here are the two ways I am displaying the button, either in HTML on page (index, prouduct page) or in the new json list view.
I have created a script that archives all products in my store, so I can run the sync and repopulate HOPEFULLY with the correct data.
<button className="snipcart-add-item flex items-center rounded-md bg-slate-900 px-5 py-2.5 text-center text-sm font-medium text-white hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-blue-300"
data-item-id={title}
data-item-url={`${process.env.NEXT_PUBLIC_SITE_URL}/shop/${slug}`}
data-item-price={price}
data-item-description={summary}
data-item-image={imgSrc}
data-item-name={title}
data-item-quantity={1}
data-item-max-quantity={1}
data-item-weight={grams}
data-item-length={13.97}
data-item-width={5.08}
data-item-height={5.08}
>
{
id: product.frontMatter.title,
url: `${process.env.NEXT_PUBLIC_SITE_URL}${product.frontMatter.href}`,
price: product.frontMatter.price,
image: product.frontMatter.imgSrc,
dimensions: {
weight: product.frontMatter.grams,
length: 13.97,
width: 5.08,
height: 5.08,
},
description: product.frontMatter.summary,
stock: stock
}
No matter HOW MANY TIMES I run the sync / wipe process… I cannot get the dashboard to show product stock. Now I’m in a situation where the checkout process breaks… I add items to my cart and then they disappear. I get a very unhelpful “an error has occoured please contact us” message and I’m not getting any errors in my developer logs.
Dashboard Screenshot
https://imgur.com/a/x4pzYeZ
Checkout Error
https://imgur.com/Bn4mr2m