Tuesday 15 June 2010

How to show sort by most popular(most sold) products on product listing page in Magento? -


To display the best-selling product type based on the option (filtering) to display on the product list page in Magenta Using the following tutorial?

Enter image details here < P> /app/code/local/Mage/Catalog/Model/Resource/Product/collection.php

  & lt ;? Php Public Function SortBirviewView ($ dir) {$ table = $ this- & gt; Receivable ('review / review'); $ Entity_code_id = Mage :: getModel ('review / review') - & gt; GetEntityIdByCode (Mage_Rating_Model_Rating :: ENTITY_PRODUCT_CODE); $ Cond = $ this- & gt; Mill Connection () - & gt; In quote ('t2.entity_pk_value = e.entity_id and', ''). $ This- & gt; Mill Connection () - & gt; QuoteInto ('t2.entity_id =?', $ Entity_code_id); $ This- & gt; GetSelect () - & gt; Joint Left (array ('t2' => $ Table), $ cond, Array ('review' => New Zend_Db_Expr ('count (review_id)'))) - & gt; Group ('e.entity_id') - & gt; Order ("review of $ dir"); }? & Gt;   

But I want to sort the products that are sold the most from every category.

How can I do this? Is there any free extension available for this?

I did the following thing as the customer did not want to automatically filter the most sold products

I have created a "popular" property as drop down and give value from 1 to 5. Then " is used for sorting in the product list " yes

This option was then visible under sorting options.

No comments:

Post a Comment