LINENGIRLS mekko classic

alk. 174 

Mittatilaustuote

LINENGIRLS mekko classic 1
LINENGIRLS mekko classic

Mittatilaustuote

//
//
// // // `; // $(document).ready(function() { // if ($('.made_to_order').length) { // $('.product-info,.product-main').addClass('pb-0'); // var id = $('[name=id_product]').val(); // var idcat = $('[name=id_cat]').val(); // $('.woocommerce-tabs').after(htmlCustom); // console.log(id + '' + idcat); // $.ajax({ // type: "POST", // url: up_ajax.up_ajax_url, // data: { // 'id': id, // 'idcat': idcat, // 'action': 'up_ajax_product_detail' // }, // success: function(data, textStatus, jqXHR) { // if (data.status) { // $('.js_step_3 .data-view').append(data.message); // } else { // console.log(data.message) // } // }, // error: function(jqXHR, textStatus, errorThrown) { // alert(errorThrown); // } // }) // } // }) $(document).on('click', '.close-modal,.bg-lingthbox', function() { $('.modal_box,.lingbox_view').hide(); setTimeout(function() { $('html').removeClass('stop_scroll'); }, 200); }); $(document).on('click', '.js-submit-accessory', function(e) { e.preventDefault(); let that = $(this); let id = $(this).attr('data-id'); let button = $('.js_click_color[data-id=' + id + ']'); let color = $('.js_click_color[data-id=' + id + '] .js_color_access'); var form = $('#upload_imageusers')[0]; // You need to use standard javascript object here var formData = new FormData(form); let imageUser = ''; if (color.val() == 'Oman sävyn toteutus') { $.ajax({ type: "POST", url: up_ajax.up_ajax_url, data: formData, processData: false, contentType: false, beforeSend: function() { loading.show(that); }, success: function(data, textStatus, jqXHR) { if (data.status) { imageUser = data.message; button.removeClass('border-red'); $.ajax({ type: "POST", url: up_ajax.up_ajax_url, data: { 'access': that.attr('data-id'), 'color': color.val(), 'imageUser': imageUser, 'action': 'up_ajax_order_access' }, beforeSend: function() { loading.show(that); }, success: function(data, textStatus, jqXHR) { if (data.status) { that.after('

Tuote on lisätty ostoskoriisi!

'); let iconCount = $('.icon-shopping-bag').attr('data-icon-label'); $('.icon-shopping-bag').attr('data-icon-label', parseInt(iconCount) + 1); setTimeout(() => { $('.js-notify-x').remove(); }, 1000); console.log(data.message); } else { console.log(data.message) } loading.hide(that); }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }) } else { console.log(data.message) } }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }) } if (color.val() != 'Oman sävyn toteutus' && color.val() != "") { button.removeClass('border-red'); $.ajax({ type: "POST", url: up_ajax.up_ajax_url, data: { 'access': that.attr('data-id'), 'color': color.val(), // 'imageuser': imageUser, 'action': 'up_ajax_order_access' }, beforeSend: function() { loading.show(that); }, success: function(data, textStatus, jqXHR) { if (data.status) { that.after('

Tuote on lisätty ostoskoriisi!

