Answer the question
In order to leave comments, you need to log in
CS-Cart + Barba.js?
Hello.
I use barba.js in my projects to navigate between pages without reloading. First experience with CS-Cart.
The problem is that it is necessary to use the scripts of this platform for the operation of the online store (adding goods to the cart, favorites, comparison, placing an order).
Each platform file is connected separately, they all lie in the barba.js container and dynamically change during transitions between pages, but are not initialized.
I saw only one solution with the launch of built-in scripts - the eval function.
Barba.Dispatcher.on('newPageReady', function(currentStatus, oldStatus, container) {
var js = container.querySelector("script");
if(js != null){
eval(js.innerHTML);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question