This is a really cool block. Can someone help me with another? I would like a block to query 5 special price items listing them in order of the most viewed.
I could probably figure it out eventually but I am afraid it might have to query two separate models or maybe not. I have seen examples that use the catalog product collection where special price seems to be available and then this one which uses reports product collection where the addViewCount can be added. As you can tell I am still trying to figure this modeling out.
Hello everyone,
I managed to show on homepage Bestselles & Most viewed products with Magento 1.3.2.2. You can find attachet the necessary files.
Here are the steps (you have to create necessary folders if they do not already exist):
1. Place *.php files here: /public_html/app/code/local/Mage/Catalog/Block/Product
2. Place *.phtml files here: /public_html/app/design/frontend/*/*/template/catalog/product
3. Create a block in your CMS for each section (Bestsellers & Most Viewed) and place this in your Content:
<p>{{block type="catalog/product_bestseller" template="catalog/product/bestseller.phtml"}} </p> - for bestsellers
<p>{{block type="catalog/product_mostviewed" template="catalog/product/mostviewed.phtml"}} </p> - for mostviewed
4. Call your blocks from CMS/Manage pages/Homepage/Custom design:
<block type="cms/block" name="bestsellers" as="banner"><action method="setBlockId"><id>bestsellers</id></action></block>
<block type="cms/block" name="mostviewed" as="banner"><action method="setBlockId"><id>mostviewed</id></action></block>
I don’t know if there is a better way, but what’s important, it worked for me this way. You can see it in action here
I am getting the following error when I use cristache’s instructions.
Fatal error: Call to undefined function mainblock() in /home6/theserap/public_html/store/app/design/frontend/default/magesupport/template/catalog/product/mostviewed.phtml on line 2
Sorry maxmin & ikelewis,
I am not a programmer, I only wanted to put together the files and instructions I found also on this forum. The fact is this method works for me with magento 1.3.2.3.
Cheers,
Cristi
I am getting the following error when I use cristache’s instructions.
Fatal error: Call to undefined function mainblock() in /home6/theserap/public_html/store/app/design/frontend/default/magesupport/template/catalog/product/mostviewed.phtml on line 2
Any help would be greatly appreciated.
Don’t use the files that cristache left , use the code posted by int2k.
@jimfraseruk - I did get this to work...I’m not sure if it was the using the same information here. This was a little while ago...let me rummage through and put some stuff up here for ya in a little bit.