PageSourceSearch

https://www.battlbox.com/cdn/shop/t/484/assets/upsell-product.js?v=8581905026412617751711477913

js battlbox.com collected 2026-09-24 17:50:58 UTC 5,033 bytes, 32 lines download raw bytes

1const upsellSelectors={modal:document.getElementById("cartUpsellModal"),container:document.querySelector("#cartUpsellModal [data_upsell_product]")};class cartUpsellJS{constructor(){}hideUpsellProduct(result){document.querySelectorAll("[data_upsell-item]").forEach(function(i,v){i.classList.remove("d-none")}),result.forEach(function(y,z){document.querySelectorAll("[data_upsell-item='"+y.handle+"']").forEach(function(i){i.classList.add("d-none")})})}upsellProduct(result){this.hideUpsellProduct(result);let html="",temp_html="";result.forEach((i,v)=>{let price=0;price=Shopify.formatMoney(i.price,window.globalVariables.money_format);var product_title=i.product_title,newProductTitle;product_title.includes("Auto")?newProductTitle=product_title.replace("15.00% Off Auto renew",""):newProductTitle=i.product_title,temp_html=`<div class="col-12 col-md-6 p-2">
2          <div class="border p-3 h-100 border-secondary d-flex align-items-center cart-item">
3                <a class="my-0 text-danger close-cart-btn" href="javascript:void(0)" title="Remove" name="Remove" aria-label="Remove" data-toggle="tooltip" data-upsellRemove data-index="${v}" data-placement="left">
4                    <i class="icon-close"></i>
5              </a>
6          <div class="d-flex align-items-center w-100">
7            <div class="cart-img me-3">
8                <img class="img-fluid item-img" style="min-width: 87px;width:87px;" src="${i.image}" alt="${i.title}" loading="lazy" width="75" height="75">
9            </div>
10            <div class="cart-item-text w-100">
11              <a href="${i.url}" class="card-title h6 mb-0 me-2 text-capitalize">${newProductTitle}</a>
12              <ul class="list-unstyled"></ul> 
13              <p class="product-option"></p>
14              <div class="d-flex align-items-center justify-content-between">
15                  <div class="cart-total-price mt-2">${price}</div>
16                    <div class="quantity-wrapper mt-2" data-qty-container="">
17                    <a href="javascript:void(0)" class="btn-increase" data-upsellQty data-index="${v}" rel="nofollow" aria-label="Increase quantity for ${i.product_title}" title="Increase quantity for ${i.product_title}" data-for="increase" data-qty-btn="" data-upsell_product-type="${i.product_type}">
18                      <i class="icon-sm-arrow-top"></i>
19                      <span class="visually-hidden">Increase quantity for ${i.product_title}</span>
20                    </a>
21                    <input type="text" data-upsell-quantity name="quantity" aria-label="Quantity for ${i.product_title}" value="${i.quantity}" step="1" min="1" inputmode="numeric" data-qty-input="" class="quantity form-control fw-bold text-secondary border-secondary ps-3 h-100" readonly="">
22                    <a href="javascript:void(0)" class="btn-decrease" rel="nofollow" data-upsellQty data-index="${v}" aria-label="Decrease ${i.product_title}" title="Decrease quantity for ${i.product_title}" data-for="decrease" data-qty-btn="" data-upsell_product-type="${i.product_type}">
23                      <i class="icon-sm-arrow-bottom"></i>
24                      <span class="visually-hidden">Decrease quantity for ${i.product_title}</span>
25                    </a>
26                  </div>
27                </div>
28              </div>
29            </div>
30          </div>
31        </div>`,html=html+temp_html}),upsellSelectors.container&&(upsellSelectors.container.innerHTML=`<div class="row m-n2">${html}</div>`,upsellSelectors.modal.querySelector(".modal").classList.add("open"),siteOverlay.prototype.showOverlay(),this.bindEvents())}updateQuantity(variantId,quantitySymbol){let currentTarget=event.currentTarget,quantity=event.currentTarget.parentNode.querySelector("[data-upsell-quantity]").value;quantity=parseInt(quantity),quantitySymbol=="plus"?(quantity=quantity+1,event.currentTarget.parentNode.querySelector("[data-upsell-quantity]").value=quantity,updateUpsell(variantId,quantity)):quantitySymbol=="minus"&&quantity!=1&&(quantity=quantity-1,event.currentTarget.parentNode.querySelector("[data-upsell-quantity]").value=quantity,updateUpsell(variantId,quantity))}bindEvents(){let qtyBtns=document.querySelectorAll("[data-upsellQty]"),removeBtns=document.querySelectorAll("[data-upsellRemove]"),ajaxCartEle=document.querySelector("ajax-cart");qtyBtns.forEach(Btn=>{Btn.addEventListener("click",event2=>{let currentTarget=event2.currentTarget,line=parseInt(currentTarget.dataset.index)+1,qtyInput
31=currentTarget.closest("[data-qty-container]").querySelector('[name="quantity"]'),qty=parseInt(qtyInput.value);currentTarget.classList.contains("btn-increase")?qty=qty+1:qty>1&&(qty=qty-1),ajaxCartEle.updateItemQty(line,qty)})}),removeBtns.forEach(Btn=>{Btn.addEventListener("click",event2=>{let currentTarget=event2.currentTarget,line=parseInt(currentTarget.dataset.index)+1;ajaxCartEle.updateItemQty(line,0)})})}}window.onload=()=>{typeof cartUpsellJS<"u"&&new cartUpsellJS};
32//# sourceMappingURL=/cdn/shop/t/484/assets/upsell-product.js.map?v=8581905026412617751711477913

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.