"); } }); }); if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) { $.getScript('https://cdn.jsdelivr.net/npm/promise-polyfill@7.1.0/dist/promise.min.js'); } /*Datetimepicker não será mais utilizado $('.date').datetimepicker({ pickTime: false }); $('.datetime').datetimepicker({ pickDate: true, pickTime: true }); $('.time').datetimepicker({ pickDate: false });*/ $('input[id^=\'input-quantity_grid\']').on('blur', function(event) { if($(this).parent().hasClass('packageTrigger')){ var product_option_id = $(this).parent().data('product-option-id'); var product_option_value_id = $(this).parent().data('product-option-value-id'); var product_id = $(this).attr('data-product-id'); var product_package_term = 'O produto em questão será fabricado e enviado no prazo de trinta dias.'; /*Quando o cliente utiliza a ordem de compra do produto e o mesmo possui um prazo para retornar ao estoque*/ $.ajax({ url: 'index.php?route=product/product/checkPurchaseOption&product_option_value_id=' + product_option_value_id + '&product_id=' + product_id, dataType: 'json', async: false, success: function (json) { if(json.success){ product_package_term = json.success; } } }); $('.button-cart').removeClass('animated tada'); swal({ title: 'Produto Sob Encomenda:', html: '
'+product_package_term+'
', type: 'warning', showCancelButton: true, confirmButtonColor: '#61a642', cancelButtonColor: '#d33', confirmButtonText: 'Eu aceito', cancelButtonText: 'Não concordo', }).then(function(result){ if (result.value) { swal({ title : 'Produto Adicionado Com Sucesso!', html: '
Fique atento ao prazo de produção, qualquer dúvida entre em contato
', type: 'success', showConfirmButton: false, timer: 3000, onClose: function() { $('.button-cart').addClass('animated tada'); } }); } else { swal({ title : 'O Produto Não foi Adicionado ao Carrinho', html: '
*Em compras a partir de '+ show_in_cash_discount +'
'; cash_discount_alert = '*'; } prefix = ''; square = false; if(special){ if(!square) { $('.price_old_product span:last-child').html(price + prefix); $('.product_details_content .price, .product-floating .price').html(` Por ${jsonPO.special} ${prefix} ${jsonPO.payment_type ? ''+ jsonPO.payment_type+ '' : '' } `); } if($('.square-calculate-price span').length > 0) { $('.square-calculate-price span').html(special); } if(special_discount){ if($('.avista_price_product .discount_simulator').length){ $('.avista_price_product').html(` ou ${special_discount} à vista ${text_special_porcent} ${text_discount_avista} ${cash_discount_alert} ${cash_discount} `); } else { $('.avista_price_product').html(` ou ${special_discount} à vista ${text_special_porcent} ${text_discount_avista} ${cash_discount_alert} ${cash_discount} `); } } $('.price_simultador_product').html(` ${special} em ${(show_interest_installment == '2' && parcel_simulator && (Number(parcel_simulator) > Number(no_interest_installments)))? `${no_interest_installments}x de ${special_simulator_no_interest}${text_no_interest} ou `: `` } ${parcel_simulator}x de ${special_simulator} ${Number(parcel_simulator) > Number(no_interest_installments) ? text_always_interest : text_no_interest} `); }else{ if(!square) { $('.product_details_content .price, .product-floating .price').html(price + prefix); } if($('.square-calculate-price span').length > 0) { $('.square-calculate-price span').html(price); } if(price_discount){ if($('.avista_price_product .discount_simulator').length){ $('.avista_price_product').html(' ou '+price_discount+' à vista ' + text_special_porcent + text_discount_avista + cash_discount_alert +''+ cash_discount); } else { $('.avista_price_product').html(' ou '+price_discount+' à vista ' + text_special_porcent + text_discount_avista + cash_discount_alert + cash_discount); } } let variationPrice= ''; let interestFree_variation =''; if (show_interest_installment == '2' && parcel_simulator && (parseInt(parcel_simulator) > parseInt (no_interest_installments))){ variationPrice = `${no_interest_installments}x de ${price_simulator_no_interest}${text_no_interest} ou `; }; if (parcel_simulator && (parseInt(parcel_simulator) >= parseInt(no_interest_installments))){ interestFree_variation = `${no_interest_installments}x de ${price_simulator_no_interest}${text_no_interest}`; }else { interestFree_variation= `${parcel_simulator}x de ${price_simulator}${text_no_interest}`; } if (variationPrice) { } $('.price_simultador_product').html(` ${price} em ${variationPrice} ${parcel_simulator}x de ${price_simulator} ${Number(parcel_simulator) > Number(no_interest_installments) ? text_always_interest : text_no_interest} `); if ($('.card_discount_product').length && installments_discount_value) { $('.card_discount_product').html(` ${installments_discount_value}em${installments_discount_parcel}xno cartão `); } } if(json.price_attacked && json.attacked_status){ $('.product-info .price_attacked:not(.min-attacked)').html('Preço de Atacado: ' + json.price_attacked + ''); } if (json.points_option) { $('.reward-points strong').html(json.points_option); } }, 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); } }); var smartHintEnabled = 0; $('#button-quote_product').on('click', function () { var quantity = $('#input-quantity').val(); if (!quantity) { quantity = 1; } total_stock_quantity = 1; if ($('.sizes.selected').length) { var product_option_value_id_size = $('.sizes.selected').attr('data-product-option-value-id'); } else { var product_option_value_id_size = 0; } let width = '11.00'; let height = '6.00'; var params = { "postcode": $('input[name=\'postcode\']').val(), "product_id": '314', "weight": '0.2000', "width": width, "height": height, "days_stock": '0', "price": '40.95', "price_without_currency": '40.95', "product_special_price": '', "price_special_type": '', "special_percent": '', "special_payment_method": '', "quantity_product": quantity, "product_option_value_id_size" : product_option_value_id_size, form: {} }; $('#product input[type=\'text\']').each(function(){ if ($(this).val()) { params['form'][$(this).attr('name')] = $(this).attr('data-product-option-id'); } }); $('#product input[type=\'hidden\']:not(.buy-together-opt)').each(function(){ if ($(this).val()) { params['form'][$(this).attr('name')] = $(this).val(); } }); $('#product input[type=\'radio\']:checked').each(function(){ if ($(this).val()) { params['form'][$(this).attr('name')] = $(this).val(); } }); $('#product input[type=\'checkbox\']:checked').each(function(){ if ($(this).val()) { params['form'][$(this).attr('name')] = $(this).val(); } }); $('#product select:not(.buy-together-opt)').each(function(){ if ($(this).val()) { params['form'][$(this).attr('name')] = $(this).val(); } }); $('#product textarea').each(function(){ if ($(this).val()) { params['form'][$(this).attr('name')] = $(this).val(); } }); var postcodeLength = 9; if($('input[name=postcode]').val().length < postcodeLength) { $('#modal-shipping').empty(); $('#modal-shipping').html('
Para poder realizar o calculo do frete escolha seu numero e a quantidade desejada. '); if (smartHintEnabled == 0) { $('#button-quote_product').button('loading'); $('#button-quote_product').button('reset'); } } else { $.ajax({ url: 'index.php?route=module/shipping/simulate', type: 'post', data: params, dataType: 'json', beforeSend: function () { if (smartHintEnabled == 0) { $('#button-quote_product').button('loading'); } $('
Carregando informações de envio
').insertAfter('#consult_shipping .postcode-inputs'); }, complete: function () { if (smartHintEnabled == 0) { $('#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 += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } } } else if (j == 'mandae'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'jadlog_api'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['location_jadlogPickup']){ if(json['shipping_method'][i]['quote'][j][k]['jadlog_label'] == 'PICKUP'){ html += `
Locais para retirada Jadlog Pickup
`; $.map( json['location_jadlogPickup'], function( n, i ) { html += `
${n['name_stablishment']}
Endereço: ${n['addres']}
Horario de Funcionamento: ${n['time_avaliable']}
${n['saturday']}
${n['sunday']}
Estacionamento: ${n['parking']}
`; }); html += `
`; } } if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'melhor_envio'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'onlog'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'posta_ja'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'neomode'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'frete_q'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'rodoe'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'frenet'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'data_frete') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'intelipost') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'smart_envios') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'kangu') { for (k in json['shipping_method'][i]['quote'][j]) { if (json['shipping_method'][i]['quote'][j][k]['title'] && json['shipping_method'][i]['quote'][j][k]['text'] && json['shipping_method'][i]['quote'][j][k]['delivery_time']){ html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } } else if (j == 'rede_sul' || j == 'ipost') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'mandou_chegou') { for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } } } else if (j == 'correios_api'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } if(json['shipping_method'][i]['quote'][j][k]['error']){ html += ''+json['shipping_method'][i]['quote'][j][k]['error']+''; } if(json['shipping_method'][i]['quote'][j][k]['msgPrazo']){ html += ''+json['shipping_method'][i]['quote'][j][k]['msgPrazo']+''; } } } else if (j == 'super_frete'){ for (k in json['shipping_method'][i]['quote'][j]) { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j][k]['title'] + ' - ' + json['shipping_method'][i]['quote'][j][k]['text']; html += ' '+json['shipping_method'][i]['quote'][j][k]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][i]['quote'][j][k]['info']){ html += ''+json['shipping_method'][i]['quote'][j][k]['info']+''; } } } else if(j == 'clique_retire_correios') { let data = json['shipping_method'][j]; let address = data.quote.clique_retire_correios.locations.address; let name = data.quote.clique_retire_correios.locations.name; html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j]['title'] + ' - ' + json['shipping_method'][i]['quote'][j]['text']; html += ' '+json['shipping_method'][j]['delivery_time']+''; html += ' '+name+''; html += ' '+address+''; html += ''; html += '
'; } else { html += '
'; html += ''; html += json['shipping_method'][i]['quote'][j]['title'] + ' - ' + json['shipping_method'][i]['quote'][j]['text']; html += ' '+json['shipping_method'][j]['delivery_time']+''; html += ''; html += '
'; if(json['shipping_method'][j]['quote']){ for(quote_info in json['shipping_method'][j]['quote']){ html += ''+json['shipping_method'][j]['quote'][quote_info]['info']+''; } } if(json['shipping_method'][i]['quote'][j]['code'] == 'pickup.pickup'){ for (k in json['shipping_method'][i]['locations']){ html += '' + json['shipping_method'][i]['locations'][k]['address'] + ''; } } let is_undefined = typeof json['shipping_method'][i]['quote'][j]['msgPrazo'] !== 'undefined'; if(json['shipping_method'][i]['quote'][j]['msgPrazo'] != '' && is_undefined){ for (k in json['shipping_method'][i]['quote']){ html += '' + json['shipping_method'][i]['quote'][k]['msgPrazo'] + ''; } } } } } 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 += '
2.1 - Dentro do PostImg clique no botão "Escolha as Imagens"
'; html += '
2.2 - Após abrir a janela, selecione a imagem que deseja enviar
'; html += '
2.3 - Assim que o upload for concluído, será exibido os links para compartilhamento, copie o link da primeira opção(opção "Link da imagem") e, dentro da página do produto na loja, cole o texto na área indicada com o nome "Arquivo"