Zen Cart Logo
Forums / Basic Configuration / Is it possible to sort by status?

Is it possible to sort by status?

Locked

Views: 838

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
21 Jul 2009, 4:00 PM
#1
sasylu avatar

sasylu

New Zenner

Join Date:
Jul 2009
Posts:
2
Plugin Contributions:
0

Is it possible to sort by status?

We have just had a catalogue revamp and are in the process of entering alot of new stuff, i have disabled all the old stock for now but is it possible to get the admin side to sort by status rather than change the model numbers

many thanks

22 Jul 2009, 3:51 PM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Is it possible to sort by status?

Yes, but you'll have to modify a couple of files:

Edit admin/categories.php
find this section of code at about line 625

        array('id' => '6', 'text'=> TEXT_SORT_PRODUCTS_PRICE_DESC)
        );

change it to this

        array('id' => '6', 'text'=> TEXT_SORT_PRODUCTS_PRICE_DESC),
        array('id' => '7', 'text'=> 'Products Status')
        );

Now edit admin/includes/modules/category_product_listing.php
Find this line of code at about line 92

      case (6);

and add this line immediately after it:

      case (7);

Now find this section of code at about line 211

      case (6);
        $order_by = " order by p.products_price_sorter DESC, pd.products_name";
        break;

and add this immediately after it:

      case (7);
        $order_by = " order by p.products_status, pd.products_name";
        break;

(the pd.products_name shown in the code above can be replaced with p.products_model if you want the secondary sort to be by model number)

Neville
An assumption is what you arrive at when you get tired of thinking...