Thursday, 27 June 2013

How to display the product price with tax in product list/view page.

Follow the steps to achieve this.
1. Sign in to Magento Admin Panel
2. Go to System > Configuration
3. Click on ‘Tax’ listed under Sales
4. Go to ‘Calculation’ and set ‘tax based on’ to ‘Shipping Origin’
5. Go to ‘Display’ and set ‘Display Cart/Order Prices’ to ‘including and excluding tax’
6. Go to ‘Display’ and set ‘Display Product Prices’ to ‘including and excluding tax’
7. Save the Configuration

Wednesday, 5 June 2013

Magento - remove trailing slash from urls

Open app\code\core\Mage\Core\Block/Abstract.php and find the getUrl() method, it should just be one line of code that returns the requested URL:


return $this->_getUrlModel()->getUrl($route, $params);
Replace that line with the following:


$return_url = $this->_getUrlModel()->getUrl($route, $params);
if ($return_url != $this->getBaseUrl() && substr($return_url, -1) == '/' && !Mage::getSingleton('admin/session')->isLoggedIn()):
    return substr($return_url, 0, -1);
else:
    return $return_url;
endif;