CUBO EIXO INFERIOR COMPATÍVEL PLATAFORMA JOHN DEERE SÉRIE 600 H169076
-
Cód:
021646 -
Disponibilidade:
Em estoque. Envio imediato!
R$ 250,00
em até 6x de R$ 41,67 sem juros
R$ 237,50
5% OFF no PIX
Compartilhe:
' + json['error']['option'][i] + '
' + json['error']['option'][i] + '
');
}
}
}
if (json['error']['recurring']) {
$('select[name=\'recurring_id\']').after('' + json['error']['recurring'] + '
');
}
// Highlight any found errors
$('.text-danger').parent().addClass('has-error');
}
if (json['success']) {
json['product_id'] = $(`input[name="product_id"]`).val();
json['quantity'] = $(`input[name="quantity"]`).val();
Cart.emit('added', json);
if (now) {
location.href = "index.php?route=checkout/cart";
} else {
setTimeout(function () {
new bootstrap.Offcanvas(document.getElementById('offcanvasCart')).show();
}, 100);
}
}
},
error: function (xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
};
$('input[name=quantity]').on('change', function() {
updatePrice($(this).val());
})
function updatePrice(multiplier) {
const elPrice = $('.product-price .product-price-value');
const elPriceOld = $('.product-price .product-price-old-value');
const elPixPrice = $('.product-price .product-pix-value');
const elInstallment = $('.product-price .product-short-installments');
const elInstallmentPrice = $('.product-price .product-short-installment');
const calcFormatted = (el, factor) => {
const raw = parseFloat(el.data('und-value')) || 0;
const result = raw * factor;
return result.toLocaleString("pt-BR", {
style: "currency",
currency: "BRL"
});
};
elPrice.text(calcFormatted(elPrice, multiplier));
elPriceOld.text(calcFormatted(elPriceOld, multiplier));
elPixPrice.text(calcFormatted(elPixPrice, multiplier));
elInstallmentPrice.text(calcFormatted(elInstallment, multiplier));
}