Friday, June 10, 2011

Fixing Product Grid bug resetting to 3 columns when cache is enabled

In Magento Commerce, if you edit layout/catalog.xml in your theme as follows:

   
       
       
       
           
       




The above layout XML code should make category/catalog page use 2 columns left page layout, and the Product Grid will use 4 columns.

Note: The above code should also be applied to the "catalog_category_layered" layout handle.

However, there is a bug as of Magento 1.5.1.0. If cache is not active, then Product Grid correctly uses 4 columns.
But if cache is active, the first page view will use 4 columns, yet the subsequent page views use 4 columns in Product Grid.

Even doing this still doesn't work:

three_columns4

I'm not sure what causes this, but there is a solution to this problem although it's more of a workaround:

It's not ideal, but at least it works: (source)


4

Another workaround is easier to do but will hurt performance: Disable layout cache :(

To learn more about designing themes for Magento, I highly recommend Magento 1.4 Themes Design book with great reviews.

3 comments:

  1. Orange Mantra are into the Magento development world since quite a while, serving the worldwide customers.

    ReplyDelete
  2. This traffic to the site has more chance of conversion success as users have already searched for exactly what they are looking for and after spending time reading the ecommerce article will then go on to look at the services available.

    Regard-

    Magento development

    ReplyDelete