Hello everyone,
I have a product priced at $59.99 and I’ve set up a discount where purchasing two items saves 10%. The total should be $107.98, but in the shopping cart and at checkout, it shows as $108. How can I set it so that the amount displayed includes decimal points instead of rounding to a whole number? Thank you!
Hi,
If things are fine like setting, theme updation etc. , then need to use a script to force Decimals
script example
document.addEventListener('DOMContentLoaded', function() {
let priceElements = document.querySelectorAll('.price');
priceElements.forEach(function(el) {
let price = parseFloat(el.textContent.replace(/[^0-9.-]+/g,""));
el.textContent = price.toFixed(2);
});
});
Thank you for your help! Could you please tell me where I should add this script?
Hi @AimeeJones
If the price is wrong on both the checkout page and the cart page.
You can install the application Haptech: B2B/wholesale . This App automatically discounts for products.There is a free version
Please see the images.