Say if I created two categories, “Featured” & “New”.. If I use the following code you provided: {{block type="catalog/product_list" category_id="123"}}, would this theoretically function the way I would want it to? I haven’t tinkered around with Magento enough to truly know, as I’m slowly studying the kinks of the screencasts and guides provided, but when I think about it, it seems to make sense.
Featured and New would be its own proprietary categories and since a product can appear in multiple categories at once, this would surely solve the problem. Is the sorting order of products, by default, displayed from newest to oldest? If not, how must one get this sort order to be achieve by default?
We have 4 or 6 products “in the spotlight” on our home page (in a grid) which are manually added to a specific category to show up here, below that is a list of new products (in a list), these are shown automatically based on their id/time. The attachment shows an example.
Is there an easy way to exclude a category with the same code? That way our “spotlight” category doesn’t show up in the new products list and we don’t have to worry about adding new products to a seperate list each day.
And how do we use that piece of code twice without it throwing errors?
Hi moshe..
I’ve tried the code you suggested but it returned some errors…
I’m missing something really simple right?
exception ‘Mage_Core_Exception’ with message ‘Block with name “product_list.toolbar” already exists’ in /home/pablo/workspace/magento/app/Mage.php:371
I’ve attached the hole error thing (didn’t want to spit it out here ...)
thanks for your patience
I am facing a similar issue. I added the following code to my Home page {{block type="catalog/product_list" category_id="4"}} and it works fine. Now what I want to do is add another listing of “Featured products” category to the sidebar. So I tried in my template to add something like:
exception ‘Mage_Core_Exception’ with message ‘Block with name “1203337198” already exists’ in C:\wamp\www\lojatilla\app\Mage.php:346
Stack trace:
#0 C:\wamp\www\lojatilla\app\code\core\Mage\Core\Model\Layout.php(354): Mage::throwException(’Block with name...’)
#1 C:\wamp\www\lojatilla\app\code\core\Mage\Catalog\Block\Product\List.php(100): Mage_Core_Model_Layout->createBlock(’catalog/product...’, 1203337198)
So the problem when we want to have two product lists in the same page (for example, a listing in the home’s content, and other in a sidebar) is that if the toolbar block is created in the same second, it will crash (in core\model\Layout.php):
elseif (isset($this->_blocks[$name])) { Mage::throwException(Mage::helper('core')->__('Block with name "%s" already exists', $name)); }
So what I did is a simple change in Block\Product\List.php in line 100: