Remove decimals from configurable product option price update script in Magento

Many time you need to remove decimal places from magento prices. In this post we going to check the code that can be used to remove decimal places when price is updated by selection of configurable product options –

in file js/varien/product.js about line 773:

change this:

formatPrice: function(price) {
            return formatCurrency(price, this.priceFormat);
        }

to this:

formatPrice: function(price) {
        this.priceFormat.requiredPrecision = 0;
        return formatCurrency(price, this.priceFormat);
    }

Categories

Faster Magento Hosting Faster WordPress Hosting