Jump to content

Prestashop 1.7 - Create a custom sorting method and subsequent display of the products in the categories of the site


Ga3bry

Recommended Posts

I created a new sorting method for products with the "getAvailableSortOrders" function in the 'Ps_FacetedsearchProductSearchProvider' class override but now I can't figure out how to:

Display in the categories of the fronted the products ordered for a field in the manufactures table. The field is called "priority" in the manufactures table and indicates. precisely, the display priority of the products of that brand in the frontend. Where do I create the query and / or method to do this? I still can't understand the mechanism that regulates this process.

private function getAvailableSortOrders(){
    return [
        (new SortOrder('product','priority','asc'))->setLabel(
            $this->module->getTranslator()->trans('MY-CUSTOM-TEXT', array(), 'Modules.Facetedsearch.Shop')
        ),
    ];
}

 

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...