var cfp_product_collection_Data ={
"products": ['8133465407776'],
"collections": [
"157209067578"
]
};
var cfp_sb_variable = '1';
var ProIDsCollections='';
var cfp_configuration = {
"is_enabled": "1",
"is_all_products": "1",
"callforprice_label": "Call for Price",
"email": "example@gmail.com",
"title": "Call for Price",
"submit": "Submit",
"hidePrice": "#shopify-section-collection-template .price",
"is_redirect": "1",
"redirect_url": "",
"recaptcha_enable": "0",
"form_theme": "1",
"country_enable": "0",
"shw_in_listing": "0",
"mail_chimp_enable": "undefined",
"pay_status": "active",
"plan_name": "cfp plan premium",
"save_customer": "0",
"gdpr_msg": "I agree to my email being stored and used to receive the newsletter.",
"variants_enable": "1",
"name_form_field": "Enter name",
"email_form_field": "Enter E-mail",
"phone_form_field": "Your Phone Number EX : +919999999999",
"country_form_field": "Select Country",
"message_form_field": "Enter Your Message",
"message_form_field_switch": "1",
"country_form_field_switch": "0",
"phone_form_field_switch": "1",
"phone_form_field_switch_required": "1",
"message_form_field_switch_required": "1",
"country_form_field_switch_required": "0",
"no_of_servings_form_field": "Enter No Of Servings",
"date_form_field": "Event Date",
"no_of_servings_form_field_switch": "undefined",
"no_of_servings_form_field_switch_required": "undefined",
"date_form_field_switch": "undefined",
"date_form_field_switch_required": "undefined",
"form_button_display_option": "show_cfp_form",
"callforpriceWhatsapp_label": "Call For Price",
"phone_form_field_whatsapp": " 919999999999",
"cfp_btn_customize_for": "",
"cfp_bg_colorValue": "#000000",
"cfp_text_colorValue": "#ffffff",
"quantity_form_field": "Enter Quantity",
"quantity_form_field_switch_required": "0",
"quantity_form_field_switch": "0",
"translate_fields": {
"placeholder_name": "Enter name",
"placeholder_email": "Enter E-mail",
"placeholder_your_msg": "Enter Your Message",
"placeholder_phone": "Your Phone Number EX : +919999999999",
"select_country": "Select Country",
"hidden_label": "Enter name",
"name_vald": "Please Enter a Name",
"email_blank_vald": "Please Enter An E-mail",
"email_invalid_vald": "Please Enter A Valid E-mail",
"country_vald": "Please Enter A Country",
"phone_blank_vald": "Please Enter Phone",
"phone_cc_vald": "Please Enter Country Code EX : +919999999999",
"no_of_servings_form_field_msg_vald": "Please Enter Only No",
"date_form_field_msg_vald": "only enter date",
"quantity_form_field_msg": "Enter Quantity",
"message_vald": "Please Enter A Message",
"success_message": "Form Submitted Successfully!",
"select_variants": "",
"placeholder_image": "",
"no_of_servings_form_field_msg": "Enter No Of Servings",
"date_form_field_msg": "Event Date",
"placeholder_phone_countrycode": "Country Code"
},
"store_settings_id": "27872469516483",
"productPage_Price": "",
"collectionPage_Price": "",
"searchPage_Price": "",
"homePage_Price": "",
"full_number": "",
"phone_form_field_call": " 919999999999",
"callforprice_label_call_button": "Call for Price",
"form_template": "0",
"phone_default_country_code": "1",
"phone_countrycode_form_field": "Country Code",
"button_form_field": "Submit",
"form_success_message": "Form Submitted Successfully!",
"recaptchasite_key": "",
"recaptchasecret_key": "",
"klaviyo_API": "",
"sendinblue_API": "",
"omnisend_API": "",
"mailchimp_API": "",
"email_service_name": "default",
"sendgrid_api": "",
"sendgrid_sender_email": "example@gmail.com",
"default_sender_name": "novedge.myshopify.com",
"variants_form_field_switch": "1",
"variants_form_field_switch_required": "0",
"image_form_field_switch": "0",
"image_form_field_switch_required": "0",
"customer_auto_email": "0",
"phone_countrycode_form_field_switch": "1",
"phone_countrycode_form_field_switch_required": "1",
"cfp_bg_hvr_colorValue": "#ffffff",
"cfp_text_hvr_colorValue": "#000000",
"hidePriceList": "#shopify-section-collection-template .price",
"products": "",
"show_form_fields": "phone,Countrycode,message,variants",
"required_form_fields": "phone,Countrycode,message"
}
console.log("Call-For-Price SB"); // 07-12-2023 - image height width
if (typeof cfp_sb_variable !== 'undefined') {
if (cfp_sb_variable == '1') {
var curr_hundle_pid = `8133465407776`;
var payment_status = `active`;
var is_payment_enable = '0';
// global variable
var phone_form_field_call = cfp_configuration.phone_form_field_call;
var callforprice_label_call_button = cfp_configuration.callforprice_label_call_button;
var product_handle_sb = `fine-art-print-100`;
var curr_title_detailpge = ``;
var product_url = `fine-art-print-100`;
var collection_handle_sb = "";
var collection_id = ``;
var curr_hundle_pid = `8133465407776`;
var form_button_display_option = cfp_configuration.form_button_display_option; //show_cfp_button
var btn_name = cfp_configuration.callforprice_label;
var btn_whatsapp = cfp_configuration.callforpriceWhatsapp_label;
var whatsappNumber = cfp_configuration.phone_form_field_whatsapp;
var request_type = 'E-mail';
var cfpwhatsapp = '';
if (form_button_display_option == 'show_cfp_whatsapp') {
btn_name = `
` + btn_whatsapp;
request_type = 'WhatsApp'; cfpwhatsapp = 'cfp-whatsapp';
} else {
btn_name = `
` + btn_name;
}
var hidePriceList_cfp = cfp_configuration.hidePriceList;
var collection_name = ``;
translate_fields = cfp_configuration.translate_fields;
var name_vald = translate_fields.name_vald
var email_blank_vald = translate_fields.email_blank_vald
var email_invalid_vald = translate_fields.email_invalid_vald
var message_vald = translate_fields.message_vald
var quantity_vald = translate_fields.quantity_form_field_msg;
if (typeof quantity_vald == "undefined") { quantity_vald = "Please Enter Quantity"; }
var phone_blank_vald = translate_fields.phone_blank_vald
var servings_vald = ``; var date_vald = ``;
var phone_cc_vald = translate_fields.phone_cc_vald
var country_vald = translate_fields.country_vald
var success_message = cfp_configuration.form_success_message
var variant_blank_vald = translate_fields.variant_form_field_msg
var image_vald = translate_fields.image_vald
var variants_enable = cfp_configuration.variants_enable;
var country_enable = cfp_configuration.country_enable;
var is_redirect = cfp_configuration.is_redirect;
var redirect_page = cfp_configuration.redirect_url;
var required_form_fields = cfp_configuration.required_form_fields;
var phone_countrycode_required = cfp_configuration.phone_countrycode_form_field_switch_required;
var phone_countrycode_show = cfp_configuration.phone_countrycode_form_field_switch;
// quantity fields
var quantity_form_field = cfp_configuration.quantity_form_field;
var quantity_form_field_switch = cfp_configuration.quantity_form_field_switch;
var quantity_form_field_switch_required = cfp_configuration.quantity_form_field_switch_required;
var form_title = cfp_configuration.title;
var submit_btn_name = cfp_configuration.submit;
var form_theme = cfp_configuration.form_theme;
var form_template = cfp_configuration.form_template;
var gdpr_msg = cfp_configuration.gdpr_msg;
var save_customer = cfp_configuration.save_customer;
var form_fields = cfp_configuration.show_form_fields;
var email = cfp_configuration.email;
var pay_status = cfp_configuration.pay_status
var plan_name = cfp_configuration.plan_name
var mail_chimp_enable = cfp_configuration.mail_chimp_enable
var shop = Shopify.shop;
var is_all_products = cfp_configuration.is_all_products;
if (is_all_products == '') { is_all_products = 0; }
var hidePriceList = cfp_configuration.hidePriceList
var enable = cfp_configuration.is_enabled;
var sender_email = cfp_configuration.email;
var cfp_btn_customize_for = cfp_configuration.cfp_btn_customize_for;
var cfp_text_colorValue = cfp_configuration.cfp_text_colorValue;
var cfp_bg_colorValue = cfp_configuration.cfp_bg_colorValue;
var cfp_text_hvr_colorValue = cfp_configuration.cfp_text_hvr_colorValue;
var cfp_bg_hvr_colorValue = cfp_configuration.cfp_bg_hvr_colorValue;
var cfp_custom_css = cfp_configuration.cfp_custom_css;
var cfp_custom_js = cfp_configuration.cfp_custom_js;
var prod_ID_arr, prod_array, col_ID_arr, col_array, prod_array_url = [];
var cfp_current_collection_list_prodPage = `temp`;
var collectionLabelClass = 'cfp-checked';
var product_id_sb = curr_hundle_pid;
var colAllresults = filterConvertArray(ProIDsCollections);
var colIDSresults = cfp_product_collection_Data['collections']
var prodAllresults = cfp_product_collection_Data['products']
var cfp_custom_css_style = ``;
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 (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 (enable == "1" && is_payment_enable == "1") {
// 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 (window.location.pathname.indexOf('/products/') == -1) {
if (cfp_product_on != true) {
for (collection_ID of colIDSresults) {
if (collection_ID.replace(/ /g, '') == collection_id) {
cfp_product_on = true;
}
}
}
}
if (is_all_products == "1" && cfp_product_on != true