Denys06 Posted April 27, 2014 Share Posted April 27, 2014 (edited) 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 April 28, 2014 by Denys06 (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted April 27, 2014 Share Posted April 27, 2014 (edited) Hi Denys, Which page exactly would you like them ordered? (URL to a specific page on your site would be good) Which PS version do you use? pascal Edited April 27, 2014 by PascalVG (see edit history) Link to comment Share on other sites More sharing options...
Denys06 Posted April 27, 2014 Author Share Posted April 27, 2014 Hello, I MP you for the link because my site is in production. I would like to ordered by name the product in "PACK" into the product page. Currently it's ordered by product ID. Link to comment Share on other sites More sharing options...
PascalVG Posted April 27, 2014 Share Posted April 27, 2014 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 More sharing options...
Denys06 Posted April 27, 2014 Author Share Posted April 27, 2014 Thank you very much PascalVG, you're a Master ! Work perfectly Link to comment Share on other sites More sharing options...
PascalVG Posted April 28, 2014 Share Posted April 28, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now