对于我的 nextjs 应用程序,我想使用 snipcart 结帐。当我尝试验证付款时,我收到一个错误:
A 'cart-confirmation' error occured in Snipcart.
Reason: 'product-crawling-failed'
--- Item 1 --- [Item ID] 8 [Item Unique ID] 9e63189a-5a3b-4a25-bf57-ceb4574cad45 [Item Name] SEFLESS [Url] https://cmeditions.fr/books/SEFLESS [Status] NotFound [Price in cart] 15 [ Crawled prices] [] [Details] We have not been able to find item with id '8' at 'https://cmeditions.fr/books/SEFLESS'. Please make sure the product is correctly defined.
这是我的 snipcart 按钮:
<div className="colophon">
{product.status === true ? (
<button
className="snipcart-add-item buy-button "
variant="dark"
onMouseEnter={(e) => handleEnter(e)}
onMouseOut={(e) => handleExit(e)}
data-item-id={product.id}
data-item-price={product.price}
data-item-url={router.asPath}
data-item-image={getStrapiMedia(product.grid_pic.url)}
data-item-name={product.name}
data-item-description={product.author}
v-bind="customFields"
>
BUY ME!
</button>
如果我单击错误中打印的产品 URL,我会进入目录而不是产品。我认为问题可能来自 nextjs 路由问题......?