XXL
/ ',attr:{tabindex:-1}},prev:{type:"button",class:"fancybox__button--prev",label:"PREV",html:' ',attr:{"data-fancybox-prev":""}},next:{type:"button",class:"fancybox__button--next",label:"NEXT",html:' ',attr:{"data-fancybox-next":""}},fullscreen:{type:"button",class:"fancybox__button--fullscreen",label:"TOGGLE_FULLSCREEN",html:'\n \n \n ',click:function(t){t.preventDefault(),Q.element()?Q.deactivate():Q.activate(this.fancybox.$container)}},slideshow:{type:"button",class:"fancybox__button--slideshow",label:"TOGGLE_SLIDESHOW",html:'\n \n \n ',click:function(t){t.preventDefault(),this.Slideshow.toggle()}},zoom:{type:"button",class:"fancybox__button--zoom",label:"TOGGLE_ZOOM",html:' ',click:function(t){t.preventDefault();var e=this.fancybox.getSlide().Panzoom;e&&e.toggleZoom()}},download:{type:"link",label:"DOWNLOAD",class:"fancybox__button--download",html:' ',click:function(t){t.stopPropagation()}},thumbs:{type:"button",label:"TOGGLE_THUMBS",class:"fancybox__button--thumbs",html:' ',click:function(t){t.stopPropagation();var e=this.fancybox.plugins.Thumbs;e&&e.toggle()}},close:{type:"button",label:"CLOSE",class:"fancybox__button--close",html:' ',attr:{"data-fancybox-close":"",tabindex:0}}}},it=function(){function t(e){var i=this;o(this,t),this.fancybox=e,this.$container=null,this.state="init";for(var n=0,a=["onInit","onPrepare","onDone","onKeydown","onClosing","onChange","onSettle","onRefresh"];nl.option("baseScale"),h=x(this.fancybox.$container.querySelectorAll(".fancybox__button--zoom"));try{for(h.s();!(r=h.n()).done;){var d=r.value;c?d.removeAttribute("disabled"):d.setAttribute("disabled","")}}catch(t){h.e(t)}finally{h.f()}var u,f=x(this.fancybox.$container.querySelectorAll("[data-fancybox-index]"));try{for(f.s();!(u=f.n()).done;){u.value.innerHTML=e.index+1}}catch(t){f.e(t)}finally{f.f()}var v,p=x(this.fancybox.$container.querySelectorAll("[data-fancybox-count]"));try{for(p.s();!(v=p.n()).done;){v.value.innerHTML=n}}catch(t){p.e(t)}finally{p.f()}if(!this.fancybox.option("infinite")){var g,m=x(this.fancybox.$container.querySelectorAll("[data-fancybox-prev]"));try{for(m.s();!(g=m.n()).done;){var y=g.value;0===i?y.setAttribute("disabled",""):y.removeAttribute("disabled")}}catch(t){m.e(t)}finally{m.f()}var b,w=x(this.fancybox.$container.querySelectorAll("[data-fancybox-next]"));try{for(w.s();!(b=w.n()).done;){var k=b.value;i===n-1?k.setAttribute("disabled",""):k.removeAttribute("disabled")}}catch(t){w.e(t)}finally{w.f()}}}},{key:"cleanup",value:function(){this.Slideshow&&this.Slideshow.isActive()&&this.Slideshow.clearTimer(),this.$container&&this.$container.remove(),this.$container=null}},{key:"attach",value:function(){this.fancybox.on(this.events)}},{key:"detach",value:function(){this.fancybox.off(this.events),this.cleanup()}}]),t}();it.defaults=et;var nt={ScrollLock:U,Thumbs:Y,Html:G,Toolbar:it,Image:K,Hash:J},ot={startIndex:0,preload:1,infinite:!0,showClass:"fancybox-zoomInUp",hideClass:"fancybox-fadeOut",animated:!0,hideScrollbar:!0,parentEl:null,mainClass:null,autoFocus:!0,trapFocus:!0,placeFocusBack:!0,click:"close",closeButton:"inside",dragToClose:!0,keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"next",ArrowDown:"prev",ArrowRight:"next",ArrowLeft:"prev"},template:{closeButton:' ',spinner:' ',main:null},l10n:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}},at=new Map,st=0,rt=function(t){l(i,t);var e=f(i);function i(t){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,i),t=t.map((function(t){return t.width&&(t._width=t.width),t.height&&(t._height=t.height),t})),(n=e.call(this,k(!0,{},ot,a))).bindHandlers(),n.state="init",n.setItems(t),n.attachPlugins(i.Plugins),n.trigger("init"),!0===n.option("hideScrollbar")&&n.hideScrollbar(),n.initLayout(),n.initCarousel(),n.attachEvents(),at.set(n.id,d(n)),n.trigger("prepare"),n.state="ready",n.trigger("ready"),n.$container.setAttribute("aria-hidden","false"),n.option("trapFocus")&&n.focus(),n}return s(i,[{key:"option",value:function(t){for(var e,n=this.getSlide(),o=n?n[t]:void 0,a=arguments.length,s=new Array(a>1?a-1:0),r=1;r1?i-1:0),o=1;o=150||Math.abs(e)>=35&&t.dragOffset.time<350?(this.option("hideClass")&&(this.getSlide().hideClass="fancybox-throwOut".concat(t.content.y<0?"Up":"Down")),this.close()):"y"===t.lockAxis&&t.panTo({y:0})}},{key:"onTransform",value:function(t){if(this.$backdrop){var e=Math.abs(t.content.y),i=e<1?"":Math.max(.33,Math.min(1,1-e/t.content.fitHeight*1.5));this.$container.style.setProperty("--fancybox-ts",i?"0s":""),this.$container.style.setProperty("--fancybox-opacity",i)}}},{key:"onMousedown",value:function(){"ready"===this.state&&document.body.classList.add("is-using-mouse")}},{key:"onKeydown",value:function(t){if(this.isTopmost()){document.body.classList.remove("is-using-mouse");var e=t.key,i=this.option("keyboard");if(i&&!t.ctrlKey&&!t.altKey&&!t.shiftKey){var n=t.composedPath()[0],o=document.activeElement&&document.activeElement.classList,a=o&&o.contains("carousel__button");if("Escape"!==e&&!a)if(t.target.isContentEditable||-1!==["BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(n.nodeName))return;if(!1!==this.trigger("keydown",e,t)){var s=i[e];"function"==typeof this[s]&&this[s]()}}}}},{key:"getSlide",value:function(){var t=this.Carousel;if(!t)return null;var e=null===t.page?t.option("initialPage"):t.page,i=t.pages||[];return i.length&&i[e]?i[e].slides[0]:null}},{key:"focus",value:function(t){if(!(i.ignoreFocusChange||["init","closing","customClosing","destroy"].indexOf(this.state)>-1)){var e=this.$container,n=this.getSlide(),o="done"===n.state?n.$el:null;if(!o||!o.contains(document.activeElement)){t&&t.preventDefault(),i.ignoreFocusChange=!0;for(var a,s=[],r=0,l=Array.from(e.querySelectorAll(X));r-1?this.lastFocus=t.target:this.lastFocus===e?q(s[s.length-1]):q(e):this.option("autoFocus")&&a?q(a):s.indexOf(document.activeElement)<0&&q(e),this.lastFocus=document.activeElement,i.ignoreFocusChange=!1}}}},{key:"hideScrollbar",value:function(){if(W){var t=window.innerWidth-document.documentElement.getBoundingClientRect().width,e="fancybox-style-noscroll",i=document.getElementById(e);i||t>0&&((i=document.createElement("style")).id=e,i.type="text/css",i.innerHTML=".compensate-for-scrollbar {padding-right: ".concat(t,"px;}"),document.getElementsByTagName("head")[0].appendChild(i),document.body.classList.add("compensate-for-scrollbar"))}}},{key:"revealScrollbar",value:function(){document.body.classList.remove("compensate-for-scrollbar");var t=document.getElementById("fancybox-style-noscroll");t&&t.remove()}},{key:"clearContent",value:function(t){this.Carousel.trigger("removeSlide",t),t.$content&&(t.$content.remove(),t.$content=null),t.$closeButton&&(t.$closeButton.remove(),t.$closeButton=null),t._className&&t.$el.classList.remove(t._className)}},{key:"setContent",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.$el;if(e instanceof HTMLElement)["img","iframe","video","audio"].indexOf(e.nodeName.toLowerCase())>-1?(i=document.createElement("div")).appendChild(e):i=e;else{var a=document.createRange().createContextualFragment(e);(i=document.createElement("div")).appendChild(a)}if(t.filter&&!t.error&&(i=i.querySelector(t.filter)),i instanceof Element)return t._className="has-".concat(n.suffix||t.type||"unknown"),o.classList.add(t._className),i.classList.add("fancybox__content"),"none"!==i.style.display&&"none"!==getComputedStyle(i).getPropertyValue("display")||(i.style.display=t.display||this.option("defaultDisplay")||"flex"),t.id&&i.setAttribute("id",t.id),t.$content=i,o.prepend(i),this.manageCloseButton(t),"loading"!==t.state&&this.revealContent(t),i;this.setError(t,"{{ELEMENT_NOT_FOUND}}")}},{key:"manageCloseButton",value:function(t){var e=this,i=void 0===t.closeButton?this.option("closeButton"):t.closeButton;if(i&&("top"!==i||!this.$closeButton)){var n=document.createElement("button");n.classList.add("carousel__button","is-close"),n.setAttribute("title",this.options.l10n.CLOSE),n.innerHTML=this.option("template.closeButton"),n.addEventListener("click",(function(t){return e.close(t)})),"inside"===i?(t.$closeButton&&t.$closeButton.remove(),t.$closeButton=t.$content.appendChild(n)):this.$closeButton=this.$container.insertBefore(n,this.$container.firstChild)}}},{key:"revealContent",value:function(t){var e=this;this.trigger("reveal",t),t.$content.style.visibility="";var i=!1;t.error||"loading"===t.state||null!==this.Carousel.prevPage||t.index!==this.options.startIndex||(i=void 0===t.showClass?this.option("showClass"):t.showClass),i?(t.state="animating",this.animateCSS(t.$content,i,(function(){e.done(t)}))):this.done(t)}},{key:"animateCSS",value:function(t,e,i){if(t&&t.dispatchEvent(new CustomEvent("animationend",{bubbles:!0,cancelable:!0})),t&&e){t.addEventListener("animationend",(function n(o){o.currentTarget===this&&(t.removeEventListener("animationend",n),i&&i(),t.classList.remove(e))})),t.classList.add(e)}else"function"==typeof i&&i()}},{key:"done",value:function(t){t.state="done",this.trigger("done",t);var e=this.getSlide();e&&t.index===e.index&&this.option("autoFocus")&&this.focus()}},{key:"setError",value:function(t,e){t.error=e,this.hideLoading(t),this.clearContent(t);var i=document.createElement("div");i.classList.add("fancybox-error"),i.innerHTML=this.localize(e||"{{ERROR}}
"),this.setContent(t,i,{suffix:"error"})}},{key:"showLoading",value:function(t){var e=this;t.state="loading",t.$el.classList.add("is-loading");var i=t.$el.querySelector(".fancybox__spinner");i||((i=document.createElement("div")).classList.add("fancybox__spinner"),i.innerHTML=this.option("template.spinner"),i.addEventListener("click",(function(){e.Carousel.Panzoom.velocity||e.close()})),t.$el.prepend(i))}},{key:"hideLoading",value:function(t){var e=t.$el&&t.$el.querySelector(".fancybox__spinner");e&&(e.remove(),t.$el.classList.remove("is-loading")),"loading"===t.state&&(this.trigger("load",t),t.state="ready")}},{key:"next",value:function(){var t=this.Carousel;t&&t.pages.length>1&&t.slideNext()}},{key:"prev",value:function(){var t=this.Carousel;t&&t.pages.length>1&&t.slidePrev()}},{key:"jumpTo",value:function(){var t;this.Carousel&&(t=this.Carousel).slideTo.apply(t,arguments)}},{key:"isClosing",value:function(){return["closing","customClosing","destroy"].includes(this.state)}},{key:"isTopmost",value:function(){return i.getInstance().id==this.id}},{key:"close",value:function(t){var e=this;if(t&&t.preventDefault(),!this.isClosing()&&!1!==this.trigger("shouldClose",t)&&(this.state="closing",this.Carousel.Panzoom.destroy(),this.detachEvents(),this.trigger("closing",t),"destroy"!==this.state)){this.$container.setAttribute("aria-hidden","true"),this.$container.classList.add("is-closing");var i=this.getSlide();if(this.Carousel.slides.forEach((function(t){t.$content&&t.index!==i.index&&e.Carousel.trigger("removeSlide",t)})),"closing"===this.state){var n=void 0===i.hideClass?this.option("hideClass"):i.hideClass;this.animateCSS(i.$content,n,(function(){e.destroy()}),!0)}}}},{key:"destroy",value:function(){if("destroy"!==this.state){this.state="destroy",this.trigger("destroy");var t=this.option("placeFocusBack")?this.option("triggerTarget",this.getSlide().$trigger):null;this.Carousel.destroy(),this.detachPlugins(),this.Carousel=null,this.options={},this.events={},this.$container.remove(),this.$container=this.$backdrop=this.$carousel=null,t&&q(t),at.delete(this.id);var e=i.getInstance();e?e.focus():(document.documentElement.classList.remove("with-fancybox"),document.body.classList.remove("is-using-mouse"),this.revealScrollbar())}}}],[{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new i(t,e)}},{key:"fromEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.defaultPrevented&&!(t.button&&0!==t.button||t.ctrlKey||t.metaKey||t.shiftKey)){var n,o,a,s=t.composedPath()[0],r=s;if((r.matches("[data-fancybox-trigger]")||(r=r.closest("[data-fancybox-trigger]")))&&(e.triggerTarget=r,n=r&&r.dataset&&r.dataset.fancyboxTrigger),n){var l=document.querySelectorAll('[data-fancybox="'.concat(n,'"]')),c=parseInt(r.dataset.fancyboxIndex,10)||0;r=l.length?l[c]:r}Array.from(i.openers.keys()).reverse().some((function(e){a=r||s;var i=!1;try{a instanceof Element&&("string"==typeof e||e instanceof String)&&(i=a.matches(e)||(a=a.closest(e)))}catch(t){}return!!i&&(t.preventDefault(),o=e,!0)}));var h=!1;if(o){e.event=t,e.target=a,a.origTarget=s,h=i.fromOpener(o,e);var d=i.getInstance();d&&"ready"===d.state&&t.detail&&document.body.classList.add("is-using-mouse")}return h}}},{key:"fromOpener",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(t){for(var e=["false","0","no","null","undefined"],i=["true","1","yes"],n=Object.assign({},t.dataset),o={},a=0,s=Object.entries(n);a-1)o[l]=!1;else if(i.indexOf(o[l])>-1)o[l]=!0;else try{o[l]=JSON.parse(c)}catch(t){o[l]=c}else o[l]=c}return t instanceof Element&&(o.$trigger=t),o},o=[],a=e.startIndex||0,s=e.target||null,r=void 0!==(e=k({},e,i.openers.get(t))).groupAll&&e.groupAll,l=void 0===e.groupAttr?"data-fancybox":e.groupAttr,c=l&&s?s.getAttribute("".concat(l)):"";if(!s||c||r){var h=e.root||(s?s.getRootNode():document.body);o=[].slice.call(h.querySelectorAll(t))}if(s&&!r&&(o=c?o.filter((function(t){return t.getAttribute("".concat(l))===c})):[s]),!o.length)return!1;var d=i.getInstance();return!(d&&o.indexOf(d.options.$trigger)>-1)&&(a=s?o.indexOf(s):a,new i(o=o.map(n),k({},e,{startIndex:a,$trigger:s})))}},{key:"bind",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function n(){document.body.addEventListener("click",i.fromEvent,!1)}W&&(i.openers.size||(/complete|interactive|loaded/.test(document.readyState)?n():document.addEventListener("DOMContentLoaded",n)),i.openers.set(t,e))}},{key:"unbind",value:function(t){i.openers.delete(t),i.openers.size||i.destroy()}},{key:"destroy",value:function(){for(var t;t=i.getInstance();)t.destroy();i.openers=new Map,document.body.removeEventListener("click",i.fromEvent,!1)}},{key:"getInstance",value:function(t){return t?at.get(t):Array.from(at.values()).reverse().find((function(t){return!t.isClosing()&&t}))||null}},{key:"close",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if(t){var n,o=x(at.values());try{for(o.s();!(n=o.n()).done;){var a=n.value;a.close(e)}}catch(t){o.e(t)}finally{o.f()}}else{var s=i.getInstance();s&&s.close(e)}}},{key:"next",value:function(){var t=i.getInstance();t&&t.next()}},{key:"prev",value:function(){var t=i.getInstance();t&&t.prev()}}]),i}(O);rt.version="4.0.31",rt.defaults=ot,rt.openers=new Map,rt.Plugins=nt,rt.bind("[data-fancybox]");for(var lt=0,ct=Object.entries(rt.Plugins||{});lt {
jQueryNuvem(".js-notification-close, .js-tooltip-close").on( "click", function(e) {
e.preventDefault();
jQueryNuvem(e.currentTarget).closest(".js-notification, .js-tooltip").hide();
});
jQueryNuvem(document).on("click", ".js-tooltip-open", function(e) {
e.preventDefault();
jQueryNuvem(this).next(".js-tooltip").show();
});
var $notification_status_page = jQueryNuvem(".js-notification-status-page");
var $fixed_bottom_button = jQueryNuvem(".js-btn-fixed-bottom");
var head_height = jQueryNuvem(".js-head-main").height();
if ($notification_status_page.length > 0){
if (LS.shouldShowOrderStatusNotification($notification_status_page.data('url'))){
$notification_status_page.css("top" , head_height + 15 + "px");
$notification_status_page.show();
};
jQueryNuvem(".js-notification-status-page-close").on( "click", function(e) {
e.preventDefault();
LS.dontShowOrderStatusNotificationAgain($notification_status_page.data('url'));
});
}
jQueryNuvem(".js-cart-notification-close").on("click", function(){
jQueryNuvem(".js-alert-added-to-cart").removeClass("notification-visible").addClass("notification-hidden");
setTimeout(function(){
jQueryNuvem('.js-cart-notification-item-img').attr('src', '');
jQueryNuvem(".js-alert-added-to-cart").hide();
},2000);
});
restoreNotifications = function(){
// Whatsapp button position
$fixed_bottom_button.css("marginBottom", "0");
};
if (!window.cookieNotificationService.isAcknowledged()) {
jQueryNuvem(".js-notification-cookie-banner").show();
const cookieBannerHeight = jQueryNuvem(".js-notification-cookie-banner").outerHeight();
if (window.innerWidth < 768) {
$fixed_bottom_button.css("marginBottom", cookieBannerHeight + 10 + "px");
}
}
jQueryNuvem(".js-acknowledge-cookies").on( "click", function(e) {
window.cookieNotificationService.acknowledge();
restoreNotifications();
});
restoreQuickshopForm = function(){
jQueryNuvem("#quickshop-modal .js-item-product").removeClass("js-swiper-slide-visible js-item-slide");
jQueryNuvem("#quickshop-modal .js-quickshop-container").attr( { 'data-variants' : '' , 'data-quickshop-id': '' } );
jQueryNuvem("#quickshop-modal .js-item-product").attr('data-product-id', '');
setTimeout(function(){
var $quickshop_form = jQueryNuvem("#quickshop-form").find('.js-product-form');
var $item_form_container = jQueryNuvem(".js-quickshop-opened").find(".js-item-variants");
$quickshop_form.detach().appendTo($item_form_container);
jQueryNuvem(".js-quickshop-opened").removeClass("js-quickshop-opened");
jQueryNuvem("#quickshop-modal .js-quickshop-img").attr('srcset', '');
jQueryNuvem("#quickshop-form").removeAttr("style");
},350);
};
resetSearchBox = function(){
jQueryNuvem(".js-search-input").val("");
jQueryNuvem(".js-search-form-suggestions").hide();
const empty_search = jQueryNuvem(".js-empty-search");
const empty_submit = jQueryNuvem(".js-search-input-submit");
empty_search.fadeOut(100);
empty_submit.fadeIn(100);
};
if (window.innerWidth < 768) {
cleanURLHash = function(){
const uri = window.location.toString();
const clean_uri = uri.substring(0, uri.indexOf("#"));
window.history.replaceState({}, document.title, clean_uri);
};
goBackBrowser = function(){
cleanURLHash();
history.back();
};
if(window.location.href.indexOf("modal-fullscreen") > -1) {
cleanURLHash();
}
jQueryNuvem(document).on("click", ".js-fullscreen-modal-open", function(e) {
e.preventDefault();
var modal_url_hash = jQueryNuvem(this).data("modalUrl");
window.location.hash = modal_url_hash;
});
jQueryNuvem(document).on("click", ".js-fullscreen-modal-close", function(e) {
e.preventDefault();
goBackBrowser();
});
window.onhashchange = function() {
if(window.location.href.indexOf("modal-fullscreen") <= -1) {
if(jQueryNuvem(".js-fullscreen-modal").hasClass("modal-show")){
if(jQueryNuvem(".js-modal.modal-show").length == 1){
jQueryNuvem("body").removeClass("overflow-none");
}
var $opened_modal = jQueryNuvem(".js-fullscreen-modal.modal-show");
var $opened_modal_overlay = $opened_modal.prev();
$opened_modal.removeClass("modal-show");
setTimeout(() => $opened_modal.hide(), 500);
$opened_modal_overlay.fadeOut(500);
resetSearchBox();
restoreQuickshopForm();
}
}
}
}
modalOpen = function(modal_id, openType){
var $overlay_id = jQueryNuvem('.js-modal-overlay[data-modal-id="' + modal_id + '"]');
if (jQueryNuvem(modal_id).hasClass("modal-show")) {
if(jQueryNuvem(".js-modal.modal-show").length == 1){
jQueryNuvem("body").removeClass("overflow-none");
}
let modal = jQueryNuvem(modal_id).removeClass("modal-show");
setTimeout(() => modal.hide(), 500);
} else {
if(!jQueryNuvem(".js-modal.modal-show").length){
jQueryNuvem("body").addClass("overflow-none move-right");
}
jQueryNuvem(modal_id).detach().appendTo("body");
jQueryNuvem(modal_id).show().addClass("modal-show");
if (((jQueryNuvem(modal_id).hasClass("js-modal-overlay-md")) && (window.innerWidth > 768)) || (!jQueryNuvem(modal_id).hasClass("js-modal-overlay-md"))) {
$overlay_id.fadeIn(400);
$overlay_id.detach().insertBefore(modal_id);
}
}
if(openType == 'openFullScreenWithoutClick' && window.innerWidth < 768 && jQueryNuvem(modal_id).hasClass("js-fullscreen-modal")){
var modal_url_hash = jQueryNuvem(modal_id).data("modalUrl");
window.location.hash = modal_url_hash;
}
}
jQueryNuvem(document).on("click", ".js-modal-open", function(e) {
e.preventDefault();
var modal_id = jQueryNuvem(this).data('toggle');
modalOpen(modal_id);
});
jQueryNuvem(document).on("click", ".js-modal-close", function(e) {
e.preventDefault();
if(jQueryNuvem(".js-modal.modal-show").length == 1){
jQueryNuvem("body").removeClass("overflow-none");
}
var $modal = jQueryNuvem(this).closest(".js-modal");
var modal_id = $modal.attr('id');
var $overlay_id = jQueryNuvem('.js-modal-overlay[data-modal-id="#' + modal_id + '"]');
$modal.removeClass("modal-show");
setTimeout(() => $modal.hide(), 500);
$overlay_id.fadeOut(500);
if ((window.innerWidth < 768) && (jQueryNuvem(this).hasClass(".js-fullscreen-modal-close"))) {
goBackBrowser();
}
resetSearchBox();
restoreQuickshopForm();
});
jQueryNuvem(document).on("click", ".js-modal-overlay", function(e) {
e.preventDefault();
if(jQueryNuvem(".js-modal.modal-show").length == 1){
jQueryNuvem("body").removeClass("overflow-none");
}
var modal_id = jQueryNuvem(this).data('modalId');
let modal = jQueryNuvem(modal_id).removeClass("modal-show");
setTimeout(() => modal.hide(), 500);
jQueryNuvem(this).fadeOut(500);
resetSearchBox();
restoreQuickshopForm();
});
jQueryNuvem(document).on("click", ".js-card-collapse-toggle", function(e) {
e.preventDefault();
var parent = jQueryNuvem(this).closest(".js-card-collapse");
parent.find(".js-card-collapse-icon").toggle();
parent.toggleClass('active');
});
const inViewport = (entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting && !entry.target.observed) {
entry.target.classList.add("is-inViewport");
entry.target.observed = true;
}
});
};
// Attach observer to every [data-transition] element:
const ELs_inViewport = document.querySelectorAll('[data-transition]');
ELs_inViewport.forEach(EL => {
EL.observed = false; // Initialize the observed flag for each element
const Obs = new IntersectionObserver(inViewport);
Obs.observe(EL);
});
applyMarqueeAnimation = function(marqueeSelector, textSelector, textDirection){
var defaultDelay = 5;
var defaultWidth = 300;
var animatedWidth = jQueryNuvem(textSelector).first(el => el.offsetWidth);
var newDelay = defaultDelay*(animatedWidth/defaultWidth)*1.5;
if((window.innerWidth > 768) && (newDelay < 60)){
var newDelay = newDelay + 20;
}
var animationDirection = textDirection === 'reverse' ? "reverse" : "normal";
jQueryNuvem(marqueeSelector).css("animation", "marquee " + newDelay + "s linear infinite " + animationDirection);
};
var $category_controls = jQueryNuvem(".js-category-controls");
jQueryNuvem(".js-toggle-menu-panel").click(function (e) {
e.preventDefault();
jQueryNuvem(this).next(".js-menu-panel").show().addClass("nav-list-panel-show");
});
jQueryNuvem(".js-toggle-menu-back").click(function (e) {
e.preventDefault();
var $panel_to_change = jQueryNuvem(this).closest(".js-menu-panel");
$panel_to_change.removeClass("nav-list-panel-show");
setTimeout(function(){
$panel_to_change.hide();
},600);
});
closeHamburgerSubpanels = function() {
jQueryNuvem("#nav-hamburger").addClass("modal-transition-fast");
jQueryNuvem(".js-menu-panel").removeClass("nav-list-panel-show");
setTimeout(function(){
jQueryNuvem(".js-menu-panel").hide();
jQueryNuvem("#nav-hamburger").removeClass("modal-transition-fast");
},1000);
};
jQueryNuvem(".js-toggle-menu-close, .js-modal-overlay[data-modal-id='#nav-hamburger'").click(function () {
closeHamburgerSubpanels();
});
var win_height = window.innerHeight;
const logoContainer = jQueryNuvem('.js-logo-container');
jQueryNuvem(".js-desktop-dropdown").css('maxHeight', (win_height - head_height - 50).toString() + 'px');
jQueryNuvem(".js-item-subitems-desktop").on("mouseenter", function (e) {
jQueryNuvem(e.currentTarget).addClass("active");
}).on("mouseleave", function(e) {
jQueryNuvem(e.currentTarget).removeClass("active");
});
jQueryNuvem(".js-nav-main-item").on("mouseenter", function (e) {
jQueryNuvem('.js-nav-desktop-list').children(".selected").removeClass("selected");
jQueryNuvem(e.currentTarget).addClass("selected");
}).on("mouseleave", function(e) {
const self = jQueryNuvem(this);
setTimeout(function(){
self.removeClass("selected");
},500);
});
jQueryNuvem(".js-nav-desktop-list-arrow").on("mouseenter", function (e) {
jQueryNuvem('.js-desktop-nav-item').removeClass("selected");
});
const menuContainer = jQueryNuvem('.js-nav-desktop-list').first(el => el.offsetWidth);
const logoColWidth = logoContainer.first(el => el.offsetWidth);
let utilityColWidth = 0;
jQueryNuvem('.js-utility-col').each(function(el) {
utilityColWidth += jQueryNuvem(el).first(el => el.offsetWidth);
});
const totalColsWidth = logoColWidth + utilityColWidth;
let menuItems = 0;
jQueryNuvem('.js-nav-desktop-list > .js-desktop-nav-item').each(function(el) {
menuItems += jQueryNuvem(el).first(el => el.offsetWidth);
});
jQueryNuvem(".js-nav-desktop-list").on("scroll", function() {
var position = jQueryNuvem('.js-nav-desktop-list').prop("scrollLeft");
if(position == 0) {
jQueryNuvem(".js-nav-desktop-list-arrow-left").addClass('disable');
} else {
jQueryNuvem(".js-nav-desktop-list-arrow-left").removeClass('disable');
}
if(position == ( menuItems - menuContainer )) {
jQueryNuvem(".js-nav-desktop-list-arrow-right").addClass('disable');
} else {
jQueryNuvem(".js-nav-desktop-list-arrow-right").removeClass('disable');
}
});
if (menuContainer < menuItems) {
jQueryNuvem('.js-nav-desktop-list').addClass('nav-desktop-with-scroll');
jQueryNuvem('.js-nav-desktop-list-arrow').show();
}
setTimeout(function(){
jQueryNuvem(".js-desktop-nav-col, .js-utility-col").css("visibility", "visible").css("height", "auto");
},200);
jQueryNuvem(".js-menu-and-banners-row").css("visibility" , "visible").css("height" , "auto").css("overflow" , "initial");
jQueryNuvem('.js-nav-desktop-list-arrow-right').on("click", function() {
var posL = jQueryNuvem('.js-nav-desktop-list').prop("scrollLeft") + 400;
jQueryNuvem('.js-nav-desktop-list').each((el) => el.scroll({ left: posL, behavior: 'smooth' }));
});
jQueryNuvem('.js-nav-desktop-list-arrow-left').on("click", function() {
var posR = jQueryNuvem('.js-nav-desktop-list').prop("scrollLeft") - 400;
jQueryNuvem('.js-nav-desktop-list').each((el) => el.scroll({ left: posR, behavior: 'smooth' }));
});
jQueryNuvem(".js-desktop-dropdown").on("mouseleave", function (e) {
const self = jQueryNuvem(this);
self.css("pointer-events" , "none");
setTimeout(function(){
self.css("pointer-events" , "initial");
},1000);
});
const search_input = jQueryNuvem(".js-search-input");
jQueryNuvem(".js-search-button").on("click", function (e) {
setTimeout(function(){
search_input.val('').each(el => el.focus());
},10);
});
function applyOffset(selector){
// Get nav height on load
if (window.innerWidth > 768) {
setTimeout(function(){
var head_height = jQueryNuvem(".js-head-main").outerHeight();
jQueryNuvem(selector).css("paddingTop", head_height.toString() - 1 + 'px');
},210);
}else{
var head_height = 0;
}
// Apply offset nav height on load
window.addEventListener("resize", function() {
// Get nav height on resize
var head_height = jQueryNuvem(".js-head-main").height();
// Apply offset on resize
if (window.innerWidth > 768) {
jQueryNuvem(selector).css("paddingTop", head_height.toString() + 'px');
}else{
jQueryNuvem(selector).css("paddingTop", "0px");
}
});
}
applyOffset(".js-head-offset");
var didScroll;
var lastScrollTop = 0;
var delta = 30;
var navbarHeight = jQueryNuvem(".js-head-main").outerHeight();
var topbarHeight = jQueryNuvem(".js-adbar").outerHeight();
window.addEventListener("scroll", function(event){
didScroll = true;
});
setInterval(function() {
if (didScroll) {
hasScrolled();
didScroll = false;
}
}, 250);
function hasScrolled() {
var st = window.pageYOffset;
// Make sure they scroll more than delta
if(Math.abs(lastScrollTop - st) <= delta)
return;
// If they scrolled down and are past the navbar, add class .compress.
if (st > lastScrollTop && st > navbarHeight){
jQueryNuvem(".js-head-main").addClass('compress').css('top', (- topbarHeight).toString() + 'px' );
} else {
// Scroll Up
let documentHeight = Math.max(
document.body.scrollHeight,
document.body.offsetHeight,
document.documentElement.clientHeight,
document.documentElement.scrollHeight,
document.documentElement.offsetHeight
);
if(st + window.innerHeight < documentHeight) {
jQueryNuvem(".js-head-main").removeClass('compress').css('top', "0px" );
}
}
lastScrollTop = st;
}
changeLang = function(element) {
var selected_country_url = element.find("option").filter((el) => el.selected).attr("data-country-url");
location.href = selected_country_url;
};
jQueryNuvem('.js-lang-select').on("change", function (e) {
lang_select_option = jQueryNuvem(this);
changeLang(lang_select_option);
});
var slidesPerViewDesktopVal = 4;
var slidesPerViewMobileVal = 2;
var itemSwiperSpaceBetween = 15;
hideSwiperControls = function(elemPrev, elemNext) {
if((jQueryNuvem(elemPrev).hasClass("swiper-button-disabled") && jQueryNuvem(elemNext).hasClass("swiper-button-disabled"))){
jQueryNuvem(elemPrev).remove();
jQueryNuvem(elemNext).remove();
}
};
// Set loop for related products products sliders
function calculateRelatedLoopVal(sectionSelector) {
let productsAmount = jQueryNuvem(sectionSelector).attr("data-related-amount");
let loopVal = false;
const applyLoop = (window.innerWidth < 768 && productsAmount > slidesPerViewMobileVal) || (window.innerWidth > 768 && productsAmount > slidesPerViewDesktopVal);
if (applyLoop) {
loopVal = true;
}
return loopVal;
}
let alternativeLoopVal = calculateRelatedLoopVal(".js-related-products");
let complementaryLoopVal = calculateRelatedLoopVal(".js-complementary-products");
createSwiper('.js-swiper-related', {
lazy: true,
loop: alternativeLoopVal,
watchOverflow: true,
threshold: 5,
watchSlideProgress: true,
watchSlidesVisibility: true,
spaceBetween: itemSwiperSpaceBetween,
slideVisibleClass: 'js-swiper-slide-visible',
slidesPerView: slidesPerViewMobileVal,
navigation: {
nextEl: '.js-swiper-related-next',
prevEl: '.js-swiper-related-prev',
},
on: {
afterInit: function () {
hideSwiperControls(".js-swiper-related-prev", ".js-swiper-related-next");
},
},
breakpoints: {
768: {
slidesPerView: slidesPerViewDesktopVal,
}
}
});
createSwiper('.js-swiper-complementary', {
lazy: true,
loop: complementaryLoopVal,
watchOverflow: true,
threshold: 5,
watchSlideProgress: true,
watchSlidesVisibility: true,
spaceBetween: itemSwiperSpaceBetween,
slideVisibleClass: 'js-swiper-slide-visible',
slidesPerView: slidesPerViewMobileVal,
navigation: {
nextEl: '.js-swiper-complementary-next',
prevEl: '.js-swiper-complementary-prev',
},
on: {
afterInit: function () {
hideSwiperControls(".js-swiper-complementary-prev", ".js-swiper-complementary-next");
},
},
breakpoints: {
768: {
slidesPerView: slidesPerViewDesktopVal,
}
}
});
var nav_height = jQueryNuvem(".js-head-main").innerHeight();
const noStockVariants = (container = null) => {
const config = {
variantsGroup: ".js-product-variants-group",
variantButton: ".js-insta-variant",
noStockClass: "btn-variant-no-stock",
dataVariationId: "data-variation-id",
dataOption: "data-option"
};
const wrapper = container ? container : jQueryNuvem('#single-product');
if (!wrapper) return;
const dataVariants = wrapper.data('variants');
const variantsLength = wrapper.find(config.variantsGroup).length;
const getOptions = (productVariationId, variantOption) => {
if (productVariationId === 2) {
return {
option0: String(wrapper.find(`${config.variantsGroup}[${config.dataVariationId}="0"] select`).val()),
option1: String(wrapper.find(`${config.variantsGroup}[${config.dataVariationId}="1"] select`).val()),
option2: String(jQueryNuvem(variantOption).attr('data-option')),
};
} else if (productVariationId === 1) {
return {
option0: String(wrapper.find(`${config.variantsGroup}[${config.dataVariationId}="0"] select`).val()),
option1: String(jQueryNuvem(variantOption).attr('data-option')),
};
} else {
return {
option0: String(jQueryNuvem(variantOption).attr('data-option')),
};
}
};
const filterVariants = (options) => {
return dataVariants.filter(variant => {
return Object.keys(options).every(optionKey => variant[optionKey] === options[optionKey]) && variant.available;
});
};
const updateStockStatus = (productVariationId) => {
const variationGroup = wrapper.find(`${config.variantsGroup}[${config.dataVariationId}="${productVariationId}"]`);
variationGroup.find(`${config.variantButton}.${config.noStockClass}`).removeClass(config.noStockClass);
variationGroup.find(config.variantButton).each((variantOption, item) => {
const options = getOptions(productVariationId, variantOption);
const itemsAvailable = filterVariants(options);
const button = wrapper.find(`${config.variantsGroup}[${config.dataVariationId}="${productVariationId}"] ${config.variantButton}[${config.dataOption}="${options[`option${productVariationId}`].replace(/"/g, '\\"')}"]`);
if (!itemsAvailable.length) {
button.addClass(config.noStockClass);
}
});
};
for (let productVariationId = variantsLength - 1; productVariationId >= 0; productVariationId--) {
updateStockStatus(productVariationId);
}
};
noStockVariants();
jQueryNuvem(document).on("click", ".js-quickshop-modal-open", function (e) {
e.preventDefault();
var $this = jQueryNuvem(this);
if($this.hasClass("js-quickshop-slide")){
jQueryNuvem("#quickshop-modal .js-item-product").addClass("js-swiper-slide-visible js-item-slide");
}
let container = jQueryNuvem(this).closest('.js-quickshop-container');
if (!container.length) return;
noStockVariants(container);
LS.fillQuickshop($this);
if (window.innerWidth < 768) {
var product_image_dimension = jQueryNuvem(this).closest('.js-item-product').find('.js-item-image-padding').attr("style");
jQueryNuvem("#quickshop-modal .js-quickshop-image-padding").attr("style", product_image_dimension);
}
});
changeVariantButton = function(selector, parentSelector) {
selector.siblings().removeClass("selected");
selector.addClass("selected");
var option_id = selector.attr('data-option');
var parent = selector.closest(parentSelector);
var selected_option = parent.find('.js-variation-option option').filter(function (el) {
return el.value == option_id;
});
selected_option.prop('selected', true).trigger('change');
parent.find('.js-insta-variation-label').html(option_id);
}
jQueryNuvem(document).on("click", ".js-insta-variant", function (e) {
e.preventDefault();
$this = jQueryNuvem(this);
changeVariantButton($this, '.js-product-variants-group');
});
LS.registerOnChangeVariant(function(variant){
const productContainer = jQueryNuvem('.js-item-product[data-product-id="'+variant.product_id+'"]');
const current_image = productContainer.find('.js-item-image');
current_image.attr('srcset', variant.image_url);
productContainer.find(".js-product-item-private-with-secondary-images").addClass("product-item-secondary-images-disabled");
});
function get_max_installments_without_interests(number_of_installment, installment_data, max_installments_without_interests) {
if (parseInt(number_of_installment) > parseInt(max_installments_without_interests[0])) {
if (installment_data.without_interests) {
return [number_of_installment, installment_data.installment_value.toFixed(2)];
}
}
return max_installments_without_interests;
}
function get_max_installments_with_interests(number_of_installment, installment_data, max_installments_with_interests) {
if (parseInt(number_of_installment) > parseInt(max_installments_with_interests[0])) {
if (installment_data.without_interests == false) {
return [number_of_installment, installment_data.installment_value.toFixed(2)];
}
}
return max_installments_with_interests;
}
function refreshInstallmentv2(price){
jQueryNuvem(".js-modal-installment-price" ).each(function( el ) {
const installment = Number(jQueryNuvem(el).data('installment'));
jQueryNuvem(el).text(LS.currency.display_short + (price/installment).toLocaleString('de-DE', {maximumFractionDigits: 2, minimumFractionDigits: 2}));
});
}
function refreshPaymentDiscount(price){
jQueryNuvem(".js-price-with-discount" ).each(function( el ) {
const payment_discount = jQueryNuvem(el).data('paymentDiscount');
jQueryNuvem(el).text(LS.formatToCurrency(price - ((price * payment_discount) / 100)))
});
}
function togglePaymentDiscounts(variant){
jQueryNuvem(".js-payment-method-total").each(function( paymentMethodTotalElement ){
const priceComparerElement = jQueryNuvem(paymentMethodTotalElement).find(".js-compare-price-display");
const installmentsOnePaymentElement = jQueryNuvem(paymentMethodTotalElement).find('.js-installments-no-discount');
const priceWithDiscountElement = jQueryNuvem(paymentMethodTotalElement).find('.js-price-with-discount');
priceComparerElement.hide();
installmentsOnePaymentElement.hide();
priceWithDiscountElement.hide();
const discount = priceWithDiscountElement.data('paymentDiscount');
if (discount > 0 && showMaxPaymentDiscount(variant)){
priceComparerElement.show();
priceWithDiscountElement.show()
} else {
installmentsOnePaymentElement.show();
}
})
}
function updateDiscountDisclaimers(variant){
updateProductDiscountDisclaimer(variant);
updatePopupDiscountDisclaimers(variant);
}
function updateProductDiscountDisclaimer(variant){
jQueryNuvem(".js-product-discount-container, .js-product-discount-disclaimer").hide();
if (showMaxPaymentDiscount(variant)){
jQueryNuvem(".js-product-discount-container").show();
}
if (showMaxPaymentDiscountNotCombinableDisclaimer(variant)){
jQueryNuvem(".js-product-discount-disclaimer").show();
}
}
function updatePopupDiscountDisclaimers(variant){
jQueryNuvem(".js-modal-tab-discount, .js-payment-method-discount").hide();
if (showMaxPaymentDiscount(variant)){
jQueryNuvem("#method_pago-nube .js-modal-tab-discount").show();
}
jQueryNuvem(".js-info-payment-method-container").each(function(infoPaymentMethodElement){
const infoPaymentMethod = jQueryNuvem(infoPaymentMethodElement)
infoPaymentMethod.find(".js-discount-explanation").hide();
infoPaymentMethod.find(".js-discount-disclaimer").hide();
const priceWithDiscountElement = infoPaymentMethod.find('.js-price-with-discount');
const discount = priceWithDiscountElement.data('paymentDiscount');
if (discount > 0 && showMaxPaymentDiscount(variant)){
infoPaymentMethod.find(".js-discount-explanation").show();
infoPaymentMethod.find(".js-payment-method-discount").show();
}
if (discount > 0 && showMaxPaymentDiscountNotCombinableDisclaimer(variant)){
infoPaymentMethod.find(".js-discount-disclaimer").show();
}
})
}
function variantHasPromotionalPrice(variant) { return variant.compare_at_price_number > variant.price_number }
function showMaxPaymentDiscount(variant) {
return true;
}
function showMaxPaymentDiscountNotCombinableDisclaimer(variant) {
return false
}
function changeVariant(variant) {
jQueryNuvem(".js-product-detail .js-shipping-calculator-response").hide();
jQueryNuvem("#shipping-variant-id").val(variant.id);
var parent = jQueryNuvem("body");
if (variant.element) {
parent = jQueryNuvem(variant.element);
if(parent.hasClass("js-quickshop-container")){
var quick_id = parent.attr("data-quickshop-id");
var parent = jQueryNuvem('.js-quickshop-container[data-quickshop-id="'+quick_id+'"]');
}
}
if(parent.hasClass("js-quickshop-container")){
var itemContainer = parent.closest('.js-item-product');
if(itemContainer.hasClass("js-item-slide")){
var parent = jQueryNuvem('.js-swiper-slide-visible .js-quickshop-container[data-quickshop-id="'+quick_id+'"]');
}
noStockVariants(parent);
} else {
noStockVariants();
}
var sku = parent.find('.js-product-sku');
if(sku.length) {
sku.text(variant.sku).show();
}
var installment_helper = function($element, amount, price){
$element.find('.js-installment-amount').text(amount);
$element.find('.js-installment-price').attr("data-value", price);
$element.find('.js-installment-price').text(LS.currency.display_short + parseFloat(price).toLocaleString('de-DE', { minimumFractionDigits: 2 }));
if(variant.price_short && Math.abs(variant.price_number - price * amount) < 1) {
$element.find('.js-installment-total-price').text((variant.price_short).toLocaleString('de-DE', { minimumFractionDigits: 2 }));
} else {
$element.find('.js-installment-total-price').text(LS.currency.display_short + (price * amount).toLocaleString('de-DE', { minimumFractionDigits: 2 }));
}
};
if (variant.installments_data) {
var variant_installments = JSON.parse(variant.installments_data);
var max_installments_without_interests = [0,0];
var max_installments_with_interests = [0,0];
jQueryNuvem('.js-payment-provider-installments-row').hide();
for (let payment_method in variant_installments) {
var paymentMethodId = '#installment_' + payment_method.replace(" ", "_") + '_1';
var minimumInstallmentValue = jQueryNuvem(paymentMethodId).closest('.js-info-payment-method').attr("data-minimum-installment-value");
let installments = variant_installments[payment_method];
for (let number_of_installment in installments) {
let installment_data = installments[number_of_installment];
max_installments_without_interests = get_max_installments_without_interests(number_of_installment, installment_data, max_installments_without_interests);
max_installments_with_interests = get_max_installments_with_interests(number_of_installment, installment_data, max_installments_with_interests);
var installment_container_selector = '#installment_' + payment_method.replace(" ", "_") + '_' + number_of_installment;
if(minimumInstallmentValue <= installment_data.installment_value) {
jQueryNuvem(installment_container_selector).show();
}
if(!parent.hasClass("js-quickshop-container")){
installment_helper(jQueryNuvem(installment_container_selector), number_of_installment, installment_data.installment_value.toFixed(2));
}
}
}
var $installments_container = jQueryNuvem(variant.element + ' .js-max-installments-container .js-max-installments');
var $installments_modal_link = jQueryNuvem(variant.element + ' #btn-installments');
var $payments_module = jQueryNuvem(variant.element + ' .js-product-payments-container');
var $installmens_card_icon = jQueryNuvem(variant.element + ' .js-installments-credit-card-icon');
var installments_to_use = max_installments_without_interests[0] > 1 ? max_installments_without_interests : max_installments_with_interests;
if(installments_to_use[0] <= 1 ) {
$installments_container.hide();
$installments_modal_link.hide();
$payments_module.hide();
$installmens_card_icon.hide();
} else {
$installments_container.show();
$installments_modal_link.show();
$payments_module.show();
$installmens_card_icon.show();
installment_helper($installments_container, installments_to_use[0], installments_to_use[1]);
}
}
if(!parent.hasClass("js-quickshop-container")){
jQueryNuvem('#installments-modal .js-installments-one-payment').text(variant.price_short).attr("data-value", variant.price_number);
}
if (variant.price_short){
parent.find('.js-price-display').text(variant.price_short).show();
parent.find('.js-price-display').attr("content", variant.price_number).data('productPrice', variant.price_number_raw);
parent.find('.js-payment-discount-price-product').text(variant.price_with_payment_discount_short);
parent.find('.js-payment-discount-price-product-container').show();
parent.find('.js-price-without-taxes').text(variant.price_without_taxes);
parent.find('.js-price-without-taxes-container').show();
} else {
parent.find('.js-price-display, .js-payment-discount-price-product-container, .js-price-without-taxes-container').hide();
}
if ((variant.compare_at_price_short) && !(parent.find(".js-price-display").css("display") == "none")) {
parent.find('.js-compare-price-display').text(variant.compare_at_price_short).show();
} else {
parent.find('.js-compare-price-display').hide();
}
var button = parent.find('.js-addtocart');
const quickshopButtonWording = parent.find('.js-open-quickshop-wording');
const quickshopButtonIcon = parent.find('.js-open-quickshop-icon');
button.removeClass('cart').removeClass('contact').removeClass('nostock');
var $product_shipping_calculator = parent.find("#product-shipping-container");
if (!variant.available){
button.val('Sin stock');
button.addClass('nostock');
button.attr('disabled', 'disabled');
quickshopButtonWording.text('Sin stock');
quickshopButtonIcon.addClass("d-none").removeClass("d-md-inline");
$product_shipping_calculator.hide();
} else if (variant.contact) {
button.val('Consultar precio');
button.addClass('contact');
button.removeAttr('disabled');
quickshopButtonWording.text('Consultar precio');
quickshopButtonIcon.addClass("d-none").removeClass("d-md-inline");
$product_shipping_calculator.hide();
} else {
button.val('Agregar al carrito');
button.addClass('cart');
button.removeAttr('disabled');
quickshopButtonWording.text('Comprar');
quickshopButtonIcon.addClass("d-md-inline");
$product_shipping_calculator.show();
}
const base_price = Number(jQueryNuvem("#price_display").attr("content"));
refreshInstallmentv2(base_price);
refreshPaymentDiscount(variant.price_number);
togglePaymentDiscounts(variant);
updateDiscountDisclaimers(variant);
if(variant.stock == 1) {
parent.find('.js-last-product').show();
} else {
parent.find('.js-last-product').hide();
}
LS.updateShippingProduct();
zipcode_on_changevariant = jQueryNuvem("#product-shipping-container .js-shipping-input").val();
jQueryNuvem("#product-shipping-container .js-shipping-calculator-current-zip").text(zipcode_on_changevariant);
}
jQueryNuvem(document).on("change", ".js-variation-option", function(e) {
var $parent = jQueryNuvem(this).closest(".js-product-variants");
var $variants_group = jQueryNuvem(this).closest(".js-product-variants-group");
var $quickshop_parent_wrapper = jQueryNuvem(this).closest(".js-quickshop-container");
var quick_id = $quickshop_parent_wrapper.attr("data-quickshop-id");
if($parent.hasClass("js-product-quickshop-variants")){
var $quickshop_parent = jQueryNuvem(this).closest(".js-item-product");
if($quickshop_parent.hasClass("js-item-slide")){
var $quickshop_variant_selector = '.js-swiper-slide-visible .js-quickshop-container[data-quickshop-id="'+quick_id+'"]';
}else{
var $quickshop_variant_selector = '.js-quickshop-container[data-quickshop-id="'+quick_id+'"]';
}
LS.changeVariant(changeVariant, $quickshop_variant_selector);
var selected_option_id = jQueryNuvem(this).val();
var $color_parent_to_update = jQueryNuvem('.js-quickshop-container[data-quickshop-id="'+quick_id+'"]');
$color_parent_to_update.find('.js-color-variant[data-option="'+selected_option_id+'"]').addClass("selected").siblings().removeClass("selected");
$variants_group.find('.js-insta-variant[data-option="'+selected_option_id+'"]').addClass("selected").siblings().removeClass("selected");
} else {
LS.changeVariant(changeVariant, '#single-product');
}
var $this_product_container = jQueryNuvem(this).closest(".js-product-container");
if($this_product_container.hasClass("js-quickshop-container")){
var this_quickshop_id = $this_product_container.attr("data-quickshop-id");
var $this_product_container = jQueryNuvem('.js-product-container[data-quickshop-id="'+this_quickshop_id+'"]');
}
var $this_compare_price = $this_product_container.find(".js-compare-price-display");
var $this_price = $this_product_container.find(".js-price-display");
var $installment_container = $this_product_container.find(".js-product-payments-container");
var $installment_text = $this_product_container.find(".js-max-installments-container");
var $this_add_to_cart = $this_product_container.find(".js-prod-submit-form");
// Get the current product discount percentage value
var current_percentage_value = $this_product_container.find(".js-offer-percentage");
// Get the current product price and promotional price
var compare_price_value = $this_compare_price.html();
var price_value = $this_price.html();
// Calculate new discount percentage based on difference between filtered old and new prices
const percentageDifference = window.moneyDifferenceCalculator.percentageDifferenceFromString(compare_price_value, price_value);
if(percentageDifference){
$this_product_container.find(".js-offer-percentage").text(percentageDifference);
$this_product_container.find(".js-offer-label").css("display" , "table");
}
if ($this_compare_price.css("display") == "none" || !percentageDifference) {
$this_product_container.find(".js-offer-label").hide();
}
if ($this_add_to_cart.hasClass("nostock")) {
$this_product_container.find(".js-stock-label").show();
$this_product_container.find(".js-offer-label").hide();
$this_product_container.find(".js-shipping-label").hide();
}
else {
$this_product_container.find(".js-stock-label").hide();
$this_product_container.find(".js-shipping-label").show();
}
if ($this_price.css('display') == 'none'){
$installment_container.hide();
$installment_text.hide();
}else{
$installment_text.show();
}
});
jQueryNuvem(".js-product-form").on("submit", function (e) {
var button = jQueryNuvem(e.currentTarget).find('[type="submit"]');
button.attr('disabled', 'disabled');
if ((button.hasClass('contact')) || (button.hasClass('catalog'))) {
e.preventDefault();
var product_id = jQueryNuvem(e.currentTarget).find("input[name='add_to_cart']").val();
window.location = "\/contacto\/?product=" + product_id;
} else if (button.hasClass('cart')) {
button.val('Agregando...');
}
});
var has_multiple_slides = false;
var has_multiple_slides = true;
Fancybox.bind('[data-fancybox="product-gallery"]', {
Toolbar: {
items: {
close: {
html: ' ',
},
counter: {
class: 'pt-2 mt-1',
type: 'div',
html: ' / ',
position: 'center',
},
},
},
Carousel: {
Navigation: {
classNames: {
button: 'btn',
next: 'swiper-button-next',
prev: 'swiper-button-prev',
},
prevTpl: ' ',
nextTpl: ' ',
},
},
Thumbs: { autoStart: false },
on: {
shouldClose: (fancybox, slide) => {
productSwiper.slideTo( fancybox.getSlide().index, 0 );
},
},
});
function productSliderNav(){
var width = window.innerWidth;
var productSwiper = null;
createSwiper(
'.js-swiper-product', {
lazy: true,
slidesPerView: 1,
threshold: 5,
centerInsufficientSlides: true,
watchOverflow: true,
spaceBetween: 25,
pagination: {
el: '.js-swiper-product-pagination',
type: 'fraction',
},
navigation: {
nextEl: '.js-swiper-product-next',
prevEl: '.js-swiper-product-prev',
},
breakpoints: {
768: {
slidesPerView: 'auto',
}
},
on: {
init: function () {
jQueryNuvem(".js-product-slider-placeholder").hide();
jQueryNuvem(".js-swiper-product").css("visibility", "visible").css("height", "auto");
},
},
},
function(swiperInstance) {
productSwiper = swiperInstance;
}
);
Fancybox.bind('[data-fancybox="product-gallery"]', {
Toolbar: {
items: {
close: {
html: ' ',
},
counter: {
class: 'pt-2 mt-1',
type: 'div',
html: ' / ',
position: 'center',
},
},
},
Carousel: {
Navigation: {
classNames: {
button: 'btn',
next: 'swiper-button-next',
prev: 'swiper-button-prev',
},
prevTpl: ' ',
nextTpl: ' ',
},
},
Thumbs: { autoStart: false },
on: {
shouldClose: (fancybox, slide) => {
productSwiper.slideTo( fancybox.getSlide().index, 0 );
},
},
});
if(has_multiple_slides){
LS.registerOnChangeVariant(function(variant){
var liImage = jQueryNuvem('.js-swiper-product').find("[data-image='"+variant.image+"']");
var selectedPosition = liImage.data('imagePosition');
var slideToGo = parseInt(selectedPosition);
productSwiper.slideTo(slideToGo);
jQueryNuvem(".js-product-slide-img").removeClass("js-active-variant");
liImage.find(".js-product-slide-img").addClass("js-active-variant");
});
}
}
productSliderNav()
jQueryNuvem('.js-pinterest-share').on("click", function(e){
e.preventDefault();
jQueryNuvem(".pinterest-hidden a").get()[0].click();
});
jQueryNuvem(document).on("click", ".js-quantity .js-quantity-up", function (e) {
$quantity_input = jQueryNuvem(this).closest(".js-quantity").find(".js-quantity-input");
$quantity_input.val( parseInt($quantity_input.val(), 10) + 1);
});
jQueryNuvem(document).on("click", ".js-quantity .js-quantity-down", function (e) {
$quantity_input = jQueryNuvem(this).closest(".js-quantity").find(".js-quantity-input");
quantity_input_val = $quantity_input.val();
if (quantity_input_val>1) {
$quantity_input.val( parseInt($quantity_input.val(), 10) - 1);
}
});
var head_height = jQueryNuvem(".js-head-main").outerHeight();
if (window.innerWidth > 768) {
jQueryNuvem("#cart-sticky-summary").css("top" , (head_height + 10).toString() + 'px');
}
function getQuickShopImgSrc(element){
const image = jQueryNuvem(element).closest('.js-quickshop-container').find('img');
return String(image.attr('srcset'));
}
jQueryNuvem(document).on("click", ".js-addtocart:not(.js-addtocart-placeholder)", function (e) {
var $productContainer = jQueryNuvem(this).closest('.js-product-container');
var $productVariants = $productContainer.find(".js-variation-option");
var $productButton = $productContainer.find("input[type='submit'].js-addtocart");
var productButtonWidth = $productButton.first(el => el.offsetWidth);
var isQuickShop = $productContainer.hasClass('js-quickshop-container');
if (isQuickShop) {
var $productButtonContainer = $productButton.closest(".js-item-submit-container");
}
var isCrossSelling = $productContainer.hasClass('js-cross-selling-container');
var $productButtonPlaceholder = $productContainer.find(".js-addtocart-placeholder");
var $productButtonText = $productButtonPlaceholder.find(".js-addtocart-text");
var $productButtonAdding = $productButtonPlaceholder.find(".js-addtocart-adding");
var $productButtonSuccess = $productButtonPlaceholder.find(".js-addtocart-success");
if (isCrossSelling) {
var imageSrc = $productContainer.find('.js-cross-selling-product-image').attr('src');
var quantity = $productContainer.data('quantity')
var name = $productContainer.find('.js-cross-selling-product-name').text();
var price = $productContainer.find('.js-cross-selling-promo-price').text();
var addedToCartCopy = $productContainer.data('add-to-cart-translation');
} else if (!isQuickShop) {
if(jQueryNuvem(".js-product-slide-img.js-active-variant").length) {
var $activeVariantImg = $productContainer.find('.js-product-slide-img.js-active-variant');
var imageSrc = $activeVariantImg.attr('srcset') || $activeVariantImg.data('srcset');
} else {
var $defaultImg = $productContainer.find('.js-product-slide-img');
var imageSrc = $defaultImg.attr('srcset') || $defaultImg.data('srcset');
}
imageSrc = imageSrc ? imageSrc.split(' ')[0] : '';
var quantity = $productContainer.find('.js-quantity-input').val();
var name = $productContainer.find('.js-product-name').text();
var price = $productContainer.find('.js-price-display').text();
var addedToCartCopy = "Agregar al carrito";
} else {
var imageSrc = getQuickShopImgSrc(this);
var quantity = 1;
var name = $productContainer.find('.js-item-name').text();
var price = $productContainer.find('.js-price-display').text().trim();
var addedToCartCopy = "Comprar";
if ($productContainer.hasClass("js-quickshop-has-variants")) {
var addedToCartCopy = "Agregar al carrito";
}else{
var addedToCartCopy = "Comprar";
}
}
if (!jQueryNuvem(this).hasClass('contact')) {
e.preventDefault();
$productButton.hide();
if (isQuickShop) {
$productButtonContainer.hide();
}
$productButtonPlaceholder.width(productButtonWidth).css('display' , 'block');
$productButtonText.fadeOut();
$productButtonAdding.addClass("active");
var callback_add_to_cart = function(html_notification_related_products, html_notification_cross_selling) {
jQueryNuvem('.js-cart-notification-item-img').attr('srcset', imageSrc);
jQueryNuvem('.js-cart-notification-item-name').text(name);
jQueryNuvem('.js-cart-notification-item-quantity').text(quantity);
jQueryNuvem('.js-cart-notification-item-price').text(price);
if($productVariants.length){
var output = [];
$productVariants.each( function(el){
var variants = jQueryNuvem(el);
output.push(variants.val());
});
jQueryNuvem(".js-cart-notification-item-variant-container").show();
jQueryNuvem(".js-cart-notification-item-variant").text(output.join(', '))
}else{
jQueryNuvem(".js-cart-notification-item-variant-container").hide();
}
var cartItemsBadge = jQueryNuvem(".js-cart-widget-amount");
var cartItemsMoney = jQueryNuvem(".js-cart-widget-total");
var cartItemsAmount = cartItemsBadge.text();
cartItemsBadge.removeClass("d-none d-md-inline-block");
if (window.innerWidth > 768) {
cartItemsMoney.removeClass("d-none d-md-inline-block");
}
if(cartItemsAmount > 1){
jQueryNuvem(".js-cart-counts-plural").show();
jQueryNuvem(".js-cart-counts-singular").hide();
}else{
jQueryNuvem(".js-cart-counts-singular").show();
jQueryNuvem(".js-cart-counts-plural").hide();
}
$productButtonAdding.removeClass("active");
$productButtonSuccess.addClass("active");
setTimeout(function(){
$productButtonSuccess.removeClass("active");
$productButtonText.fadeIn();
},2000);
setTimeout(function(){
$productButtonPlaceholder.removeAttr("style").hide();
$productButton.show();
if (isQuickShop) {
$productButtonContainer.show();
}
},3000);
$productContainer.find(".js-added-to-cart-product-message").slideDown();
if (isQuickShop) {
jQueryNuvem("#quickshop-modal").removeClass('modal-show');
jQueryNuvem(".js-modal-overlay[data-modal-id='#quickshop-modal']").hide();
jQueryNuvem("body").removeClass("overflow-none");
restoreQuickshopForm();
if (window.innerWidth < 768) {
cleanURLHash();
}
}
let notificationWithRelatedProducts = false;
function recommendProductsOnAddToCart(){
jQueryNuvem('.js-related-products-notification-container').html("");
modalOpen('#related-products-notification');
jQueryNuvem('.js-related-products-notification-container').html(html_notification_related_products).show();
// Set loop for recommended products
function calculateRelatedNotificationLoopVal(sectionSelector) {
let productsAmount = jQueryNuvem(sectionSelector).attr("data-related-amount");
let loopVal = false;
const applyLoop = (window.innerWidth < 768 && productsAmount > 2) || (window.innerWidth > 768 && productsAmount > 4);
if (applyLoop) {
loopVal = true;
}
return loopVal;
}
let cartRelatedLoopVal = calculateRelatedNotificationLoopVal(".js-related-products-notification");
// Create new swiper on add to cart
createSwiper('.js-swiper-related-products-notification', {
lazy: true,
loop: cartRelatedLoopVal,
watchOverflow: true,
threshold: 5,
watchSlideProgress: true,
watchSlidesVisibility: true,
spaceBetween: itemSwiperSpaceBetween,
slideVisibleClass: 'js-swiper-slide-visible',
slidesPerView: 2.5,
navigation: {
nextEl: '.js-swiper-related-products-notification-next',
prevEl: '.js-swiper-related-products-notification-prev',
},
on: {
afterInit: function () {
hideSwiperControls(".js-swiper-related-products-notification-prev", ".js-swiper-related-products-notification-next");
},
},
breakpoints: {
768: {
slidesPerView: 4,
}
}
});
}
notificationWithRelatedProducts = html_notification_related_products != null;
if(notificationWithRelatedProducts){
if (isQuickShop) {
setTimeout(function(){
recommendProductsOnAddToCart();
},300);
}else{
recommendProductsOnAddToCart();
}
}
let shouldShowCrossSellingModal = html_notification_cross_selling != null;
if(!notificationWithRelatedProducts){
const cartOpenType = jQueryNuvem("#modal-cart").attr('data-cart-open-type');
if((cartOpenType === 'show_cart') && !shouldShowCrossSellingModal){
modalOpen('#modal-cart', 'openFullScreenWithoutClick');
}else{
setTimeout(function(){
jQueryNuvem(".js-alert-added-to-cart").show().addClass("notification-visible").removeClass("notification-hidden");
},500);
if (!cookieService.get('first_product_added_successfully')) {
cookieService.set('first_product_added_successfully', 1, 7 );
} else{
setTimeout(function(){
jQueryNuvem(".js-alert-added-to-cart").removeClass("notification-visible").addClass("notification-hidden");
setTimeout(function(){
jQueryNuvem('.js-cart-notification-item-img').attr('src', '');
jQueryNuvem(".js-alert-added-to-cart").hide();
},2000);
},8000);
}
}
}
if (html_notification_cross_selling != null) {
jQueryNuvem('.js-cross-selling-modal-body').html("");
modalOpen('#js-cross-selling-modal');
jQueryNuvem('.js-cross-selling-modal-body').html(html_notification_cross_selling).show();
}
const crossSellingContainer = document.querySelector('.js-cross-selling-container');
if (crossSellingContainer) {
LS.fillCrossSelling(crossSellingContainer);
}
if (jQueryNuvem("#product-shipping-container .js-shipping-input").val()) {
zipcode_on_addtocart = jQueryNuvem("#product-shipping-container .js-shipping-input").val();
jQueryNuvem("#cart-shipping-container .js-shipping-input").val(zipcode_on_addtocart);
jQueryNuvem(".js-shipping-calculator-current-zip").text(zipcode_on_addtocart);
} else if (cookieService.get('calculator_zipcode')){
var zipcode_from_cookie = cookieService.get('calculator_zipcode');
jQueryNuvem('.js-shipping-input').val(zipcode_from_cookie);
jQueryNuvem(".js-shipping-calculator-current-zip").text(zipcode_from_cookie);
}
jQueryNuvem(".js-fs-add-this-product").hide();
jQueryNuvem(".js-fs-add-one-more").show();
if (isCrossSelling) {
jQueryNuvem('#js-cross-selling-modal .js-modal-close').trigger('click');
}
}
var callback_error = function(){
$productButtonAdding.removeClass("active");
$productButtonText.fadeIn();
$productButtonPlaceholder.removeAttr("style").hide();
$productButton.show();
if (isQuickShop) {
$productButtonContainer.show();
}
}
$prod_form = jQueryNuvem(this).closest("form");
LS.addToCartEnhanced(
$prod_form,
addedToCartCopy,
'Agregando...',
'No hay más stock de este producto.',
false,
callback_add_to_cart,
callback_error
);
}
});
jQueryNuvem(document).on("keypress", ".js-cart-quantity-input", function (e) {
if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
return false;
}
});
jQueryNuvem(document).on("focusout", ".js-cart-quantity-input", function (e) {
var itemID = jQueryNuvem(this).attr("data-item-id");
var itemVAL = jQueryNuvem(this).val();
if (itemVAL == 0) {
var r = confirm("¿Seguro que quieres borrar este artículo?");
if (r == true) {
LS.removeItem(itemID, true);
} else {
jQueryNuvem(this).val(1);
}
} else {
LS.changeQuantity(itemID, itemVAL, true);
}
});
jQueryNuvem(".js-trigger-empty-cart-alert").on("click", function (e) {
e.preventDefault();
let emptyCartAlert = jQueryNuvem(".js-mobile-nav-empty-cart-alert").fadeIn(100);
setTimeout(() => emptyCartAlert.fadeOut(500), 1500);
});
document.addEventListener( 'cart.released', () => {
const cart_amount = jQueryNuvem(".js-cart-widget-amount").text();
if(cart_amount == 1) {
jQueryNuvem(".js-amount-one-item").show();
jQueryNuvem(".js-amount-many-items").hide();
}else{
jQueryNuvem(".js-amount-one-item").hide();
jQueryNuvem(".js-amount-many-items").show();
}
});
jQueryNuvem('form[action="\/comprar\/"]').on("submit", function() {
cookieService.remove('first_product_added_successfully');
});
if (jQueryNuvem('.js-selected-shipping-method').length) {
var shipping_cost = jQueryNuvem('.js-selected-shipping-method').data("cost");
var $shippingCost = jQueryNuvem("#shipping-cost");
$shippingCost.text(shipping_cost);
$shippingCost.removeClass('opacity-40');
}
selectShippingOption = function(elem, save_option) {
jQueryNuvem(".js-shipping-method, .js-branch-method").removeClass('js-selected-shipping-method');
jQueryNuvem(elem).addClass('js-selected-shipping-method');
var shipping_cost = jQueryNuvem(elem).data("cost");
var shipping_price_clean = jQueryNuvem(elem).data("price");
if(shipping_price_clean = 0.00){
var shipping_cost = ''
}
// Updates shipping (ship and pickup) cost on cart
var $shippingCost = jQueryNuvem("#shipping-cost");
$shippingCost.text(shipping_cost);
$shippingCost.removeClass('opacity-40');
if (save_option) {
LS.saveCalculatedShipping(true);
}
if (jQueryNuvem(elem).hasClass("js-shipping-method-hidden")) {
if (jQueryNuvem(elem).hasClass("js-pickup-option")) {
jQueryNuvem(".js-other-pickup-options, .js-show-other-pickup-options .js-shipping-see-less").show();
jQueryNuvem(".js-show-other-pickup-options .js-shipping-see-more").hide();
} else {
jQueryNuvem(".js-other-shipping-options, .js-show-more-shipping-options .js-shipping-see-less").show();
jQueryNuvem(".js-show-more-shipping-options .js-shipping-see-more").hide()
}
}
};
if (cookieService.get('calculator_zipcode')) {
var zipcode_from_cookie = cookieService.get('calculator_zipcode');
jQueryNuvem('#product-shipping-container .js-shipping-input').val(zipcode_from_cookie);
jQueryNuvem(".js-shipping-calculator-current-zip").text(zipcode_from_cookie);
jQueryNuvem(".js-shipping-calculator-head").addClass("with-zip").removeClass("with-form");
jQueryNuvem(".js-shipping-calculator-with-zipcode").addClass("transition-up-active");
jQueryNuvem(".js-shipping-calculator-spinner").show();
} else {
jQueryNuvem(".js-shipping-calculator-form").addClass("transition-up-active");
}
removeShippingSuboptions = function(){
var shipping_suboptions_id = jQueryNuvem(".js-modal-shipping-suboptions").attr("id");
jQueryNuvem("#" + shipping_suboptions_id).remove();
jQueryNuvem('.js-modal-overlay[data-modal-id="#' + shipping_suboptions_id + '"').remove();
};
jQueryNuvem(".js-calculate-shipping").on("click", function (e) {
e.preventDefault();
let shipping_input_val = jQueryNuvem(e.currentTarget).closest(".js-shipping-calculator-form").find(".js-shipping-input").val();
jQueryNuvem(".js-shipping-input").val(shipping_input_val);
if (jQueryNuvem(".js-cart-item").length) {
LS.calculateShippingAjax(
jQueryNuvem('#cart-shipping-container').find(".js-shipping-input").val(),
'\/envio\/',
jQueryNuvem("#cart-shipping-container").closest(".js-shipping-calculator-container") );
}
jQueryNuvem(".js-shipping-calculator-current-zip").html(shipping_input_val);
removeShippingSuboptions();
});
jQueryNuvem(".js-shipping-input").on('keydown', function (e) {
var key = e.which ? e.which : e.keyCode;
var enterKey = 13;
if (key === enterKey) {
e.preventDefault();
jQueryNuvem(e.currentTarget).closest(".js-shipping-calculator-form").find(".js-calculate-shipping").trigger('click');
if (window.innerWidth < 768) {
jQueryNuvem(e.currentTarget).trigger('blur');
}
}
});
jQueryNuvem(document).on("change", ".js-shipping-method, .js-branch-method", function (e) {
selectShippingOption(this, true);
jQueryNuvem(".js-shipping-method-unavailable").hide();
});
jQueryNuvem(document).on('shipping.options.checked', '.js-shipping-method', function (e) {
let shippingPrice = jQueryNuvem(this).attr("data-price");
LS.addToTotal(shippingPrice);
let total = (LS.data.cart.total / 100) + parseFloat(shippingPrice);
jQueryNuvem(".js-cart-widget-total").html(LS.formatToCurrency(total));
selectShippingOption(this, false);
});
jQueryNuvem(document).on("click", ".js-toggle-more-shipping-options", function(e) {
e.preventDefault();
if(jQueryNuvem(this).hasClass("js-show-other-pickup-options")){
jQueryNuvem(".js-other-pickup-options").slideToggle(600);
jQueryNuvem(".js-show-other-pickup-options .js-shipping-see-less, .js-show-other-pickup-options .js-shipping-see-more").toggle();
}else{
jQueryNuvem(".js-other-shipping-options").slideToggle(600);
jQueryNuvem(".js-show-more-shipping-options .js-shipping-see-less, .js-show-more-shipping-options .js-shipping-see-more").toggle();
}
});
calculateCartShippingOnLoad = function() {
if (jQueryNuvem("#cart-shipping-container .js-shipping-input").val()) {
// If user already had calculated shipping: recalculate shipping
setTimeout(function() {
LS.calculateShippingAjax(
jQueryNuvem('#cart-shipping-container').find(".js-shipping-input").val(),
'\/envio\/',
jQueryNuvem("#cart-shipping-container").closest(".js-shipping-calculator-container") );
removeShippingSuboptions();
window.toggleAccordionPrivate("#cart-shipping-container .js-toggle-shipping");
}, 100);
}
if (jQueryNuvem(".js-branch-method").hasClass('js-selected-shipping-method')) {
}
};
jQueryNuvem(document).on("click", ".js-shipping-calculator-change-zipcode", function(e) {
e.preventDefault();
jQueryNuvem(".js-shipping-calculator-response").fadeOut(100);
jQueryNuvem(".js-shipping-calculator-head").addClass("with-form").removeClass("with-zip");
jQueryNuvem(".js-shipping-calculator-with-zipcode").removeClass("transition-up-active");
jQueryNuvem(".js-shipping-calculator-form").addClass("transition-up-active");
});
jQueryNuvem(document).on("click", ".js-save-shipping-country", function(e) {
e.preventDefault();
lang_select_option = jQueryNuvem(this).closest(".js-modal-shipping-country");
changeLang(lang_select_option);
jQueryNuvem(this).text('Aplicando...').addClass("disabled");
});
var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIOS) {
var ios_input_fields = jQueryNuvem("input[type='text'], input[type='number'], input[type='password'], input[type='tel'], textarea, input[type='search'], input[type='hidden'], input[type='email']");
ios_input_fields.addClass("form-control-ios");
jQueryNuvem(".js-quantity").addClass("form-group-quantity-ios");
jQueryNuvem(".js-cart-quantity-container").addClass("cart-quantity-container-ios");
jQueryNuvem(".js-search-form").toggleClass("search-form-ios");
jQueryNuvem(".js-price-filter-btn").addClass("price-btn-ios");
jQueryNuvem(".js-price-filter-empty").addClass("input-clear-content-ios");
}
jQueryNuvem(".js-footer-col-sticky").css("top" , head_height + 40 + 'px');
jQueryNuvem('img[src*="www.afip.gob.ar"]').attr('alt', 'Logo de AFIP');
});
});
No se encontraron comentarios para este producto. ¡Sé el primero en comentar!