Hi, me again!
I think that in checkout_one_confirmation/header_php.php there is a problem with the message stack.
Here's the code that handles the "translation" of messages to the correct class of message:
Code:
if ($error || $messageStack->size('checkout_payment') > 0 || !$order_confirmed) {
// -----
// Need to "redirect" any messages to 'checkout' (issued by ot_coupon and possibly others) so they display properly
// on the checkout_one page.
//
if ($messageStack->size('checkout') > 0) {
foreach ($messageStack->messages as $i => $current_message) {
if ($current_message['class'] == 'checkout') {
$messageStack->messages[$i]['class'] = 'checkout_payment';
}
}
}
$checkout_one->debug_message("Something causing redirection back to checkout_one, error ($error), order_confirmed ($order_confirmed)" . var_export($messageStack->messages, true) . var_export($ot_total, true));
zen_redirect(zen_href_link(FILENAME_CHECKOUT_ONE, '', 'SSL'));
}
The problem is that the method $messageStack->size includes a reset of the variable $_SESSION['messageToStack'] which means that one loses all the add_session messages.
I think you need to do something like:
Code:
$temp['checkout_payment'] = 0;
$temp['checkout'] = 0;
if (count($messageStack->messages)) {
foreach ($messageStack->messages as $m) {
switch ($m['class']) {
case 'checkout_payment':
$temp['checkout_payment']++;
break;
case 'checkout':
$temp['checkout']++;
break;
default:
break;
}
}
}
if ($error || $temp['checkout_payment'] > 0 || !$order_confirmed) {
// -----
// Need to "redirect" any messages to 'checkout' (issued by ot_coupon and possibly others) so they display properly
// on the checkout_one page.
//
if ($temp['checkout'] > 0) {
foreach ($messageStack->messages as $i => $current_message) {
if ($current_message['class'] == 'checkout') {
$messageStack->messages[$i]['class'] = 'checkout_payment';
}
}
}
$checkout_one->debug_message("Something causing redirection back to checkout_one, error ($error), order_confirmed ($order_confirmed)" . var_export($messageStack->messages, true) . var_export($ot_total, true));
zen_redirect(zen_href_link(FILENAME_CHECKOUT_ONE, '', 'SSL'));
}
Nick
Bookmarks