Broca Serra Copo Videa Para Alvenaria e Concreto 40mm

Broca Serra Copo Videa Para Alvenaria e Concreto 40mm

  • Marca: Lotus
  • REF. 17068-FE
  • Disponibilidade: Pronta Entrega
  • R$ 29,18 (10%) à vista no Pix
  • 3x de R$ 10,81 sem juros
Quantidade
Mais formas de pagamento
Calcule o freteNão sei meu CEP
Ligar para Central de Atendimento

DETALHES DO PRODUTO

Broca Serra Copo Videa Para Alvenaria e Concreto 40mm

*não acompanha haste, comprar separadamente.

').appendTo('.product-body-color .image-preview'); $('.image-preview #preview').hide(); } } }); $('.image360-navigation .fa-arrow-circle-left').click(function(){ $("#mySpriteSpin").spritespin('api').prevFrame(); }); $('.image360-navigation .fa-arrow-circle-right').click(function(){ $("#mySpriteSpin").spritespin('api').nextFrame(); }); $(document).ready(function (e) { $('.dateInput').mask('00/00/0000'); $('input[data-option-name=\'Comprimento (milímetros)\'], input[data-option-name=\'Largura (milímetros)\']').mask({thousands: '.', decimal: ',', precision: 2}); $('.price-entry, .custom-price').mask('999.99'); var current = 0; minItemsCarousel = 2; var orientation_carousel = 'horizontal'; if (screen.width < 768){ minItemsCarousel = 2; } $preview = $('#preview'); $carouselEl = $('#carousel'); $carouselItems = $carouselEl.children(); carousel = $carouselEl.elastislide({ current: current, minItems: minItemsCarousel, orientation : orientation_carousel, onClick: function (el, pos, evt) { changeImage(el, pos); evt.preventDefault(); }, onReady: function () { changeImage($carouselItems.eq(current), current); } }); function changeImage(el, pos) { $preview.attr('data-zoom-image', el.attr('data-zoom')); $preview.attr('src', el.data('preview')); if(el.attr('data-image-id')){ $carouselItems.removeClass('current-img'); el.addClass('current-img'); } carousel.setCurrent(pos); $('.zoomContainer').remove(); if($(this).attr('id') != 'video-youtube'){ if(screen.width > 900){ $("#preview").elevateZoom({backgroundImage: el.attr('data-zoom'), zoomType: "inner", cursor: "crosshair"}); } } } /* PRODUCT STOCK IMAGE */ if(window.matchMedia("(min-width: 768px)").matches) { $('ul.product_options_list > .li_stock_image').click(function() { $('ul.product_options_list > li img').removeClass('current-img'); if($(this).children('.product_stock_image').hasClass('product_stock_image')) { changeStockImage($(this).children('.product_stock_image')); } else { $('#carousel li:first-child').click(); } }); } if ($('.options-list .option_type_select').length) { $('.options-list .option_type_select').change(function() { const clickedOptionListElement = $('option[value="' + this.value + '"]'); if (clickedOptionListElement.data('original-image')) { changeStockImage(clickedOptionListElement); } }); } if(window.matchMedia("(max-width: 767px)").matches) { if($('.product_carousel_mobile').length) { /* QUANDO CARROSSEL TEM MAIS DE UMA IMAGEM */ if($('.product_carousel_mobile.owl-carousel').length) { var old_img_src_caroussel_mobile = $('.product_carousel_mobile .owl-stage > .owl-item.active img').attr('src'); var old_product_carousel_mobile_html = $('#content .product_carousel_mobile').parent().html(); $('ul.product_options_list > li img').click(function() { var product_carousel_mobile_html = $('#content .product_carousel_mobile').parent().html(); loadYoutubeEmbed(); $('ul.product_options_list > li img').removeClass('current-img'); if($(this).hasClass('product_stock_image')) { $('.product_carousel_mobile').parent().html(product_carousel_mobile_html); let img_src = $(this).attr('data-original-image'); $('.product_carousel_mobile .owl-stage > .owl-item.active img').addClass('stock_img_carousel_mobile').attr('src', img_src); $('.popup-zoom .product_carousel_mobile .owl-stage > .owl-item:first-child img').addClass('stock_img_carousel_mobile').attr('src', img_src); } else { if($('.product_carousel_mobile .owl-stage > .owl-item.active img').hasClass('stock_img_carousel_mobile')) { $('.product_carousel_mobile').parent().html(old_product_carousel_mobile_html); } } }); } else { $('ul.product_options_list > .li_stock_image').click(function() { if($(this).children('.product_stock_image').hasClass('product_stock_image')) { let img_src = $(this).children('.product_stock_image').attr('data-original-image'); $('.product_carousel_mobile .grid_product_picture > img').attr('src', img_src); } }); } } else { $('ul.product_options_list > .li_stock_image').click(function() { $('ul.product_options_list > li img').removeClass('current-img'); if($(this).children('.product_stock_image').hasClass('product_stock_image')) { changeStockImage($(this).children('.product_stock_image')); } else { $('#carousel li:first-child').click(); } }); } } function changeStockImage(el) { $('#preview').attr('src', el.attr('data-original-image')); if (el.data('type')) { $('#preview').attr('data-zoom-image', el.attr('data-zoom-image')); } else { $('#preview').attr('data-zoom-image', el.attr('data-original-image')); } $('#carousel > li').removeClass('current-img'); el.addClass('image-additional current-img'); if(screen.width > 900){ $('.zoomContainer').remove(); $("#preview").elevateZoom({backgroundImage: el.attr('data-original-image'), zoomType: "inner", cursor: "crosshair"}); } } let quantity_shortage_alert = '02'; quantity_shortage_alert = Number(quantity_shortage_alert); console.log(quantity_shortage_alert); function getOptionValueQuantity(product_option_value_id){ if(product_option_value_id){ $.ajax({ url: 'index.php?route=product/product/quantityByOptionValue&product_option_value_id=' + product_option_value_id, dataType: 'json', success: function (json) { $('.shortage-warning').remove(); if(json['quantity'] != 0 && json['subtract'] == 1 && json['quantity'] <= quantity_shortage_alert){ $(`
Apenas ${json['quantity']} ${json['quantity'] > 1 ? 'unidades disponíveis' : 'unidade disponível'} em estoque!
`).insertAfter('.afterSizes'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } } if($('.uniqueInputValue').val()){ getOptionValueQuantity($('.uniqueInputValue').val()); } $('.option-type-select').change(function(){ var package_val = $(this).find('.packageTrigger').data('product-option-value-id'); var option_val = $(this).find(":selected").val(); if(option_val == package_val){ $(this).find('.packageTrigger').eq(0).trigger('click'); } else { if(option_val != 'size-no-available' && option_val != 'warn-me' && option_val != 'unavailable'){ getOptionValueQuantity($(this).val()); } else { $('.shortage-warning').remove(); $(' Opção temporariamente fora de estoque ').insertAfter('.afterSizes'); if(option_val == 'unavailable' || option_val == 'warn-me'){ $(this).val(''); } } } }); $('[data-product-option-id]').click(function(){ getOptionValueQuantity($(this).data('product-option-value-id')); $('.added-option-price').remove(); $('.price').removeClass('animated rubberBand'); }); $('[data-toggle="popover"]').click(function(){ if (!$(this).find('input[name="quantity_grid"]').length) { priceOptionClick(); } }); $('.grid_remove_selected').click(function () { $(this).parent().removeClass('selected'); $(this).parent().removeClass('grid_selected'); return false; }); /* Adição e Subtração */ $('.product_quantity_minus_plus .btn-number').click(function(e){ e.preventDefault(); fieldName = $(this).attr('data-field'); type = $(this).attr('data-type'); var input = $("input[name='"+fieldName+"']"); var currentVal = parseInt(input.val()); if (!isNaN(currentVal)) { if(type == 'minus') { if(currentVal > input.attr('min')) { input.val(currentVal - 1).change(); } if(parseInt(input.val()) == input.attr('min')) { $(this).attr('disabled', true); } } else if(type == 'plus') { if(currentVal < input.attr('max')) { input.val(currentVal + 1).change(); } if(parseInt(input.val()) == input.attr('max')) { $(this).attr('disabled', true); } } } else { input.val(0); } }); $('.product_quantity_minus_plus .input-number').focusin(function(){ $(this).data('oldValue', $(this).val()); }); $('.product_quantity_minus_plus .input-number').change(function() { minValue = parseInt($(this).attr('min')); maxValue = parseInt($(this).attr('max')); valueCurrent = parseInt($(this).val()); name = $(this).attr('name'); if(valueCurrent >= minValue) { $(".btn-number[data-type='minus'][data-field='"+name+"']").removeAttr('disabled') } else { $(this).val($(this).data('oldValue')); } if(valueCurrent <= maxValue) { $(".btn-number[data-type='plus'][data-field='"+name+"']").removeAttr('disabled') } else { $(this).val($(this).data('oldValue')); } }); $(".product_quantity_minus_plus .input-number").keydown(function (e) { if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 || (e.keyCode == 65 && e.ctrlKey === true) || (e.keyCode >= 35 && e.keyCode <= 39)) { return; } if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) { e.preventDefault(); } }); var product_option_value_stock = $('.stock-text').attr('data-product-option-id'); $('.stock-text-price').change(function(){ priceOptionClick(); }); $('#input-quantity').change(function() { priceOptionClick('quantity'); }); $('#input-square').change(function() { priceOptionClick('square_package'); }); }); function priceOptionClick(parameter = null) { $('#simulator_payments_board').hide(); $('.product-info .price_attacked:not(.min-attacked)').hide(); if($('#input-quantity').length > 0){ var product_quantity = $('#input-quantity').val(); } else { var product_quantity = 1; } var total_price_option = 0; var rule_price_type = false; var option_price = 0; $('#product select[id^="options-graduation"], #product select[id^="input-option"], #product [type="text"], #product [data-toggle="popover"].selected, #product [type="checkbox"][data-toggle="popover_change"]:checked, #product input:radio:checked').each(function () { if ($('#' + $(this).val()).attr('data-content') || $('#' + $(this).attr('id') + '[type="text"]').attr('data-content') || $(this).hasClass('selected') || $(this).is('checked') || $('.' + $(this).attr('class') + '[type="radio"]').attr('data-content')) { let att_price = false; if ($('#' + $(this).val()).attr('data-content')) { var price_option = $('#' + $(this).val()).attr('data-content').split("|"); if(price_option[1]) { att_price = true; } } else if($(this).hasClass('selected') && $(this).attr('data-content')){ var price_option = $(this).attr('data-content').split("|"); if(price_option[1]) { att_price = true; } } else if ($('#' + $(this).attr('id') + '[type="text"]').attr('data-content') || $('.' + $(this).attr('class') + '[type="radio"]').attr('data-content')) { var price_option = $(this).attr('data-content').split("|"); if (!$(this).val() == '') { att_price = true; } } if(att_price) { let additional_price = 0; if (price_option[0] == 'sub') { price_option[1] = "-" + price_option[1]; } if ($(this).hasClass('custom-price')) { additional_price = parseFloat($(this).siblings('.option-total').find('.option-total-value').text().replace(',', '.')); } else { additional_price = parseFloat(price_option[1]); } total_price_option += additional_price; if (additional_price && $(this).attr('data-rule-price-type') !== undefined) { rule_price_type = true; } } } }); option_price += total_price_option; optionPriceAjax(option_price, product_quantity, rule_price_type, parameter); } function optionPriceAjax(option_price, product_quantity, rule_price_type, parameter) { option_price = typeof option_price !== 'undefined' ? option_price : 0; product_quantity = typeof product_quantity !== 'undefined' ? product_quantity : 1; rule_price_type = typeof rule_price_type !== 'undefined' ? rule_price_type : false; if($('#input-square').length > 0){ var square_quantity = $('#input-square').val(); } else { var square_quantity = 1; } $.ajax({ url: 'index.php?route=product/product/priceOption', type: 'post', data: 'product_id=3270&option_price=' + option_price + '&product_quantity=' + product_quantity + '&rule_price_type=' + rule_price_type + '&square+quantity=' + square_quantity + '¶meter=' + parameter, dataType: 'json', beforeSend: function () { $('#simulator_payments_board').before(''); }, success: function (json) { $('#simulator_payments_board').show(); $('.product-info .price_attacked:not(.min-attacked)').show(); $('.loading').remove(); $('#simulate_payment').html(json.simulate_payment_output); $('#payment-simulator-content .accordion-body').html(json.simulate_payment_output); parcel_simulator = json.calculate_prices_output.parcel_simulator; special = json.calculate_prices_output.special; price = json.calculate_prices_output.price; price_simulator = json.calculate_prices_output.price_simulator; price_simulator_no_interest = json.calculate_prices_output.price_simulator_no_interest; price_discount = json.calculate_prices_output.price_discount; special_discount = json.calculate_prices_output.special_discount; special_simulator = json.calculate_prices_output.special_simulator; special_simulator_no_interest = json.calculate_prices_output.special_simulator_no_interest; show_interest_installment = json.calculate_prices_output.show_interest_installment; no_interest_installments = json.calculate_prices_output.no_interest_installments; show_in_cash_discount = json.calculate_prices_output.show_in_cash_discount; text_discount_avista_list_products = json.calculate_prices_output.text_discount_avista_list_products; special_porcent = Math.round(json.calculate_prices_output.special_porcent); quantity = json.quantity; package_quantity = json.package_quantity; text_no_interest = 'sem juros'; if(show_interest_installment && parcel_simulator > no_interest_installments){ text_interest = "com juros"; }else{ text_interest = "sem juros"; } text_special_porcent = ''; product_special_percentage_display = ''; if (special_porcent && product_special_percentage_display ) { text_special_porcent = ''+special_porcent+'% '; } text_discoun_avista = ''; text_discoun_avista = 'no Pix'; text_discount = ''; if (text_discount_avista_list_products && product_special_percentage_display) { text_discount = ' '+ text_discount_avista_list_products +''; } cash_discount = ''; cash_discount_alert = ''; if (show_in_cash_discount) { cash_discount = '
* Em compras a partir de '+ show_in_cash_discount +'
'; cash_discount_alert = '*'; } prefix = ''; if(special){ $('.price_old_product span:last-child').html(price + prefix); $('.product_details_content .price, .product-floating .price').html('Por '+ special + prefix); if(special_discount){ $('.avista_price_product').html(' ou '+special_discount+' à vista' + text_special_porcent + text_discoun_avista + text_discount + cash_discount_alert + cash_discount); } $('.price_simultador_product').html(` ${parcel_simulator}x de ${special_simulator} ${text_interest}`); }else{ $('.product_details_content .price, .product-floating .price').html(price + prefix); if(price_discount){ $('.avista_price_product').html(' ou '+price_discount+' à vista ' + text_special_porcent + text_discoun_avista + text_discount + cash_discount_alert + cash_discount); } $('.price_simultador_product').html(` ${parcel_simulator}x de ${price_simulator} ${text_interest}`); } if(json.price_attacked && json.attacked_status){ $('.product-info .price_attacked:not(.min-attacked)').html('Preço de Atacado: ' + json.price_attacked + ''); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } $('#img_aro').removeAttr('style'); $('.quantity_display #input-quantity').blur(function(){ quantity_value = $('.quantity_display #input-quantity').val(); if(quantity_value <= 0 || quantity_value == ''){ $('.quantity_display #input-quantity').val(1); } }); $('#button-quote_product').on('click', function () { var quantity = $('#input-quantity').val(); if (!quantity) { quantity = 1; } total_stock_quantity = 1; var params = ""; params = params + "&postcode=" + $('input[name=\'postcode\']').val(); params = params + "&product_id=3270"; params = params + "&weight=0.5000"; params = params + "&width=10,00"; params = params + "&height=10,00"; params = params + "&days_stock=0"; params = params + "&price=32.42"; params = params + "&quantity_product=" + quantity; var postcodeLength = 9; if($('input[name=postcode]').val().length < postcodeLength || total_stock_quantity < 1) { $('#modal-shipping').empty(); $('#button-quote_product').button('loading'); $('#modal-shipping').html('
 Para poder realizar o calculo do frete escolha seu numero e a quantidade desejada.
'); $('#button-quote_product').button('reset'); } else { $.ajax({ url: 'index.php?route=module/shipping/simulate', type: 'post', data: params, dataType: 'json', beforeSend: function () { $('#button-quote_product').button('loading'); $('
Carregando informações de envio
').insertAfter('#consult_shipping .postcode-inputs'); }, complete: function () { $('#button-quote_product').button('reset'); $('.shipping-load-message').remove(); }, success: function (json) { $('#modal-shipping').empty(); $('#shipping-error').empty(); $('.alert, .text-danger, .simulate_shipping_methods').remove(); if (json['error']) { if (json['error']['warning']) { $('#shipping-error').remove(); $('.postcode-inputs').append('
' + json['error']['warning'] + '
'); } if (json['error']['postcode']) { $('.postcode-inputs').append('
' + json['error']['postcode'] + '
'); } } if (json['shipping_method']) { html = '
'; html_error = ''; for (i in json['shipping_method']) { if (!json['shipping_method'][i]['error']) { for (j in json['shipping_method'][i]['quote']) { if(j == 'frete_rapido'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } } } else if (j == 'mandae'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'jadlog_api'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'melhor_envio'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } }else if (j == 'rodoe'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'frenet'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'data_frete') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'intelipost') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'smart_envios') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'kangu') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'rede_sul' || j == 'ipost') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else if (j == 'mandou_chegou') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''; } } } else { html += '
'; html += ''; html += '
'; if(json['shipping_method'][j]['info']){ html += ''; } if(json['shipping_method'][i]['quote'][j]['code'] == 'pickup.pickup'){ for (k in json['shipping_method'][i]['locations']){ html += ''; } } } } } else { if ((i == 'sedex' || i == 'pac') && html_error.search(json['shipping_method'][i]['quote'][i]['msgErro']) == -1) { if (json['shipping_method']['sedex'] == undefined || json['shipping_method']['pac'] == undefined) { html_error += '
' + json['shipping_method'][i]['quote'][i]['msgErro'] + '
'; } else if (json['shipping_method']['sedex']['error'] && json['shipping_method']['pac']['error']) { html_error += '
' + json['shipping_method'][i]['quote'][i]['msgErro'] + '
'; } } else if (i === 'mandae' || i === 'mandae' && i != 'pickup') { console.log(json['shipping_method'][i]['error']); html += '
'; html += ''; html += '
'; } else if (i != 'sedex' && i != 'pac' && i != 'mandae' && i != 'jadlog_api' && i != 'melhor_envio') { html_error += '
' + json['shipping_method'][i]['quote'][i]['msgErro'] + '
'; } } } html += html_error; html += '
'; $(html).insertAfter('.postcode-inputs'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } }); $('select[name=\'recurring_id\'], input[name="quantity"]').change(function () { $.ajax({ url: 'index.php?route=product/product/getRecurringDescription', type: 'post', data: { 'product_id' : $('input[name=\'product_id\']').val(), 'quantity' : $('input[name=\'quantity\']').val(), 'recurring_id' : $('select[name=\'recurring_id\'] option:selected').val() }, dataType: 'json', beforeSend: function () { $('#recurring-description').html(''); }, success: function (json) { $('.alert, .text-danger').remove(); if (json['success']) { $('#recurring-description').html(json['success']); } }, error: function (error) { console.log(error.responseText); } }); }); $('select[id^="options-graduation"], select[id^="input-option"], [type="checkbox"][data-toggle="popover_change"], #product input:radio').change(function () { var option_price = 0; if($(this).attr('data-product-option-id')){ var data_product_option_id = $(this).attr('data-product-option-id'); $("#preview_graduation" + data_product_option_id + " #img_value").remove(); if ($('#' + $(this).val()).data('image')) { $("#preview_graduation" + data_product_option_id).append("
"); } } if($('#input-quantity').length > 0){ var product_quantity = $('#input-quantity').val(); } else { var product_quantity = 1; } priceOptionClick(); $('#simulator_payments_board').hide(); $('.product-info .price_attacked:not(.min-attacked)').hide(); }); function dowloadImageProduct (){ let image_popup_height = '600'; let image_popup_width = '600'; if(window.matchMedia("(min-width: 768px)").matches) { imageLink = $('.image-preview #preview').attr('src').replace('webp', '').replace(`fit-in/${image_popup_width}x${image_popup_height}/`, ''); $('#btn-download-product-image').attr('href', imageLink); console.log(imageLink); } else{ imageLink = $('.product_carousel_mobile .owl-item.active .item .grid_product_picture img').attr('src').replace('webp', '').replace(`fit-in/${image_popup_width}x${image_popup_height}/`, ''); $('#btn-download-product-image').attr('href', imageLink); console.log(imageLink); } } function verifyCm(){ if(!$('#value_centimeters_filter').val() && $('#value_centimeters_filter').length){ $('.guide-shoes_erro_filter').fadeIn('slow'); return false; } $.ajax({ url: 'index.php?route=product/product/checkSizeOption', type: 'post', data: { 'product_id' : '3270', 'value_centimeters' : $("#value_centimeters").val(), 'filter_type' : $("#value_centimeters_filter").val() }, dataType: 'json', beforeSend: function () { $('.btn-shoes_guide').button('Carregando...'); }, complete: function () { $('.btn-shoes_guide').button('reset'); }, success: function (json) { if(json.name){ html = ""; $('.modal-shoes-guide').remove(); $('body').append(html); $('#modal-shoes-guide').modal('show'); } else { $('.guide-shoes_erro').fadeIn('slow'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } $('.button-cart-budget-option').on('click', function () { let product_id = $(this).data('product-id'); let product_options = {}; if( $('.product_options_list .sizes.selected').length > 0 ) { $('.product_options_list .sizes.selected').each(function(){ product_options[$(this).data('product-option-id')] = "" + $(this).data('product-option-value-id'); }); cartlist_add.addCartBudgetOption(product_id, $('#input-quantity').val(), product_options); } else { cartlist_add.addCartBudget(`${product_id}`, $('#input-quantity').val()); } }); $('#button-consult').on('click', function () { $.ajax({ url: 'index.php?route=product/product/price_consult', type: 'post', data: 'product_id=3270', dataType: 'json', beforeSend: function () { $('#button-consult').button('loading'); }, complete: function () { $('#button-consult').button('reset'); }, success: function (json) { html = ''; $('.modal-price-consult').remove(); $('body').append(html); $('#modal-price-consult').modal('show'); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.responseText); } }); }); $('.btn_upload_file').on('click', function(){ html = ''; $(".modal-upload-file").remove(); $('body').append(html); $('#modal-upload-file').modal('show'); }); $('.button-cart').on('click', function () { var error_select_option = false; if($(".addBuyTogetherProduct").length){ $(".addBuyTogetherProduct").each(function(index, element) { var product_id = $(this).data("buyTogetherProductId"); if ($(".buy-together-" + product_id + " select").length) { $('.buy-together-' + product_id + " select").each(function (i, e) { if ($(this).val() == 0) { error_select_option = true; $(this).parent().addClass('has-error'); } }); } else { $('.buy-together-' + product_id + " .product_options_list").each(function (i, e) { if ($(this).find('input[type="hidden"]').val() == 0) { error_select_option = true; $(this).parent().addClass('has-error'); } }); } if(error_select_option){ $('#error-insert').remove(); $('.product-single .product-prices-content').after('
Você precisa selecionar algum tamanho!
'); clearTimeout(clear_time); clear_time = setTimeout("$('#error-insert').fadeOut();", 5000); } }); } if(!error_select_option){ if($('#input-quantity').hasClass('packageTrigger')){ $('.packageTrigger').trigger('click'); return; } if($(this).hasClass('btn-add-to-cart')){ addCart('btn-add-to-cart'); } else { addCart(); } } }); function addCart(){ $('.button-cart').button('loading'); var type_button = '#product'; var package = ''; product_floating_info = ''; if($(this).hasClass('button-cart-floating') && product_floating_info){ type_button = '.product-floating'; } if($(".sizes").hasClass('packageTrigger selected') || $(".option_type_select > option").hasClass('packageTrigger') || $('#input-quantity').hasClass('packageTrigger')){ package = 'packageTrigger'; } $('.price-entry, .custom-price').each(function(){ if (isNaN($(this).val())) { $('#button-cart').before(''); $('.button-cart').button('reset'); return false; } $(this).val(Math.abs($(this).val())); }); $.ajax({ url: 'index.php?route=checkout/cart/add&package=' + package + '&v='+new Date().getTime(), type: 'post', data: $(type_button + ' input[type=\'text\'], #product input[type=\'hidden\']:not(.buy-together-opt), #product #input-quantity, ' + type_button + ' input[type=\'radio\']:checked, ' + type_button + ' input[type=\'checkbox\']:checked, ' + type_button + ' select:not(.buy-together-opt), ' + type_button + ' textarea'), dataType: 'json', async: false, success: function (json) { $('.alert, .text-danger').remove(); $('.product_details .product-option-warning').remove(); $('.form-group').removeClass('has-error'); if (json['error']) { if (json['error']['option']) { for (i in json['error']['option']) { if(type_button == '#product'){ var element = $('#input-option' + i.replace('_', '-')); } else { var element = $('#input-optionf' + i.replace('_', '-')); } if (element.parent().hasClass('input-group')) { element.parent().after(''); } else { element.after(''); } } } if (json['error']['recurring']) { $('select[name=\'recurring_id\']').after(''); } if (json['error']['product']) { $('#button-cart').before(''); } if (json['error']['empty_option']) { $('#button-cart').before(''); } if($('#product .options_list').length){ $('html, body').animate({scrollTop: $('#product .options_list').offset().top - 60}, 700); } $('.text-danger').parent().addClass('has-error'); $('
Preencha os campos obrigatórios para prosseguir na compra.
').insertBefore('.product_details #button-cart'); $('.button-cart').button('reset'); } if (json['error_stock']) { $('.button-cart').button('reset'); html = ''; $(".top_modal").remove(); $('body').append(html); $('#modal-cart').modal('show'); } if (json.buy_permission) { $.each(json.buy_permission, function(index, value) { if((value == null) && (!json.error && !json.error_stock)){ $('#modal-cart').remove(); $('.modal-content').remove(); swal({ title : 'Produto temporariamente reservado. Ele poderá ficar disponivel caso o cliente venha a desistir do mesmo ', html: '
Qualquer duvida permanecemos a disposição
', timer: 3000, onClose: function() { window.location.href = window.location.href; } }); return false; } else { if(value == 'upon_request'){ swal({ title : 'Produto temporariamente reservado. Você ainda poderá finalizar seu pedido com a nossa exclusiva ferramenta de Sob-Encomenda', html: '
Qualquer duvida permanecemos a disposição
', showConfirmButton: true, timer: 5000, onClose: function() { window.location.href = window.location.href; } }); return false; } } }); } if (!$(".addBuyTogetherProduct").length) { if (json['success_redirect'] && !json['fail_redirect']) { location.href = json['success_redirect']; } if (json.success_modal) { $('#modal-cart').remove(); $('.button-cart').button('reset'); html = ''; $(".top_modal").remove(); $('body').append(html); $('#modal-cart').modal('show'); $('#cart-total').html(json['total']); $('.header_sticky #cart-total').html(json['total']); $('#cart-quantity').html(json['total_quantity']); $('.header_sticky #cart-quantity').html(json['total_quantity']); $('#cart > ul').load('index.php?route=common/cart/info ul li'); } } else if ($(".addBuyTogetherProduct").length && !json['error'] && !json['error_stock']) { $.each($(".addBuyTogetherProduct"), function(index, val) { var product_id = $(this).data("buyTogetherProductId"); var option = {}; if ($(".buy-together-" + product_id + " select").length) { $(".buy-together-" + product_id + " select").each(function (i, e) { option[$(this).data("product-option-id")] = $(this).val(); }); } else { option[$(".buy-together-" + product_id + " input").data("product-option-id")] = $(".buy-together-" + product_id + " input").val(); } if ($(".buy-together-" + product_id + " input[type='text']").length) { $(".buy-together-" + product_id + " input[type='text']").each(function (i, e) { option[$(this).data("product-option-id")] = $(this).val(); }); } if ($(".buy-together-" + product_id + " textarea").length) { $(".buy-together-" + product_id + " textarea").each(function (i, e) { option[$(this).data("product-option-id")] = $(this).val(); }); } if ($(".buy-together-" + product_id + " input[data-upload-option-id]").length) { $(".buy-together-" + product_id + " input[data-upload-option-id]").each(function (i, e) { option[$(this).data("upload-option-id")] = $(this).val(); }); } $(this).removeClass('addBuyTogetherProduct'); $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: { 'product_id' : product_id, 'quantity' : 1, 'option' : option }, dataType: 'json', async: false, beforeSend: function () { $('.button-cart').button('loading'); }, success: function (json) { if (json['error_stock']) { html = ''; $(".top_modal").remove(); $('body').append(html); $('#modal-cart').modal('show'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); }); setTimeout(function() { closeLoad(); location.href = "index.php?route=checkout/cart"; }, 5000); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(XMLHttpRequest.responseText); } }); } function optionSelection() { $('html, body').animate({scrollTop: $('#top').offset().top}, 1500); return; } $('button[id^=\'button-upload\']').on('click', function (event) { var node = $(this); var option_id = node.data('upload-option-id'); $('#form-upload').remove(); $('body').prepend(''); $('#form-upload input[name=\'file\']').trigger('click'); $('#form-upload').on('change', function(){ if ($('#form-upload input[name=\'file\']').val() != '') { $.ajax({ url: 'index.php?route=tool/upload&upload-option-id=' + node.data('upload-option-id'), type: 'post', dataType: 'json', data: new FormData($('#form-upload')[0]), cache: false, contentType: false, processData: false, beforeSend: function () { $(node).button('loading'); }, success: function (json) { $('.text-danger').remove(); $('.alert-success').remove(); if (json['error']) { $(node).button('reset'); $(node).parent().find('input').after('
' + json['error'] + '
'); } if (json['success']) { swal(json.success); var str = json.filename; var res = str.slice(-4); if(str.length > 30){ var res2 = str.slice(0, 15); } else{ var res2 = str.slice(0, (str.length / 2)); } $(node).html(res2 + '(...)' + res).addClass('btn btn-success').removeClass('disabled').removeAttr('disabled'); $(node).parent().find('input').attr('value', json['code']); } }, error: function (xhr, ajaxOptions, thrownError) { console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); } }); }); $('#review-form input[type="radio"]').on('click', function(){ $('#review-empty').remove(); if ($(this).hasClass('check') ) { $(this).removeAttr('checked'); $(this).removeClass('check'); $('').insertBefore($('#review-radios1')); } else { $('#review-form input[type="radio"]').removeClass('check'); $(this).addClass('check'); $(this).prop('checked', true); $('#review-empty').remove(); } }); $('#button-review').on('click', function () { var recommend = 0; if($('#review-form input[name=\'recommend\']:checked').val()){ var recommend = $('#review-form input[name=\'recommend\']:checked').val(); } $.ajax({ url: 'index.php?route=product/product/write&product_id=3270', type: 'post', dataType: 'json', data: 'name=' + encodeURIComponent($('#review-form input[name=\'name\']').val()) + '&email=' + encodeURIComponent($('#review-form input[name=\'email\']').val()) + '&cellphone=' + encodeURIComponent($('#review-form input[name=\'cellphone\']').val()) + '&text=' + encodeURIComponent($('#review-form textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('#review-form input[name=\'rating\']:checked').val() ? $('#review-form input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('#review-form input[name=\'captcha\']').val()) + '&recommend=' + recommend, beforeSend: function () { $('#button-review').button('loading'); }, success: function (json) { $('.alert-success, .alert-danger').remove(); $('#button-review').button('reset'); if (json['error']) { $('#button-review').before('
' + json['error'] + '
'); } if (json['success']) { $('#review-form .modal-header').html('

Agradecemos sua avaliação

'); $('#review-form .modal-body').fadeOut('fast'); setTimeout(function(){ $('#review-form').modal('hide'); }, 3000); $('input[name=\'name\']').val(''); $('input[name=\'email\']').val(''); $('input[name=\'cellphone\']').val(''); $('textarea[name=\'text\']').val(''); $('input[name=\'rating\']:checked').prop('checked', false); $('input[name=\'captcha\']').val(''); $('').insertBefore($('#review-radios1')); $('#captcha').attr('src', 'index.php?route=tool/captcha#' + new Date().getTime()); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.responseText); } }); }); $('#review-form').on('show.bs.modal', function(){ $('.captcha-image').each(function(){ if (!$(this).hasClass('loaded')) { let captcha_image = ''; captcha_image = captcha_image ? 'data:image/jpeg;base64,' + captcha_image : 'index.php?route=tool/captcha'; $(this).attr('src', captcha_image); $(this).addClass('loaded'); } }); }); $("#review-form").on('show.bs.modal', function(){ $('#review-form .modal-header').html('

Faça uma avaliação

'); $('#review-form .modal-body').fadeIn('fast'); }); $('#ups_country').change(function(){ if($(this).val() == 30){ $('input[name=postcode]').mask('99999-999'); } else{ $('input[name=postcode]').unmask(); } }); $(document).ready(function () { /*$('.thumbnails').magnificPopup({ type: 'image', delegate: 'a', gallery: { enabled: true } });*/ $('input[name=postcode]').mask('99999-999'); $('.cellphone').mask('(99)9999-99999'); $('.button-top-fixed').click(function () { $('html,body').animate({scrollTop: 0}, 1); }); if (window.screen.width > 999) { filterBoxTop = $('.button_float_mark').offset().top; filterBoxHeight = $('.button_float_mark').height(); $(window).scroll(function () { if (0 > filterBoxTop - $(window).scrollTop() + filterBoxHeight) { $('.button-top-fixed').fadeIn('slow'); $('.product-floating').fadeIn('slow'); } else { $('.button-top-fixed').fadeOut('fast'); $('.product-floating').fadeOut('fast'); } }); } }); $('input[name=\'postcode\']').keydown(function (e) { if (e.keyCode == 13) { $('#button-quote_product').click(); } }); $('.notify-btn').on('click', function () { $('#product_notify').remove(); var product_id = $(this).attr('data-product-id'); var floating = $(this).data('floating'); var data_product_option_id = $(this).attr('data-product-option-id'); var data_product_option_value_id = $(this).attr('data-product-option-value-id'); if(screen.width >= 992){ $('
').insertBefore('#details-product'); $('#details-product').hide(); $('#product_notify').load('index.php?route=product/notify&product_id=' + product_id + '&data_product_option_id=' + data_product_option_id + '&data_product_option_value_id=' + data_product_option_value_id); if(floating == 1){ $('html, body').animate({ scrollTop: $("#product_notify").offset().top }, 500); } } else { html = ''; $('body').append(html); $('#notify-content').load('index.php?route=product/notify&product_id=' + product_id + '&data_product_option_id=' + data_product_option_id + '&data_product_option_value_id=' + data_product_option_value_id); $('#modal-notify').modal('show'); if(floating == 1){ $('html, body').animate({ scrollTop: $("#product_notify").offset().top }, 2000); } } }); var no_zoom = 1; if(no_zoom == 0){ $('#preview').click(function(e) { counter = 0; pagination = 0; current_id = $('.image-additional.current-img').attr('data-image-id'); $('#modal-thumbnails').remove(); e.preventDefault(); html = ''; $('body').append(html); $('#modal-thumbnails').modal('show'); loadGallery(true, 'a.thumbnail'); updateGallery($('[data-image-id="' + current_id + '"]')); }); } function updateGallery(selector) { current_image = selector.data('image-id'); if($('.product_stock_image.current-img').length) { if($('#preview').attr('src').trim() == $('.product_stock_image.current-img').attr('data-original-image').trim()) { $('#image-gallery-image').attr('src', $('.product_stock_image.current-img').attr('data-original-image')); } else { $('#image-gallery-image').attr('src', $('[data-image-id="' + current_image + '"]').attr('data-zoom')); } } else { $('#image-gallery-image').attr('src', $('[data-image-id="' + current_image + '"]').attr('data-zoom')); } disableButtons(counter, current_image); } function disableButtons(counter_max, counter_current){ $('#show-previous-image, #show-next-image').show(); if(counter_max == 1){ $('#show-next-image').hide(); $('#show-previous-image').hide(); } else if(counter_max == counter_current){ $('#show-next-image').hide(); } else if (counter_current == 1){ $('#show-previous-image').hide(); } } function loadGallery(setIDs, setClickAttr){ var current_image = $('.image-additional.current-img').attr('data-image-id'), selector; $('#show-next-image, #show-previous-image').click(function(){ if($(this).attr('id') == 'show-previous-image'){ if(current_id > 1){ current_id--; } } else { current_id++; } selector = $('[data-image-id="' + current_id + '"]'); updateGallery(selector); }); if(setIDs == true){ $('[data-image-id]').each(function(){ counter++; $(this).attr('data-image-id',counter).attr('src'); }); } $(setClickAttr).on('click',function(){ updateGallery($(this)); }); } /* $('.product_options_list').click(function (e) { var target = e.target; if(!$(target).hasClass('sizes') && !$(target).hasClass('swal2-styled') && !$(target).attr('src')){ $('#product > div.row.options_list > div > div > ul > li.sizes').removeClass('selected'); $('.text-danger').remove(); $('input[id^=\'input-option\']').val('') } }); */ function number_format(number, decimals, dec_point, thousands_point) { if (number == null || !isFinite(number)) { throw new TypeError("number is not valid"); } if (!decimals) { var len = number.toString().split('.').length; decimals = len > 1 ? len : 0; } if (!dec_point) { dec_point = '.'; } if (!thousands_point) { thousands_point = ','; } number = parseFloat(number).toFixed(decimals); number = number.replace(".", dec_point); var splitNum = number.split(dec_point); splitNum[0] = splitNum[0].replace(/\B(?=(\d{3})+(?!\d))/g, thousands_point); number = splitNum.join(dec_point); return number; } $('input[name="quantity_grid"]').focus(function(){ if($('.optionValueQuantity').length >= 1) { $('.optionValueQuantity').remove(); } }); function totalQuantity() { setTimeout(() => { $('.total-stock-div').removeAttr('hidden'); if($('.optionValueQuantity').length >= 1) { $('.optionValueQuantity').remove(); } let total_stock_quantity = 0; let price_element, price_special_element, price_special_old_element, currency, price, price_special, new_price = 0, new_price_special = 0, product_price_discount, parcel_simulator, simulator_element, simulator_price, simulator_parcel_element, total_stock_element, input_id = []; price_element = $('h2.price'); price_special_element = $('h2.price'); price_special_old_element = $('.price_old_product span:last-of-type'); currency = 'R$ '; price = '32.42'; price_special = ''; product_price_discount = '15.00'; parcel_simulator = '3'; simulator_element = $('.price_simultador_product strong:nth-last-child(2)'); simulator_parcel_element = $('.price_simultador_product strong:nth-last-child(3)'); total_stock_element = $('div.total-stock-div'); if (product_price_discount) { product_price_discount = (100 - product_price_discount) / 100; } $('.quantity-grid').each(function() { if (!$(this).val() == ''){ if (input_id.includes($(this).prop('id'))) { return; } else { input_id.push($(this).prop('id')); } var value = parseInt($(this).val()); var max_quantity = parseInt($(this).attr('max')); var total_stock_quantity_value = 0; if( value > max_quantity) { total_stock_quantity_value = max_quantity; $(' Quantidade inserida acima da quantidade total do estoque ').insertAfter('.afterSizes'); $(this).val(max_quantity); } else { total_stock_quantity_value = value; } total_stock_quantity = total_stock_quantity + total_stock_quantity_value; if ($(this).closest('.sizes').data('content')) { let operation_and_value = $(this).closest('.sizes').data('content').split('|'); let operation = operation_and_value[0]; let stock_value = operation_and_value[1]; if (operation === 'mor' && stock_value > 0) { new_price += (parseInt(total_stock_quantity_value) * (parseFloat(price) + parseFloat(stock_value))); } else if (operation === 'sub' && stock_value > 0) { new_price += parseInt(total_stock_quantity_value) * (parseFloat(price) - parseFloat(stock_value)) } else { new_price += parseInt(total_stock_quantity_value) * parseFloat(price); } } else { new_price += parseInt(total_stock_quantity_value) * parseFloat(price); } if (price_special) { if ($(this).closest('.sizes').data('content')) { let operation_and_value = $(this).closest('.sizes').data('content').split('|'); let operation = operation_and_value[0]; let stock_value = operation_and_value[1]; if (operation === 'mor' && stock_value > 0) { new_price_special += (parseInt(total_stock_quantity_value) * (parseFloat(price) + parseFloat(stock_value))) * product_price_discount; } else if (operation === 'sub' && stock_value > 0) { new_price_special += (parseInt(total_stock_quantity_value) * (parseFloat(price) - parseFloat(stock_value))) * product_price_discount; } else { new_price_special += parseInt(total_stock_quantity_value) * parseFloat(price_special); } } else { new_price_special += parseInt(total_stock_quantity_value) * parseFloat(price_special); } } if (total_stock_quantity >= 2 || ($(this).closest('.sizes').data('content') && total_stock_quantity >= 1)) { simulator_parcel_element.text(parcel_simulator + 'x'); let new_price_formated = ''; new_price_formated = new_price.toFixed(2); simulator_price = parseFloat(new_price) / parseInt(parcel_simulator); simulator_price = simulator_price.toFixed(2); new_price_formated = new_price_formated.toString(); simulator_price = simulator_price.toString(); new_price_formated = new_price_formated.replace('.', ','); simulator_price = simulator_price.replace('.', ','); price_element.text(currency + new_price_formated); simulator_element.text(currency + simulator_price); if (price_special) { let new_price_special_formated = ''; new_price_special_formated = new_price_special.toFixed(2); simulator_price = new_price_special / parseInt(parcel_simulator); simulator_price = simulator_price.toFixed(2); new_price_special_formated = new_price_special_formated.toString(); simulator_price = simulator_price.toString(); new_price_special_formated = new_price_special_formated.replace('.', ','); simulator_price = simulator_price.replace('.', ','); price_special_element.text(`Por ${currency + new_price_special_formated}`); price_special_old_element.text(currency + new_price_formated); simulator_element.text(currency + simulator_price); } } else { simulator_parcel_element.text(parcel_simulator + 'x'); simulator_price = parseFloat(price) / parseInt(parcel_simulator); simulator_price = simulator_price.toFixed(2); simulator_price = simulator_price.toString(); simulator_price = simulator_price.replace('.', ','); price = price.replace('.', ','); price_element.text(currency + price); simulator_element.text(currency + simulator_price); if (price_special) { simulator_parcel_element.text(parcel_simulator + 'x'); simulator_price = price_special / parseInt(parcel_simulator); simulator_price = simulator_price.toFixed(2); simulator_price = simulator_price.toString(); simulator_price = simulator_price.replace('.', ','); price_special_element.text(`Por ${currency + price_special.replace('.', ',')}`); price_special_old_element.text(currency + price); simulator_element.text(currency + simulator_price); } } } }); $('.total-stock-div .total-stock-content span').text(total_stock_quantity); }, 100); }