SCH_001 Posted January 17, 2020 Share Posted January 17, 2020 Hi All, I regularly use Multi Products Manager v2.9 to move products from place to place in the shop but have a need to be able to sort the list by status. The code is not that old "28th July 2019 Multi Products Manager v2.9" but the tread has been archived.. Can anyone assist me with this? I can post the php if that will help Link to comment Share on other sites More sharing options...
♥ecartz Posted January 17, 2020 Share Posted January 17, 2020 ORDER BY p.products_status DESC If it's ordered in the wrong direction, remove the DESC. That would go at the end of the SQL query and may replace another ORDER BY clause that is already there. For more help than that, you'd have to post at least the relevant SQL query. Always back up before making changes. Link to comment Share on other sites More sharing options...
SCH_001 Posted January 17, 2020 Author Share Posted January 17, 2020 It's currently arranged by Product name but would like to be able to have a few options at the top to arrange the list by <?php $categories_count = 0; $rows = 0; if ($_REQUEST['search']) { if($cat_stat==1) { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from categories c, categories_description cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and cd.categories_name like '%" . $_REQUEST['search'] . "%' order by c.sort_order, cd.categories_name"); } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from categories c, categories_description cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and cd.categories_name like '%" . $_REQUEST['search'] . "%' order by c.sort_order, cd.categories_name"); } } else { if($cat_stat==1) { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from categories c, categories_description cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name"); } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from categories c, categories_description cd where c.parent_id = '" . $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by c.sort_order, cd.categories_name"); } } while ($categories = tep_db_fetch_array($categories_query)) { $categories_count++; $rows++; Link to comment Share on other sites More sharing options...
SCH_001 Posted January 17, 2020 Author Share Posted January 17, 2020 Opps that was search let me look again Link to comment Share on other sites More sharing options...
SCH_001 Posted January 17, 2020 Author Share Posted January 17, 2020 I can not find where it would be File attached products_multi.php Link to comment Share on other sites More sharing options...
mhsuffolk Posted January 17, 2020 Share Posted January 17, 2020 Line 247 and 249 Change in both lines. order by pd.products_name to order by p.products_status DESC Remove DESC if sort is reversed to how you require it. DESC stands for descending. Live shop Phoenix 1.0.8.4 on PHP 7.4 Working my way up the versions. Link to comment Share on other sites More sharing options...
♥ecartz Posted January 17, 2020 Share Posted January 17, 2020 Since there's an existing order by, you might prefer ORDER BY p.products_status DESC, pd.products_name Always back up before making changes. Link to comment Share on other sites More sharing options...
SCH_001 Posted January 17, 2020 Author Share Posted January 17, 2020 Thank you @mhsuffolk and @ecartz this has got me sorted for now... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.