monito Posted October 4, 2006 Posted October 4, 2006 I would like to add an extra column, next to orders total column in the orders.php in the admin area with the quantity total ordered . I can display the column without problems, but I don't know how to get the quantity total from each order. Thanks, PL
ComicWisdom Posted October 4, 2006 Posted October 4, 2006 I would like to add an extra column, next to orders total column in the orders.php in the admin area with the quantity total ordered . I can display the column without problems, but I don't know how to get the quantity total from each order. Thanks, PL Find this line in orders.php $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, 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 where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC"; Add into the list o.products_quantity This is from the table orders_products so you would need to add "o left join . TABLE_ORDERS_PRODUCTS. ' just before ot on (o.orders_id etc) then put o.products_quantity in the output line for the correct column Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!! Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience. The quickest way to learn is to forget to BACKUP!
monito Posted October 4, 2006 Author Posted October 4, 2006 I'm getting the following error: 1066 - Not unique table/alias: 'o' select count(*) as total from orders o left join orders_total o left join orders_products ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' Here is my code: $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.products_quantity, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " o left join " . TABLE_ORDERS_PRODUCTS . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by $order"; Thanks for the help, Pat
Recommended Posts
Archived
This topic is now archived and is closed to further replies.