Latest Articles

[Extension] Easily generate custom grid in Magento Backoffice

A colleague of mine has recommended to me this great extension that lets the backoffice user customize all the grids on the Magento Backoffice. You can add new columns to your order, products or other grids with just few clicks. Download | Enhanced Admin Grids (+ Editor)

Programmatically set product position in a category in Magento

Today I had to reorder products in a category. Basically, our client wanted to put the products with special price at the end. After trying to do this with the category model in Magento, I finally run into the Category Api. It worked like a charm, even though it works kind of slow. Here you […]

Passing arguments to a Magento Shell script

Using Magento Api to create shell scripts seems to be easy, but there are too many things to take into account to get the most of it. In this case, I want to explain how to pass an argument from the command line when executing a magento shell script. You have to call the script […]

Solving reindex issues with Product Flat Data in Magento

For the past 2 years we’ve run into a reindex issue when reindexing product flat data in Magento more than once. Basically, we wet something like: The key is here: That is telling you which table is failing. This exception tells that the referential integrity between: catalog_product_flat_2.entity_id and catalog_product_entity.entity_id is corrupted. This usually means some […]

The most useful [active] Magento blogs

Ever since I started programming in Magento/PHP, I had the need to find Magento blogs with useful tips and up-to-date information (Magento changes very quickly along with how things have to be done with it as well). After almost two years I’ve only found a few blogs that are up to date and useful. I […]

Executing cron tasks manually in Magento

Usually I’ve been asked about how to run a cron task manually. A cron task defined in Magento is not anything else than a function that belongs to a model that is loaded and executed. For example, we have this cron task on a config.xml file of a specific module: It’s easy to identify the […]

How to use Solr as a search engine for Magento

We recently upgraded a Magento Community Edition 1.4 to a Magento Enterprise Edition 1.11. Once the upgraded was done and everything was working fine, our client started complaining about the fact that the search results where not good in comparison to the previous version they had (with Magento CE 1.4). After doing some research we […]

Empty the cart programatically in Magento

One of the last things I had to implement in Magento was a function to empty the customer cart. At first I found this great extension made by the Inchoo people, but it did much more than I needed. Having a controller to do this is fair enough, and the only code you need to […]

How to create a custom setup script in Magento

During the past days we have had some problems when updating our Magento custom modules. Oddly, even though we created the mysql4-upgrade file and edited the config.xml with the new version, the upgrade script wouldn’t run. Why? We don’t know. But we needed a quick solution because there was an important issue in the production […]

Magento search not working properly, how to improve search results?

My experience has shown me that the default Magento search is really bad, it doesn’t matter if you’re using the Community version or the Enterprise one: search results are always bad, even if you don’t have too many products in your catalogue (less than 200). Here are some tips on how to improve the search: […]