$64.95 $38.97 Sale
You Save: $25.98 (40.00%)
Currency Converter
×
Notify Me When Back In Stock
'; if (!$("#iz-notifymodal").length) { $("body").append(ntfForm); } if (!$("#js-notify-button-now").length) { $(".btn-buy-now").after(ntfBtn); } else { $("#js-notify-button-now").prop("disabled", false); } if (remove) { $("#js-notify-button-now, #iz-notifymodal").remove(); } }, validateForm: function () { setTimeout(() => { $("#js-notifyfrm .form_row").each(function (i, p) { if ($(this).hasClass("required")) { if ($(this).find("input").val().length > 0) { $(this).removeClass("invalid-field"); } else { $(this).addClass("invalid-field"); } } if ($("#js-notifyfrm .form_row").length == i + 1) { if ($("#js-notifyfrm .invalid-field").length == 0) { $("#js-notifyfrm button").prop("disabled", false); } else { $("#js-notifyfrm button").prop("disabled", true); } } }); }, 1e2); }, getPartId: function (_this) { var attr = $(_this).attr("data-value"), prodID = $("input[name=id_product]").val(), token = $("input[name=token]").val(); if ($("#js-notifyfrm .ntf-sizes").length > 1) { if ($("#js-notifyfrm select.ntf-sizes option:selected").data("value")) { attr = $("#js-notifyfrm select.ntf-sizes option:selected").data("value") + ","; } if ($("#js-notifyfrm .ntf-sizes .active").data("size-attr")) { attr += $("#js-notifyfrm .ntf-sizes .active").data("size-attr") + ","; } attr = attr.replace(",,", ","); } $.ajax({ url: "/modules/vc_notify/getPartId.php", data: "id_product=" + prodID + "&attr=" + attr + ",&token=" + token, success: function (data) { $("input[name=ntf_id]").val(data?.product[0]?.id_part); if ($("#js-notifyfrm .ntf-sizes").length > 1 && data?.product.length > 1) { $("#js-notifyfrm .ntf-sizes span").hide(); $.each(data.product, function (index, point) { if (!+point.quantity) { $("#js-notifyfrm .ntf-sizes span[data-size-attr=" + point.id_attribute + "]").show(); } notifyMe.validateForm(); }); } notifyMe.validateForm(); }, error: function () { console.log("Error: Stock Notify"); }, }); notifyMe.validateForm(); }, renderAttributesAndData: function (tag) { notifyMe.validateForm(); let click = { number: $("#js-notify-button-now").attr("data-number"), }; if (tag && $(tag).hasClass("disabled")) { click.tag = tag; click.number = $(tag).parents(".product-attributes").data("product-attr"); if (tag.parents("select").length) { click.type = "select"; } else if (tag.parents(".colors-attribute").length) { click.type = "color"; } else if (tag.parents(".size-attributes").length) { click.type = "size"; } } else if (!tag && !click.number) { alert("Our of Stock product not Found"); return; } var product = { id: $("[name = part_id]").val(), attributesTag: $("[data-product-attr = " + click.number + "]"), attributesType: "", image: "https://" + window.location.hostname + $(".main_image_" + click.number).attr("src"), isCombo: false, isOptional: $('label[for="combo-optional_' + click.number + '"]').length ? 1 : 0, }; if ($("[name=product_id-combo]").length) { product.isCombo = true; } if (product.isCombo) { product.id = product.attributesTag.find("[name=product_id-combo]").val(); } if (click.tag && click.type == "color") { product.image = window.location.hostname + click.tag.find("img").attr("src"); } if (product.image.indexOf(window.location.hostname) == -1) product.image = window.location.hostname + product.image; if (product.image.indexOf('http') == -1) product.image = 'https://' + product.image; var form = { ntfVerbiage: $("#ntf-verbiage"), ntfAttrVerbiage: $("#ntf-attr-verbiage"), imageTag: $("#ntf-img"), inputs: { image: $("[name=ntf_image]"), productName: $("[name=ntf_product]"), url: $("[name=ntf_url]"), token: $("#js-notifyfrm [name=token]"), }, }; //Set Image form.imageTag.attr("src", product.image); //Set inputs form.inputs.image.val( product.image); form.inputs.url.val(window.location.href); form.inputs.token.val($("#add-to-cart-or-refresh input[name=token]").val()); if (product.isCombo) { if (product.isOptional) { form.inputs.productName.val( $('label[for="combo-optional_' + click.number + '"]') .text() .trim() ); } else { form.inputs.productName.val($(".product-information .page-title--prod").text().trim()); } } else { form.inputs.productName.val($(".product-information .page-title--prod").text().trim()); } //Set type of product attibutes if (product.attributesTag.find(".colors-attribute").length == 1 && !product.attributesTag.find("select").length && !product.attributesTag.find(".size-attributes").length) { //Only image attributes product.attributesType = "images"; } else if (product.attributesTag.find(".size-attributes").length == 1 && !product.attributesTag.find("select").length && !product.attributesTag.find(".colors-attribute").length) { //Only size attributes product.attributesType = "sizes"; } else if (product.attributesTag.find("select").length && !product.attributesTag.find(".size-attributes").length == 1 && !product.attributesTag.find(".colors-attribute").length) { //Only select attributes product.attributesType = "select"; } else if (product.attributesTag.find(".colors-attribute").length == 1 && product.attributesTag.find(".size-attributes").length == 1 && !product.attributesTag.find("select").length) { //Image & size attributes product.attributesType = "images-sizes"; } else if (product.attributesTag.find(".colors-attribute").length == 1 && product.attributesTag.find("select").length == 1 && !product.attributesTag.find(".size-attributes").length) { //Image & select product.attributesType = "images-select"; } else if (product.attributesTag.find("select").length == 1 && product.attributesTag.find(".size-attributes").length == 1 && !product.attributesTag.find(".colors-attribute").length) { //Select & sizes product.attributesType = "select-sizes"; } else if (product.attributesTag.find("select").length == 1 && product.attributesTag.find(".size-attributes").length == 1 && product.attributesTag.find(".colors-attribute").length == 1) { //Image & select & size product.attributesType = "image-select-size"; } //Form form.ntfVerbiage.empty(); form.ntfAttrVerbiage.empty(); //Render attributes var disabledTag = "", colorID = ""; switch (product.attributesType) { case "select": form.ntfAttrVerbiage.text("Please, select model:"); disabledTag = product.attributesTag.find("select .disabled:not(:disabled)"); printAttributes(disabledTag, "select"); break; case "sizes": form.ntfAttrVerbiage.text("Please, select size/model:"); disabledTag = product.attributesTag.find(".size-attributes .disabled"); printAttributes(disabledTag, "button"); break; case "images": form.ntfAttrVerbiage.text("Please, select color:"); disabledTag = product.attributesTag.find(".colors-attribute .disabled"); printAttributes(disabledTag, "select"); break; case "images-sizes": if (click.type && click.type == "color") { form.ntfVerbiage.text("Selected color: " + click.tag.find("b").text()); disabledTag = product.attributesTag.find(".size-attributes label"); colorID = click.tag.find("input").val(); } else if (!product.attributesTag.find(".colors-attribute input:checked").length) { form.ntfVerbiage.text("Selected color: " + product.attributesTag.find(".colors-attribute input:nth-child(1)").attr("title")); disabledTag = product.attributesTag.find(".size-attributes label"); colorID = product.attributesTag.find(".colors-attribute input:nth-child(1)").val(); } else { form.ntfVerbiage.text("Selected color: " + product.attributesTag.find(".colors-attribute input:checked").attr("title")); disabledTag = product.attributesTag.find(".size-attributes .disabled"); colorID = product.attributesTag.find(".colors-attribute input:checked").val(); } form.ntfAttrVerbiage.text("Please, select size:"); printAttributes(disabledTag, "button"); break; case "images-select": if (click.type && click.type == "color") { form.ntfVerbiage.text("Selected color: " + click.tag.find("b").text()); disabledTag = product.attributesTag.find("select option:not(:disabled)"); colorID = click.tag.find("input").val(); } else { form.ntfVerbiage.text("Selected color: " + product.attributesTag.find(".colors-attribute input:checked").attr("title")); disabledTag = product.attributesTag.find("select .disabled:not(:disabled)"); colorID = product.attributesTag.find(".colors-attribute input:checked").val(); } form.ntfAttrVerbiage.text("Please, select size:"); printAttributes(disabledTag, "select"); break; case "select-sizes": if (click.type && click.type == "select") { form.ntfVerbiage.text("Selected model: " + click.tag.attr("title")); disabledTag = product.attributesTag.find(".size-attributes label"); colorID = click.tag.val(); } else { form.ntfVerbiage.text("Selected model: " + product.attributesTag.find("select option:selected").attr("title")); disabledTag = product.attributesTag.find(".size-attributes .disabled:not(:disabled)"); colorID = product.attributesTag.find("select option:selected").val(); } form.ntfAttrVerbiage.text("Please, select size:"); printAttributes(disabledTag, "select"); break; case "image-select-size": colorID = product.attributesTag.find(".colors-attribute input:checked").val(); if (product.attributesTag.find("select option:selected:not(:disabled)").hasClass("disabled") || !product.attributesTag.find("select").val()) { form.ntfVerbiage.text("Selected color: " + product.attributesTag.find(".colors-attribute input:checked").attr("title")); form.ntfAttrVerbiage.text("Please, select size and model:"); disabledTag = "select,sizes"; printAttributes(disabledTag, "select,button", 2); } else { form.ntfVerbiage.html( "Selected color: " + product.attributesTag.find(".colors-attribute input:checked").attr("title") + "
Selected model:" + product.attributesTag.find("select option:selected:not(:disabled)").attr("title") ); form.ntfAttrVerbiage.text("Please, select size:"); disabledTag = "sizes"; printAttributes(disabledTag, "button"); } break; } function printAttributes(disabledTag, type, count, remove) { if (!disabledTag) return false; if (!type) type = "select"; if (!count) count = 1; if (remove == null) remove = 1; remove && $("#js-notifyfrm .ntf-sizes").remove(); var html = ""; if (count === 1) { if (disabledTag == "select") { disabledTag = product.attributesTag.find("select .disabled:not(:disabled)"); } else if (disabledTag == "sizes") { disabledTag = product.attributesTag.find(".size-attributes .disabled:not(:disabled)"); } $.each(disabledTag, function (index, point) { var t, v = $(point).attr("data-attr-id"); if (type == "button") { t = $(point).text(); html += '' + t + ""; } else { t = $(point).attr("title") || $(point).attr("for"); html += '
"; } if (index + 1 == disabledTag.length) { if (type == "button") { $("#js-notifyfrm [for=ntf_size]").after('
' + html + "
"); } else { $("#js-notifyfrm [for=ntf_size]").after('"); } } }); } else if (count > 1) { disabledTag = disabledTag.split(","); type = type.split(","); for (var index = disabledTag.length; index > 0; index--) { printAttributes(disabledTag[index - 1].trim(), type[index - 1].trim(), 1, !1); } } } }, autoSearch: function () { setTimeout(function () { $.each($('.product-variants .product-attributes:not(".optional-attributes")'), function (index, point) { if ($(point).find(".disabled:not(:disabled)").length) { let number = $(this).attr("data-product-attr"); notifyMe.renderBtnForm(0, number); return true; } if ($('.product-variants .product-attributes:not(".optional-attributes")').length == +index + 1) { notifyMe.renderBtnForm(1); return false; } }); }, 2500); }, }; $(document).ready(function () { /*Notify triggers*/ notifyMe.autoSearch(); $(document).on("click", "#js-notify-button-now", function () { $("[name=ntf_id]").val(""); $("#iz-notifymodal").show(); notifyMe.renderAttributesAndData(); }); $(document).on("change", ".product-variants select", function (e) { // if ($(this).find("option:selected").hasClass("disabled")) { // e.preventDefault(); // if (!$("#iz-notifymodal").length) { // notifyMe.renderBtnForm(); // } // $("[name=ntf_id]").val(""); // $("#iz-notifymodal").show(); // notifyMe.renderAttributesAndData($(this).find("option:selected")); // } else { // $("#js-notify-button-now").prop("disabled", true); // notifyMe.autoSearch(); // } }); $(document).on("click", ".select-buttons label", function (e) { // if ($(this).hasClass("disabled")) { // e.preventDefault(); // if (!$("#iz-notifymodal").length) { // notifyMe.renderBtnForm(); // } // $("[name=ntf_id]").val(""); // $("#iz-notifymodal").show(); // notifyMe.renderAttributesAndData($(this)); // } else { // $("#js-notify-button-now").prop("disabled", true); // notifyMe.autoSearch(); // } }); $(document).on("change", '[id *= "combo-optional_"]', function () { notifyMe.autoSearch(); }); $(document).on("change", "#js-notifyfrm input", function () { notifyMe.validateForm(); }); $(document).on("click", ".close", function (e) { $("#iz-notifymodal").hide(); }); $(document).on("change", ".product-variants select", function (e) { // if ($(this).find("option:selected").hasClass("disabled")) { // e.preventDefault(); // $("[name=ntf_id]").val(""); // $("#iz-notifymodal").show(); // notifyMe.renderAttributesAndData($(this).find("option:selected")); // } }); $(document).on("click", ".ntf-sizes span", function () { $(".ntf-sizes .active").removeClass("active"); $(this).addClass("active"); notifyMe.getPartId($(this)); notifyMe.validateForm(); }); $(document).on("change", "select.ntf-sizes", function () { notifyMe.getPartId($(this).find("option:selected")); }); $(document).on("submit", "#js-notifyfrm", function (e) { e.preventDefault(); var data = $(this).serialize(); if ($('#ntf_marketing').is(':checked')){ $.ajax({ type: 'POST', dataType: 'JSON', url: '/module/ps_emailsubscription/subscription', cache: !1, data: 'action=0&email='+ $('#ntf_email').val() }); }; $.ajax({ type: "POST", url: "/", data: data, success: function (response) { if (response.message) { $("#js-global-notify-message").show().html(response.message); } else { if (response.status) { $("#js-global-notify-message").show().html("We will let you know when the product back in stock again. Thanks for cooperation!"); } else { $("#js-global-notify-message").show().html("An Error has occured. Please connect with our support team"); } } setTimeout(function () { $("#iz-notifymodal").slideUp(); $("#iz-notifymodal").remove(); notifyMe.renderBtnForm(); }, 2000); }, }); }); });
Add to Wishlist »
Select all of the options to add to Wishlist