Guest Posted March 31, 2005 Posted March 31, 2005 I'm giving AdWords a try and would like to customize their code to reflect the dollar amount of sales generated by them. The code is in place in checkout_success.php with no problems and the variable I need to change is: var google_conversion_color = "BBD3C2"; if (1.0) { var google_conversion_value = 1; } So- if I add this require at the top of checkout_success: require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; and then change the google variable so: var google_conversion_color = "BBD3C2"; if (1.0) { var google_conversion_value = <?php echo $order_total_modules ?>; } Would that pass the correct information (the order total) back to AdWords/Google? Or am I way off base?
boxtel Posted March 31, 2005 Posted March 31, 2005 I'm giving AdWords a try and would like to customize their code to reflect the dollar amount of sales generated by them. The code is in place in checkout_success.php with no problems and the variable I need to change is: var google_conversion_color = "BBD3C2"; if (1.0) { var google_conversion_value = 1; } So- if I add this require at the top of checkout_success: require(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; and then change the google variable so: var google_conversion_color = "BBD3C2"; if (1.0) { var google_conversion_value = <?php echo $order_total_modules ?>; } Would that pass the correct information (the order total) back to AdWords/Google? Or am I way off base? <{POST_SNAPBACK}> this way you are passing the order_total class to google, they will be surprised. the order total is retrieved and displayed like: $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><br>'; so you pass $order_total_result['value'] which only contains the value without the currency symbols etc. Treasurer MFC
Guest Posted March 31, 2005 Posted March 31, 2005 this way you are passing the order_total class to google, they will be surprised. the order total is retrieved and displayed like: $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><br>'; so you pass $order_total_result['value'] which only contains the value without the currency symbols etc. <{POST_SNAPBACK}> Hmm, I can't find that method used anywhere on my catalog to view an example- I did find this though: $order_total_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'"); $order_total = tep_db_fetch_array($order_total_query); But I still can't find how that info is displayed in the checkout pages? Would I just change ot_total in the variable to order_total?
boxtel Posted March 31, 2005 Posted March 31, 2005 Hmm, I can't find that method used anywhere on my catalog to view an example- I did find this though: $order_total_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'"); $order_total = tep_db_fetch_array($order_total_query); But I still can't find how that info is displayed in the checkout pages? Would I just change ot_total in the variable to order_total? <{POST_SNAPBACK}> that code is not in there in the default osc, you can put it there. Treasurer MFC
jacobr Posted March 31, 2005 Posted March 31, 2005 this way you are passing the order_total class to google, they will be surprised. the order total is retrieved and displayed like: $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><br>'; so you pass $order_total_result['value'] which only contains the value without the currency symbols etc. <{POST_SNAPBACK}> Amanda, I have attempted to add this code in to display the order total on checkout_success.php with no luck. It is just blank for the order total (i.e. "Total Order Value: "). Can you give a little more help on where exactly to implement your code on the page (does it matter) and if there are any other changes that need to me made in order to implement it? Thanks so much for your help. jacob
jacobr Posted March 31, 2005 Posted March 31, 2005 Amanda, I have attempted to add this code in to display the order total on checkout_success.php with no luck. It is just blank for the order total (i.e. "Total Order Value: "). Can you give a little more help on where exactly to implement your code on the page (does it matter) and if there are any other changes that need to me made in order to implement it? Thanks so much for your help. jacob <{POST_SNAPBACK}> Nevermind, got it squared away. Was missing a semicolon... :blush: jacob
Recommended Posts
Archived
This topic is now archived and is closed to further replies.