any ideas how to get orderTotal and orderId inside the tpl_checkout_success_default for the conversions tracking purposes ?
So far it looks like order id can be accessed by using this variable $zv_orders_id but how to get order total ?
will this code work:
$orders_query = "SELECT * FROM zen_orders WHERE orders_id = " . $zv_orders_id ." LIMIT 1";
$orders = $db->Execute($orders_query);
$order_total = $orders->fields['order_total'];
many thanks, cheers
look in /includes/modules/pages/checkout_success/header_php.php
in there you will see the queries already being run by zencart
to do with your order, and id say its already pulling out the info you want.
so you just need to set said data you need to a variable that you can then use in your tpl_checkout_success_default.php
file.
eg, something like $customer_has_gv_balance
, you will see where it is set in the hearder file and then used in the template file
heres something i found in order.php
that would almost do it as is:
$order_total_query = "select text, value
from " . TABLE_ORDERS_TOTAL . "
where orders_id = '" . (int)$order_id . "'
and class = 'ot_total'";
$order_total = $db->Execute($order_total_query);