Product Tag :
0 :
255
1 :
255); color: rgb(51
2 :
3140CW
3 :
3150CDN
4 :
3170CDW
5 :
3180CDW
6 :
51
7 :
51);">DCP-9020CDN
8 :
9020CDN
9 :
9130CW
10 :
9330CDW
11 :
9340CDW
12 :
sb_countries[x].code === user_country_code);
user_country_name = sb_countries[dataset].country;
dataset = Object.keys(sb_countries).find(x => sb_countries[x].code === store_country_code);
store_country_name = sb_countries[dataset].country;
edd_data =[{store_id : sb_edd_options.store_id,
plan : sb_edd_plan_info.plan,
store_country_name : store_country_name,
store_country_code : store_country_code,
user_country_name : user_country_name,
user_country_code : user_country_code,
allowed_store : sb_edd_options.allow_store,
trial_store : '0',
plan_active : '1' ,
is_install : '1'
}];
//console.log(' store_country_name '+store_country_name +' store_country_code '+store_country_code)
//console.log(' user_country_name '+user_country_name +' user_country_code '+user_country_code)
setEDDCookie("edd_data", JSON.stringify(edd_data));
var check_edd_data = getEDDCookie("edd_data");
check_edd_data = JSON.parse(check_edd_data);
if(typeof check_edd_data[0] != 'undefined'){
check_edd_data = check_edd_data[0]
}
setEDDCountryData(check_edd_data);
}
function setEDDCountryData(check_edd_data){
edd_store_country_name = check_edd_data.store_country_name;
edd_store_country_code = check_edd_data.store_country_code;
edd_user_country_name = check_edd_data.user_country_name;
edd_user_country_code = check_edd_data.user_country_code;
edd_app_plan = sb_edd_plan_info.plan;
edd_store_id = sb_edd_options.store_id;
edd_trial_store = sb_edd_options.trial_store;
edd_allowed_store = sb_edd_options.allow_store;
if(edd_store_id > 2614 || edd_shop == 'purrfetto.myshopify.com' || edd_shop == 'estimated-delivery-date-time.myshopify.com'){
//console.log('Qty => based on product qty');
if(edd_sb_product_qty > 0){sb_product_have_qty = 1;}
}else{
// console.log('Qty => based on product avaiable');
if(sb_product_avaiable == 'true'){sb_product_have_qty = 1;}
}
//console.log(' sb_product_have_qty '+sb_product_have_qty)
var is_vaction_msg_on = 'false';
if(typeof sb_edd_options.is_vaction_msg_on != 'undefined'){
is_vaction_msg_on = sb_edd_options.is_vaction_msg_on;
}
if(is_vaction_msg_on == 'true' && typeof sb_edd_options.vacation_message != 'undefined' && typeof sb_edd_options.schedule_date != 'undefined' && typeof sb_edd_options.schedule_end_date != 'undefined'){
vacation_message = sb_edd_options.vacation_message;
schedule_date = sb_edd_options.schedule_date;
schedule_end_date = sb_edd_options.schedule_end_date;
if((new Date() > new Date(schedule_date)) && (new Date() < new Date(schedule_end_date)) ){
//console.log('=> set vacation_message')
sb_set_vaction_msg = '1';
sb_is_rule_set_for_location = '0';
sb_edd_preview_design = {"animation_class":"no_effect","preview_design":"set","highlight_color":"not_set","color":"#000","border":"transparent","font_size":"16","text_align":"unset","text_transform":"unset","font_weight":"unset","font_style":"unset","background_option":"color","background":"transparent","margin":"0px 0px 0px 0px ","padding":"10px 10px 10px 10px ","border_radius":"0px "};
}
}
// console.log('sb_set_vaction_msg = '+sb_set_vaction_msg )
if(sb_is_rule_set_for_location == '0'){
//console.log('=> location wise edd message not set')
//findSpecificEDDMsg();
if(sb_set_vaction_msg == '1'){
if(typeof edd_exclude_product != 'undefined' && edd_exclude_product != 'not_set' && edd_exclude_product.filter(e => e.check_rule_for == edd_sb_product_id).length > 0){
sb_is_exclude_product = '1';
//console.log('=> exclude product');
}else{
sb_edd_message = sb_edd_options.vacation_message;
sb_set_specific_msg = 1;
}
}else{
findSpecificEDDMsg();
}
}else{
// console.log('=> location wise edd message set')
checkLocationResponse = setInterval(function(){
// console.log('get_location_response '+get_location_response)
if(get_location_response == '1'){
clearInterval(checkLocationResponse)
findSpecificEDDMsg();
}
},500)
}
if(sb_set_specific_msg == 1){
edd_country_name = edd_user_country_name;
edd_country_code = edd_user_country_code;
}else{
edd_country_name = edd_store_country_name;
edd_country_code = edd_store_country_code;
}
}
/* changelog */
/*16-02-24 */
function checkUserCountry($){
}
function findUserCountry($){
$.ajax({
url: "//estimated-delivery-days.setubridgeapps.com/estimated-delivery-days/app/src/public/checkEDDPaymentFromAppExtension",
data : {shop:edd_shop},
type:"POST",
success: function(response){
edd_data = response;
check_edd_data = JSON.parse(edd_data);
setEDDCountryData(check_edd_data);
checkEddDataInterval = setInterval(function(){
var check_edd_data = getEDDCookie("edd_data");
if (check_edd_data == ""){
setEDDCookie("edd_data", edd_data);
clearInterval(checkEddDataInterval);
}
},700);
}
})
}
/* changelog */
var loadScriptInLiquidData = 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);
};
/* check Jquery loaded in theme or not */
if((typeof jQuery === 'undefined') || (parseFloat(jQuery.fn.jquery) < 1.7)){
loadScriptInLiquidData('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function () {
var jQuery191 = jQuery.noConflict(true);
if(jQuery191(".sb_info").length){
jQuery191('.sb_info').remove();
}
check_sb_edd_coockie(jQuery191);
if(location.href.includes("/products/")){
getLocation(jQuery191);
}else{
get_location_response = '1';
}
});
}else{
if(jQuery(".sb_info").length){
jQuery('.sb_info').remove();
}
check_sb_edd_coockie(jQuery);
if(location.href.includes("/products/")){
getLocation(jQuery);
}else{
get_location_response = '1';
}
}
function getLocation($){
//console.log('call location sb_is_rule_set_for_location '+sb_is_rule_set_for_location);
/* location wise edd */
if(typeof sb_is_rule_set_for_location != 'undefined'){
if(sb_is_rule_set_for_location == '1'){
location_ids = sb_edd_options.sb_location;
location_ids = location_ids.toString();
$.ajax({
url: "//estimated-delivery-days.setubridgeapps.com/estimated-delivery-days/app/src/public/getProductLocation",
data : {shop:edd_shop,product_id:edd_sb_product_id,location_ids:location_ids},
type:"GET",
success: function(response){
get_location_response = '1';
sb_locationId_having_max_qty = response.locationId_having_max_qty;
sb_product_locations = response.location_id;
}
})
}
}
/* location wise edd */
}
function findSpecificEDDMsg(){
//console.log('call function findSpecificEDDMsg')
if(typeof edd_exclude_product != 'undefined' && edd_exclude_product != 'not_set' && edd_exclude_product.filter(e => e.check_rule_for == edd_sb_product_id).length > 0){
sb_is_exclude_product = '1';
//console.log('=> exclude product');
}
else {
if(typeof sb_edd_specific_product_msg != 'undefined' && sb_edd_specific_product_msg != 'not_set' && sb_edd_specific_product_msg.filter(e => e.check_rule_for == edd_sb_product_id).length > 0){
//console.log('Specific Mesage type => Product ');
setEddMessageFromExtension(sb_edd_specific_product_msg,edd_sb_product_id,'product');
}
if(sb_set_specific_msg == 0 && typeof sb_edd_collection_msg != 'undefined' && sb_edd_collection_msg != 'not_set' ){
//console.log('Specific Mesage type => Collection ');
for(var c=0; c e.check_rule_for.toLocaleLowerCase() == edd_sb_product_vendor.toLocaleLowerCase()).length > 0){
//console.log('Specific Mesage type => Product Vendor');
setEddMessageFromExtension(sb_edd_product_vendor_msg,edd_sb_product_vendor,'vendor');
}
if(sb_set_specific_msg == 0 && typeof sb_edd_product_tag_msg != 'undefined' && sb_edd_product_tag_msg != 'not_set'){
//console.log('Specific Mesage type => Product Tag');
for(var t=0; t e.check_rule_for == 'all_product').length > 0){
//console.log('Specific Mesage type => All Product');
setEddMessageFromExtension(sb_edd_all_product_msg,'all_product','all_product');
}
}
}
function checkLocationWiseEddMessage(edd_msg_list,check_with,edd_rule_type,check_with_location_id){
//console.log(edd_msg_list)
pass_edd__in_out_stock_spe_c = edd_msg_list.filter(e => e.location_id == check_with_location_id && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == sb_product_have_qty && e.country_code == edd_user_country_code && e.is_enable == '1') ;
pass_edd_both_edd_spe_c = edd_msg_list.filter(e => e.location_id == check_with_location_id && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == 2 && e.country_code == edd_user_country_code && e.is_enable == '1') ;
pass_edd__in_out_stock_all_c = edd_msg_list.filter(e =>e.location_id == check_with_location_id && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == sb_product_have_qty && e.country_code == 'all_country' && e.is_enable == '1') ;
pass_edd_both_edd_all_c = edd_msg_list.filter(e => e.location_id == check_with_location_id && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == 2 && e.country_code == 'all_country' && e.is_enable == '1') ;
return {'check_edd__in_out_stock_spe_c':pass_edd__in_out_stock_spe_c,
'check_edd_both_edd_spe_c':pass_edd_both_edd_spe_c,
'check_edd__in_out_stock_all_c':pass_edd__in_out_stock_all_c,
'check_edd_both_edd_all_c':pass_edd_both_edd_all_c}
}
function checkZipcodeWiseEddMessage(check_edd_msg){
get_edd_msg_arr = check_edd_msg[0];
for(i=0;i 0 && set_edd_in_out_spe_c == 0 ){
set_edd_in_out_spe_c = 1;
check_edd__in_out_stock_spe_c = checkLocationData.check_edd__in_out_stock_spe_c;
}
if(checkLocationData.check_edd_both_edd_spe_c.length > 0 && set_edd_both_spe_c == 0){
set_edd_both_spe_c = 1;
check_edd_both_edd_spe_c = checkLocationData.check_edd_both_edd_spe_c;
}
if(checkLocationData.check_edd__in_out_stock_all_c.length > 0 && set_edd_in_out_all == 0){
set_edd_in_out_all = 1;
check_edd__in_out_stock_all_c = checkLocationData.check_edd__in_out_stock_all_c;
}
if(checkLocationData.check_edd_both_edd_all_c.length > 0 && set_edd_both_all == 0){
set_edd_both_all = 1;
check_edd_both_edd_all_c = checkLocationData.check_edd_both_edd_all_c;
}
/* check with location all location if location having a max qty => message is not set */
for(i=0;i 0 && set_edd_in_out_spe_c == 0 ){
set_edd_in_out_spe_c = 1;
check_edd__in_out_stock_spe_c = checkLocationData.check_edd__in_out_stock_spe_c;
}
if(checkLocationData.check_edd_both_edd_spe_c.length > 0 && set_edd_both_spe_c == 0){
set_edd_both_spe_c = 1;
check_edd_both_edd_spe_c = checkLocationData.check_edd_both_edd_spe_c;
}
if(checkLocationData.check_edd__in_out_stock_all_c.length > 0 && set_edd_in_out_all == 0){
set_edd_in_out_all = 1;
check_edd__in_out_stock_all_c = checkLocationData.check_edd__in_out_stock_all_c;
}
if(checkLocationData.check_edd_both_edd_all_c.length > 0 && set_edd_both_all == 0){
//console.log('set edd msg')
set_edd_both_all = 1;
check_edd_both_edd_all_c = checkLocationData.check_edd_both_edd_all_c;
// console.log(check_edd_both_edd_all_c)
}
// console.log('set_edd_both_all '+set_edd_both_all +' length '+checkLocationData.check_edd_both_edd_all_c.length)
//}
//console.log(check_edd_both_edd_all_c)
}
}
// console.log('***********')
//console.log(check_edd_both_edd_all_c)
/* check location wise message */
if(check_edd__in_out_stock_spe_c.length == 0){
// console.log('witout location 1')
check_edd__in_out_stock_spe_c = edd_msg_list.filter(e => e.location_enable == '0' && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == sb_product_have_qty && e.country_code == edd_user_country_code && e.is_enable == '1') ;
}
if(check_edd_both_edd_spe_c.length == 0){
// console.log('witout location 2')
check_edd_both_edd_spe_c = edd_msg_list.filter(e => e.location_enable == '0' && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == 2 && e.country_code == edd_user_country_code && e.is_enable == '1') ;
}
if(check_edd__in_out_stock_all_c.length == 0){
//console.log('witout location 3')
check_edd__in_out_stock_all_c = edd_msg_list.filter(e => e.location_enable == '0' && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == sb_product_have_qty && e.country_code == 'all_country' && e.is_enable == '1') ;
}
if(check_edd_both_edd_all_c.length == 0){
// console.log('witout location 4')
check_edd_both_edd_all_c = edd_msg_list.filter(e => e.location_enable == '0' && e.check_rule_for.toLocaleLowerCase() == check_with.toLocaleLowerCase() && e.is_instock == 2 && e.country_code == 'all_country' && e.is_enable == '1') ;
}
//console.log('check zipcode');
//console.log(check_edd__in_out_stock_all_c)
// console.log(typeof check_edd__in_out_stock_all_c[0].zipcode_enable);
// console.log(check_edd__in_out_stock_all_c[0].zipcode_enable);
// console.log(check_edd__in_out_stock_all_c[0].zipcode_list)
if(check_edd__in_out_stock_spe_c.length > 0){
// console.log('instock specific country')
check_edd_msg = checkZipcodeWiseEddMessage(check_edd__in_out_stock_spe_c);
// console.log('instock all country '+check_edd_msg.length)
sb_edd_zipcode_enable = check_edd_msg.zipcode_enable;
sb_edd_zipcode_list = check_edd_msg.zipcode_list;
sb_edd_preview_design = check_edd_msg.preview_design;
sb_edd_message = check_edd_msg.message;
sb_edd_message = getLanguageWiseMsg(check_edd_msg,sb_edd_message);
sb_set_specific_msg = 1;
checkSpecificMsgForSB(edd_rule_type);
sb_edd_rule_list = check_edd__in_out_stock_spe_c;
}
else if(check_edd_both_edd_spe_c.length > 0){
//console.log('both specific country')
check_edd_msg = checkZipcodeWiseEddMessage(check_edd_both_edd_spe_c);
//console.log('instock all country '+check_edd_msg.length)
sb_edd_zipcode_enable = check_edd_msg.zipcode_enable;
sb_edd_zipcode_list = check_edd_msg.zipcode_list;
sb_edd_preview_design = check_edd_msg.preview_design;
sb_edd_message = check_edd_msg.message;
sb_edd_message = getLanguageWiseMsg(check_edd_msg,sb_edd_message);
sb_set_specific_msg = 1;
checkSpecificMsgForSB(edd_rule_type);
sb_edd_rule_list = check_edd_both_edd_spe_c;
}
else if(check_edd__in_out_stock_all_c.length > 0){
// console.log('instock all country '+check_edd__in_out_stock_all_c.length)
check_edd_msg = checkZipcodeWiseEddMessage(check_edd__in_out_stock_all_c);
//console.log(check_edd_msg)
sb_edd_zipcode_enable = check_edd_msg.zipcode_enable;
sb_edd_zipcode_list = check_edd_msg.zipcode_list;
sb_edd_preview_design = check_edd_msg.preview_design;
sb_edd_message = check_edd_msg.message;
sb_edd_message = getLanguageWiseMsg(check_edd_msg,sb_edd_message);
sb_set_specific_msg = 1;
checkSpecificMsgForSB(edd_rule_type);
sb_edd_rule_list = check_edd__in_out_stock_all_c;
}
else if(check_edd_both_edd_all_c.length > 0){
//console.log('both all country')
//console.log(check_edd_both_edd_all_c)
check_edd_msg = checkZipcodeWiseEddMessage(check_edd_both_edd_all_c);
//console.log('instock all country '+check_edd_msg.length)
sb_edd_zipcode_enable = check_edd_msg.zipcode_enable;
sb_edd_zipcode_list = check_edd_msg.zipcode_list;
sb_edd_preview_design = check_edd_msg.preview_design;
sb_edd_message = check_edd_msg.message;
sb_edd_message = getLanguageWiseMsg(check_edd_msg,sb_edd_message);
sb_set_specific_msg = 1;
checkSpecificMsgForSB(edd_rule_type);
sb_edd_rule_list = check_edd_both_edd_all_c;
}
// console.log('******************* display edd messsge *****************')
// console.log(sb_edd_message)
}
function getLanguageWiseMsg(check_edd_msg,message){
store_language = Shopify.locale;
if(typeof sb_edd_options.store_language != 'undefined'){
sb_store_languages = sb_edd_options.store_language;
sb_store_languages = sb_store_languages.split(',')
//console.log(sb_store_languages)
if(typeof check_edd_msg.language_grp_msgs != 'undefined'){
language_grp_msgs = check_edd_msg.language_grp_msgs;
var get_lang_wise_msg = '0';
//console.log('language_grp_msgs')
//console.log(language_grp_msgs)
if(language_grp_msgs != 'not_set'){
// console.log('set lanaguage grp')
for(l=0;l