cybervirem Posted November 22, 2012 Share Posted November 22, 2012 (edited) Hi, PS 1.5.2 I finally found how to order features in the comparison product data sheet, without renaming features (i mean 01. 02. etc. as it is seen in some posts) I don't konw if it is a good practice, but it works nice edit the classes/Feature.php around line 256 ( function GetFeaturesForComparison(..) ) replace ORDER BY nb DESC by ORDER BY f.`position` ASC then, it will place features as they are ordered in your back end / features (drag/drop features to order them as you want) Maybe it can be added in the next version, just to avoid an ugly unordered list in the comparison result, knowing that features are ordered in the back end/features conf page. Edited November 22, 2012 by cybervirem (see edit history) 5 Link to comment Share on other sites More sharing options...
jorgeferpas Posted January 17, 2013 Share Posted January 17, 2013 Man, I have to give a thousand thanks to you. I was about to suicide. Link to comment Share on other sites More sharing options...
cybervirem Posted January 18, 2013 Author Share Posted January 18, 2013 You're welcome Link to comment Share on other sites More sharing options...
jorgeferpas Posted February 17, 2013 Share Posted February 17, 2013 I have a question. What does the f. mean? I usually see things like that in SQL queries (I have seen pc., pccl., fp., etc.), but I have no idea of what they mean, and I have googled it with no positive results. Link to comment Share on other sites More sharing options...
cybervirem Posted February 17, 2013 Author Share Posted February 17, 2013 have a look to the original source code, in classes/feature.php (line 256) : return Db::getInstance()->executeS(' SELECT * , COUNT(*) as nb FROM `'._DB_PREFIX_.'feature` f LEFT JOIN `'._DB_PREFIX_.'feature_product` fp ON f.`id_feature` = fp.`id_feature` LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON f.`id_feature` = fl.`id_feature` WHERE fp.`id_product` IN ('.$ids.') AND `id_lang` = '.(int)$id_lang.' GROUP BY f.`id_feature` ORDER BY nb DESC '); we can see that "f" stands for table `'._DB_PREFIX_.'feature`, "fp" for `'._DB_PREFIX_.'feature_product`, etc. (it's often used when you need to select from many tables) so if you want to order by features, you need to change to ORDER BY f DESC (instead of ordering by number) Link to comment Share on other sites More sharing options...
mowax Posted November 19, 2014 Share Posted November 19, 2014 thank you for this! works right nice Link to comment Share on other sites More sharing options...
cybervirem Posted November 20, 2014 Author Share Posted November 20, 2014 You are welcome Link to comment Share on other sites More sharing options...
eec Posted July 16, 2015 Share Posted July 16, 2015 Thanks for the solution, it worked PS1.6 also. I have organized a set of 98 features for our 2000+ catalog by manually setting the position valus in ps_feature table, this was what matters most will be on top everywhere, only the comparison was not following which is now solved thanks to this thread! Good Luck Link to comment Share on other sites More sharing options...
cybervirem Posted July 18, 2015 Author Share Posted July 18, 2015 Hi, Thank you very much for feed back 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