Magento – 4 Split / Columns in the grid / Grid view in the frontend

Whether you are the lists- or grid view preferred, it is nevertheless always a problem when you're in the grid- or Grid view changes:

It should(t)in 4 Columns are shown, But there are only 3.

This can have various causes:

  • Im Template (APP) set
  • Specified in the Core Data
  • Data provided in CSS
  • Specified in the backend
  • ….

I myself was standing in front of the problem, that although four columns have been shown, but not with the most right an article “filled” was. What have I done, order and as far as I am anticipating- At the end the right result, 4 Products to get together?

  1. Backend: System > Configuration > Catalog > Shop. This can be used, how the display lists steps for- and will be grid view. Should be here in the grid view, most values ​​are, which also extends through the Divide the number of columns can. Although this has required no immediate impact on the problem but later on it anyway.
  2. CSS: There, I've seen, may be missing if a pixel here or there, or the main area of ​​the main box, so that the width does not fit into four products side by side. Unfortunately this was not a solution.
  3. Template (APP): In Folder /app / design / frontend /[base or default]/[IhrTemplate]/layout/ the file catalog.xml and open about. from line 96 look for the specifications of the columns. Among other things, it says here <action method=”addColumnCountLayoutDepend”><layout>two_columns_right</layout><count>4</count></action> Here, the number of columns to be entered for the two-column layout with right bar. In this case 4 and this was also the, what I wanted. So that did not continue. In the case of the other layouts accordingly. (Selbige settings in one file Incidentally usually repeated in several places for different layouts. Sun e.g.. auch ca. from line 137.) (In connection with this step by step, sometimes directly on top 6 look!)
  4. (TIP!) Another step in the data, the feather edge. can help, especially in newer versions of Magento (1.5 ff.) is an interference with the core data. For this, the file Abstract.php in the folder /app/code/core/Mage/Catalog/Block/Product/ and there about open. in line 55 nach protected protected $_defaultColumnCount = looking at me it was here protected $_defaultColumnCount = 3; I have this on protected $_defaultColumnCount = 4; changed. A tip from a user, which is understandable: Abstract.php not directly change the file, Copy it and then a new folder in local folders in the file is copied, to edit it then, so then it looks like app/code/local/Mage/Catalog/Block/Product/Abstract.php . This would be even more secure update.
  5. One step I have not tried the, I have however found in the course of this research is: In Folder app/[base or default]/[IhrTemplate]/template/catalog/product/ the file list.phtml and then take the following do: <?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper(&#8216;catalog/output&#8217;);

    Search and add this line below:
    $this->setData(&#8216;column_count&#8217;,4);
  6. A fault, of a cause of my problem was: It must be ensured, that the categories and certainly the correct layout is assigned! (Catalog > Edit categories > Own design > Page Layout) There's no, Step 3 to take into account, if the layout is not clear with 2 Right column is defined. So at best this step BEFORE the steps 4-5 and make the same step 3.

 

This has now helped four columns show, and I think, that this summary will also help one or the other.

Used in Magento versions 1.4.1.1 and 1.5.1.0 Comments? Additions? Notes? Gladly!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

6 comments on “Magento – 4 Split / Columns in the grid / Grid view in the frontend”

  1. Hey, very nice explanation helped me 🙂 !!!
    I have no. 5 tried (Magento 1.7) and it works beautifully. Is also particularly well suited, if you want to show different Kategroieübersichten a different number of product columns!

    Thanks for 🙂
    LG Sina

  2. Thanks for the explanation – est days to come would be safe in this solution:)
    I myself have the Step 04 used for our Magento 1.7.0.2 and it worked out fine!!

Leave a Reply

Your email address will not be published. Required fields are marked *