shopify 添加到购物车问题(购物车为空)

时间:2021-05-25 09:46:11

标签: shopify shopify-app

我的问题是: 我使用粗体订阅应用程序自动将替换头添加到任何购买中。 错误是尝试结帐时购物车是空的。 请观看此视频以了解 https://www.loom.com/share/526e5d0f6e324ba1808c9099d23114a5

这是我使用的jquery代码

$( "#AddTOCART" ).click(function(cart) {
data = {items: [
      {
       id: 37498684506266,
       quantity: 1,
       selling_plan: 64290970
       
      }
 ]}
 jQuery.ajax({
     type: 'POST',
     url: '/cart/add.js',
     data: data,
     async: false,
     cache: false,
     dataType: 'json',
     success:AddtoCartSuccess
 });

function AddtoCartSuccess(){
     $.ajax({
         type: 'GET',
         url: '/cart.js',
         async: false,
         cache: false,
         dataType: 'json'
     });
}
alert("Thank You! The Product Was added to the Cart Successfully.");
});

如果您需要我提供任何代码,请告诉我

0 个答案:

没有答案