Skip to content
Advertisement

Change filtration method in Opencart 3 Category Bestseller module

I have a module for Opencart 3 – Category Bestseller. It shows the popular categories in which the most items are sold. I would like to change this filter. Make it so that it shows the categories in which the most viewed products. After sorting through the files, I found that this was written in the model.

Here is model file

JavaScript

I think that sorting is here. What I need to change?

JavaScript

Advertisement

Answer

Replace the query string with this. So the categories will be filtered by number of views using the viewed property from the {prefix}_products table.

JavaScript

After changing the model, you need to reset the modification cache.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement