El término “Carrito Ajax” se refiere al cajón del carrito, al carrito emergente o al carrito deslizante que algunas tiendas utilizan. Si tu tienda utiliza uno de estos carritos especiales y deseas ofrecer ventas adicionales en estos carritos, ¡entonces In Cart Upsell es la aplicación para ti! A continuación se muestra un ejemplo de cómo se ve un Carrito Ajax.
El código “Ajax Refresh” se utiliza para evitar la redirección a la página del carrito cuando la venta adicional generada por In Cart Upsell se agrega al carrito. Así que, lo que hace el código es asegurar que tus compradores permanezcan en el cajón del carrito “Ajax Cart” después de agregar la venta adicional. Estos códigos son únicos para tu tema y normalmente son proporcionados por los desarrolladores de tu tema. A lo largo de los años, In Cart Upsell ha recopilado códigos de Ajax Refresh para algunos temas comunes.
Lo primero que necesitas saber es el nombre de tu tema. Una vez que sepas eso, puedes proceder a buscar en nuestra lista de “Refresh Codes” el nombre de tu tema. Después de localizar el nombre de tu tema, copia el código de actualización y pégalo en la aplicación yendo a configuración, haz clic en Ajax Cart, y luego pega el código copiado en el cuadro de texto proporcionado para el Ajax Refresh Code.
Theme Name | Refresh Code |
Athens | document.querySelector('.nudge-offer').remove(); document.querySelector('form.mini-cart-inner input.quantity-input-field').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Atlantic | $('.nudge-offer').remove() fetch('/cart?view=mini', { credentials: 'same-origin', method: 'GET' }).then(function (content) { content.text().then(function(html){ $('.cart-mini-content').html(html.replace('<script class="cartFlagX"></script>','').replace('<template data-options>','').replace('{}','').replace('</template>','').replace('<template data-html="content">','').replace('<template data-html="footer">','')) $('.cart-mini-content .cart-mini-subtotal').remove() $('.cart-mini-content .cart-mini-actions').remove() $('.cart-mini-content .cartdrawer-information-header').remove() }) }) $('.quantity .field').trigger('change');<br>
|
Baseline | document.querySelector(".nudge-offer").remove(); document.body.dispatchEvent(new CustomEvent("baseline:modalcart:afteradditem")) InCartUpsell.prototype.findOfferWhenReady();
|
Booster | HsCartDrawer.updateSlideCart(); |
Broadcast | document.querySelector(".nudge-offer").remove(); cart.getCart(); InCartUpsell.prototype.findOfferWhenReady();
|
Brooklyn | document.querySelector(".nudge-offer").remove(); ajaxCart.load(); InCartUpsell.prototype.findOfferWhenReady();
|
Cart.js | CartJS.getCart(); document.querySelector('.nudge-offer').remove(); InCartUpsell.prototype.findOfferWhenReady(); |
Colors | document.querySelector('.nudge-offer').remove(); |
Dawn | document.querySelector('.nudge-offer').remove(); document.querySelector('.nudge-offer').remove(); ajaxCart.load(); InCartUpsell.prototype.findOfferWhenReady();
|
Debut | closeAjaxCart(); ajaxCartUpdate();
|
Debutify | document.querySelector('.nudge-offer').remove(); theme.ajaxCart.update(); InCartUpsell.prototype.findOfferWhenReady(); ------- OR ------- $(".nudge-offer").remove(); $("form.ajaxcart .ajaxcart__qty-num").first().trigger("change"); setTimeout( function(){ InCartUpsell.prototype.findOfferWhenReady(); }, 3000); ------- OR -------- Look for the following line in theme.js.liquid (Get collab access) and change it $(".nudge-offer").remove();
|
Editorial | $.ajax({ url: "/cart.js", type: "GET", _sellify: sellify, success: function(resp){ this._sellify.ucd.helpers.ajaxCart.buildCart(resp); } });
|
Ella | document.querySelector('.nudge-offer').remove(); document.querySelector('div.has-items input.item-quantity').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Expanse | document.querySelector('.nudge-offer').remove(); document.dispatchEvent(new CustomEvent('cart:build')); InCartUpsell.prototype.findOfferWhenReady();
|
Flex | document.querySelector(".nudge-offer").remove(); Shopify.theme.jsAjaxCart.updateView(); InCartUpsell.prototype.findOfferWhenReady();
|
Flow | document.querySelector('.nudge-offer').remove(); document.querySelector('form.cart input.ajaxcart__qty-num').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Focal | document.querySelector('.nudge-offer').remove(); document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', {bubbles: true})); InCartUpsell.prototype.findOfferWhenReady();
|
FoxPad | document.querySelector('.nudge-offer').remove(); document.querySelector('form.cart-flyout__form input.quantity').dispatchEvent(new Event("change")); InCartUpsell.prototype.findOfferWhenReady();
|
Go Live | document.querySelector('.nudge-offer').remove(); $("form.cart-form .cart__qty-input").first().trigger("change"); InCartUpsell.prototype.findOfferWhenReady();
|
Impulse | document.querySelector('.nudge-offer').remove(); $("form.ajaxcart .js-qty__num").first().trigger("change"); InCartUpsell.prototype.findOfferWhenReady(); or document.querySelector('.nudge-offer').remove(); document.dispatchEvent(new CustomEvent('cart:build')); InCartUpsell.prototype.findOfferWhenReady();
|
Minimal | $.getJSON("/cart.js", function(cart) { refreshCart(cart); });
|
Motion | var ajcresp = theme.cart.getCart(); try{ (new theme.CartDrawer()).buildCart(ajcresp.responseJSON); } catch (e){ var oa = 1; }
|
Narrative | $(".nudge-offer").remove(); $("form.cart-drawer .cart-drawer__item-quantity").first().trigger("input");
|
Parallax | ajaxUpdateCart(1, $(this).val(), $(this).parents('#cart'));<br>
|
Pipeline | Shopify.getCart(ajaxifyShopify.buildCart);!Important: Change Line 1131 in Ajaxify.js.liquidFROMmodule = { init: init };TOmodule = { init: init, buildCart: buildCart; }; document.querySelector('.nudge-offer').remove(); document.querySelector('div.drawer__content input.quantity__input').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Pop | document.querySelector('.nudge-offer').remove(); document.querySelector('div.ajaxifyCart--content input.ajaxifyCart--num').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Prestige | fetch('/cart?view=drawer×tamp=' + Date.now(), { credentials: 'same-origin', method: 'GET' }).then(function (content) { content.text().then(function(html){ document.getElementById("sidebar-cart").innerHTML = html; document.getElementById("sidebar-cart").children[0].setAttribute("aria-hidden", "false"); }) }) OR jQuery.get('/cart?view=drawer×tamp=' + Date.now(), function(data, textStatus, jqXHR) { jQuery("#sidebar-cart").html(jQuery(jQuery.parseHTML(data)).filter("#sidebar-cart").html()); jQuery("#sidebar-cart").attr("aria-hidden", false); jQuery("#sidebar-cart").attr("tabindex", "-1"); if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { if (browserRatio >= 1.5) { jQuery("#sidebar-cart").attr("style", "min-height: 360px;"); } else { jQuery("#sidebar-cart").attr("style", "min-height: 555px;"); } } else { jQuery("#sidebar-cart").attr("style", "height: 100vh !important;"); } }); OR document.querySelector('.nudge-offer').remove(); document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', {bubbles: true})); InCartUpsell.prototype.findOfferWhenReady();
|
Refresh | document.querySelector('.nudge-offer').remove(); document.querySelector('form.cart__contents input.quantity__input').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Ride | document.querySelector('.nudge-offer').remove(); |
Sense | document.querySelector('.nudge-offer').remove(); document.querySelector('form.cart__contents input.quantity__input').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Shella | document.querySelector('.nudge-offer').remove(); theme.cart.updateData() setTimeout(() => { theme.cart.updateCart(); }, 1000);
|
SlideCart | window.SLIDECART_UPDATE(); OR window.SLIDECART_UPDATE(function() { window.SLIDECART_OPEN() });
Full list of SlidecartHQ callbacks
|
Starter | setTimeout(function(){ $(window).trigger('updateCart'); }, 100)
|
Streamline | theme.cart._updateCart(); $(".nudge-offer").fadeOut(400,function(){ $(".nudge-offer").remove() }); OR document.dispatchEvent(new CustomEvent("cart:build")) document.querySelector(".nudge-offer").remove(); InCartUpsell.prototype.findOfferWhenReady();
|
Supply | $(".nudge-offer").remove(); $("form.cart-form .ajaxifyCart--num").first().trigger("change"); setTimeout(function(){ InCartUpsell.prototype.findOfferWhenReady(); },3000);
|
Testament | document.querySelector('.nudge-offer').remove(); Shopify.getCart(ajaxifyShopify.buildCart); InCartUpsell.prototype.findOfferWhenReady();
|
Turbo | $("[data-cart-quantity-input]").first().clone(true,true).val(1).css("display","none").appendTo($("[data-cart-quantity-input]").first().closest(".product-quantity-box")).trigger("change"); OR $("input.quantity").first().clone(true,true).val(1).css("display","none").appendTo($("input.quantity").first().closest(".product-quantity-box")).trigger("change");
|
Vella Framework | $('.drawerProductQty .qtyNum').first().trigger("change"); $(".nudge-offer").remove(); InCartUpsell.prototype.findOfferWhenReady();
|
Venture | document.querySelector(".nudge-offer").remove(); fetchCart(); InCartUpsell.prototype.findOfferWhenReady();
|
Venue | document.querySelector('.nudge-offer').remove(); document.querySelector('form.cart input.ajaxcart__qty-num').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|
Vision | document.querySelector('.nudge-offer').remove(); document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', {bubbles: true})); InCartUpsell.prototype.findOfferWhenReady(); |
Warehouse | document.querySelector('.nudge-offer').remove(); document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', { bubbles: true})); InCartUpsell.prototype.findOfferWhenReady();
|
Zen | document.querySelector('.nudge-offer').remove(); document.querySelector('div.ajaxifyCart--content input.ajaxifyCart--num').dispatchEvent(new Event("change", { bubbles: true })); InCartUpsell.prototype.findOfferWhenReady();
|