I've been searching for 2 days trying to figure this out. I'm not finding any documentation on how to list products on the home page, that explains this function.
I have this in my content space for my home page in the cms. I know this is the home page because I can type stuff in and see it when I refresh.
{{block type="catalog/product_list" category_id="2" column_count="3" product_count="18" limit="18" template="catalog/product/list.phtml" }}
If I change the template to list-home.phtml it only shows 3 products, no matter what I try.
I've seen and tried variations on the type from product_list to product_list_random and product_list_new.
(apparently I have no new products, lol)
I have Magento ver. 1.9.2.1
It doesn't seem to be paying attention to any of the details - category id, column count, product count, and limit.
I'd like to display 18 products, in 3 columns, from featured or new products. (or even a specific category if I have to add them to a category to show them this way.)
I am not understanding the nuances here, and even if my variables are the right ones. Am I using the right method?
You need to leave the type and template alone. Alter the category_id, column_count, product_count, and limit.
Pick the category you want to show products from (or make a new one) and grab the ID from the Catalog->Manage Categories page. The ID will appear next to the title in parenthesis like this: Featured Products (ID: 3)
See, that's the problem. The things you say not to change are the only ones that make anything change. It's ignoring the category, count and limit, no matter how I spell it. All products from all categories show, paginated in groups of 24 (I set this number in the product list settings.)
Am I using the wrong thing to do this? I pasted that code into my home page content, in cms.
{{block type="catalog/product_list_random" category_id="133" column_count="3" product_count="18" product_limit="18" count="18" limit="18" template="catalog/product/list.phtml" }}
Hello
I'm taking about Magento 1.
Magento is a complicated platform. I think we must spend more time on learning it. If you want to understand how Magento works, the best way is that you should look into Magento code lines.
{{block type="catalog/product_list" category_id="2" column_count="3" product_count="18" limit="18" template="catalog/product/list.phtml" }}
-type="catalog/product_list" => It's catalog product list block, you can find app/code/core/Mage/Catalog/Block/Product/List.php. In this file, you can see many methods: getLoadedProductCollection(), _getProductCollection(),setCategoryId(), getCategoryId(), etc. For example: when you set category_id = 2 => getCategoryId() will get your category id = 2. In your template, it will calls a function $this->getLoadedProductCollection() to get your some configurations xml.
Magento will ignore "wrong" config in xml layout, e.g: column_count, limit. => Actually, Magento doesn't have methods to process your "new" config elements. You can rewrite this block and add more methods to process them.
Ok, none of this answered my question. I've spent many hours in the meantime looking up solutions, trying them, failing, looking more, failing more...
this is my site http://ropes.courses.
I have 1 website, 5 stores, and 1 store view per store.
It ignores the category I've chosen.
It ignores the number of items to limit the display to.
I want each site to shown it's own products, but not all of the products in the store, just the products in it's own category.
each category I'm using is marked:
is active - yes
include in navigation - yes
is anchor - yes
The home page I've been fussing with is http://cheappower.tools/ (power tools in the top menu)
I added this code to the home page, design tab, "layout update XML" field.
<reference name="content"> <block type="catalog/product_list_random" name="featured" template="catalog/product/list-home.phtml"> <action method="setCategoryId"><category_id>175</category_id></action> <action method="setItemLimit"><limit>18</limit></action> </block> </reference>
3 products show.... (175 is a child category for this store)
I tried changing it to this
<reference name="content"> <block type="catalog/product_list_random" name="random" template="catalog/product/list.phtml"> <action method="setCategoryId"><category_id>215</category_id></action> <action method="setItemLimit"><limit>18</limit></action> </block> </reference>
3 products show... (215 is the main category for this store)
I can't find any guides about what variables work here. One discussion seems to indicate I need to change the code in the list page (by making one that won't get overwritten)
What other info can I post here so I could get an answer? Am I missing some documentation on this somewhere?
Ok, so, it seems that if I pick a child category, and not a root category, it works as expected - the category I choose and the qty,
If I choose one of my 5 root categories, it draws from the whole database.
I set my categories up like this
store 1
child 1
child 2
child a1
child a2
child 3
store 2
child 1
child 2
child a1
child a2
child 3
store 3
child 1
child 2
child a1
child a2
child 3
Should they all be in one main root category, and each store then uses it's own sub category?
Also, when I go into catalog, products, there's a drop down for "store view" and all 5 stores have all the items in them.