Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / what loads tpl_checkout_success_default.php

what loads tpl_checkout_success_default.php

Views: 660

Results 1 to 3 of 3
28 Aug 2012, 2:02 PM
#1
nullx8 avatar

nullx8

New Zenner

Join Date:
Aug 2012
Location:
Bangkok, Thailand
Posts:
2
Plugin Contributions:
0

what loads tpl_checkout_success_default.php

is there any structural document out there . .to identify what files are executed ?

my current problem is that (sometimes) in tpl_checkout_success_default.php the variable $zv_orders_id is empty or holds a wrong value.

the confirmation email to the customer is sent correctly, also the order is correct.

it would be nice to know which files are between "send confirmation email" and tpl_checkout_success_default.php

28 Aug 2012, 2:13 PM
#2
nullx8 avatar

nullx8

New Zenner

Join Date:
Aug 2012
Location:
Bangkok, Thailand
Posts:
2
Plugin Contributions:
0

Re: what loads tpl_checkout_success_default.php

i have learned that modules/pages/checkout_success/header_php.php does find the order id

my code seems slightly different (but i can not really see how there a "different order-id could come up"

// find out the last order number generated for this customer account
$orders_query = "SELECT * FROM " . TABLE_ORDERS . "
                 WHERE customers_id = :customersID
                 ORDER BY date_purchased DESC LIMIT 1";
$orders_query = $db->bindVars($orders_query, ':customersID', $_SESSION['customer_id'], 'integer');
$orders = $db->Execute($orders_query);
$orders_id = $orders->fields['orders_id'];

// use order-id generated by the actual order process
// this uses the SESSION orders_id, or if doesn't exist, grabs most recent order # for this cust (needed for paypal et al).
// Needs reworking in v1.4 for checkout-rewrite
if ((!isset($orders_id))&&($orders_id!="")) {
	$zv_orders_id = (isset($_SESSION['order_number_created']) && $_SESSION['order_number_created'] >= 1) ? $_SESSION['order_number_created'] : $orders_id;
	$orders_id = $zv_orders_id;
	$order_summary = $_SESSION['order_summary'];
	unset($_SESSION['order_summary']);
	unset($_SESSION['order_number_created']);
}
if ((!isset($zv_orders_id))||($zv_orders_id =="")) {
	$zv_orders_id = $orders->fields['orders_id'];
}

the other question .. in what file is the email beeing send (because in the email and the order, the ID is always correct)

28 Aug 2012, 8:42 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: what loads tpl_checkout_success_default.php

The "order confirmation" email is sent by the checkout_process "page", just before that page redirects to checkout_success.

You can use your admin's Tools->Developers Tool Kit to search for all the files that use the value $zv_orders_id.