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

500 Internal Server Error: Mismatch between target GID (XXX) and GID (XXX) of file

Today (at the time of writing) I tried to install Magento 1.7.0.0 via SSH as ‘root’ user using following bash script: #!/bin/bash wget http://www.magentocommerce.com/downloads/assets/1.7.0.0/magento-1.7.0.0.tar.gz wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz tar -zxvf magento-1.7.0.0.tar.gz tar -zxvf magento-sample-data-1.2.0.tar.gz mv magento-sample-data-1.2.0/media/* magento/media/ mv magento-sample-data-1.2.0/magento_sample_data_for_1.2.0.sql magento/data.sql mv magento/* magento/.htaccess . chmod -R o+w media mysql -u dbUserName -pdbPass dbName < data.sql chmod o+w …

Read more