If this is your first visit, check our documentation. To post, register or login.
Forums / Managing Customers and Orders / Sort items by model name on the order page.

Sort items by model name on the order page.

Started by repgard on 30 Jan 2011, 8:11 AM · Views: 1,096

Results 1 to 6 of 6
30 Jan 2011, 8:11 AM
#1
repgard avatar

repgard

New Zenner

Join Date:
Jan 2011
Posts:
8
Plugin Contributions:
0

Sort items by model name on the order page.

When I go to admin/customers/orders and then choose an order and then edit it or click invoice, I would like it to sort the items by the module name. I can't seem to sort them by anything nor does it appear to be sorted in any specific order.

How would I make it display the model name in apha numeric order?

30 Jan 2011, 2:17 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sort items by model name on the order page.

You can customize the order class in the Admin around line 115 and change the order by to use the module:

      $orders_products = $db->Execute("select orders_products_id, products_id, products_name, products_model,
                                              products_price, products_tax, products_quantity,
                                              final_price, onetime_charges,
                                              product_is_free
                                       from " . TABLE_ORDERS_PRODUCTS . "
                                       where orders_id = '" . (int)$order_id . "'
                                       order by orders_products_id");

try using:

      $orders_products = $db->Execute("select orders_products_id, products_id, products_name, products_model,
                                              products_price, products_tax, products_quantity,
                                              final_price, onetime_charges,
                                              product_is_free
                                       from " . TABLE_ORDERS_PRODUCTS . "
                                       where orders_id = '" . (int)$order_id . "'
                                       order by products_model, orders_products_id");

and see if that gives the results that you are looking for ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Feb 2011, 2:46 PM
#3
repgard avatar

repgard

New Zenner

Join Date:
Jan 2011
Posts:
8
Plugin Contributions:
0

Re: Sort items by model name on the order page.

In the admin? Do you mean admin.php?

1 Feb 2011, 3:45 PM
#4
repgard avatar

repgard

New Zenner

Join Date:
Jan 2011
Posts:
8
Plugin Contributions:
0

Re: Sort items by model name on the order page.

I went to admin/orders.php and did not find this code. I am using zencart version 1.3.9g. What file am I supposed to change?

1 Feb 2011, 3:55 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Sort items by model name on the order page.

This is in the order class file in:
/your_secret_admin_dir/includes/classes/order.php

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

1 Feb 2011, 4:09 PM
#6
repgard avatar

repgard

New Zenner

Join Date:
Jan 2011
Posts:
8
Plugin Contributions:
0

Re: Sort items by model name on the order page.

That appears to have done the trick. THANK YOU.