I currently have 4 widgets on my front page that display 4 products each.
At the moment it uses either featured products, special producs or hot products to decide which products to populate the widget with.
I select the product types using the categories.
I'm looking for a way to randomize the products from the specific category.
Best Answer
The are two obvious approaches to achieve this. You can do it either within your theme or create a module that will utilise this functionality.
Within the theme you can just create a template (let's say in
catalog/product/randomize.phtml
) and put the following code in there:and then in your CMS page you put something like this:
The second approach is to create your module with just one
block
, extendMage_Catalog_Block_Product_List
and then implement_getProductCollection
method in almost the same manner as in first approach:Then in your CMS page you can call your block like this: