'; $(".waio__nt-overlay").hide(); $(".waio__nt-overlay").after(success_popup); } else{ console.log("WAIO NET TERM: Error: ",result.message); alert("An error occured"); } }, error: function(err){ console.log("WAIO NET TERM: Error: ",err); alert("An error occured"); } }); }); $(".waio__nt-overlay").show(); }); }); $(document).on("click",".sclose", function(){ $.post('/cart/clear.js').always(function(){ window.location.href="/"; }); }); $(document).on('click','.waio__nt-close, #waio__nt--popupp',function(e) { console.log(e.target) if((!$(e.target).parents('.waio__nt-wrapper').length && !$(e.target).hasClass('waio__nt-wrapper')) || ( $(e.target).hasClass('waio__nt-close') )) $(".waio__nt-overlay").hide(); }); } WholesaleAllInOne.NetTerms = function(){ var nert_terms = WholesaleAIO.netTerms; console.log(nert_terms, 'nert_terms'); if(nert_terms.enabled){ var _payment_options = []; nert_terms.payment_options.split(',').forEach(function(d, i){_payment_options.push({value:d, text: d})}) if(nert_terms.customers_group == "tag_based" && is_loggedIn){ var cus_tags = customerTags.map(function (e) { return e.trim().toUpperCase() }); var tag_to_match = nert_terms.customers_tag; var isTagMatched = false; var tag_array = tag_to_match.split(','); tag_array.forEach(function(_tag, i){ if(cus_tags.indexOf(_tag.trim().toUpperCase()) > -1){ isTagMatched = true; return false; } }); console.log(isTagMatched, 'isTagMatched') if(isTagMatched){ WholesaleAllInOne.apply_net_terms({ onlyNetTerms: nert_terms.disable_checkout, // sirf net term ka button show hoga, checkout button will be hidden netTerm_Button_Text: nert_terms.checkout_btn_label, payment_options: _payment_options, show_payment_mode: nert_terms.show_payment_mode, show_delivery_date: nert_terms.show_delivery_date, cart_message: nert_terms.cart_message, messages: nert_terms.messages, default_payment_option: nert_terms.payment_options, }); } } else if(nert_terms.customers_group == "loggedin" && is_loggedIn){ WholesaleAllInOne.apply_net_terms({ onlyNetTerms: nert_terms.disable_checkout, // sirf net term ka button show hoga, checkout button will be hidden netTerm_Button_Text: nert_terms.checkout_btn_label, payment_options: _payment_options, show_payment_mode: nert_terms.show_payment_mode, show_delivery_date: nert_terms.show_delivery_date, cart_message: nert_terms.cart_message, messages: nert_terms.messages, default_payment_option: nert_terms.payment_options, }); } } } WholesaleAllInOne.NetTerms(); $(document).on("change",".slct_cntry select",function(){ var c_val = $(this).find(":selected").val(); $("#address_country option[value='"+c_val+"']").prop('selected', true).change(); }); $(document).on("change",".slct_state select",function(){ var s_val = $(this).find(":selected").val(); $("#address_province option[value='"+s_val+"']").prop('selected', true).change(); }); $(document).on("change",".zp_code input",function(){ var zip_val = $(this).val(); $("#address_zip").val(zip_val); }); $(document).on("click",".estimate_shipping",function(){ if($(".slct_cntry select").find(":selected").val() ==""){ var html = '