Jump to content

[SOLVED] : Organize the list of products PACK alphabetically


Denys06

Recommended Posts

Hello,

 

Can you please tell me how to arrange the list of products contained in a PACK Product alphabetically, not in order of ID as is currently the case?

 

I guess I need to to change something in the file /classes/Pack.php, but I do not know how.

 

Thank you in advance for your help

Edited by Denys06 (see edit history)
Link to comment
Share on other sites

OK, then try this:

 

override/edit the file /classes/pack.php  (make backup, just in case)

 

and find function:  

    public static function getItemTable($id_product, $id_lang, $full = false)

 

 

There edit the SQL statement (add red code): (code sample from ps 1.5.5.0)

...

WHERE product_shop.`id_shop` = '.(int)Context::getContext()->shop->id.'
AND a.`id_product_pack` = '.(int)$id_product.'
GROUP BY product_shop.id_product ORDER BY pl.`name` ';
...

 

see if that helps,

pascal.

Link to comment
Share on other sites

Hi Denys,

good to hear. There are more functions in Pack.php that select rows from the tables, so maybe on other places another function needs to be modified, but this one was for the product.tpl file - pack details.

 

Please mark the topic as solved (see my footer for details)

 

Happy selling,

pascal

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