
Originally Posted by
dcmall
Hi, wonder if anyone have any clue how to customize the checkout_sucess page so that different messages can be display upon completing final step - Confirm the Order - based on the payment method processed.
E.g.
1. If the Payment Method = Cheque / Money Order
Message: Your order has been received. Please note that your order will be delivered upon confirmation of payment. Please ensure you quote your order number when making payment.
2. If the Payment Method = Express Check out with Paypal
Message: Your order has been received and payment confirmed. Your order will be processed for shipment the next working day.
3. If the Payment Method = Cash on Delivery
Message: Your order has been received. We will be in touch with you by the next working day to arrange your delivery appointment.
Thanks in advance.
dcmall

Originally Posted by
DrByte
You'd need to set a session variable in the checkout_process header_php.php before the unset() of session-payment information.
Then read that session variable in the checkout_success header_php.php, and then unset that session variable after reading its value.

Originally Posted by
dcmall
DrByte,
How to I set a session variable in checkout_process header_php.php and how do I read the session variable in the checkout_success header_php.php?
I know where to open the two files, but when it comes to coding, I really do not know how to set and read the session variable for the above said purpose.
I know nuts of php. Appreciate if you could give some guidance.
Looking forward to your prompt guidance...
Perhaps you'll consider making a donation to the Zen Cart project for this custom code:
1. edit /includes/modules/pages/checkout_process/header_php.php
Add the slashes, as shown:
Code:
// unset($_SESSION['payment']);
2. edit /includes/modules/pages/checkout_success/header_php.php
after this:
Code:
// if the customer is not logged on, redirect them to the shopping cart page
if (!$_SESSION['customer_id']) {
zen_redirect(zen_href_link(FILENAME_TIME_OUT));
}
SCRATCH THAT ... look for this instead:
Code:
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
and add this below it:
Code:
$payment_instructions_message = 'Thank you for your order';
if (defined('TEXT_PAYMENT_MESSAGE_' . strtoupper($_SESSION['payment']) )) $payment_instructions_message = constant('TEXT_PAYMENT_MESSAGE_' . strtoupper($_SESSION['payment']) );
unset($_SESSION['payment']);
3. Edit /includes/languages/english/YOURTEMPLATE/checkout_success.php
Add new defines for each of your required payment modules, following the pattern:
Code:
define('TEXT_PAYMENT_MESSAGE_MONEYORDER', 'Your order has been received. Please note that your order will be delivered upon confirmation of payment. Please ensure you quote your order number when making payment.');
define('TEXT_PAYMENT_MESSAGE_PAYPALWPP', 'Your order has been received and payment confirmed. Your order will be processed for shipment the next working day.');
define('TEXT_PAYMENT_MESSAGE_COD', 'Your order has been received. We will be in touch with you by the next working day to arrange your delivery appointment.');
4. edit /includes/templates/YOURTEMPLATE/templates/tpl_checkout_success_default.php
find this:
Code:
<div id="checkoutSuccessOrderNumber"><?php echo TEXT_YOUR_ORDER_NUMBER . $zv_orders_id; ?></div>
add this on a line below it:
Code:
<div id="checkoutSuccessMessage"><?php echo $payment_instructions_message; ?></div>