${{amount}}
`;
var cfp_custom_js_script = "";
cfp_custom_js_script = document.createElement("script");
cfp_custom_js_script.type = "text/javascript";
cfp_custom_js_script.text = cfp_custom_js;
if (typeof timeDelay == 'undefined') timeDelay = 0; //for settimeout method
if (typeof additional_hide_element == 'undefined') additional_hide_element = ""; //for hiding complex theme element
if (typeof hide_cfp_modal_sec == 'undefined') hide_cfp_modal_sec = 3000;
if (typeof cfp_additional_field == 'undefined') {
var cfp_additional_field = ``;
} else {
var cfp_additional_field = cfp_additional_field;
}
if(typeof(window.BOOMR) !== "undefined") {var originThemeName = window.BOOMR.themeName;}else{var originThemeName = Shopify.theme.name; }
if (typeof (cfp_configuration.phone_default_country_code) !== 'undefined') { var phone_default_country_code = '+' + cfp_configuration.phone_default_country_code; } else { var phone_default_country_code = ''; }
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;
}
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 (payment_status == 'active' || payment_status == 'trial' || payment_status == 'allow_store') {
is_payment_enable = '1';
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);
myAppJavaScript_cfp(jQuery191);
loadEventForm(jQuery191);
functionForFilter(jQuery191)
});
} else {
myAppJavaScript_cfp(jQuery);
loadEventForm(jQuery);
functionForFilter(jQuery)
}
}
function myAppJavaScript_cfp($) {
if (sb_cfp_enable == "1" && is_payment_enable == "1") {
$(".cfp-sb-old-wrapper").remove(); $(".cfp-sb-old-modal-wrapper").remove(); //old store fix issue
// alert("myAppJavaScript_cfp")
$('body').append(``);
// alert("hide prices");
setTimeout(function () {
$("body").append(cfp_custom_css_style); $("body").append(cfp_custom_js_script);
CFPcheckForProductPage(); CFPcheckForCollectionPage();
// // cfp buttob_customization
if ((cfp_btn_customize_for !== "") && (cfp_btn_customize_for !== "undefined")) {
$('body').append(``);
$("body").append("")
} else {
$("body").append("")
}
// loadEventForm(); // cfpForm();
// alert("showing");
setTimeout(function(){
$("body").append("");
}, 800)
}, timeDelay)
}
// CFP detailpage Form
function CFPcheckForCollectionPage() {
if ($(".cfp_custom_position").length > 0) {
$(".cfp_custom_position").each(function () {
if (!$(this).hasClass('cfp-checked')) {
var curr_this = $(this);
var product_handle = $(this).attr('product_handle');
var product_url = "/products/" + product_handle;
try {
fetch(product_url + ".json", {
credentials: "same-origin"
}).then(function (data) {
data.json().then(function (data) {
var get_product = data.product;
var cfp_product_on = false;
if (cfp_product_on != true) {
for (collection_ID of cfpcolIDSresults) {
if (collection_ID.replace(/ /g, '') == collection_id && collection_id !="" && collection_ID != "") {
cfp_product_on = true;
}
}
}
if (sb_cfp_is_all_products == "1" && cfp_product_on != true) { cfp_product_on = true; }
if (cfpprodAllresults.includes(get_product.id.toString()) || sb_cfp_colAllresults.includes(get_product.id.toString()) && cfp_product_on != true) {
cfp_product_on = true;
}
if (cfp_product_on != true) {
$.each(sb_cfp_ProIDsCollectionsTest, function (key, value) {
if (value.includes(get_product.id.toString())) {
var colid = key.split('_')[0]
cfp_product_on = true;
}
})
}
var collection_id_liquid = $(curr_this).attr('collection-id');
if (typeof collection_id_liquid != 'undefined') {
collection_id_liquid = filterConvertArray(collection_id_liquid)
if (cfp_product_on != true) {
for (collection_ID of cfpcolIDSresults) {
if ($.inArray(collection_ID.replace(/ /g, ''), collection_id_liquid) != -1 && collection_ID != "") {
cfp_product_on = true;
}
}
}
}
if (sb_cfp_enable == "1" && cfp_product_on) {
var current_object = '';
var isButtonPositionFound = true;
specificThemePriceClass()
current_object = appendCFPButtonCollection(curr_this);
if (form_button_display_option == 'show_cfp_button') {
var cfpButtonCollection =
'
';
} else {
var cfpButtonCollection =
'
';
}
if (current_object != '') {
if (!$(curr_this).hasClass(cfpCollectionLabelClass)) {
if ($('.cfp-prod-wrapper.' + get_product.handle).length > 0 || current_object.parent().parent().parent().find('.cfp-prod-wrapper-detail').length > 0) {
if ($('.cfp-prod-wrapper.' + get_product.handle).parent().parent().parent().find('.cfp-prod-wrapper.' + get_product.handle).length > 0 || current_object.parent().parent().parent().find('.cfp-prod-wrapper-detail').length > 0) {
$(".cfp_custom_position." + product_handle).html(cfpButtonCollection);
} else {
$(".cfp_custom_position." + product_handle).html(cfpButtonCollection);
}
} else {
$(".cfp_custom_position." + product_handle).html(cfpButtonCollection);
}
current_object.remove();
cfpHideAddToCartOnCollection($(curr_this));
$(curr_this).addClass(cfpCollectionLabelClass);
}
}
}
})
})
} catch (e) { }
}
})
} else {
$("a").each(function () {
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 (curr_href.indexOf("products/") >= 1 && $(this).parent().get(0).tagName != 'LI' && !$(this).hasClass('doNotAdd_cfp')) {
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 cfp_product_on = false;
//check for collection
if (cfp_product_on != true) {
for (collection_ID of cfpcolIDSresults) {
if (collection_ID.replace(/ /g, '') == collection_id && collection_id !="" && collection_ID != "") {
cfp_product_on = true;
}
}
}
//check all products
if (sb_cfp_is_all_products == "1" && cfp_product_on != true) { cfp_product_on = true; /*console.log('all pro match ', cfp_product_on); */ }
//check specific products
if (cfpprodAllresults.includes(get_product.id.toString()) || sb_cfp_colAllresults.includes(get_product.id.toString()) && cfp_product_on != true) {
cfp_product_on = true;
}
// check products in collections
if (cfp_product_on != true) {
$.each(sb_cfp_ProIDsCollectionsTest, function (key, value) {
if (value.includes(get_product.id.toString())) {
var colid = key.split('_')[0]
cfp_product_on = true;
}
})
}
//check for all collection with theme attr
var collection_id_liquid = $(curr_this).attr('collection-id');
if (typeof collection_id_liquid != 'undefined') {
collection_id_liquid = filterConvertArray(collection_id_liquid)
if (cfp_product_on != true) {
for (collection_ID of cfpcolIDSresults) {
if ($.inArray(collection_ID.replace(/ /g, ''), collection_id_liquid) != -1) {
cfp_product_on = true;
}
}
}
}
if (sb_cfp_enable == "1" && cfp_product_on) {
var current_object = '';
var cfpProductPrice = 'price';
var isButtonPositionFound = true;
specificThemePriceClass()
if ($(curr_this).find('img').first().length > 0) {
if (!$(curr_this).find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this);
$(curr_this).find('img').first().addClass(cfpCollectionLabelClass);
}
} else if ($(curr_this).closest('div').find('img').first().length > 0) {
if (!$(curr_this).closest('div').find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this);
$(curr_this).closest('div').find('img').first().addClass(cfpCollectionLabelClass);
}
} else if ($(curr_this).closest('div').parent().find('img').first().length > 0) {
if (!$(curr_this).closest('div').parent().find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this);
$(curr_this).closest('div').parent().find('img').first().addClass(cfpCollectionLabelClass);
}
}
else if ($(curr_this).closest('div').parent().parent().find('img').first().length > 0) {
if (!$(curr_this).closest('div').parent().parent().find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this)
$(curr_this).closest('div').parent().parent().find('img').first().addClass(cfpCollectionLabelClass);
}
} else if ($(curr_this).closest('div').parent().parent().parent().find('img').first().length > 0) {
if (!$(curr_this).closest('div').parent().parent().parent().find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this)
$(curr_this).closest('div').parent().parent().parent().find('img').first().addClass(cfpCollectionLabelClass);
}
} else if ($(curr_this).closest('div').parent().parent().parent().parent().find('img').first().length > 0) {
if (!$(curr_this).closest('div').parent().parent().parent().parent().find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this)
$(curr_this).closest('div').parent().parent().parent().parent().find('img').first().addClass(cfpCollectionLabelClass);
}
} else if ($(curr_this).closest('div').parent().parent().parent().parent().parent().find('img').first().length > 0) {
if (!$(curr_this).closest('div').parent().parent().parent().parent().parent().find('img').first().hasClass(cfpCollectionLabelClass)) {
current_object = appendCFPButtonCollection(curr_this)
$(curr_this).closest('div').parent().parent().parent().parent().parent().find('img').first().addClass(cfpCollectionLabelClass);
}
}
if (form_button_display_option == 'show_cfp_button') {
var cfpButtonCollection =
'
';
} else {
var cfpButtonCollection =
'
';
}
if (current_object != '') {
if (!$(curr_this).hasClass(cfpCollectionLabelClass)) {
$(curr_this).addClass(cfpCollectionLabelClass);
if ($('.cfp-prod-wrapper.' + get_product.handle).length > 0 || current_object.parent().parent().parent().find('.cfp-prod-wrapper-detail').length > 0) {
if ($('.cfp-prod-wrapper.' + get_product.handle).parent().parent().parent().find('.cfp-prod-wrapper.' + get_product.handle).length > 0 || current_object.parent().parent().parent().find('.cfp-prod-wrapper-detail').length > 0) {
} else {
current_object.after(cfpButtonCollection);
}
//$('.cfp-prod-wrapper.'+get_product.handle)[1].remove();
} else {
current_object.after(cfpButtonCollection);
}
current_object.remove();
cfpHideAddToCartOnCollection($(curr_this));
}
}
}
})
})
};
}
})
}
}
function appendCFPButtonCollection(curr_this) {
var cfpProductPrice = 'price';
var cfpProductMoney = 'money';
var current_object = '';
var isTitleFound = false;
if (typeof (doNotHidePrice) !== 'undefined') { isTitleFound = true; current_object = curr_this.find('test'); }
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').find('div,h3,h2,a,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').parent().find('div,h3,h2,a,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').parent().parent().find('div,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').parent().parent().find('a,h2,h3,h4,h1,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').parent().parent().parent().find('div,h2,h3,a,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').parent().parent().parent().parent().find('div,h2,h3,a,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
if (!isTitleFound) {
var divFind = $(curr_this).closest('div').parent().parent().parent().parent().parent().find('div,h2,h3,a,span,ul,dl');
current_object = searchCFPprice(divFind);
if (current_object != '') { isTitleFound = true; }
}
return current_object;
}
function searchCFPprice(divFind) {
var cfpProductPrice = 'price';
var cfpProductMoney = 'money';
var current_object = '';
$(divFind).each(function (i) {
var class_title = $(this).attr('class');
if (typeof (class_title) != 'undefined') {
if (class_title.includes(cfpProductPrice) || class_title.includes(cfpProductMoney)) {
current_object = $(this)
// $(this).hide(); // return current_object;
return false;
}
}
});
return current_object;
}
function CFPcheckForProductPage() {
if (window.location.pathname.indexOf('/products/') !== -1) {
var sb_cfp_current_collection_list_prodPage = filterConvertArray(cfp_current_collection_list_prodPage);
var cfp_total_collection_list_prodPage = cfpcolIDSresults;
var cfp_enabled = "no";
//check for collection ids
if (cfp_enabled != 'yes') {
for (collection_name of cfp_total_collection_list_prodPage) {
for (current_collection of sb_cfp_current_collection_list_prodPage) {
if (current_collection.length >= 2 && collection_name.length >= 2) {
if (current_collection.replace(/ /g, '') == collection_name.replace(/ /g, '')) {
cfp_enabled = "yes";
}
}
}
}
}
//check all products
if (sb_cfp_is_all_products == "1" && cfp_enabled != 'yes') { cfp_enabled = "yes"; }
//check specific products
if (cfpprodAllresults.includes(product_id_sb.toString()) && cfp_enabled != "yes") {
cfp_enabled = "yes";
}
if (cfp_enabled == "yes") {
//$('.csp-prod-wrapper.'+product_handle_sb).remove();
if (form_button_display_option == 'show_cfp_button') {
var addtocfpbutton =
'
';
} else {
var addtocfpbutton =
'
';
}
var current_object_detail = '';
$("form").each(function (index) {
var getForm = $(this).attr("action");
if (!(typeof (getForm) !== 'undefined') || $(this).hasClass("do_not_check")) {
var getForm = '';
}
if (getForm.includes("/cart/add") && $(".cfp-prod-wrapper-detail").length == 0 && $(".cfp-prod-wrapper-detail-call").length == 0) {
if($(".cfp-pdp-custom-position").length <= 0){$(this).after(addtocfpbutton);}
$(".cfp-prod-button").show();
specificThemePriceClass();
// CFPhidePriceOnAllPages($(this));
current_object_detail = appendCFPButtonCollection($(this));
if (current_object_detail == '') {
CFPhidePriceOnAllPages($(this));
}
CFPhidePriceOnAllPages($(this)); //hide the price added class //05-09
var cfpdetaiilInForm = $('form[action*="/cart/add"]').find('.sb-call-for-price-title,.product-meta__title,.product-meta,.product__title,.gt_heading,.product-title,.product-single__title,.product-single__vendor,.cfp-pdp-custom-position')
if (!(typeof (doNotHideaddtoCart) !== 'undefined')) {
if (cfpdetaiilInForm.length > 0) {
$('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
} else {
$(this).remove();//someone buys the product so remove the add to cart
$('form[action*="/cart/add"]').remove();
}
if($(".cfp-pdp-custom-position").length <= 0){}else{ $(".cfp-pdp-custom-position").append(addtocfpbutton);}
}
}
});
//remove price on detail page
if (current_object_detail != '') {
if (checkFreeTheme()) { //for free theme variant change price show issue
$("product-info .no-js-hidden").each(function () { if ($(this).find(".price").length > 0) { $(this).remove(); } })
}
// if (!current_object_detail.parent().hasClass('cfp-detail-checked')) {
// current_object_detail.parent().addClass('cfp-detail-checked');
current_object_detail.remove();
// }
}
}
else {
$('form[action="/cart/add"]').show();
}
}
}
function specificThemePriceClass(){
if(originThemeName == 'Warehouse'){
hidePriceList_cfp += ',.price-list,.product-form__price-info';
}
if(originThemeName == 'Influence'){
$("product-price").addClass('price');
hidePriceList_cfp += ',.payment-buttons';
}
if(originThemeName == 'Kalles'){
$(".t4s-sticky-atc__btns").remove();
}
if(originThemeName == 'Wokiee'){
$(".tt-fixed-product-wrapper").remove();
}
if(originThemeName == 'Avone'){
$(".stickyCart").remove();
hidePriceList_cfp += ',.psinglePriceWr';
}
if(originThemeName == 'Prestige'){
$(".product-sticky-bar").remove();
}
if(originThemeName == 'Leo ftshop 3'){
$(".ap-productstickyform").remove();
}
}
function CFPhidePriceOnAllPages(curr_this) {
//if (typeof (doNotHidePrice) !== 'undefined') {return;}
if ($(curr_this).find(hidePriceList_cfp).length > 0) {
$(curr_this).find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').parent().find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').parent().find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').parent().parent().find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').parent().parent().find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').parent().parent().parent().find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').parent().parent().parent().find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').parent().parent().parent().find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').parent().parent().parent().find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').parent().parent().parent().parent().find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').parent().parent().parent().parent().find(hidePriceList_cfp).remove();
} else if ($(curr_this).closest('div').parent().parent().parent().parent().parent().find(hidePriceList_cfp).length > 0) {
$(curr_this).closest('div').parent().parent().parent().parent().parent().find(hidePriceList_cfp).remove();
}
}
function cfpHideAddToCartOnCollection(curr_this) {
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,.quick-product__btn,.product-item__quick-form';
if ((typeof (doNotHideaddtoCart) !== 'undefined')) { var hideCartBuuton = 'NOT-HIDE'; }
if ((typeof (doHideaddtoCartOnCollection) !== 'undefined')) { var hideCartBuuton = doHideaddtoCartOnCollection; }
// var priceClass = '.price,.money';
var priceClass = '.product-name,.title,.product-title,.sb-call-for-price-title,.product-single__title';
if ($(curr_this).find(hideCartBuuton).length > 0) {
if ($(curr_this).children().find(hideCartBuuton).find(priceClass).length <= 0) {
$(curr_this).find(hideCartBuuton).remove();
}
} 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).remove();
}
} 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).remove();
}
} 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).remove();
}
} 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).remove();
}
} 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).remove();
}
} 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).remove();
}
} 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).remove();
}
}
}
setTimeout(function () { hideSearchPrice($) }, 1000);
}
function loadEventForm($) {
$(document).on('keyup','.form-group input[type="text"],.form-group input[type="number"]',function(){
$(this).parent().find('.text-danger').remove();
$(this).removeClass('invalid-cfp-field');
});
$(document).on('keyup','#cfpemail',function(){
$(this).parent().find('.text-danger').remove();
$(this).removeClass('invalid-cfp-field');
var email = $('#cfpemail').val();
var email_regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (email.length == 0) {
$('#cfpemail').after(`
${email_blank_vald} `);
$('#cfpemail').addClass('invalid-cfp-field');
count_name = false;
}else if (!email_regex.test(email)) {
$('#cfpemail').after(`
${email_invalid_vald} `);
$('#cfpemail').addClass('invalid-cfp-field');
count_name = false;
}
});
$(document).on('keyup','#cfpphone',function(){
$(this).parent().parent().find('.text-danger').remove();
$("#cfpphone").removeClass('invalid-cfp-field');
var phone = $('#cfpphone').val();
var countrycode_val = phone.match(/\d{9,15}$/);
if (required_form_fields.includes("phone") && phone.length <= 9) {
if (phone.length <= 9) {
$('.phone-code-wrap').after(`
${phone_blank_vald} `);
$('#cfpphone').addClass('invalid-cfp-field');
}
}
});
$(document).on('keyup','#cfpcountrycode',function(){
$(this).parent().parent().find('.text-danger').remove();
$("#cfpcountrycode").removeClass('invalid-cfp-field');
if ($("#cfpcountrycode").length) {
var cfpcountrycode = $("#cfpcountrycode").val();
var countrycode_val = cfpcountrycode.match(/^\+\d{1,3}/);
if (!countrycode_val && phone_countrycode_required != "0") {
var country_code_vald_hide_shops = ["mirage-sari-center.myshopify.com", "prim-and-pro-commercial-cleaning.myshopify.com", "rp-imaging.myshopify.com", "flooring-for-less-online.myshopify.com", "pessoa-joias.myshopify.com", "jessica-flinn-designs.myshopify.com", "no-42-interiors.myshopify.com", "high-tech-delivery.myshopify.com", "i-dance-contemporary.myshopify.com", "bohl-companies.myshopify.com", "spread-event-co.myshopify.com", "joombo-co.myshopify.com", "portabo.myshopify.com", "production-case.myshopify.com", "w-rltd.myshopify.com", "robs-furniture-mattresses.myshopify.com", "myartph.myshopify.com"];
if ($.inArray(shop, country_code_vald_hide_shops) == -1) // if shop is not present in array only then validate for mobile field
{
$('.phone-code-wrap').after(`
${phone_cc_vald} `);
$('#cfpcountrycode').addClass('invalid-cfp-field');
}
}
}
});
$(document).on('change',"select.form-control",function(){
$(this).addClass("color-black-cfp-select");
});
// code for theme-2 form************************
var Theme2_data = (productdata) => {
var images = productdata.product.images;
var productImgDivMain = `
`;
if (form_template == '1') {
var finalImageFomrm = productImgDivMain;
$('.slider-image-theme2').html(finalImageFomrm);
}
}
var Create_form_fields = (productdata) => {
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=`cfp_sel_${varianName}`;
select_id = varianName;
select_id = select_id.replace("(", "");
select_id = select_id.replace(")", "");
// select_id=select_id.replaceAll(" ","_");
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 = `