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);
    }

Displaying Category name on Magento Product page

The trick is very simple and easy to do. Using the view.phtml file of your theme that can be found on app/design/frontend/your-package/your-theme/template/catalog/product/view.phtml. Open it and add the following code:

 
		foreach ($cats as $category_id) {
		$_cat = Mage::getModel('catalog/category')->setStoreId(Mage::app()->getStore()->getId())->load($category_id);
		echo $_cat->getName();             
		}

Categories