How to find the current URL in Magento?

You must be wondering we can simply use: $currentUrl = Mage::helper(‘core/url’)->getCurrentUrl() or $currentUrl = Mage::getUrl(‘*/*/*’, array(‘_current’ => true)); in order to find the current URL. But it doesn’t always work as expected. Try to use the above code in a page which has some missing CSS, js, images, etc.(You can use Firebug in order to …

Read more

Debugging technique in Magento: Process of elimination

Introduction: Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Source: Wikipedia Nobody is perfect so don’t expect an application to be perfect. As a developer you may face many bugs during your …

Read more

Clear abandoned cart items during login in Magento

You may have noticed that old cart items (abandoned) get merged with the current one when the customer tries to log in. It’s good in terms of sales but sometimes your merchant simply may not want this feature. In this case, we can easily clear the abandoned cart items and stop being merged with the …

Read more