首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“购物车-确认”错误发生在Snipcart中

“购物车-确认”错误发生在Snipcart中
EN

Stack Overflow用户
提问于 2021-05-18 14:05:26
回答 1查看 330关注 0票数 0

对于我的nextjs应用程序,我想使用snipcart签出。当我试图验证付款时,我会收到一个错误:

代码语言:javascript
复制
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.

这是我的按钮:

代码语言:javascript
复制
<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,我将在目录中而不是在产品目录中登陆。我想这个问题可能是因为下一个路由问题.?

EN

回答 1

Stack Overflow用户

发布于 2021-05-19 14:03:12

由于订单验证失败,所以会出现此错误。您将在de 开发人员日志中找到有关导致错误的产品的更多信息。

首先,如果使用HTML爬虫,确保data url指向带有Snipcart按钮的页面,如果使用JSON爬虫,则指向产品定义。

如果使用的是相对URL,请确保设置了默认域。此URL需要公开访问。如果您想在本地开发中进行测试,可以使用像ngrok这样的工具。

另一个重要方面是Snipcart按钮不能动态添加(例如,通过javascript或前端框架(如Vue) )。如果这是您的情况,那么JSON履带机将更适合您。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67587897

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档