Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

orders.php excluding certain statuses


pafranklin

Recommended Posts

Hello,

 

I am using osC 2.2 MS2 and I wish to develop a new orders.php page where three certain status are excluded.

 

I have got the following query so far in the orders_raw_query........

 

$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, o.fedex_tracking, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s [color=#FF0000][b]where o.orders_status != 1[/b][/color] and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total'  " . (!is_null($search_query)?$search_query:''). " order by o.orders_id DESC";

 

This excludes any order with a status which equals 1.

 

My question is to ask how can I amend this query to leave out orders with a status of 1, 2 or 3 for example? I am not particularly proficient in this area so would be grateful if someone could assist or point me in the right direction please?

 

Very many thanks.

Paul

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Sorry for the follow up but I next tried this (and it didn't work)......... Any suggestions gratefully recieved........

 

  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, o.fedex_tracking, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s [b][color=#FF0000]where (o.orders_status != 1 OR o.orders_status != 2 OR o.orders_status != 11)[/color][/b] and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total'  " . (!is_null($search_query)?$search_query:''). " order by o.orders_id DESC";

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Dear NodsDorf,

 

Very many thanks - this works perfect and my orders.php can now exclue the statuses I need.

 

Thank you for the replay and assistance!

 

Paul

You will never learn if you don't try. And boy am I trying....!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...