FROM CACHE - it_header

Redirect automatica on Cart Page

silvialorusso
Visitatore
2 0 0

Buongiorno, uso il tema Debutify e, dopo aver aggiunto un prodotto al carrello, avviene il redirect automatico che vorrei eliminare e sostituire semplicemente con l'icona del carrello che segna 1 prodotto.

 

Ho individuato il problema del redirect in theme.js.liquid

itemAddedCallback = function() {
if (theme.settings.dbtfySkipCart) {
theme.goToCheckoutWithDiscount();
} else {
if (theme.settings.cartType === "drawer") {
ShopifyAPI.getCart(cartUpdateCallback);
} else {
if (document.body.classList.contains("template-cart")) {
ShopifyAPI.getCart(cartUpdateCallback);
} else {
window.location.assign("/cart");
}
}
}
};

 

Con cosa dovrei sostituire questa riga di codice secondo voi?

1 RISPOSTA 1

silvialorusso
Visitatore
2 0 0

condivido la soluzione che ho trovato, così funziona, solo che si aggiorna solo il numero sul carrello e non c'è un feedback esplicito

 

itemAddedCallback = function() {
if (theme.settings.dbtfySkipCart) {
theme.goToCheckoutWithDiscount();
} else {
if (theme.settings.cartType === "drawer") {
ShopifyAPI.getCart(cartUpdateCallback);
} else {
if (document.body.classList.contains("template-cart")) {
ShopifyAPI.getCart(cartUpdateCallback);
} else {
ShopifyAPI.getCart(cartUpdateCallback);
}
}
}
};