Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi Products Manager v2.9 - Sort order


Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...