PageSourceSearch

https://www.rockymountainoils.com/cdn/shop/t/383/assets/cart-sideb…170066356698547187711790969353?v=1791062567

js rockymountainoils.com collected 2026-10-03 21:23:38 UTC 14,213 bytes, 2 lines download raw bytes

1jQuery(document).ready(function(jQuery2){for(var qtyOptions="",q=1;q<=100;q++)qtyOptions+='<option value="'+q+'">'+q+"</option>";jQuery2("#CartMenu").on("click",function(){jQuery2(".cart-side-menu").removeClass("cart-menu-isClosed").addClass("cart-menu-isOpen"),jQuery2("body").addClass("side-menu-open")}),jQuery2(".cart-side-menu-close").on("click",function(){jQuery2(".cart-side-menu").removeClass("cart-menu-isOpen").addClass("cart-menu-isClosed"),jQuery2("body").removeClass("side-menu-open")}),jQuery2(".add-to-cart").on("click",function(e){cart_sidebar_open();var form=jQuery2(this).closest("form");jQuery2.ajax({type:"POST",url:"/cart/add.js",data:form.serialize(),dataType:"json",success:function(cart){cart_sidebar_update()},error:function(xhr,text){jQuery2(".cart-sidebar-error-message").show(),jQuery2(".cart-sidebar-error-message").text(jQuery2.parseJSON(xhr.responseText).description),cart_sidebar_update(),jQuery2(".cart-sidebar .cart-sidebar-loading").hide()}}),e.preventDefault()});function cart_sidebar_open(){jQuery2(".cart-sidebar-error-message").hide().text(""),jQuery2(".cart-side-menu").removeClass("cart-menu-isClosed").addClass("cart-menu-isOpen _loading"),jQuery2("body").addClass("side-menu-open")}window.RMO_COMPARE=window.RMO_COMPARE||{};function rmoEnsureCompare(cart){var handles=[];return cart.items.forEach(function(it){window.RMO_COMPARE[it.variant_id]===void 0&&it.handle&&handles.indexOf(it.handle)===-1&&handles.push(it.handle)}),handles.length?Promise.all(handles.map(function(h){return fetch("/products/"+h+".js").then(function(r){return r.json()}).then(function(p){(p.variants||[]).forEach(function(v){window.RMO_COMPARE[v.id]=v.compare_at_price&&v.compare_at_price>v.price?v.compare_at_price:null})}).catch(function(){})})).then(function(){return!0}):Promise.resolve(!1)}function cart_sidebar_update(){jQuery2.getJSON("/cart.js",function(cart){cart_sidebar_update_mini_cart(cart),cart_sidebar_update_free_shipping(cart),cart_sidebar_update_product(cart),cart_sidebar_update_totals(cart),jQuery2(".cart-sidebar").removeClass("_loading"),jQuery2(".cart-sidebar").removeClass("is_empty"),jQuery2("#cart-items").removeClass("_loading"),jQuery2("#cart-items").removeClass("is_empty"),cart.item_count==0&&(jQuery2(".cart-sidebar").addClass("is_empty"),jQuery2("#cart-items").addClass("is_empty")),rmoEnsureCompare(cart).then(function(fetched){if(fetched){var hasSale=cart.items.some(function(it){var c=window.RMO_COMPARE[it.variant_id];return c&&c>it.original_price});hasSale&&cart_sidebar_update_product(cart)}})})}function cart_sidebar_update_mini_cart(cart){jQuery2(".mini-cart-count").text(cart.item_count)}function cart_sidebar_update_free_shipping(cart){var oilty=!1;if(cart.item_count>0)for(var i=0;i<cart.items.length;i++)oilty_id_monthly&&cart.items[i].id==oilty_id_monthly&&(oilty=!0,oilty_type="monthly"),oilty_id_annually&&cart.items[i].id==oilty_id_annually&&(oilty=!0,oilty_type="annually");if(is_oilty==!0&&(oilty=!0),oilty==!0)var free_shipping_price=15;else var free_shipping_price=49.95;var free_shipping_away=0,cart_total_price=parseInt(cart.total_price)/100,free_shipping_bar=Math.round(cart_total_price*100/free_shipping_price);if(cart_total_price>=free_shipping_price)jQuery2(".ajax-cart-free-shipping .progress-bar").css("width","100%"),free_shipping_price==15?jQuery2(".ajax-cart-free-shipping h3").text("QUALIFIED FOR FREE SHIPPING ($15+)"):jQuery2(".ajax-cart-free-shipping h3").text("QUALIFIED FOR FREE SHIPPING ($49.95+)");else{if(free_shipping_away=free_shipping_price-cart_total_price,free_shipping_away<1)var free_shipping_bar=99;jQuery2(".ajax-cart-free-shipping h3").html("Almost There! Add $<span>"+free_shipping_away.toFixed(2)+"</span> To Unlock Free Shipping"),jQuery2(".ajax-cart-free-shipping .progress-bar").css("width",free_shipping_bar+"%")}}function cart_sidebar_update_product(cart){var template='<li class="__cart_sidebar_{ID} __cart_product_{PRODUCT_ID}" data-id="{ID}"><div class="cart-product-wrap"><div class="cp-image"><a href="{URL}"><img src="{IMAGE}" alt="{ALT}" width="75"></a></div><div class="cp-detail"><button type="button" data-id="{ID}" class="shoppingcart-remove-item" aria-label="Remove item"><i class="remove-icon"></i></button><h6>{NAME}</h6>{PLAN}{OPTION}{DISCOUNT}<div class="items-count"><label class="sr-only" for="qty_{ID}">Quantity for {PTITLE}</label><select name="qty" id="qty_{ID}" data-id="{ID}" class="shoppingcart-item-qty qty_{INDEX}" aria-label="Quantity for {PTITLE}">'+qtyOptions+'</select><span class="p-price"><span>{OLD_PRICE}</span> {PRICE}</span></div>{DONATION_PRICE}</div></div></li>',ProductList=jQuery2(".carts-product-list");if(cart.item_count>0){for(var oilty_status2=!1,i=0;i<cart.items.length;i++){if(cart.items[i].image)var __image_url=cart.items[i].image,__image_url_array=__image_url.split("."),__image_url_replace="."+__image_url_array[__image_url_array.length-1],__image_url_new="_75x120@2x."+__image_url_array[__image_url_array.length-1],__image_url_final=__image_url.replace(__image_url_replace,__image_url_new);else var __image_url_final="https://cdn.shopify.com/s/files/1/0679/7908/4098/files/favicon.png";if(i==0&&ProductList.html(""),cart.items[i].id==oilty_id_monthly)var oilty_status2=!0;if(cart.items[i].id==oilty_id_annually)var oilty_status2=!0;var _price=cart.items[i].original_price,discounted_price=cart.items[i].discounted_price,script_discount_note=!1,script_discount_notenote;for(var key in cart.items[i].properties)cart.items[i].properties.hasOwnProperty(key)&&key==="Discount Note"&&(script_discount_notenote=cart.items[i].properties[key],script_discount_note=!0);if(script_discount_note===!0)var price=Shopify.formatMoney(cart.items[i].original_price),old_price="",discount_title=script_discount_notenote,discount_html='<p><svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-discount" viewBox="0 0 12 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 0h3a2 2 0 012 2v3a1 1 0 01-.3.7l-6 6a1 1 0 01-1.4 0l-4-4a1 1 0 010-1.4l6-6A1 1 0 017 0zm2 2a1 1 0 102 0 1 1 0 00-2 0z" fill="currentColor"></svg> '+discount_title+"</p>";else if(_price!=discounted_price)var price=Shopify.formatMoney(cart.items[i].discounted_price),old_price=Shopify.formatMoney(cart.items[i].original_price),discount_title=cart.items[i].discounts&&cart.items[i].discounts.length?cart.items[i].discounts[0].title:"",discount_html='<p><svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-discount" viewBox="0 0 12 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 0h3a2 2 0 012 2v3a1 1 0 01-.3.7l-6 6a1 1 0 01-1.4 0l-4-4a1 1 0 010-1.4l6-6A1 1 0 017 0zm2 2a1 1 0 102 0 1 1 0 00-2 0z" fill="currentColor"></svg> '+discount_title+"</p>";else var price=Shopify.formatMoney(cart.items[i].original_price),__cmp=window.RMO_COMPARE[cart.items[i].variant_id],old_price=__cmp&&__cmp>cart.items[i].original_price?Shopify.formatMoney(__cmp):"",discount_html="";var option_html="";if(cart.items[i].options_with_values&&cart.items[i].options_with_values.length)for(var p=0;p<cart.items[i].options_with_values.length;p++){var opt=cart.items[i].options_with_values[p]||{},optName=opt.name?String(opt.name).trim():"",optValue=opt.value?String(opt.value).trim():"";optValue&&optValue!=="Default Title"&&(option_html+="<p>"+(optName?optName+": ":"")+optValue+"</p>")}if(!option_html&&cart.items[i].variant_title&&String(cart.items[i].variant_title).trim()!==""&&String(cart.items[i].variant_title).trim()!=="Default Title"&&(option_html="<p>"+String(cart.items[i].variant_title).trim()+"</p>"),!option_html&&cart.items[i].properties){for(var propKey in cart.items[i].properties)if(cart.items[i].properties.hasOwnProperty(propKey)&&propKey!=="Discount Note"){var propVal=cart.items[i].properties[propKey];propVal!==null&&propVal!==""&&propVal!==void 0&&(option_html+="<p>"+propKey+": "+propVal+"</p>")}}var plan_html="";cart.items[i].selling_plan_allocation&&(plan_html="<p>"+cart.items[i].selling_plan_allocation.selling_plan.name+"</p>"),cart.items[i].product_id=="8260603019586"&&(plan_html='<span class="donation-price">'+Shopify.formatMoney(cart.items[i].line_price)+"</span>");var __alt=cart.items[i].featured_image&&cart.items[i].featured_image.alt?cart.items[i].featured_image.alt:cart.items[i].product_title;__alt=String(__alt||"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");var __ptitle=String(cart.items[i].product_title||"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),item=template;item=item.replace(/\{ID\}/g,cart.items[i].id),item=item.replace(/\{INDEX\}/g,i),item=item.replace(/\{URL\}/g,cart.items[i].url),item=item.replace(/\{NAME\}/g,cart.items[i].product_title),item=item.replace(/\{ALT\}/g,function(){return __alt}),item=item.replace(/\{PTITLE\}/g,function(){return __ptitle}),item=item.replace(/\{VARIANT\}/g,cart.items[i].variant_title||""),item=item.replace(/\{QUANTITY\}/g,cart.items[i].quantity),item=item.replace(/\{IMAGE\}/g,__image_url_final),item=item.replace(/\{OLD_PRICE\}/g,old_price),item=item.replace(/\{PRICE\}/g,price),item=item.replace(/\{PLAN\}/g,plan_html),item=item.replace(/\{OPTION\}/g,option_html),item=item.replace(/\{DISCOUNT\}/g,discount_html),item=item.replace(/\{DONATION_PRICE\}/g,""),item=item.replace(/\{PRODUCT_ID\}
1/g,cart.items[i].product_id),ProductList.append(item)}oilty_status2==!0||is_oilty==!0||hide_oilty_signup==!0?jQuery2(".oilty-plus-cart-sidebar").hide():(jQuery2(".oilty-plus-cart-sidebar").show(),jQuery2("#oilty-plus-checkbox").prop("checked",!1)),cart_sidebar_update_dropdown(cart)}else ProductList.html(""),jQuery2(".cart-sidebar").addClass("is_empty"),is_oilty==!0||hide_oilty_signup==!0?jQuery2(".oilty-plus-cart-sidebar").hide():(jQuery2(".oilty-plus-cart-sidebar").show(),jQuery2("#oilty-plus-checkbox").prop("checked",!1))}function cart_sidebar_update_totals(cart){jQuery2(".__subtotal").html(Shopify.formatMoney(cart.total_price)),jQuery2(".__total").html(Shopify.formatMoney(cart.total_price)),jQuery2("#cart-value").val(cart.total_price)}function cart_sidebar_update_dropdown(cart){if(cart.item_count>0)for(var i=0;i<cart.items.length;i++)jQuery2(".qty_"+i).val(cart.items[i].quantity)}function cart_sidebar_update_quantity(product_id,quantity){cart_sidebar_open(),jQuery2.ajax({type:"POST",url:"/cart/change.js",data:"quantity="+quantity+"&id="+product_id,dataType:"json",success:function(){cart_sidebar_update()},error:function(xhr,text){jQuery2(".cart-sidebar-error-message").show(),jQuery2(".cart-sidebar-error-message").text(jQuery2.parseJSON(xhr.responseText).description),cart_sidebar_update(),jQuery2(".cart-sidebar .cart-sidebar-loading").hide()}})}jQuery2(document).on("change",".shoppingcart-item-qty",function(e){cart_sidebar_update_quantity(jQuery2(this).attr("data-id"),jQuery2(this).val())}),jQuery2(document).on("click",".shoppingcart-remove-item",function(e){cart_sidebar_open();var product_id=jQuery2(this).attr("data-id");jQuery2.ajax({type:"POST",url:"/cart/change.js",data:"quantity=0&id="+product_id,dataType:"json",success:function(){cart_sidebar_update()},error:function(xhr,text){jQuery2(".cart-sidebar-error-message").text(jQuery2.parseJSON(xhr.responseText).description),jQuery2(".cart-sidebar .cart-sidebar-loading").hide()}}),e.preventDefault()}),jQuery2("#oilty-plus-checkbox").click(function(){jQuery2(".oilty-plus-add").click()}),jQuery2(document).on("click",".add-subscription",function(e){jQuery2(".subscribe-remove").show(),jQuery2(".add-subscription").hide(),jQuery2(".selling-option").show(),jQuery2("#selling_plan").val(jQuery2("#selling_option").val()),subscription_update()}),jQuery2(document).on("click",".subscribe-remove",function(e){jQuery2(".subscribe-remove").hide(),jQuery2(".add-subscription").show(),jQuery2(".selling-option").hide(),jQuery2("#selling_plan").val(""),subscription_update()}),jQuery2(document).on("change","#selling_option",function(e){jQuery2("#selling_plan").val(jQuery2(this).val()),subscription_update()}),jQuery2(document).on("change",".subscription__select",function(e){var selected_option=jQuery2(this).val().toLowerCase(),selling_id=jQuery2(".selling_plan_"+selected_option).attr("data-id");jQuery2("#subscription_selling_plan").val(selling_id)});function subscription_update(){var price=jQuery2(".product-subscribe").attr("data-price"),compare_price=jQuery2(".product-subscribe").attr("data-compare-price"),discount=jQuery2("#selling_option").find(":selected").attr("data-discount"),selling_plan=jQuery2("#selling_plan").val();if(selling_plan){var subscription_price=price-price*discount/100,html='<span class="actual-price">'+Shopify.formatMoney(price)+'</span><strong class="subscribe-price">'+Shopify.formatMoney(subscription_price)+"<span>"+discount+"% Off</span></strong>";jQuery2(".product-price").html(html),jQuery2(".product-price").addClass("sale")}else if(compare_price>price){jQuery2(".product-price").addClass("sale");var html='<span class="actual-price">'+Shopify.formatMoney(compare_price)+"</span><strong>"+Shopify.formatMoney(price)+"</strong>";jQuery2(".product-price").html(html)}else{var html='<span class="actual-price"></span><strong>'+Shopify.formatMoney(price)+"</strong>";jQuery2(".product-price").removeClass("sale"),jQuery2(".product-price").html(html)}}jQuery2(document).on("click",".other-payment",function(e){jQuery2(".additional-checkout-buttons").toggleClass("active"),jQuery2(this).toggleClass("active"),e.preventDefault()}),jQuery2(document).on("click",".checkout-popup",function(e){if(typeof oilty_gift!="undefined"&&oilty_gift==!0&&typeof oilty_status!="undefined"&&oilty_status==!0){var total_price=jQuery2("#cart-value").val(),popup_type=jQuery2("#cart-type").val();popup_type=="annually"&&(total_price=total_price-9995),total_price>100&&(window.location.href="/checkout")}else window.location.href="/checkout"}),jQuery2(".oilty-options").change(function(){this.value==oilty_id_monthly?jQuery2("#checkout-selling-id").val(jQuery2("#checkout-selling-id").data("monthly")):jQuery2("#checkout-selling-id").val(jQuery2("#checkout-selling-id").data("yearly"))})});
2//# sourceMappingURL=/cdn/shop/t/383/assets/cart-sidebar.js.map?v=170066356698547187711790969353%3Fv%3D1791062567

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.