Dirty Butter Posted December 8, 2011 Share Posted December 8, 2011 When you choose a Manufacturer while you are creating a new Product the list of Manufacturers is in alphabetical order, which is great! BUT, when you go to create a new manufacturer the list is NOT in alphabetical order. Those I had created previous to the v5 update are in order, but new ones I've added since then are at the bottom of the list. This means it's way too easy to make a duplicate. If the list can be alphabetized in the code in one place surely it can be done in the other????? Quote Link to comment Share on other sites More sharing options...
Guest Viola Posted December 13, 2011 Share Posted December 13, 2011 In /admin/sources/products.manufacturers.inc.php find around line 80: if (($manufacturers = $GLOBALS['db']->select('CubeCart_manufacturers', array('id','image'), false, false, $per_page, $page)) !== false) { and change it to: if (($manufacturers = $GLOBALS['db']->select('CubeCart_manufacturers', array('id','image'), false, "name", $per_page, $page)) !== false) { Not the most elegant solution since it involves changing source code. In theory it should be possible to sort the manufacturers array in the template using this smarty plugin: http://smartcoding.wordpress.com/2009/02/24/smarty-sort-array/ but this didn't work for me. I think there are some security settings in the way and I'm not sure how to get around them. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2011 Author Share Posted December 13, 2011 In /admin/sources/products.manufacturers.inc.php find around line 80: if (($manufacturers = $GLOBALS['db']->select('CubeCart_manufacturers', array('id','image'), false, false, $per_page, $page)) !== false) { and change it to: if (($manufacturers = $GLOBALS['db']->select('CubeCart_manufacturers', array('id','image'), false, "name", $per_page, $page)) !== false) { Not the most elegant solution since it involves changing source code. In theory it should be possible to sort the manufacturers array in the template using this smarty plugin: http://smartcoding.wordpress.com/2009/02/24/smarty-sort-array/ but this didn't work for me. I think there are some security settings in the way and I'm not sure how to get around them. The page was blank when I tried going to Manufacturers. I emptied Cache, but that didn't fix it. Quote Link to comment Share on other sites More sharing options...
Guest Viola Posted December 14, 2011 Share Posted December 14, 2011 The page was blank when I tried going to Manufacturers. I emptied Cache, but that didn't fix it. Odd. I tested it and it worked for me. I've attached my copy of the file - see if that makes any difference. products.manufacturers.inc.php And incidentally, I tested this on version 5.0.6 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 14, 2011 Author Share Posted December 14, 2011 The page was blank when I tried going to Manufacturers. I emptied Cache, but that didn't fix it. Odd. I tested it and it worked for me. I've attached my copy of the file - see if that makes any difference. products.manufacturers.inc.php And incidentally, I tested this on version 5.0.6 That worked!! This is very weird. I tried adding your line 80 from your attached file to MY file to see what I had copied wrong, and it STILL didn't work. But when I use YOUR file it does. So something else must be different in my file??? I'm on 5.0.6, too. I really appreciate all the help you've given me. Would you please suggest this fix for v5.0.7? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.