Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 4 of 4
best selling products/ most viewed
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

One more option to show bestselling or most viewed products is to use new sorting options from the Improved Sorting for the default product grid.

The evident benefits are:
1) customers can look for the bestsellers, the most rated or the most viewed products within one category
2) no additional blocks needed, no annoying ads, customers decide how to sot on their own
3) easy to integrate with any custom theme, easy to install, easy to use.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cleanline
Jr. Member
 
Total Posts:  21
Joined:  2009-10-29
 

Does anyone know how to get this to display the “starting at” price?  I have grouped products that show this on the products list page but I can’t seem to get it to be displayed in this block.

Any suggestions?

Thanks,

Chris

 
Magento Community Magento Community
Magento Community
Magento Community
 
couchboy
Jr. Member
 
Total Posts:  16
Joined:  2010-11-13
 

How can I edit the CSS for the widget’s products? I don’t want to modify the other items, but only dealing with the products within this widget. I’ve tried with the widgets.css file with no luck.

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
teksatan
Jr. Member
 
Total Posts:  1
Joined:  2012-02-27
 

I know this is old but i just wanted to clerify something here

<?php if ($i>5): continue; endif; ?>

Don’t use this. As it would continue to iterate through each item after the max was reached. this wastes your host’s resources the proper line would be.

<?php if ($i>5): break; endif; ?>

The “break” exits the foreach loop.

You could shorten this slightly like this:

<?php if($i>5) break; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
mellog
Jr. Member
 
Total Posts:  29
Joined:  2010-05-22
 
wallysson - 06 September 2010 09:26 AM

English Version Best Seller And most Viewed
Magento Version: 1.4.1.1
Status: Working website RH Super (Just using Bestseller)

------------------------------------------------------------------------------------------------

Hey guys, just try to do wha jazkatt sayd…
Step by step to make this work:

1. Download all the updated files files(i have updated them):
If you would like to download the original files posted by cristache, the link is:
http://www.magentocommerce.com/boards/viewthread/14764/P15/

2. When you download all the files, Edit these lines:
(if you have downloaded the updated files, jump to the third step)

<?php mainBlock('top'?>
<?php title('top'?>
<?php title('bottom'?>
<?php contentBlock('top'?>
<?php contentBlock('bottom'?>
<?php mainBlock('bottom'?>

Just open each PHTML file and edit them(Just have 2 files)

3. When you have finished, put all the files in the correct folder.
Place *.php files here: /public_html/app/code/core/Mage/Catalog/Block/Product
Place *.phtml files here: /public_html/app/design/frontend/*/*/template/catalog/product
(The * is your template folder)

4. Now, you will create static blocs at the main menu of your admin system. Acess these menu:
CMS -> static blocs -> new block

In the page to create the new block, fill the form with the required information.
The unique information you need to put, and can’t be diferent is the form content and it will be filled with this value:
{{block type="catalog/product_bestseller" template="catalog/product/bestseller.phtml"}}
fill the name as Bestseller

Do the same think whith the most viewed, create an static block and fill the content value with:
{{block type="catalog/product_mostviewed" template="catalog/product/mostviewed.phtml"}}
fill the name as Mostviewed

5. The next step is to put the block working on the fist page
Acess the menu system: CMS -> pages ->home -> content

Desabilite the editor text, clicking at “Show / Hide Editor”
After clicking on it, click on the button: “Insert Widget”

An new window will open, choose CMS static block at the dropdown
And hit the button: Select

An grid with all static blocks will be showed, choose your static block and hit “Insert Widget” at the top of the window,
An variable of the system like this should appear at the text form:

{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="6"}}

6. Now, styling… Edit pages HTML from PHTML the way you want. Put styles, divs and everything you need.
The variable {{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="6"}} can pe puted inside divs at the content home page.

If you do all the steps, should be working nice!
------------------------------------------------------------------------------------------------

Any help, ask me at:
Se alguém precisar de uma tradução galera…
Posso estar traduzindo também…

Me enviem um email caso seja necessário!
Good luck Guys!

For me steps 3 and 4 worked perfect. I found a decent discription how to add a static block in a phtml file here
http://www.phptechi.com/how-to-add-static-block-in-magento.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  427
Joined:  2009-02-03
 

Thanks guys!

To display configurable products I am currently using a workaround, that displays all products, visible or not. Simply comment out the two lines starting Mage::getSingleton in Bestseller.php to do so.
Now I just need to get the url of the parent product instead of the simple products url…

 
Magento Community Magento Community
Magento Community
Magento Community
 
smallperson
Jr. Member
 
Total Posts:  4
Joined:  2012-09-19
 

This is great. I have it working, but I can’t figure out how to show more than 5 products. Does any one know how this is done?

 
Magento Community Magento Community
Magento Community
Magento Community
 
smallperson
Jr. Member
 
Total Posts:  4
Joined:  2012-09-19
 

Thank you for your quick reply. That link has really helped.

What I have done is changed this from 5 to 8 in app/design/frontend/default/YourTheme/template/catalog/product/mostviewed.phtml

<?php $_collectionSize 8;//count($_products->getItems()); echo $_collectionSize; ?>

<?php $i=1; foreach ($_products->getItems() as $_product): ?>
    
<li class="item" <?php if($i%8==or $i==$_collectionSize){echo 'class="last"';} ?> >

And this line in app/code/local/Mage/Catalog/Block/Product/Mostviewed.php

$products->setPageSize(8)->setCurPage(1);

I had to tweak the code to accommodate my css, now it is doing exactly what I want.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vjtemplates
Guru
 
Avatar
Total Posts:  408
Joined:  2010-12-15
Washington, USA
 

This theme includes NEW, SALE, FEATURED, BEST-SELLING, MOST-VIEWED, TOP-RATED out of the box.

http://www.magentocommerce.com/magento-connect/responsive-theme-white-lily-9163.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
Zodiac Media
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2010-11-03
London
 

Hi,

Up until recently we made use of the ‘addOrderedQty’ method from the class Mage_Reports_Model_Resource_Product_Collection to achieve a Bestsellers page but we noticed that the results this generated didn’t match up with actual orders.

We did some investigation work and found out this was down to inconsistencies with the data stored in the ‘sales_flat_order_item’ table.  We’ve no firm idea what caused this data to not match up with reality but we managed to work around it by creating our own ‘addOrderedQty’ method.  You can read about our work here:

http://www.zodiacmedia.co.uk/blog/magento-bestselling-products

Or download our resulting Magento Widget from Magento Connect here:

http://www.magentocommerce.com/magento-connect/zodiac-media-bestsellers.html

If anybody else has run into problems with the data in the ‘sales_flat_order_item’ table I’d like to hear from you and whether you figured out what caused them.

Thanks,

Billy

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jase007
Guru
 
Total Posts:  388
Joined:  2013-11-05
 

Hi,

You can also check this thread best selling products/ most viewed

Hope this will help you!!

Thanks

iLoveMage

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 4 of 4