User account menu

  • Log in
BXTra.net

Breadcrumb

  • Home
  • Articles
  • Drupal 6 + Ubercart 2.4 : Display all orders in Order History

Drupal 6 + Ubercart 2.4 : Display all orders in Order History

By BXTra | 11:29 PM PDT, Sun April 24, 2011
Drupal
Ubercart

Our online store doesn't have real time stock online due to integrated software with POS doesn't finish yet. So, we allow customer to place an order, then, contact them back if we really have those items in stock. We also keep those items waiting for them to pay. The problem is that, many times, customer that placed an order with us just don't want to pay at that time. They ignore it until we cancel that order. Then, they place another order a week later or so. That would be ok if it happens a couple times. But some customer, they do this so many times and it's hard for us to check if they re-order the same item or they just place a new order. Also to prevent some customer that come here just to play around. So, what we do is edit "Order History" to show all orders so we can check it.

What I did is to edit "uc_order.admin.inc". Path of the file should be in "/public_html/sites/all/modules/ubercart/uc_order/uc_order.admin.inc"

Edit this file from :

$result = pager_query("SELECT o.order_id, o.created, os.title, SUM(op.qty) AS products, o.order_total AS total FROM {uc_orders} AS o LEFT JOIN {uc_order_statuses} AS os ON o.order_status = os.order_status_id LEFT JOIN {uc_order_products} AS op ON o.order_id = op.order_id WHERE o.uid = %d AND o.order_status IN ". uc_order_status_list('general', TRUE) ." GROUP BY o.order_id, o.created, os.title, o.order_total". tablesort_sql($header), 20, 0, "SELECT COUNT(*) FROM {uc_orders} WHERE uid = %d AND order_status NOT IN ". uc_order_status_list('specific', TRUE), $user->uid);

To

$result = pager_query("SELECT o.order_id, o.created, os.title, SUM(op.qty) AS products, o.order_total AS total FROM {uc_orders} AS o LEFT JOIN {uc_order_statuses} AS os ON o.order_status = os.order_status_id LEFT JOIN {uc_order_products} AS op ON o.order_id = op.order_id WHERE o.uid = %d GROUP BY o.order_id, o.created, os.title, o.order_total". tablesort_sql($header), 20, 0, "SELECT COUNT(*) FROM {uc_orders} WHERE uid = %d AND order_status NOT IN ". uc_order_status_list('specific', TRUE), $user->uid);

That will be it. Now, you can see all orders placed by your customers.

 

Updated (2012.11.29)

It's a bit different in the code in Ubercart 2.10. So, what you have to do is to edit the same file in "/public_html/sites/all/modules/ubercart/uc_order/uc_order.admin.inc".

Search for the line below :

$result = pager_query("SELECT o.order_id, o.uid, o.created, os.title, SUM(op.qty) AS products, o.order_total AS total, o.order_status FROM {uc_orders} AS o LEFT JOIN {uc_order_statuses} AS os ON o.order_status = os.order_status_id LEFT JOIN {uc_order_products} AS op ON o.order_id = op.order_id WHERE o.uid = %d AND o.order_status IN ". uc_order_status_list('general', TRUE) ." GROUP BY o.order_id, o.uid, o.created, os.title, o.order_total, o.order_status". tablesort_sql($header), 20, 0, "SELECT COUNT(*) FROM {uc_orders} WHERE uid = %d AND order_status NOT IN ". uc_order_status_list('specific', TRUE), $user->uid);

Changed it to :

$result = pager_query("SELECT o.order_id, o.uid, o.created, os.title, SUM(op.qty) AS products, o.order_total AS total, o.order_status FROM {uc_orders} AS o LEFT JOIN {uc_order_statuses} AS os ON o.order_status = os.order_status_id LEFT JOIN {uc_order_products} AS op ON o.order_id = op.order_id WHERE o.uid = %d GROUP BY o.order_id, o.uid, o.created, os.title, o.order_total, o.order_status". tablesort_sql($header), 20, 0, "SELECT COUNT(*) FROM {uc_orders} WHERE uid = %d AND order_status NOT IN ". uc_order_status_list('specific', TRUE), $user->uid);

That would be it. Basically, you just need to remove the line below in the code :

AND o.order_status IN ". uc_order_status_list('general', TRUE) ." 

 

Software :
- Drupal 6.20
- Ubercart 2.4
- Ubercart 2.6 (Update 2011.08.01)
- Ubercart 2.10 (update 2012.11.29)

About text formats
  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.

  • Will the router get the Openvpn as a client option?
    6 years ago
  • cancellation
    6 years 1 month ago
  • Router ASUS RT-N12 D1 tomatoes passwort falsch
    7 years 8 months ago
  • WPS button = 30/30/30 hard reset button
    7 years 9 months ago
  • Save my day!
    8 years 3 months ago
  • How to
    8 years 6 months ago
  • Can i still access my modem (the one with the ISP provided)?
    8 years 6 months ago
  • A saving step!
    8 years 10 months ago
  • Problem with Asus n12e-c1
    8 years 11 months ago
  • don't use Hostgator
    9 years 2 months ago

© 2007 - 2023 BXTra.net. All Rights Reserved. 
Certain other content, photos and artwork displayed on BXTra.net are protected by copyright and are the property of their respective owners.

Privacy Policy