is_file() vs file_exists()

Introduction If you do not know how to use is_file() and file_exists() properly, then you will end up pulling out your hair. Here we will talk about a scenario which will clarify the usage of is_file() vs file_exists(). Case: We are trying to show the gallery images from a table which has the field: ‘imagepath’ …

Read more

Configuring Magento for Development / Debug Mode

Configuring Magento for Development/Debug Mode

Configuring Magento for Development / Debug Mode: 1. Disable Cache System > Cache Management > Select All [check-boxes] > Actions = Disable > Submit 2. Re-Index All System > Index Management > Select All [check-boxes] > Actions = Reindex Data > Submit 3. Disable Compilation System > Tools > Compilation > Disable Note: By default …

Read more

Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration

I got the following error for one of the Magento e-commerce website: Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration After googling it was found that the related headers module was not enabled in Apache. I was able to fix the issue simply by following two commands: …

Read more

Usage of Magento event: core_block_abstract_to_html_after

Introduction There are lots of events in Magento which are dispatched by default. Among them ‘core_block_abstract_to_html_after’ is the one. Recently we have re-developed the Easy Template Path Hints extension using this event as the previous version of the extension has some confliction issues with other modules. In this article we will demonstrate the implementation of …

Read more

How to change default sort order/dir in Magento search results?

Introduction Today we will be discussing how to change the default sort order/dir in Magento search results (simple & advanced). Regarding solution, some say you need to change the /app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php file in order to change the default sort order field and dir. But you don’t need to do so as there is an extremely easy …

Read more