J-works.cz Posted November 23, 2014 Share Posted November 23, 2014 (edited) Hello, I am looking for solution how to order manufacturers in BLOCK MANUFACTURER by my specific order. There are few solutions but none of them I would like to use. I have just few manufacturers and it's number will not be growing much. So I need something to order them and when one or two will be added I need to reorder all of them to make my specific order that I need. I do not want to rename manufacturers like 01, 02, 03 etc because when I have Clean URL, this number (01, 02, 03 ..) will be there. Edited November 23, 2014 by J-works.cz (see edit history) Link to comment Share on other sites More sharing options...
J-works.cz Posted November 23, 2014 Author Share Posted November 23, 2014 I found the solution. If you do not need data about when you added current manufacturer into PrestaShop. Personally I do not need this data. I do not show it anywhere so I can you se it for order my manufacturers in BLOCK MANUFACTURER. 1) Create backup. 2) Edit data in DB table PS_MANUFACTURER - update date of all manufacturers (column DATE_ADD) acording to your specific. First manufacturer with older date, others with date closer to today, etc. 3) Edit file classes/Manufacturer.php. Look for words "ORDER BY m.`name` ASC" (line 177). Change this to: ORDER BY m.`date_add` ASC. 4) .. that is all. Now you have manufacturers ordered according the date in column ADD_DATE all over the site. Link to comment Share on other sites More sharing options...
J-works.cz Posted November 23, 2014 Author Share Posted November 23, 2014 P.S. there is also similar solution but it is based on altering (add one column) the table PS_MANUFACTURER: http://www.prestashop.com/forums/topic/25227-solved-help-how-to-sort-block-manufacturer/?do=findComment&comment=227332 But I think this is cleaner and faster solution. Link to comment Share on other sites More sharing options...
3oh3 Posted December 8, 2014 Share Posted December 8, 2014 Well that one really worked out. Thumbs up and thanks for sharing. Link to comment Share on other sites More sharing options...
Recommended Posts