EvgeniyMukhamedjanov / liquid-ajax-cart

Build a Shopify Ajax-cart without JavaScript coding
https://liquid-ajax-cart.js.org
195 stars 22 forks source link

Integration with Barba.js #104

Open JoeriE opened 3 months ago

JoeriE commented 3 months ago

Hi,

We would like to use liquid ajax cart together with Barba.js.. Is there a way to re-init everything after a page transition? So that the correct data is fetched.

Best wishes, Joeri Evers

EvgeniyMukhamedjanov commented 3 months ago

Hi Joeri, Barba.js is kind of PAJAX way to navigate between pages? I've never tested Liquid Ajax Cart with that but I don't see any reason it wouldn't work. Do you have any test theme with Liquid Ajax Cart and Barba installed to see what issue you are facing?

EvgeniyMukhamedjanov commented 3 months ago

If you want to force Liquid Ajax Cart to reload data from Shopify, you can run an empty POST update.js request by doing this: window.liquidAjaxCart.update(); It will send an empty update request to Shopify and Shopify will return current cart state and cart related sections HTML.