Teste - Não Comprar
SKU:
R$ 1,00
Preço unitário
/
Indisponível
const installment_functioninstallment_product6763087593550_87977 = () => {
const productValue = Number(100 / 100);
const parcels = Number('6');
const feeTax = Number('0');
const minParcel = Number(50,00);
const optJuros = 'sem_juros';
const hasTax = optJuros === 'sem_juros' ? false : true;
const startTax = Number(2);
const parcelNoTax = productValue / parcels;
const feeTaxDecimal = feeTax / 100;
let qtdParcelView = 0;
let parcelValue;
let viewParcel;
let labelText = '';
for (let i = 1; i <= parcels; i ++) {
if(hasTax && i >= startTax){
parcelValue = (productValue * feeTaxDecimal) / (1 - Math.pow(1 + feeTaxDecimal, -i));
}else{
parcelValue = productValue / i;
}
if(parcelValue <= minParcel){
break
}else{
viewParcel = parcelValue;
qtdParcelView = i;
if(hasTax){
labelText = i < startTax ? 'sem juros' : 'com juros';
}else{
labelText = 'sem juros';
}
}
}
if(qtdParcelView > 1){
const parentEl = document.querySelector(`.custom-parcels[data-product-id="installment_product6763087593550_87977"]`);
const changeValue = parentEl.innerHTML.replace('#parcel#', qtdParcelView).replace('#priceParcel#', viewParcel.toLocaleString('pt-BR', {minimumFractionDigits: 2,maximumFractionDigits: 2})).replace('#labelParcel#', labelText);
parentEl.innerHTML = changeValue;
parentEl.style.display = 'block';
}
}
const intervalInitinstallment_product6763087593550_87977 = setInterval(() => {
if (typeof installment_functioninstallment_product6763087593550_87977 === 'function'){
installment_functioninstallment_product6763087593550_87977();
clearInterval(intervalInitinstallment_product6763087593550_87977);
}
}, 500)