Sorting Products as best seller and Most Popular(based on number of viewing)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
Hi....

I'm using Nop 2.2...

I want to sort products list as best seller and Most Popular(based on number of viewing)...

How can i implement....???

Thank You....
12 年 前
Short step list:
1. You should extend 'Product' entity with two new properties: 'NumberOfSales' and 'NumberOfViews'.
2. Increment them in appropriate cases (when new order is placed and a product details page is viewed)
2. Add these new options to ProductSortingEnum (\src\Libraries\Nop.Core\Domain\Catalog\ProductSortingEnum.cs)
3. Update appropriate methods and stored procedure in order to use these new option (\src\Libraries\Nop.Services\Catalog\ProductService.cs - 'SearchProducts' method and [ProductLoadAllPaged] stored procedure)
12 年 前
a.m. wrote:
Short step list:
1. You should extend 'Product' entity with two new properties: 'NumberOfSales' and 'NumberOfViews'.
2. Increment them in appropriate cases (when new order is placed and a product details page is viewed)
2. Add these new options to ProductSortingEnum (\src\Libraries\Nop.Core\Domain\Catalog\ProductSortingEnum.cs)
3. Update appropriate methods and stored procedure in order to use these new option (\src\Libraries\Nop.Services\Catalog\ProductService.cs - 'SearchProducts' method and [ProductLoadAllPaged] stored procedure)




Thank you so much...

One more thing is ....

i don't want 'Position' in sorting...


How to disable it...????
12 年 前
Just remove appropriate option from ProductSortingEnum enum (and all other places where it is used)
12 年 前
a.m. wrote:
Just remove appropriate option from ProductSortingEnum enum (and all other places where it is used)


How can i hide it using jquery...???
12 年 前
a.m. wrote:
Just remove appropriate option from ProductSortingEnum enum (and all other places where it is used)



I've tried this but did not work...






<script type="text/javascript">
    
$(document).ready(function () {
    
      $("#products-orderby option").each(function () {
          
                if (this.text == "Position") {
              
                     var v = this.value;
                
                $("#products-orderby option[value=" + v + "]").hide();

                
            }
        });
    });
  
  
</script>




got error like this..


uncaught exception: Syntax error, unrecognized expression: [value=http://localhost:3810/jewelry/c-17?orderby=0]
6 年 前
a.m. wrote:
Short step list:
1. You should extend 'Product' entity with two new properties: 'NumberOfSales' and 'NumberOfViews'.
2. Increment them in appropriate cases (when new order is placed and a product details page is viewed)
2. Add these new options to ProductSortingEnum (\src\Libraries\Nop.Core\Domain\Catalog\ProductSortingEnum.cs)
3. Update appropriate methods and stored procedure in order to use these new option (\src\Libraries\Nop.Services\Catalog\ProductService.cs - 'SearchProducts' method and [ProductLoadAllPaged] stored procedure)


I have performed these same steps but not working.

---

I have customized code for the add Custom sorting on Product list or seatch. I have added new field in Database LifetimeSalesAmount DECIMAL.

I have done following changes.

1) Added new property to Product entity
2) Increment them in appropriate cases (when new order is placed)
3) Add these new options to ProductSortingEnum (\src\Libraries\Nop.Core\Domain\Catalog\ProductSortingEnum.cs)
4) Update appropriate methods and stored procedure in order to use these new option (\src\Libraries\Nop.Services\Catalog\ProductService.cs - 'SearchProducts' method and [ProductLoadAllPaged] stored procedure)

Now, New Option is displayed at UI side but after selecting that option products are sorted on default (position) option, but not on my custom option.

Can any suggest? What's Wrong?

---
6 年 前
Find the attached file where i have defined the steps with screen shot.

https://www.dropbox.com/s/tjeo1naprweoos0/Custom%20Sorting%20Issue.pdf?dl=0
6 年 前
Please check any external plugin is installed for product list pages. Like filtering products. If yes then it will overwrite your code and executes the plugin code. Please check it first and also try it with new clean nop project.
6 年 前
True, There is a external plugin issue. Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.