While this isn’t “random” it will get you a change of products on the homepage.
If you have info on your current home page under CMS collect it all.. save it to a homepage static block.
Make a homepage category under your Root Category, assign the url: home , this will take over your current home page.
Assign the homepage static block with the: products and static block
Apply w/e products you want into the homepage category and you can move around the simple/configurable/grouped products as needed as highlights.
You get the same “effect.”
--------------------------------------
IMO ... having something like:
{{block type="catalog/product_list" category_id="1" category_id="4" random_id="1-100" display_results="{{product_number=’$number’}}" }}
Arg 1) - view type
where: catalog/product_list == list or grid view
Arg 2) - item type
where: category_id == argument of what category to draw items from
where: cateogry_id == a secondary master category to draw items from
or
where: random_id == random call with a range of product id if present to call from
Arg 3) - item amount
where: display_results == how many items to list
Hi, I have the same problem. Without num_products parameter, it shows all (for example 8 products that are the whole shopping now), and if I put the parameter, with any number it shows all too.
Hi, I have the same problem.
With the type="catalog/product_list_random" seems like the “num_product” parameter does not work.
Also, if I try to filter by category with category_id="someid" , doesn’t seem to filter by that either.
The good things are that : first, it effectivly does a random on products. Second : the num_products parameter is correctly sets and passes to the setPage() function. But obviously, this function doesn’t take care of…
So, I opened up the home.phtml template and I see it has hard-coded products. So I created my own theme and copied home.phtml, and modified it so that it was more like list.phtml.
I also changed the type to product_list_random and removed category_id so that I could see random items.
I am still not sure how to limit the items, other than something dodgey in the template like if($i>X).
In any case, this is looking really good. Can’t wait to see some more documentation and examples.
Here is the code i hacked up for the home page listing incase anybody cares to try it:
<?$_productCollection=$this->getLoadedProductCollection()?> <?if(!$_productCollection->getSize()):?> <div class="note-msg"> <?=$this->__('There are no products matching the selection.')?> </div> <?else:?>
On fresh 1.0 stable install, I am getting this error, on that code:
Fatal error: Call to a member function getId() on a non-object in /home/mycardg/domains/mydomain.ge/public_html/app/code/core/Mage/Catalog/Model/Layer.php on line 80