3 MSI con Paypal* - Clic aquí
ENVÍOS GRATIS en compras de $999
A 6 QUINCENAS con Kueski Pay - Clic aquí
3 MSI con Paypal* - Clic aquí
ENVÍOS GRATIS en compras de $999
A 6 QUINCENAS con Kueski Pay - Clic aquí
Ir al contenido FACTURAR TIENDAS ¡AFÍLIATE! BLOGS CAMBIOS USA
MUJERES Magia Nueva 2024 Lightwear Essence Pantalones Suede Primavera - Verano Gabardinas Blazer Gabardinas Suede Pantalones Bolsas Vestidos Otoño - Invierno Abrigos Chamarras Chalecos Camisolas HOMBRES ESTILOS PARA ELLOS ¡ÚLTIMAS TALLAS!
See Also
Shyla 2,5 mg Tabletten - PatientenInfo-Service Shyla 2,5 mg Tabletten - Wirkung, Nebenwirkungen, Dosierung Shyla 2.5 Mg Tabletten 2.5mg TAB, tibolon, Anwendungsgebiete, Dosierung und Art der Anwendung, Nebenwirkungen Shyla » Name mit Bedeutung, Herkunft, Beliebtheit & mehr Otoño - Invierno Lightwear 2024 Abrigos Chamarras Chalecos REBAJAS PRENDAS EXCLUSIVAS OUTLET
MUJERES Magia Nueva 2024 Lightwear Essence Pantalones Suede Primavera - Verano Gabardinas Blazer Gabardinas Suede Pantalones Bolsas Vestidos Otoño - Invierno Abrigos Chamarras Chalecos Camisolas HOMBRES Otoño - Invierno Lightwear 2024 Abrigos Chamarras Chalecos REBAJAS PRENDAS EXCLUSIVAS OUTLET FACTURAR TIENDAS ¡AFÍLIATE! BLOGS CAMBIOS USA MUJERES MUJERES Magia Nueva 2024 Magia Nueva 2024 Lightwear Essence Pantalones Suede Primavera - Verano Primavera - Verano Gabardinas Blazer Gabardinas Suede Pantalones Bolsas Vestidos Otoño - Invierno Otoño - Invierno Abrigos Chamarras Chalecos Camisolas HOMBRES HOMBRES Otoño - Invierno Otoño - Invierno Lightwear 2024 Abrigos Chamarras Chalecos REBAJAS REBAJAS PRENDAS EXCLUSIVAS OUTLET FACTURAR TIENDAS ¡AFÍLIATE! BLOGS CAMBIOS USA Registro / Inicio de sesión
ESSENCE 2024 Descarga el Catálogo Digital LIGHTWEAR 2024 Descarga el Catálogo Digital ABRIGOS 2023 Descarga el Catálogo Digital JACKETS 2023 Descarga el Catálogo Digital PAGOS SEGUROS Todas nuestras pasarelas de pago son 100% seguras.
ATENCIÓN PERSONALIZADA Contáctanos al 55 5709 0018 EXT: 213
COBERTURA Enviamos la magia a todas partes de México
'+gdpr_msg+' ';}var gdpr_newuser = gdpr_msg_show; console.log("Coming Soon App Notify Me 2.0.0"); //08-01-2024 var SB$; // if (typeof is_theme_extension !== 'undefined') { var csp_sb_extension = 1; var sb_csp_ProIDsCollectionsTest = { } var sb_csp_ProIDsCollections =``; var csp_collections = {"collections":[]}; var csp_products = {"products":[]}; csp_product_collection_Data = {}; Object.assign(csp_product_collection_Data, csp_collections, csp_products); // console.log(cspprodAllresults); // console.log(cspcolIDSresults); var productOBJ = null var pay_status="active" var plan_name="Coming Soon Premium" var mail_chimp_enable="undefined" var sb_csp_shop= Shopify.shop; var csp_premium = 0; if(pay_status=="active" && plan_name =="Coming Soon Premium" ){ var csp_premium=1; } var store_timezone = `America/Mexico_City`; var payment_status = `active`; var payment_plan_name = ``; var sb_csp_is_all_products = ``; if(sb_csp_is_all_products == ''){ sb_csp_is_all_products = 0; } var hidePriceCollction = "" var hidePriceList = `` var productPage_Price = ``; var show_available_date = `0`; var available_date_for_all_products = ``; var available_date_msg=`Product will be available on {date}`; var date_format =`17`; var date_option =`default`; var show_available_date_msg =`0`; var time_format = `7`; var show_datetime_collection =`none`; var sb_csp_enable="1"; var enable = sb_csp_enable; var detail_page_show_class = "detail_page_show_class"; var form_button_display_option =`show_csp_button`; var btn_name = "PRÓXIMAMENTE"; var sb_csp_product_handle =``; var sb_csp_product_id =``; var product_url =``; var collection_id =``; var prod_ID_arr,prod_array,col_ID_arr,col_array,prod_array_url=[]; var csp_current_collection_list_prodPage =`temp`; var curr_url_detailpge = ``; var curr_title_detailpge = ``; var curr_hundle_detailpge = ``; var curr_hundle_pid = ``; var form_title = `NOTIFICARME CUANDO ESTÉ DISPONIBLE`; var csp_form_subtitle = ``; var product_title = ``; var csp_placeholder =`Agregar Correo Electrónico`; var submit_btn_name=`Envíar`; var recaptcha_enable = `0`; var recaptchasite_key =``; var show_only_comingsoon = `undefined`; var comingsoon_button_label = `PRÓXIMAMENTE`; var auto_mode =`0`; var auto_notify =`0`; var name_placeholder =``; var email_placeholder =``; var phone_placeholder =``; var show_name_filed =``; var show_email_filed =``; var show_phone_filed =``; var name_filed_reuired =``; var email_filed_reuired =``; var phone_filed_reuired =``; var name_error_msg =``; var phone_error_msg =``; var email_error_msg =``; var email_blank_msg =``; var phone_blank_msg =``; var show_variants_filed = `` var variants_filed_reuired = `` var variants_error_msg = `` csp_custom_css = ``; var csp_custom_js = ""; csp_custom_js = document.createElement("script"); csp_custom_js.type = "text/javascript"; csp_custom_js.text = ``; var is_redirect=""; var redirect_page=""; var csp_badge_template = "default_temp"; if(csp_badge_template == "default_temp"){ var cspCollectionLabelClass = 'collection-coming-soon-label';}else if(csp_badge_template == "temp1"){ var cspCollectionLabelClass = 'coll_csp_lbl_temp1';}else if (csp_badge_template == "temp2"){var cspCollectionLabelClass = 'coll_csp_lbl_temp2'; }else if(csp_badge_template == "temp3"){ var cspCollectionLabelClass = 'coll_csp_lbl_temp3';}else if (csp_badge_template == "temp4"){var cspCollectionLabelClass = 'coll_csp_lbl_temp4'; }else if(csp_badge_template == "temp5"){ var cspCollectionLabelClass = 'coll_csp_lbl_temp5'; }else if(csp_badge_template == "static_temp1"){ var cspCollectionLabelClass = 'coll_csp_lbl_statictemp1';}else if(csp_badge_template == "static_temp2"){var cspCollectionLabelClass = 'coll_csp_lbl_statictemp2';}else if(csp_badge_template == "static_temp3"){ var cspCollectionLabelClass = 'coll_csp_lbl_statictemp3'; }else if(csp_badge_template == "static_temp4"){ var cspCollectionLabelClass = 'coll_csp_lbl_statictemp4'; } var sb_csp_colAllresults = filterConvertArray(sb_csp_ProIDsCollections); var cspcolIDSresults = CreateArrays(csp_product_collection_Data['collections']) var cspprodAllresults = CreateArrays(csp_product_collection_Data['products']) var registeredIntervals = []; var csp_form_success_msg = `¡Se ha enviado la solicitud!`; var store_real_time = `2024/06/16 03:07:09`; var match_procol_id = match_type = ''; var first_selected_var = `` var first_selected_var_id = `` var isTimeZoneFetch = false; var autoNotifyArr = []; var serverPath = 'https://setubridgeapps.com/coming-soon-product/app/src/public'; // Timer Template var timer_template_option = ``; if(timer_template_option == "" || timer_template_option == " "){ timer_template_option = "default"; } let sb_hide_css = ``; if(comingsoon_button_label.length <= 0){sb_hide_css += `.csp-prod-wrapper-detailpage{ display: none }`;} if(btn_name.length <= 0){sb_hide_css += `.collection-coming-soon-label:after{ content: none }`;} var titleClassesInForm = '.sb-coming-soon-title,.product-meta__title,.product-meta,.product__title,.gt_heading,.product-title,h1[data-pf-type="ProductTitle"],.product-page--heading,.product-name,.title,.product-single__title,.product-sku,h2[id="popup_cart_title"],.flash-deal,.product-form__variants'; if(typeof(window.BOOMR) !== "undefined") {var originalThemeName = window.BOOMR.themeName;}else{var originalThemeName = Shopify.theme.name; } function filterConvertArray(arr){ var processArray = arr.replace(/(\r\n|\n|\r)/gm, ""); processArray = processArray.replace(/ /g,''); processArray = processArray.split(','); const arrResults = processArray.filter(element => { return element !== ""; }); return arrResults; } function CreateArrays(handle){ var NewArray = []; for (var i = 0, n = handle.length; i < n; i++) { var device = handle[i]; NewArray.push(device.id); } return NewArray; } var loadScript = function (url, callback) { var script = document.createElement('script'); script.type = 'text/javascript'; if (script.readyState) { script.onreadystatechange = function () { if (script.readyState == 'loaded' || script.readyState == 'complete') { script.onreadystatechange = null; callback(); } }; } else { script.onload = function () { callback(); }; } script.src = url; document.getElementsByTagName('head') [0].appendChild(script); }; if ((typeof jQuery === 'undefined') || (parseFloat(jQuery.fn.jquery) < 1.7)) { loadScript('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function () { jQuery191 = jQuery.noConflict(true); SB$ = jQuery191; get_timezone(jQuery191); }); } else { SB$ = jQuery; get_timezone(jQuery); } if((sb_csp_shop == "656391.myshopify.com" || sb_csp_shop == "shop-hey-june.myshopify.com") && payment_plan_name == "coming_soon_special"){ if(sb_repload_script === "undefined"){ sb_repload_script = "v1"; } (function() { console.log("csp: js loaded"); var script = document.createElement('script'); script.src = 'https://setubridgeapps.com/coming-soon-product/client-customization/'+sb_csp_shop+'/coming-soon.js?'+sb_repload_script; script.onload = function() { }; document.head.appendChild(script); })(); }else{ function myAppJavaScript_csp($){ $("body").append(csp_custom_css); $("body").append(csp_custom_js); $("body").append(``); if(csp_badge_template == "temp4"){$('.media, .card__media').css({"overflow":"unset"});} AjaxURL = 'https://' + Shopify.shop + '/products/' + curr_hundle_detailpge + '.json'; var request = $.ajax({ url: AjaxURL, type: "GET", dataType: "json", }); request.done(function (productdata) { var myJSON = JSON.stringify(productdata); productdata = JSON.parse(myJSON); Create_form_fields(productdata); }); request.fail(function (productdata) { }); var Create_form_fields = (productdata) => { $(".csp_variants").html(""); var options = productdata.product.options; for (let i = 0; i < options.length; i++) { var varianName = options[i].name; var varianValuesArray = options[i].values; select_id = varianName; select_id = select_id.replace("(", ""); select_id = select_id.replace(")", ""); select_id = select_id.replace(/\s/g, ""); select_id = select_id.replace(/\//g, ""); select_id = select_id.replace(/&/g, "and"); select_id = select_id.replace(/:/g, ""); select_id = select_id.replace(/-/g, ""); select_id = select_id.replace(/=/g, ""); var variant_class = "cfp_var" + i; if (varianName == "Title") { continue; } Select_keyword_placeholder = "Select"; if (Shopify.shop == "shoopsschweiz.myshopify.com") { Select_keyword_placeholder = ""; } SelectDiv = ``; //created dynamic select option $('.csp_variants').prepend(SelectDiv); var options_html = varianValuesArray.forEach(Create_selectmenu); function Create_selectmenu(item) { var options = '
' + item + ' '; $('#' + select_id).append(options); } } } checkForCollectionPage(); checkForProductPage(); function lookup( id, devices) { for (var i = 0, n = devices.length; i < n; i++) { var device = devices[i]; if ( parseInt(id) == parseInt(device.id) ) { return device; } } return false; } // CSP detailpage Form function themeConditions(){ if(originalThemeName == "Impulse" || originalThemeName == "Motion" || originalThemeName == "Molla"){ $("body").append(``); } if(originalThemeName == "Molla"){ $("body").append(``); } if(originalThemeName == "Avone" || originalThemeName == "Avone OS 2.0"){ $("body").append(``); } if(originalThemeName == "Sofine theme"){ $("body").append(``); } if(originalThemeName == "Kalles"){ $("body").append(``); } } function checkForCollectionPage(){ $("a").each(function(index) { var specificMatchAutoRemove = ''; var curr_this = $(this); var curr_href = curr_this.attr("href"); var imgg = $(curr_this).closest('div').find('img').first(); if(typeof curr_href !== 'undefined') { if(typeof($(this).
parent ().attr('class')) !== "undefined"){ var parent_class_att = $(this).parent().attr('class'); }else{ var parent_class_att = ''; } if(curr_href.indexOf("products/") >= 1 && $( this ).parent().get( 0 ).tagName != 'LI' && !$(this).parent().hasClass('sbDoNot_add_csp') && !parent_class_att.includes("breadcrumbs")&& checkNotAddBadge($(this))){ curr_href = curr_href.split("?")[0]; fetch(curr_href + ".json", { credentials: "same-origin" }).then(function(data) { data.json().then(function(data) { var get_product = data.product; var csp_product_on = false; var prod_id = get_product.id.toString(); var match_type = ''; var a_index = index; //check specific products if(cspprodAllresults.includes(get_product.id.toString())){ csp_product_on=true; match_procol_id = get_product.id.toString(); match_type = 'products'; } if (window.location.pathname.indexOf('/products/') == -1) { //check for collection if(csp_product_on != true){ for (collection_ID of cspcolIDSresults) { if(collection_ID.replace(/ /g,'')==collection_id.replace(/ /g,'')) { csp_product_on=true; match_procol_id = collection_id.replace(/ /g,''); match_type = 'collections'; } } } } // check products in collections if(csp_product_on != true) { $.each(sb_csp_ProIDsCollectionsTest,function(key, value){ if(value.includes(get_product.id.toString())){ var colid = key.split('_')[0] csp_product_on=true; match_procol_id = colid; match_type = 'collections'; } }) } //check all products if(sb_csp_is_all_products == "1" && csp_product_on != true) { csp_product_on=true; /*console.log('all pro match ',csp_product_on); */ } var collection_id_liquid = $(curr_this).attr('collection-id'); if(typeof collection_id_liquid != 'undefined'){ collection_id_liquid = filterConvertArray(collection_id_liquid) if(csp_product_on != true){ for (collection_ID of cspcolIDSresults) { if($.inArray(collection_ID.replace(/ /g,''), collection_id_liquid) != -1) { csp_product_on=true; match_procol_id = collection_id.replace(/ /g,''); match_type = 'collections'; } } } } var todayDate=new Date(store_real_time); var show_csp_form = true; if(available_date_for_all_products != null && show_available_date =='1' && todayDate >= new Date(available_date_for_all_products) && auto_mode == '1'){ show_csp_form=false; } if(show_datetime_collection == "datetimer"){ var col_msg = '{date}'; col_msg += 'countdown_timer'; }else if(show_datetime_collection == "timer"){ var col_msg = 'countdown_timer'; }else if(show_datetime_collection == 'date'){ var col_msg = '{date}'; }else{var col_msg = '';} var show_available_date_content = ''; if(col_msg != '' && show_available_date == '1' && available_date_for_all_products != null && available_date_for_all_products != '' ){ specificMatchAutoRemove = 'all'; } //check for specific date var returnval = ''; var is_auto_notify = ''; if(match_type != '' && match_procol_id != '' && sb_csp_is_all_products != "1" ){ returnval = lookup(match_procol_id , csp_product_collection_Data[match_type]) try{ returnval.csp_date = returnval.csp_date.replaceAll('-','/'); //safari issue solve }catch(e){ } var old_auto_mode = 'No'; try{old_auto_mode = returnval.csp_date_show;}catch(e){} try{ is_auto_notify = returnval.auto_notify; }catch(e){ } if(todayDate <= new Date(returnval.csp_date) && returnval.csp_date != null && returnval.csp_date != ''){ show_csp_form = true; } if((auto_mode == '1' || old_auto_mode == 'Yes') && todayDate >= new Date(returnval.csp_date) && returnval.csp_date != null && returnval.csp_date != ''){ show_csp_form = false; } //specific message checking if(col_msg != '' && returnval.csp_date != null ){ specificMatchAutoRemove = 'specific'; var new_msg = addCountDownTimerCollection($,col_msg,returnval.csp_date,'not_default',prod_id,a_index,match_type,match_procol_id,is_auto_notify) convertedDate = apply_date_formate($,date_format,returnval.csp_date); responseMessage = getShortCodeFromMessage($,new_msg,convertedDate); var show_available_date_content = '
'+responseMessage+' '; } } if(specificMatchAutoRemove == 'specific'){ }else if(specificMatchAutoRemove == 'all'){ if(sb_csp_is_all_products == '1'){match_type='all';} var new_msg = addCountDownTimerCollection($,col_msg,available_date_for_all_products,'default',prod_id,a_index,match_type,match_procol_id,is_auto_notify) convertedDate = apply_date_formate($,date_format,available_date_for_all_products); responseMessage = getShortCodeFromMessage($,new_msg,convertedDate); var show_available_date_content = '
'+responseMessage+' '; } // remove duplicate timer if($(".show_available_date."+prod_id).length > 0 ){ $(".show_available_date."+prod_id).remove(); } if( sb_csp_enable=="1" && csp_product_on && show_csp_form){ if($(curr_this).find('img').first().length > 0 || $(curr_this).find('.sb-coming-soon-label').length > 0){ checkCSPBadgeVisibility($(curr_this).find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').find('img').first().length > 0 || $(curr_this).closest('div').find('.sb-coming-soon-label').length > 0){ checkCSPBadgeVisibility($(curr_this).closest('div').find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').find('.sb-coming-soon-label').addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').parent().find('img').first().length > 0 || $(curr_this).closest('div').parent().find('.sb-coming-soon-label').length > 0 ){ checkCSPBadgeVisibility($(curr_this).closest('div').parent().find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').parent().find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').parent().parent().find('img').first().length > 0 || $(curr_this).closest('div').parent().parent().find('.sb-coming-soon-label').length > 0){ checkCSPBadgeVisibility($(curr_this).closest('div').parent().parent().find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').parent().parent().find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').parent().parent().find('img').first().length > 0 || $(curr_this).closest('div').parent().parent().find('.sb-coming-soon-label').length > 0 ){ checkCSPBadgeVisibility($(curr_this).closest('div').parent().parent().parent().find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').parent().parent().parent().find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().find('img').first().length > 0 || $(curr_this).closest('div').parent().parent().parent().find('.sb-coming-soon-label').length > 0){ checkCSPBadgeVisibility($(curr_this).closest('div').parent().parent().parent().find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').parent().parent().parent().find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().parent().find('img').first().length > 0 || $(curr_this).closest('div').parent().parent().parent().parent().find('.sb-coming-soon-label').length > 0 ){ checkCSPBadgeVisibility($(curr_this).closest('div').parent().parent().parent().parent().find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').parent().parent().parent().parent().find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().parent().parent().find('img').first().length > 0 || $(curr_this).closest('div').parent().parent().parent().parent().parent().find('.sb-coming-soon-label').length > 0 ){ checkCSPBadgeVisibility($(curr_this).closest('div').parent().parent().parent().parent().parent().find('img').first().parent(),cspCollectionLabelClass,prod_id,show_available_date_content); $(curr_this).closest('div').parent().parent().parent().parent().parent().find('.sb-coming-soon-label').first().parent().addClass(cspCollectionLabelClass+' '+prod_id); } hidePriceOnAllPages(curr_this,prod_id); if(!(typeof(dpnotHideCartForm) !== "undefined")){ hideAddToCartOnCollection(curr_this,prod_id); } } else{ // for old store migration $(".csp-prod-wrapper."+get_product.handle).addClass('sb_hide_add_to_cart'); $(".csp-prod-wrapper."+get_product.handle).remove(); } }) }) }; } }) themeConditions(); } function checkCSPBadgeVisibility(img_elem,cspCollectionLabelClass,prod_id,show_available_date_content){ if(img_elem.is(':visible')){ img_elem.addClass(cspCollectionLabelClass+' '+prod_id); img_elem.after(show_available_date_content); }else if(img_elem.parent().is(':visible')){ img_elem.parent().addClass(cspCollectionLabelClass+' '+prod_id); img_elem.parent().after(show_available_date_content); } } function checkNotAddBadge(curre_elem){ var return_val = true; if(curre_elem.attr('class') !== "undefined"){var curr_elm_class= curre_elem.attr('class');}else{var curr_elm_class= '';} if(curre_elem.parent().hasClass('pl-swatches__container') && originalThemeName =="Prestige"){ return_val=false; } if(originalThemeName == "Kalles" && curr_elm_class?.includes('mini_cart')){ return_val=false; } return return_val; } function hideAddToCartOnCollection(curr_this,prod_id) { var hideCartBuuton = 'form[action*="/cart/add"],.quick-view,.t4s-pr-quickview,.t4s-pr-addtocart,.add-to-cart,.quick-view-btn,.boost-pfs-quickview-btn,.quick-add,.product-form__quantity,.quickbuy-toggle,product-to-cart,.m-product-quickview-button,.tt-btn-quickview,.quickShop,.woodmart-buttons,.product-buttons,.product-cta,.product-cta-upright,.quickview-icon,.btn-quickview,.productitem--actions,.add_to_cart_button,.sold-out-badge,.sale-badge,.t4s-product-badge,.t4s-product-btns,.prod__tag--soldout,.badge--sold-out,.product-card__label,.product-cart-action,.card__badge,.grid-product__sold-out,.grid-product__on-sale,.badge--sale,.soldOut-badge,.product-quickview,.sold-out,.button-set,.group-button,.badge-list,.hover_button,.out-of-stock,.sf__pcard-quick-add,.sf__pcard-action,.card-quickview,.price__badge-sold-out'; if ((typeof (doNotHideaddtoCart) !== 'undefined')) { var hideCartBuuton = 'NOT-HIDE'; } // var priceClass = '.price,.
money '; var priceClass = titleClassesInForm; if ($(curr_this).find(hideCartBuuton).length > 0) { //console.log('1'); if ($(curr_this).
children ().find(hideCartBuuton).find(priceClass).length <= 0) { $(curr_this).find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').parent().find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').parent().find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').parent().find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').parent().parent().find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').parent().parent().find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').parent().parent().find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').parent().parent().parent().find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').parent().parent().parent().find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').parent().parent().parent().find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').parent().parent().parent().find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').parent().parent().parent().find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').parent().parent().parent().find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').parent().parent().parent().parent().find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').parent().parent().parent().parent().find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').parent().parent().parent().parent().find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } else if ($(curr_this).closest('div').parent().parent().parent().parent().parent().find(hideCartBuuton).length > 0) { if ($(curr_this).closest('div').parent().parent().parent().parent().parent().find(hideCartBuuton).children().find(priceClass).length <= 0) { $(curr_this).closest('div').parent().parent().parent().parent().parent().find(hideCartBuuton).addClass('sb-csp-hideclass '+prod_id); } } } function checkForProductPage(){ if (window.location.pathname.indexOf('/products/') !== -1) { var sb_csp_current_collection_list_prodPage = filterConvertArray(csp_current_collection_list_prodPage); var csp_total_collection_list_prodPage = cspcolIDSresults; var prod_id = sb_csp_product_id.toString(); var csp_enabled = "no"; var specificMatchAutoRemove = ''; var a_index = $(".show_available_date_detail."+prod_id).length; //check all products if(sb_csp_is_all_products == "1" && csp_enabled != 'yes' ) { csp_enabled="yes"; /*console.log('all Products')*/} //check specific products if(cspprodAllresults.includes(sb_csp_product_id.toString()) && csp_enabled != "yes"){ csp_enabled="yes"; match_procol_id = sb_csp_product_id.toString(); match_type = 'products'; } //check for collection ids if(csp_enabled != 'yes'){ for (collection_name of csp_total_collection_list_prodPage) { for (current_collection of sb_csp_current_collection_list_prodPage) { if(current_collection.length >= 2 && collection_name.length >= 2) { if(current_collection.replace(/ /g,'')==collection_name.replace(/ /g,'')) { csp_enabled="yes"; match_procol_id = current_collection.replace(/ /g,'') match_type = 'collections'; } } } } } var todayDate=new Date(store_real_time); var show_csp_form = true; if(available_date_for_all_products != null && show_available_date =='1' && todayDate >= new Date(available_date_for_all_products) && auto_mode == '1'){ show_csp_form=false; } var show_available_date_contentdetail = ''; if(show_available_date == '1' && show_available_date_msg == '1' && available_date_for_all_products != null && available_date_for_all_products != ''){ if(available_date_msg != null){ specificMatchAutoRemove = 'all'; } } //check for specific date var returnval = ''; var is_auto_notify = ''; if(match_type != '' && match_procol_id != '' && sb_csp_is_all_products != "1" ){ returnval = lookup(match_procol_id , csp_product_collection_Data[match_type]) try{ returnval.csp_date = returnval.csp_date.replaceAll('-','/'); //safari usse solve }catch(e){ } try{ is_auto_notify = returnval.auto_notify }catch(e){ } var old_auto_mode = 'No'; try{old_auto_mode = returnval.csp_date_show;}catch(e){} if(todayDate <= new Date(returnval.csp_date) && returnval.csp_date != null && returnval.csp_date != ''){ show_csp_form = true; } if((auto_mode == '1' || old_auto_mode == 'Yes' ) && todayDate >= new Date(returnval.csp_date) && returnval.csp_date != null && returnval.csp_date != ''){ show_csp_form = false; } //specific message checking if(show_available_date_msg == '1' && returnval.csp_date != null && available_date_msg != null){ specificMatchAutoRemove = 'specific'; var new_msg = addCountDownTimer($,available_date_msg,returnval.csp_date,'not_default',prod_id,a_index,match_type,match_procol_id,is_auto_notify); convertedDate = apply_date_formate($,date_format,returnval.csp_date); new_msg = new_msg.replace('{time}',formatAMPM(new Date(returnval.csp_date))); responseMessage = getShortCodeFromMessage($,new_msg,convertedDate); show_available_date_contentdetail = '
'+responseMessage+'
'; } } if(specificMatchAutoRemove == 'specific'){ }else if(specificMatchAutoRemove == 'all'){ if(sb_csp_is_all_products == '1'){match_type='all';} var new_msg = addCountDownTimer($,available_date_msg,available_date_for_all_products,'default',prod_id,a_index,match_type,match_procol_id,is_auto_notify); convertedDate = apply_date_formate($,date_format,available_date_for_all_products); new_msg = new_msg.replace('{time}','
'+formatAMPM(new Date(available_date_for_all_products))+' '); responseMessage = getShortCodeFromMessage($,new_msg,convertedDate); show_available_date_contentdetail = '
'+responseMessage+'
'; } if(csp_enabled=="yes" && show_csp_form){ if($(".csp-sb-timer").length > 0){ $(".csp-sb-timer").html(''); $(".csp-sb-timer").append(show_available_date_contentdetail); show_available_date_contentdetail =''; } if(form_button_display_option == 'show_csp_button'){ var addtocspbutton = '
'+ ''+ '
'+show_available_date_contentdetail+'
'; }else{ var name_form_field = phone_form_field = email_form_field = variants_form_field= ''; if(show_name_filed != "" && show_name_filed != "0"){ name_required = '' if(name_filed_reuired == '1'){ name_required = 'required'; } name_form_field =''; } if(show_phone_filed != "" && show_phone_filed != "0"){ phone_required = '' if(phone_filed_reuired == '1'){ phone_required = 'required'; } phone_form_field =''; } if(show_email_filed == "" || show_email_filed == "1"){ email_required = '' if(email_filed_reuired == '1' || show_email_filed == ""){ email_required = 'required'; } email_form_field = ''; } if(show_variants_filed == "" || show_variants_filed == "1"){ if(variants_filed_reuired == '1'){ variants_filed_reuired = 'required'; } variants_form_field = '' } var addtocspbutton = '
'; } $( "form" ).each(function( index ) { var getForm = $(this).attr("action"); var current_form = $(this); if(typeof getForm != 'undefined'){ if(getForm.includes("/cart/add") && $(".csp-prod-wrapper-detailpage").length == 0){ if($(".csp-sb-form").length <= 0){ $(this).after(addtocspbutton); } hidePriceOnAllPages($(this),prod_id); if(typeof(dpnotHideCartForm) === "undefined"){ dpnotHideCartForm = false; } var detaiilInForm = $('form[action*="/cart/add"]').find(titleClassesInForm) if(!dpnotHideCartForm){ if(detaiilInForm.length > 0){ $('form[action*="/cart/add"]').find('button').addClass('sb-csp-hideclass '+prod_id); $('form[action*="/cart/add"]').find('button').remove(); //someone buys the product so remove the add to cart $('form[action*="/cart/add"]').find('input[type="submit"][name="button"]').remove(); // remove [name] if not working on any store $('form[action*="/cart/add"]').find('#product-add-to-cart').remove(); }else{ $('form[action*="/cart/add"]').addClass('sb-csp-hideclass '+prod_id); current_form.addClass('sb-csp-hideclass '+prod_id); } } if($(".csp-sb-form").length > 0){ $(".csp-sb-form").append(addtocspbutton); } $(".csp-prod-button").show(); if(!originalThemeName.includes('Minimog') && !originalThemeName.includes('Theme Lab')){ hideStickyAddToCart($) $(document).on( 'scroll', function(){ hideStickyAddToCart($) }); } } } }); if(typeof(cspAppendAfter)!=="undefined" && $(".csp-prod-wrapper-detailpage").length == 0){ $(cspAppendAfter).after(addtocspbutton); } } else{ $('form[action*="/cart/add"]').show(); $('form[action*="/cart/add"]').removeClass('sb_hide_add_to_cart'); $('form[action*="/cart/add"]').find('button').show(); } } } function hidePriceOnAllPages(curr_this,prod_id){ if($(curr_this).find(hidePriceList).length > 0){ $(curr_this).find(hidePriceList).hide(); }else if($(curr_this).closest('div').find(hidePriceList).length > 0){ $(curr_this).closest('div').find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); }else if($(curr_this).closest('div').parent().find(hidePriceList).length > 0){ $(curr_this).closest('div').parent().find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); }else if($(curr_this).closest('div').parent().parent().find(hidePriceList).length > 0){ $(curr_this).closest('div').parent().parent().find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().find(hidePriceList).length > 0){ $(curr_this).closest('div').parent().parent().parent().find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().find(hidePriceList).length > 0){ $(curr_this).closest('div').parent().parent().parent().find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().parent().find(hidePriceList).length > 0){ $(curr_this).closest('div').parent().parent().parent().parent().find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); }else if($(curr_this).closest('div').parent().parent().parent().parent().parent().find(hidePriceList).length > 0){ $(curr_this).closest('div').parent().parent().parent().parent().parent().find(hidePriceList).addClass('sb-csp-hideclass '+prod_id); } } /* CUSTOM DATE */ function apply_date_formate($,date_format,user_date_with_weekoff_cutoff){ var shoplanguage = Shopify.locale; var get_custom_date_format = 'not_set'; user_date_with_weekoff_cutoff = user_date_with_weekoff_cutoff.replaceAll('-','/'); var d = new Date(user_date_with_weekoff_cutoff); var month = d.getMonth()+1; var day = d.getDate(); var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var monthNamesShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"]; var weekdayShort = ["Sun","Mon","Tues","Wed","Thur","Fri","Sat"]; var ord = ["st", "nd", "rd"]; var exceptions = [11, 12, 13] var nth = ord[(day % 10) - 1] == undefined || exceptions.includes(day % 100) ? "th" : ord[(day % 10) - 1] year = d.getFullYear(); //like 2021 twoDigityear = year.toString().substr(-2); //like 21 singleDigitmonth = d.getMonth()+1; // like 5 month = ((''+month).length<2 ? '0' : '') + month ; // like 05 monthName= d.toLocaleDateString(shoplanguage, { month: 'long'}); //like august monthShort= d.toLocaleDateString(shoplanguage, { month: 'short'}); //like aug singleDigitday = d.getDate(); //like 2 singleDigitDayOrd= singleDigitday + nth // like 2nd day = ((''+day).length<2 ? '0' : '') + day; //like 02 dayOrd = day + nth; // like 02nd dayName = d.toLocaleDateString(shoplanguage, {weekday: 'long'}); // like sunday dayNameShort = d.toLocaleDateString(shoplanguage, { weekday: 'short'}); // like sun monthShort = monthShort.replace('.', ''); monthName = monthName.replace('.', ''); dayNameShort = dayNameShort.replace('.', ''); dayName = dayName.replace('.', ''); date_array_list=[]; date_array_list['dd'] = date_array_list['dayNameShort'] = dayNameShort; date_array_list['dddd'] = date_array_list['dayName']=dayName; date_array_list['D'] = date_array_list['singleDigitday']=singleDigitday; date_array_list['DD'] = date_array_list['day']=day; date_array_list['DDD'] = date_array_list['singleDigitDayOrd']=singleDigitDayOrd; date_array_list['DDDD'] = date_array_list['dayOrd']=dayOrd; date_array_list['M'] = date_array_list['singleDigitmonth'] = singleDigitmonth; date_array_list['MM'] = date_array_list['month']=month; date_array_list['MMM'] = date_array_list['monthShort']=monthShort; date_array_list['MMMM'] = date_array_list['monthName']=monthName; date_array_list['YYYY'] = date_array_list['year']=year; date_array_list['YY'] = twoDigityear; date_array_list['YYY'] = '`'+twoDigityear; date_format_arry = ['', date_array_list['year'] + '-' + date_array_list['month'] + '-' +date_array_list['day'], date_array_list['month'] + '-' +date_array_list['day']+ '-' +date_array_list['year'] , date_array_list['month'] + '/' +date_array_list['day']+ '/' +date_array_list['year'], date_array_list['monthShort'] + ', '+date_array_list['dayOrd']+' '+date_array_list['year'], date_array_list['dayOrd'] + ', '+date_array_list['monthShort']+' '+date_array_list['year'], date_array_list['dayNameShort']+', '+date_array_list['monthShort'] + ' '+date_array_list['dayOrd']+' '+date_array_list['year'], date_array_list['dayNameShort']+', '+date_array_list['dayOrd'] + ' '+date_array_list['monthShort']+' '+date_array_list['year'], date_array_list['day'] + '.' +date_array_list['month']+ '.' +date_array_list['year'], date_array_list['day'] + '-' +date_array_list['month']+ '-' +date_array_list['year'], date_array_list['month'] + '.' +date_array_list['day']+ '.' +date_array_list['year'] , date_array_list['year'] + '.' +date_array_list['month']+ '.' +date_array_list['day'] , date_array_list['year'] + '/' + date_array_list['month'] + '/' +date_array_list['day'], date_array_list['day'] + '/' +date_array_list['month']+ '/' +date_array_list['year'], date_array_list['dayOrd']+' '+date_array_list['monthShort'], date_array_list['dayNameShort']+', '+date_array_list['dayOrd'] + ' '+date_array_list['monthShort'], date_array_list['dayName']+', '+ date_array_list['monthName'] +' '+date_array_list['dayOrd'], '
'+ date_array_list['MMM']+' '+ date_array_list['DD']+' ' , date_array_list['monthShort'] + ' '+date_array_list['dayOrd']+', '+date_array_list['year'] ]; /* set custom date format */ if(get_custom_date_format != 'not_set' || ( date_option == 'custom' && edd_options.custom_date_format != ' ')){ eval(edd_options.additional_script); if(typeof edd_options.custom_date_format != 'undefined' && date_option == 'custom' && edd_options.custom_date_format != ' '){ client_custom_date_format = edd_options.custom_date_format; custom_date_format = client_custom_date_format; } custom_date_format = replaceAllOccurance(custom_date_format,4,'-',' - '); custom_date_format = replaceAllOccurance(custom_date_format,4,',',' , '); custom_date_format = replaceAllOccurance(custom_date_format,4,'.',' . '); custom_date_format = replaceAllOccurance(custom_date_format,4,'/',' / '); custom_date_format_array = custom_date_format.split(" "); create_cusom_date = ''; for(b=0;b
'+date+''); message = message.replace('{'+shortcodeList[a].toLowerCase()+'}', ''+date+' '); capitalizeSHortcode = shortcodeList[a].toLowerCase().replace(/\b[a-z]/g, function(letter) { return letter.toUpperCase(); }); message = message.replace('{'+capitalizeSHortcode+'}', ''+date+' '); } return message; } function googleCaptcha(){ if (recaptcha_enable == "1" && recaptchasite_key !="" && form_button_display_option != 'show_csp_button'){ grecaptcha.ready(function() { try{ grecaptcha.execute(recaptchasite_key, {action:'validate_captcha'}) .then(function(token) { document.getElementById('g-recaptcha-response').value = token; }); } catch(err) { } }); } } function formatAMPM(date) { var hours = date.getHours(); var minutes = date.getMinutes(); var ampm = hours >= 12 ? 'pm' : 'am'; hours = hours % 12; hours = hours ? hours : 12; // the hour '0' should be '12' minutes = minutes < 10 ? '0'+minutes : minutes; var strTime = hours + ':' + minutes + ' ' + ampm; return strTime; } function minTwoDigits(n) { return (n < 10 ? '0' : '') + n; } function addComingLabelOnCollection($,message,prod_id,btn_name){ message = message.replace('countdown_timer',''+btn_name+' '); return message; } function addComingLabelOnDetail($,message,prod_id,btn_name){ message=''+btn_name+'
'; return message; } function addCountDownTimerCollection($,message,store_full_dateTime,defaultCheck,prod_id,a_index,match_type,col_id,is_auto_notify){ message = message.replace('countdown_timer',' '); var distance = getDistance($,store_full_dateTime,prod_id); if(registeredIntervals.indexOf(prod_id+a_index) == -1){ if (distance <= 0) { checkAutoNofify(prod_id,match_type,col_id,is_auto_notify); } var countDownTimer = CSPCountDownTimer(distance,prod_id,store_full_dateTime,a_index,"collection"); } return message; } function addCountDownTimer($,message,store_full_dateTime,defaultCheck,prod_id,a_index,match_type,col_id,is_auto_notify){ message = message.replaceAll('{countdown_timer}',' '); message = message.replaceAll('{Countdown_Timer}',' '); message = message.replaceAll('{COUNTDOWN_TIMER}',' '); var distance = getDistance($,store_full_dateTime,prod_id); if(registeredIntervals.indexOf(prod_id+a_index) == -1){ if (distance <= 0) { checkAutoNofify(prod_id,match_type,col_id,is_auto_notify); } var countDownTimer = CSPCountDownTimer(distance,prod_id,store_full_dateTime,a_index,"product"); } return message; } function getDistance($,csp_product_time,prod_id){ try{ csp_product_time = csp_product_time.replaceAll('-','/'); }catch(e){ } var defaultTime= csp_product_time.replace(' AM',''); defaultTime= csp_product_time.replace(' PM',''); var store_time = new Date(store_real_time).getTime(); var countDownDate = new Date(defaultTime+":20").getTime(); var distance = (countDownDate - store_time) / 1000; return distance; } var cspCDTimer; function CSPCountDownTimer(distance,prod_id,store_full_dateTime,a_index,target_page) { cspCDTimer = setInterval(cspClock, 1000); var cspT = distance; //Initially set to 1 hour registeredIntervals.push(prod_id+a_index); function cspClock() { --cspT var seconds = cspT; var days = Math.floor(seconds / (24 * 60 * 60)); seconds -= days * (24 * 60 * 60); var hours = Math.floor(seconds / (60 * 60)); seconds -= hours * (60 * 60); var minutes = Math.floor(seconds / (60)); seconds -= Math.floor(minutes * (60)); if (cspT == 0 || cspT <= 0) { days = 0; hours = 0; seconds = 0; minutes = 0; } if(timer_template_option != "default" && target_page == "product"){ var hours_str = minTwoDigits(hours).toString();var minutes_str = minTwoDigits(minutes).toString();var second_str = minTwoDigits(seconds).toString(); switch (timer_template_option){ case 'timer_template_1': var timer =''+apply_date_formate($,"17",store_full_dateTime)+' '+minTwoDigits(days)+' d '+minTwoDigits(hours)+' h '+minTwoDigits(minutes)+' m '+minTwoDigits(seconds)+' s ';break; case 'timer_template_2': var timer =''+hours_str.charAt(0)+' '+hours_str.charAt(1)+' Hours
'+minutes_str.charAt(0)+' '+minutes_str.charAt(1)+' Minutes
'+second_str.charAt(0)+' '+second_str.charAt(1)+' Seconds
';break; default: var timer = ''; break; }}else{ switch (time_format) { case '1':var timer = ' ' + minTwoDigits(days) + ' Days ' + minTwoDigits(hours) + ' Hours ' + minTwoDigits(minutes) + ' Minutes ' + minTwoDigits(seconds) + ' Seconds ';break; case '2':var timer = ' ' + minTwoDigits(hours) + ' Hours ' + minTwoDigits(minutes) + ' Minutes ' + minTwoDigits(seconds) + ' Seconds ';break; case '3':var timer = ' ' + minTwoDigits(hours) + ' Hrs ' + minTwoDigits(minutes) + ' Mins ' + minTwoDigits(seconds) + ' Secs ';break; case '4':var timer = ' ' + minTwoDigits(hours) + ' Hrs ' + minTwoDigits(minutes) + ' Mins ';break; case '5':var timer = ' ' + minTwoDigits(hours) + 'H : ' + minTwoDigits(minutes) + 'M : ' + minTwoDigits(seconds) + 'S ';break; case '6':var timer = ' ' + minTwoDigits(days) + 'days / ' + minTwoDigits(hours) + 'hours / ' + minTwoDigits(minutes) + "minutes / " + minTwoDigits(seconds) + 'seconds ';break; case '7':var timer = ' ' + minTwoDigits(days) + ' d ' + minTwoDigits(hours) + ' h ' + minTwoDigits(minutes) + ' m ' + minTwoDigits(seconds) + ' s ';break; case '8':var timer = ' ' + minTwoDigits(days) + ' Days ' + minTwoDigits(hours) + ' Hours ' + minTwoDigits(minutes) + ' Mins ' + minTwoDigits(seconds) + ' Secs ';break; case '9':var timer = ' ' + minTwoDigits(days) + 'D : ' + minTwoDigits(hours) + 'H : ' + minTwoDigits(minutes) + 'M : ' + minTwoDigits(seconds) + 'S ';break; case '10':var timer = ' ' + minTwoDigits(days) + ' Days : ' + minTwoDigits(hours) + ' Hrs : ' + minTwoDigits(minutes) + ' Mins : ' + minTwoDigits(seconds) + ' Secs ';break; default: var timer = ' ' + minTwoDigits(hours) + ' Hrs ' + minTwoDigits(minutes) + ' Mins ' + minTwoDigits(seconds) + ' Secs ';break; } } if(typeof(checkDataIndex) !== "undefined" && target_page == "collection"){ $('.count_down_timer'+prod_id).html(timer); }else{ $('.count_down_timer'+prod_id+'.'+a_index).html(timer); } if (cspT == 0 || cspT <= 0 && auto_mode == '1') { $(".csp-prod-wrapper-detailpage."+ prod_id).remove(); $(".csp-prod-wrapper-detailpage-button."+ prod_id).remove(); $(".show_available_date_detail."+prod_id).remove(); $(".show_available_date."+prod_id).remove(); $(".collection-coming-soon-label."+prod_id).removeClass("collection-coming-soon-label"); $(".sb-csp-hideclass."+prod_id).removeClass("sb-csp-hideclass "+prod_id); clearInterval(cspCDTimer);}}} function checkAutoNofify(prod_id,match_type,col_id,is_auto_notify){ if(match_type == 'all' && sb_csp_is_all_products == '1'){ autoNotifyArr.push({ all: 'all' }); }else if(match_type == 'collections'){ if(is_auto_notify != '' && is_auto_notify != "1"){ autoNotifyArr.push({ collections: col_id }); } }else if(match_type == 'products'){ if(is_auto_notify != '' && is_auto_notify != "1"){ autoNotifyArr.push({ products: prod_id });}}} setTimeout(function(){ autoNotifyCall(); },5000) function arrUnique(arrr) { var cleaned = []; arrr.forEach(function(itm) { var unique = true; cleaned.forEach(function(itm2) { if (JSON.stringify(itm) === JSON.stringify(itm2)) unique = false; }); if (unique) cleaned.push(itm); }); return cleaned; } function autoNotifyCall(){ if(autoNotifyArr.length > 0 && auto_notify == '1'){ autoNotifyArr = arrUnique(autoNotifyArr); $.ajax({ type: "POST", url: serverPath+'/autoNotifyCustomer', data: {shop:sb_csp_shop,autoNotifyArr:autoNotifyArr}, dataType: "json", success: function(response) { }, error:function(e){ }}); }} if (window.location.href.indexOf("cart") > -1) { if(typeof notPreorder !== "undefined"){ removeCSPFromCart(); setTimeout(function(){removeCSPFromCart();},500); }} function removeCSPFromCart(){ var ProIDsCollectionsCart = sb_csp_ProIDsCollectionsTest; var cspcolIDSresultsCart = cspcolIDSresults; var cspprodAllresultsCart = cspprodAllresults; setTimeout(function(){ var GETcart = 'not_set'; $.ajax({ url: '/cart.json', type: 'get', dataType: 'json', success: function(cart){ GETcart =cart; $(GETcart.items).each(function(itemID,item){ var pro_id = item['sb_csp_product_id']; var index = itemID+1; var cartID= item['id']; if(cspprodAllresultsCart.includes(pro_id.toString())){ var todayDate=new Date(store_real_time); var show_csp_form = true; var returned_response = lookup( pro_id, csp_product_collection_Data['products']) if(auto_mode == '1' && todayDate >= new Date(returned_response.csp_date)){ show_csp_form = false; }else{ removeCartItemt(cartID,0); } }});}}) },300) function removeCartItemt(id,qty){ cartProperty = { 'id': id, 'quantity': qty } $.ajax({ type: 'POST', url: '/cart/change.js', data: cartProperty, dataType: 'json', success: function() { }, error:function(e){ }});}} try{$("body").append('');}catch(e){} } function loadCSPEvents($){ $(document).on('keyup','.csp-prod-form input[type="text"],.form-group input[type="number"]',function(){ if($(this).attr('id')=="cspname"){ $(".err_name.text-danger").remove(); $(this).removeClass('invalid-csp-field'); } }); $(document).on('keyup','#cspemail',function(){ $(".err_email.text-danger").remove(); $(this).removeClass('invalid-csp-field'); var email = $('#cspemail').val(); var email_regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (email.length == 0) { $('#cspemail').after(`${email_blank_msg} `); $('#cspemail').addClass('invalid-csp-field'); count_name = false; }else if (!email_regex.test(email)) { $('#cspemail').after(`${email_error_msg} `); $('#cspemail').addClass('invalid-csp-field'); count_name = false; } });$(document).on('keyup','#cspphone',function(){ $(".err_phone.text-danger").remove(); $("#cspphone").removeClass('invalid-csp-field'); var phone = $('#cspphone').val(); phone = phone.replace(/ /g, '') var countrycode_val = phone.match(/^\+\d{1,3}\d{9,15}$/); if (phone_filed_reuired == '1' && phone.length <= 9) { $('#cspphone').after(`${phone_blank_msg} `); $('#cspphone').addClass('invalid-csp-field'); }else if (phone_filed_reuired == '1' && !countrycode_val) { $('#cspphone').after(`${phone_error_msg} `); $('#cspphone').addClass('invalid-csp-field'); }}); $(document).on('click', '.submitReq', function(){ $('.submitReq').attr("disabled","true"); $('.text-danger').remove(); $(".invalid-csp-field").removeClass("invalid-csp-field"); var email_regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; var phone_regex = /^\+\d{1,3}\d{9,15}$/; var variantData = selectedVariantData($); var name = $('#cspname').val(); var email = $('#cspemail').val(); var phone = $('#cspphone').val(); var message = $('#cspmessage').val(); var country = $('#csp_country').val(); var ownermail="contacto@shyla.com"; var checkqty = $('#Quantity').val(); var gcaptcha=$('.g-recaptcha-response').val(); var qty = ''; var csp_selected_variant = variantData; if(typeof checkqty !== "undefined"){ qty = checkqty; } setTimeout(function() { $('.submitReq').removeAttr("disabled"); }, 1000); customer_subscribe=0; //terms and condition checkbox value if($(".csp_gdpr_cb").prop('checked') == true){ customer_subscribe=1; } count_name = true; if (name_filed_reuired == '1' && typeof(name) !== "undefined" && name.length == 0) { $('#cspname').after(""+ name_error_msg +" "); $('#cspname').addClass('invalid-csp-field'); count_name = false; } else if ((phone_filed_reuired == '1' && typeof(phone) !== "undefined") && (phone.length == 0 || !phone_regex.test(phone))) { if (phone.length == 0) { $('#cspphone').after(""+ phone_blank_msg +" "); $('#cspphone').addClass('invalid-csp-field'); count_name = false; } else { if(!phone_regex.test(phone)){ $('#cspphone').after(""+phone_error_msg+" "); $('#cspphone').addClass('invalid-csp-field'); count_name = false; } } }else if((show_email_filed == '1' && email_filed_reuired == '1') && (email.length == 0 || !email_regex.test(email))){ if (email.length == 0) { $('#cspemail').after(""+ email_blank_msg +" "); $('#cspemail').addClass('invalid-csp-field'); count_name = false; } else if(!email_regex.test(email)){ $('#cspemail').after(""+ email_error_msg +" "); $('#cspemail').addClass('invalid-csp-field'); $('.err_email.text-danger').show(); count_name = false; } }var errorDisplayed = false;if (variants_filed_reuired == 'required') {var variants_validation = [".cfp_var0", ".cfp_var1", ".cfp_var2"];for (variant_vald of variants_validation) {if ($(variant_vald).length > 0) {var variant_value = $(variant_vald).val();if (variant_value == null && !errorDisplayed) {$(variant_vald).after();cvarian_vald = "abcd";$('#cspvariants').after(""+variants_error_msg+" ");$('#cspvariants').addClass('invalid-csp-field');count_name = false;errorDisplayed = true;}}}}if(count_name){$('.csp_form-btn-lable').hide();$('.nb-spinner').show();$.ajax({url: serverPath+'/submitreq',method: 'GET',data: { /*form_data */name: name,email: email,phone: phone,productid:sb_csp_product_id,pid: sb_csp_shop+product_url,shop: sb_csp_shop,senderemail: ownermail,title:product_title,qty:qty,gcaptcha: gcaptcha,customer_subscribe : customer_subscribe,csp_selected_variant : csp_selected_variant,},cache: false,beforeSend: function() {},success: function (data){$('.nb-spinner').hide();$('.csp_form-btn-lable').show();$('.submitReq.c-form__button span').show();var redirectpage="";$('#cspmodal input,#cspmodal textarea').val(' ');$('.c-form_label .submitReq').after(''+ csp_form_success_msg +'
');$('.success-msg').delay(3000).fadeOut('slow');setTimeout(function() { $('.success-msg').remove(); }, 3000);$('.csp-parent-wrapper').css("opacity","1");setTimeout(function() { $('.c-form')[0].reset(); }, 3000);$('#cspphone').val('');$('#cspmessage').val('');$('#cspphone').val('');$('#cspvariants').val('');setTimeout(function(){$('#cspmodal .alert-success').remove();$('#cspmodal').hide();if(is_redirect=="1"){redirect_page=redirect_page.trim();if(redirect_page.length==0){ return false;}window.open(redirect_page,"_self");}},2000);}});}else{return false;}});}function selectedVariantData($){var selectedVariants = [];$('#cspvariants :selected').each(function(i, selected){var curr_option = $(this).parent().attr("id");selectedVariants.push({ [$(this).parent().attr("id")] : $(selected).val()});});return selectedVariants}function setCookieCSP(name,value,exdays) {const d = new Date();d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));let expires = "; expires=" + d.toUTCString();document.cookie = name + "=" + value + ";" + expires + "; path=/";}function getCookieCSP(name) {var nameEQ = name + "=";var ca = document.cookie.split(';');for(var i=0;i < ca.length;i++) {var c = ca[i];while (c.charAt(0)==' ') c = c.substring(1,c.length);if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);}return null;}function eraseCookieCSP(name) {document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';}function checkPayemnt($){setCookieCSP('sb_payment_status_check_csp','active',1);returnvar sb_payment_status_check = getCookieCSP('sb_payment_status_check_csp');if(sb_payment_status_check == null){$.ajax({url: serverPath+"/checkPaymentStatus",type: "GET",data: {shop:sb_csp_shop},cache: false,success: function(response){if(response){response = JSON.parse(response);if(response.result.status == "active"){setCookieCSP('sb_payment_status_check_csp','active',1);myAppJavaScript_csp($);setTimeout(function(){loadCSPEvents($);functionForFilter_CSP($)},2000);}else{setCookieCSP('sb_payment_status_check_csp','not_set',1);}}else{setCookieCSP('sb_payment_status_check_csp','not_set',1);}if(response.status == '1'){setCookieCSP('sb_payment_status_check_csp','active',1);myAppJavaScript_csp($);setTimeout(function(){loadCSPEvents($);functionForFilter_CSP($)},2000);}}});}}// Function for filter issuefunction checkFreeTheme(){var sb_cfp_freeThemes = ['Dawn','Refresh','Craft','Sense','Studio','Crave','Origin','Ride','Taste','Spotlight','Colorblock','Publisher'];if(sb_cfp_freeThemes.includes(originalThemeName)){return true;}return false;}function functionForFilter_CSP($){if(checkFreeTheme()){// show button on availability filter***************$(document).on('click',".js-filter, .active-facets",function(){setTimeout(function(){myAppJavaScript_csp($);},1300);});// Show button on price filter**********************$(document).on('keyup', ".field__input, .active-facets", function(){setTimeout(function(){myAppJavaScript_csp($);},1300);});// category wise filter*****************************$(document).on('change', ".facet-filters__sort", function(){setTimeout(function(){myAppJavaScript_csp($);},1300);});// Recommendaed Product*****************************if($('body').find('.related-products__heading')){setTimeout(function(){myAppJavaScript_csp($);},1300);}//Remove Filter Function*****************$(document).on('click', ".active-facets, .active-facets__button-wrapper, .active-facets__button-inner", function(){setTimeout(function(){myAppJavaScript_csp($);},1300);});}}// End Function for filter issue// Hide sticky add to cart--------function hideStickyAddToCart($) {// if(`page` == "product"){$(document).ready(function () {$(window).scroll(function () {var elementsWithStickyText = $('[class*="sticky_add"],[class*="sticky_form"],[class*="product-sticky-bar"], [class*="sticky-atc"], [class*="sticky_atc_wrap"],[class*="sticky_atc_shown"], [class*="sticky-add"], [class*="stickyCart"], [class*="sticky_cart"], [class*="sticky-cart"], [class*="sticky-addtocart"], [class*="sticky_addtocart"], [class*="stickyAdd"], [class*="sticky_form"], [class*="sticky-atc"]');elementsWithStickyText.each(function () {var element = $(this);if (element.is(":visible") && !element.is(":hidden")) {element.hide();}});});});// }}}function get_timezone($){if (!(typeof(wait_for_timezone) !== 'undefined')) {var wait_for_timezone = 1300;}if (typeof(timeDelay) == "undefined") {var timeDelay = 0;}setTimeout(function(){$.ajax({type: "GET",url: serverPath+'/get_timezone',data: {shop:sb_csp_shop,store_timezone:store_timezone},dataType: "json",success: function (response) {if(!isTimeZoneFetch){store_real_time = response.dateTimemyAppJavaScript_csp($);setTimeout(function(){loadCSPEvents($);functionForFilter_CSP($)},2000);isTimeZoneFetch = true;}}});setTimeout(function(){if(!isTimeZoneFetch){myAppJavaScript_csp($);setTimeout(function(){loadCSPEvents($);functionForFilter_CSP($)},2000);isTimeZoneFetch = true;}},wait_for_timezone);},timeDelay);}//1. add class for custom position of CSP for of detail page (csp-sb-form)// //2. add class if you do not want to append csp label of collection grid ( add class on parent of a tag)// sbDoNot_add_csp//3. if detail page form contains title etc add class to this variable (if hiding all detail)// detaiilInForm//4. add this class to title or any element where you dont want to hide form// sb-coming-soon-title// 5. add class for timting of add to cart hide// sb_hide_add_to_cart//6. add attribute to a tag for all collection issue//7. show form on detial page, do not hide cart form ( var dpnotHideCartForm = true;)//add this "var dpnotHideCartForm = true;" js variable to theme.liquid above csp liquid render file//8. if collection page not have img tag if not showing csp label on collection page//add this "sb-coming-soon-label" class in the html element where you want to show coming soon label//9. auto remove csp products from cart// var notPreorder = true;//10. for add to cart issue on timezone timing for cart (add in theme.liquid)// var wait_for_timezone = 2000;//11. for wait for csp execuion including timezone | csp app loads after 2 sec// var timeDelay = 2000;// }