Jump to content

Need to add multiple sort in list of products inside category page


s.elettronew

Recommended Posts

Hi guys,

 

I need to put a multiple sort parameters in the page of category. Actually, i sort my products with "sales" parameters. But i would like add to sales, also "quantity DESC". But i don't understand how can i edit this , because in my front controller "ProductListingFrontController.php" is used a Hook called actionProductSearchProviderRunQueryAfter and i don't know how it work.



 

            $encodedSortOrder = 'product.sales.DESC';
            Hook::exec('actionProductSearchProviderRunQueryAfter', array('query' => $query->setSortOrder(SortOrder::newFromString(
                $encodedSortOrder
            )))); 


Ideally a would like obtein this result: "SELECT... FROM .....ORDER BY sales DESC, quantity DESC, but how can i do this in my front controller?

Immagine 2022-09-12 165459.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...