$('input[name="total"]').val(totalDiscount);
$('input[name="totalCost"]').val(total);
if ((applyPromo && discount) || (applyPromo && welcome)) {
$('.result-price__number').html('<span style="text-decoration: line-through;color:black;">' + total + '</span> ' + totalDiscount + "");
// $('p.totalOrderStep2 span').html(totalDiscount + " руб.");
$('p.totalOrderStep2 span').html(totalDiscount + "");
} else {
$('.result-price__number').html(total + "");
// $('p.totalOrderStep2 span').html(total + " руб.");
$('p.totalOrderStep2 span').html(total + "");
}
if (additionalHtml !== "") {
$('.order-result__text').html('<span>Дополнительно:</span> ' + additionalHtml);
} else {
$('.order-result__text').html('');
}
if (additionalPromoHtml !== "") {
$('.order-result__text').append(additionalPromoHtml);
}
if (welcome) {
$('.order-result__text').append("<p> </p><p>Промокод приглашение: " + welcome + " рублей</p>");
}
console.log(total);
};
$('input[name="total"]').val(totalDiscount);
$('input[name="totalCost"]').val(total);
if ((applyPromo && discount) || (applyPromo && welcome)) {
$('.result-price__number').html('<span style="text-decoration: line-through;color:black;">' + total + '</span> ' + totalDiscount + "");
// $('p.totalOrderStep2 span').html(totalDiscount + " руб.");
$('p.totalOrderStep2 span').html(totalDiscount + "");
} else {
$('.result-price__number').html(total + "");
// $('p.totalOrderStep2 span').html(total + " руб.");
$('p.totalOrderStep2 span').html(total + "");
}
if (additionalHtml !== "") {
$('.order-result__text').html('<span>Дополнительно:</span> ' + additionalHtml);
} else {
$('.order-result__text').html('');
}
if (additionalPromoHtml !== "") {
$('.order-result__text').append(additionalPromoHtml);
}
if (welcome) {
$('.order-result__text').append("<p> </p><p>Промокод приглашение: " + welcome + " рублей</p>");
}
console.log(total);
};
Александр, можете отправить готовое решение для нашего варианта?