'); let iconCount = $('.icon-shopping-bag').attr('data-icon-label'); $('.icon-shopping-bag').attr('data-icon-label', parseInt(iconCount) + 1); setTimeout(() => { $('.js-notify-x').remove(); }, 1000); console.log(data.message); } else { console.log(data.message) } loading.hide(that); }, error: function(jqXHR, textStatus, errorThrown) { alert(errorThrown); } }) } else { button.addClass('border-red'); } }); $(document).on('change', '.box-size', function() { checkSize($(this)); }); function checkSize(elh = null) { let select = elh != null ? elh : $('.box-size'); select.each(function() { let classify = $(this).find('[name]').attr('name'); let val = $(this).find('[name]').val(); $('.mutil-box [classify="' + classify + '"]').each(function() { let ranger = $(this).attr('ranger').replace(' ', '').split(','); // console.log(ranger); if (ranger[1] == '∞') { parseInt(val) >= parseInt(ranger[0]) ? $(this).prop("checked", true) : $(this).prop( "checked", false); } else { parseInt(val) >= parseInt(ranger[0]) && parseInt(val) <= parseInt(ranger[1]) ? $( this).prop("checked", true) : $(this).prop("checked", false); } }); }) } $("input[type='file']").on("change", function() { if (this.files[0].size > 10000000) { alert("kuvan koko max 10MB!"); $(this).val(''); } }); $(document).on('click', '.js-backto', function() { let step = $(this).attr('data-id'); let thisStep = parseInt(step) + 1; $('.js_step_' + thisStep.toString()).hide(); $('.js_step_' + step.toString()).show(); }) $(document).on('click', 'input.only:checkbox', function() { // in the handler, 'this' refers to the box clicked on var $box = $(this); if ($box.is(":checked")) { // the name of the box is retrieved using the .attr() method // as it is assumed and expected to be immutable var group = "input:checkbox[name='" + $box.attr("name") + "']"; // the checked state of the group/box on the other hand will change // and the current value is retrieved using .prop() method $(group).prop("checked", false); $box.prop("checked", true); if ($(this).is('[name=color_custom]')) { let id = $(this).attr('id'); let that = $(this); $('.js_click_color').each(function() { // if($(this).find('input[name=colors_access]').val() == ''){ $(this).find('input[name=colors_access]').val(that.val()); $('.box-img[data-id=' + $(this).attr('data-id') + '] ~ .box-text .box-txt-color').remove(); if (!$('.box-txt-color').length) { $(".product-small-accessory .flickity-viewport").css("height", $('.product-small-accessory .flickity-viewport').height() + 70); } $('.box-img[data-id=' + $(this).attr('data-id') + '] ~ .box-text .price-wrapper').before('
' + that.val() + '
'); // $(this).find('.image-access').remove(); // $(this).append(''); // } }); if (!$(this).is('#color_s')) { $('input[cover-upload=1]').prop("checked", false); $('#color_x').val('') $('.upload_image img').attr('src', 'https://www.linengirls.com/wp-content/uploads/2023/03/upload-image-button-1.png'); } } if ($(this).is('[name=colors_custom]')) { let id = $(this).attr('id'); $('html').removeClass('noScroll'); let idModal = $('.modal-color').attr('data-id-access'); $('.js_click_color[data-id=' + idModal + '] input[name=colors_access]').val($(this).val()); $('.box-img[data-id=' + idModal + '] ~ .box-text .box-txt-color').remove(); if (!$('.box-txt-color').length) { $(".product-small-accessory .flickity-viewport").css("height", $('.product-small-accessory .flickity-viewport').height() + 70); } $('.box-img[data-id=' + idModal + '] ~ .box-text .price-wrapper').before('
' + $(this).val() + '
'); $('.js_click_color[data-id=' + idModal + ']').attr('idColor', id); // $('.js_click_color[data-id=' + idModal + ']').append(''); $('.modal-color').hide(); $('.modal-color').removeClass('active'); $('.js_click_color[data-id=' + idModal + ']').removeClass('border-red'); } } else { $box.prop("checked", false); } }); $(document).on('click', '.js_click_color', function() { $('.js_image_pp').remove(); $('.modal-color').show(); let image = $('.box-img[data-id=' + $(this).attr('data-id') + '] img').attr('src'); $('.modal-color .close-modal').before(''); $('html').addClass('noScroll'); $('.modal-color').attr('data-id-access', $(this).attr('data-id')); $('input:checkbox[name=colors_custom]').prop("checked", false); $('.modal-color').find('input[id=' + $(this).attr('idColor') + ']').prop("checked", true); $('.modal-color').addClass('active'); }) $(document).on('click', '.js_step_4 .box-context .box-access', function() { let input = $(this).attr('data-input'); let id = $(this).find('.box-img').attr('data-id'); if (!$('#' + input).is(':checked')) { $(this).addClass('is-checked'); $('.quantity_box[data-id=' + id + ']').show(); $('#' + input).prop("checked", true); } else { $('#' + input).prop("checked", false); $(this).removeClass('is-checked'); $('.quantity_box[data-id=' + id + ']').hide(); } }); $(document).on('click', '.modal-color .close-modal,.js_bg_modal', function() { $('.js_image_pp').attr('src', ''); $('.modal-color').hide(); $('.modal-color').removeClass('active'); $('html').removeClass('noScroll'); }) $(document).on('click', '.js-minus,.js-plus', function() { let id = $(this).attr('data-id'); let quantity = $('input[name="quantity_access[]"][data-id=' + id + ']'); if ($(this).is($('.js-minus')) && parseInt(quantity.val()) > 1) { quantity.val(parseInt(quantity.val()) - 1); } if ($(this).is($('.js-plus'))) { quantity.val(parseInt(quantity.val()) + 1); } }); $(document).on('change', '#color_x', function() { if (this.files && this.files[0]) { var reader = new FileReader(); reader.onload = imageIsLoaded; reader.readAsDataURL(this.files[0]); $('.only[name=color_custom]').prop("checked", false); $('#color_s').prop("checked", true); $('input[cover-upload=1]').prop("checked", true); } else { $('input[cover-upload=1]').prop("checked", false); $('.upload_image img').attr('src', 'https://www.linengirls.com/wp-content/uploads/2023/03/gallery-1.png'); } }); function imageIsLoaded(e) { $('.upload_image img').attr('src', e.target.result); // $image = ''; $('.product-small-accessory .js_click_color .image-access').remove(); // $('.product-small-accessory .js_click_color').append($image).attr('idcolor', 'colors_xs'); $('.product-small-accessory .js_color_access').val('Oman sävyn toteutus'); $('.box-txt-color').remove(); $('.product-small-accessory .box-text .price-wrapper').before('
Oman sävyn toteutus
'); if (!$('.box-txt-color').length) { $(".product-small-accessory .flickity-viewport").css("height", $('.product-small-accessory .flickity-viewport').height() + 70); } $('.checkbox-img.custom-color').remove(); $boxImage = '

Oma sävy

'; $('.modal-color .d-flex').append($boxImage); }; const urlParams = new URLSearchParams(window.location.search); let custom = urlParams.get('custom'); console.log(custom); $(document).ready(function() { if (urlParams.get('custom')) { $('.js_product_custom').click() } }) } if ($('.close__next_page').length) { $('.close__next_page a').attr('target', '') } var up_ajax = { "up_ajax_url": "https:\/\/www.linengirls.com\/wp-admin\/admin-ajax.php" };-->