Closed 8geonirt closed 4 years ago
@gavinballard whenever you have a chance could you please take a look at it?
@8geonirt Released in 1.0.2.
@8geonirt Released in 1.0.2.
Awesome! Thanks for taking a look at it 👍
It seems this isn't working anymore and the cart.js endpoint is being cached regardless.
Another workaround:
$.ajax({ type: 'GET', url: '/cart.js', cache: false, dataType: 'json', success: function(cart) { CartJS.init(cart, { "moneyFormat": "{{ shop.money_format }}", "moneyWithCurrencyFormat": "{{ shop.money_with_currency_format }}", "requestBodyClass": "cart-loading" }); } });
Thanks @capatina. I have an underlying change to pass cache: false
in the Ajax request, should be released shortly.
Fixes #158
This commit adds a timestamp to the API call to get a non-cached response. This approach is done by Shopify itself to avoid loading cached assets
Note: I am maintaining a Shopify theme and we have a custom slide cart component created from scratch (no libraries used), we faced the same issue and before creating a fix for this I found this library and I would like to contribute to it with that simple fix.