DarrenBull Posted August 5, 2005 Share Posted August 5, 2005 Hi All, I'm very new to osCommerce and am trying to implement alittle ROI tracking code into the checkout_success pagMy code sits at the very bottom of the checkout_success page and works fine however I would like to propagate 2 veriables with information regards the customer. Can anyone please supply the PHP required to pull the customer ID and total order value? The version of osCommerce I'm using is commented as follows: /* $Id: checkout_success.php,v 1.49 2003/06/09 23:03:53 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ Many thanks, Darren. Link to comment Share on other sites More sharing options...
Guest Posted August 5, 2005 Share Posted August 5, 2005 You can get customer id from the global $customer_id. I think the includes\classes\shopping_cart.php has all the info you need to set up this. Link to comment Share on other sites More sharing options...
boxtel Posted August 5, 2005 Share Posted August 5, 2005 Hi All, I'm very new to osCommerce and am trying to implement alittle ROI tracking code into the checkout_success pagMy code sits at the very bottom of the checkout_success page and works fine however I would like to propagate 2 veriables with information regards the customer. Can anyone please supply the PHP required to pull the customer ID and total order value? The version of osCommerce I'm using is commented as follows: /* $Id: checkout_success.php,v 1.49 2003/06/09 23:03:53 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ Many thanks, Darren. <{POST_SNAPBACK}> $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); $orders = tep_db_fetch_array($orders_query); $order_total_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where class = 'ot_total' and orders_id = '" . $orders['orders_id'] . "'"); $order_total_result = tep_db_fetch_array($order_total_query); echo 'Total Order Value: ' . $order_total_result['text'] . '<br>'; echo 'Your Customer Id: ' . $customer_id; Treasurer MFC Link to comment Share on other sites More sharing options...
DarrenBull Posted August 5, 2005 Author Share Posted August 5, 2005 OK - I'll give it a go later tonight and let you know how I get on. Many many thanks! :'( $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1"); $orders = tep_db_fetch_array($orders_query); $order_total_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where class = 'ot_total' and orders_id = '" . $orders['orders_id'] . "'"); $order_total_result = tep_db_fetch_array($order_total_query); echo 'Total Order Value: ' . $order_total_result['text'] . '<br>'; echo 'Your Customer Id: ' . $customer_id; <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
DarrenBull Posted August 5, 2005 Author Share Posted August 5, 2005 OK - fantastic!! Awesome!! Many thanks... Worked great!! :D One little point.. could it be posisble to have the price without the currency symbol? :P OK - I'll give it a go later tonight and let you know how I get on. Many many thanks! :'( <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
boxtel Posted August 5, 2005 Share Posted August 5, 2005 OK - fantastic!! Awesome!! Many thanks... Worked great!! :D One little point.. could it be posisble to have the price without the currency symbol? :P <{POST_SNAPBACK}> yes, echo 'Total Order Value: ' . $order_total_result['value'] . '<br>'; Treasurer MFC Link to comment Share on other sites More sharing options...
DarrenBull Posted August 6, 2005 Author Share Posted August 6, 2005 :D Massive thanks!! Worked like a charm :D yes, echo 'Total Order Value: ' . $order_total_result['value'] . '<br>'; <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
DarrenBull Posted August 7, 2005 Author Share Posted August 7, 2005 Aghhh... my bad. I made a mistake... :-" I don't need the customer id.. I really require the order id. Do you know how I could get that instead. Sorry .. :blush: :D Massive thanks!! Worked like a charm :D <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
kayakbabe Posted August 8, 2005 Share Posted August 8, 2005 I'm doing the same roi tracking stuff... I need to figure out how to get the tax on it's own. I've managed to get the order product count, total, model numbers all into comma delmited strings so I can pass it to my tracking software. But I seem to be stumped on the tax. There doesn't seem to be any order total for tax that I can find. Do you guys have any ideas? Once I get this thing done, I'm going to make a contribution for hbx webside story. I think everyone using hitbox will find it useful. But I still need to figure out a few tidbits of info and this is one of them. Kelly Aghhh... my bad. I made a mistake... :-" I don't need the customer id.. I really require the order id. Do you know how I could get that instead. Sorry .. :blush: <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
boxtel Posted August 8, 2005 Share Posted August 8, 2005 Aghhh... my bad. I made a mistake... :-" I don't need the customer id.. I really require the order id. Do you know how I could get that instead. Sorry .. :blush: <{POST_SNAPBACK}> echo 'Your Order Number: ' . $orders['orders_id'] . '<br>'; Treasurer MFC Link to comment Share on other sites More sharing options...
boxtel Posted August 8, 2005 Share Posted August 8, 2005 I'm doing the same roi tracking stuff... I need to figure out how to get the tax on it's own. I've managed to get the order product count, total, model numbers all into comma delmited strings so I can pass it to my tracking software. But I seem to be stumped on the tax. There doesn't seem to be any order total for tax that I can find. Do you guys have any ideas? Once I get this thing done, I'm going to make a contribution for hbx webside story. I think everyone using hitbox will find it useful. But I still need to figure out a few tidbits of info and this is one of them. Kelly <{POST_SNAPBACK}> tax is on the product so that is stored in the orders_products table. Treasurer MFC Link to comment Share on other sites More sharing options...
DarrenBull Posted August 8, 2005 Author Share Posted August 8, 2005 Hi, When I use the suggestion below to display the price without the currency symbol, the price seems to have a few extra 0's at the end. Like this 21.9900 Any ideas why? Thanks, Darren. yes, echo 'Total Order Value: ' . $order_total_result['value'] . '<br>'; <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
DarrenBull Posted August 11, 2005 Author Share Posted August 11, 2005 Anyone?? Please :( Hi, When I use the suggestion below to display the price without the currency symbol, the price seems to have a few extra 0's at the end. Like this 21.9900 Any ideas why? Thanks, Darren. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
boxtel Posted August 11, 2005 Share Posted August 11, 2005 Anyone?? Please :( <{POST_SNAPBACK}> because that is the way it is fixed in order total. I guess it has to do with the number of decimals as defined in your currency definition but am not sure. In any event, that value is not formatted as the text field is so you get it plain. You can alway use a round function to trim it to 2 decimals. Treasurer MFC Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.