简体   繁体   English

请求shopify cart.json停止工作并出现错误330

[英]Request shopify cart.json stopped working with error 330

I use jQuery to get the cart data contents from Shopify and display it on another site. 我使用jQuery从Shopify获取购物车数据内容,并将其显示在另一个站点上。 It just stopped working. 它只是停止工作。 Google Chrome shows the request is 'failed' and when I open this request in another tab Google shows: Google Chrome浏览器显示请求“失败”,当我在另一个标签中打开此请求时,Google显示:

Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.

When I Google for this message I only get reports saying it has something todo with compression. 当我用Google搜索此消息时,我只收到报告说它与压缩有关。 Which is a bit difficult to debug as Shopify is a hosted webshop. 由于Shopify是托管的网上商店,因此调试起来有些困难。

I use this method to get the cart contents: 我使用这种方法来获取购物车内容:

Shopify.getCart = function(callback) {
  console.log("getCart")
  jQuery.ajax({url: 'http://shop-here/cart.json', dataType: 'jsonp', cache: false, success:
    function(cart){
      console.log("response: " + callback)
      console.log(cart)
      if (callback !== undefined && (typeof callback) === 'function') {
        callback(cart);
      }
      else {
        Shopify.onCartUpdate(cart);
      }
    }
  });
};

What is going wrong and how do I fix this? 发生了什么问题,我该如何解决?

Shopify fixed the issue. Shopify解决了该问题。 As the error messages indicated, it was an error on the Shopify servers. 如错误消息所示,这是Shopify服务器上的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM