I would like to customise the New Products Grid.
I've set up a new widget using "Manage Widget Instances", and selected "Catalog New Products List" as the type.
In Layout Updates, I selected "Main Content Area" and "New Products Grid Template"
On the Widget Options, I selected "New Products" as the display type and entered 10 products to display.
It all works fine - but I would like to change the number of columns from 5 to 3 (or 4, haven't decided!)
How do I do this? Where is the column count set?
Solved! Go to Solution.
its defined in Mage_Catalog_Block_Product_New::_construct
protected function _construct() { parent::_construct(); $this->addColumnCountLayoutDepend('empty', 6) ->addColumnCountLayoutDepend('one_column', 5) ->addColumnCountLayoutDepend('two_columns_left', 4) ->addColumnCountLayoutDepend('two_columns_right', 4) ->addColumnCountLayoutDepend('three_columns', 3); $this->addData(array('cache_lifetime' => 86400)); $this->addCacheTag(Mage_Catalog_Model_Product::CACHE_TAG); }
its easier to rewirte this class, but the best option would be to add a column count option to this widget.
its defined in Mage_Catalog_Block_Product_New::_construct
protected function _construct() { parent::_construct(); $this->addColumnCountLayoutDepend('empty', 6) ->addColumnCountLayoutDepend('one_column', 5) ->addColumnCountLayoutDepend('two_columns_left', 4) ->addColumnCountLayoutDepend('two_columns_right', 4) ->addColumnCountLayoutDepend('three_columns', 3); $this->addData(array('cache_lifetime' => 86400)); $this->addCacheTag(Mage_Catalog_Model_Product::CACHE_TAG); }
its easier to rewirte this class, but the best option would be to add a column count option to this widget.
Thanks. Looks fairly straightforward. Where would I find "Mage_Catalog_Block_Product_New"?
Do you mean this one in Core: /app/code/core/Mage/Catalog/Block/Product/new.php
(I can copy that to Local)
Also, how would I go about adding a column count option to the widget?