I know that in catalog.xml this line effects all layouts:
<action method="setColumnCount"><columns>5</columns></action>
But I want to change the number of columns based upon specific page layouts, i.e.: 2columns with left bar, 3 columns, etc.
This is what someone said to do but I am not sure I was adding the update tag in the right spot because it didn't seem to work. Also if you read the comments they say once you turn caching back on it breaks it: http://www.lotusseedsdesign.com/blog/change-grid-view-column-4-product-listing
So does anyone know how to use the addColumnCountLayoutDepend method or any other way to change the number of columns on the product grid specific to the page layout?
In order to apply custom layout updates for your product pages, you'll need to put an . XML file in a specified folder ( app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/layout/ ). The layout update from that . XML file will then appear under Custom Layout Update as a selectable option.
For sub category page, in app/design/frontend/Your Interface/layout/catalog.xml change columns value the following line :
<action method="setColumnCount"><columns>4</columns></action>
For root category page, in app/design/frontend/Your Interface/template/catalog/product/list.phtml find the following code in "Grid Mode" section and change with appropiate value :
<?php $_columnCount = $this->getColumnCount(); ?>
like
<?php $_columnCount = 4; ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With