GoneShootin2 Posted February 19, 2008 Posted February 19, 2008 In the admin section, when you view the orders, I'm having problems finding the function that lists the orders in both the admin screens and the email generated to the customer. I did see that it looks like the following actually lists the order: new order($oID) But I can't find the order() function! What I want to do is change the listing order for orders from the current order_id to the product model instead!
GoneShootin2 Posted February 21, 2008 Author Posted February 21, 2008 In the admin section, when you view the orders, I'm having problems finding the function that lists the orders in both the admin screens and the email generated to the customer. I did see that it looks like the following actually lists the order: new order($oID) But I can't find the order() function! What I want to do is change the listing order for orders from the current order_id to the product model instead! Anyone?
burt Posted February 21, 2008 Posted February 21, 2008 Anyone? It's a bit more complicated than you think! You'd need to play with this code (line 361 approx of /admn/orders.php } else { $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, 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.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } You'd need to access the `products_model` in the `orders_products` table doing a join the `orders_id`. Once you got that in the SQL, you then change the "order by" to the `products_model`. What happens if the person ordered two or more products? Anyway, once you overcome that hurdle, you then add a table heading; <td class="dataTableHeadingContent" align="right">MODEL</td> and come contents; <td class="dataTableContent" align="center"><?php echo $orders['products_model']; ?></td> Easy as 123, eh ;)
GoneShootin2 Posted April 20, 2008 Author Posted April 20, 2008 Easy as 123, eh ;) Turns out it was a bit easier than that. I went looking for "function order(" and found it admin/include/classes/order.php. Once there I went to line 80 and added an order by product_model to the following: $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "' ORDER BY products_model"); But thanks burt for pointing me in a general location :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.