A couple more bugfixes have been posted to the plugin's GitHub repository:
Need to move the customers_auth check to after we know the customer's logged in (there were PHP Notify errors being recorded). Change needed to /includes/modules/pages/checkout_one/header_php.php to move that checking block. Currently:
Code:
// -----
// If the plugin's debug-mode is set to "full", then enable ALL error reporting for the checkout_one page.
//
if (CHECKOUT_ONE_DEBUG == 'full') {
@ini_set('error_reporting', -1 );
}
// -----
// In the "normal" Zen Cart checkout flow, the module /includes/init_includes/init_customer_auth.php performs the
// following check to see that the customer is authorized to checkout. Rather than changing the code in that
// core-file, we'll repeat that check here.
//
if ($_SESSION['customers_authorization'] != 0) {
$messageStack->add_session ('header', TEXT_AUTHORIZATION_PENDING_CHECKOUT, 'caution');
zen_redirect (zen_href_link (FILENAME_DEFAULT));
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
zen_redirect (zen_href_link (FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
// if the customer is not logged on, redirect them to the login page
if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
$_SESSION['navigation']->set_snapshot();
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
} else {
// validate customer
if (zen_get_customer_validate_session ($_SESSION['customer_id']) == false) {
$_SESSION['navigation']->set_snapshot (array ('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_ONEPAGE));
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
}
}
to
Code:
// -----
// If the plugin's debug-mode is set to "full", then enable ALL error reporting for the checkout_one page.
//
if (CHECKOUT_ONE_DEBUG == 'full') {
@ini_set('error_reporting', -1 );
}
// if there is nothing in the customers cart, redirect them to the shopping cart page
if ($_SESSION['cart']->count_contents() <= 0) {
zen_redirect (zen_href_link (FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
// if the customer is not logged on, redirect them to the login page
if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
$_SESSION['navigation']->set_snapshot();
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
} else {
// validate customer
if (zen_get_customer_validate_session ($_SESSION['customer_id']) == false) {
$_SESSION['navigation']->set_snapshot (array ('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_ONEPAGE));
zen_redirect (zen_href_link (FILENAME_LOGIN, '', 'SSL'));
}
}
// -----
// In the "normal" Zen Cart checkout flow, the module /includes/init_includes/init_customer_auth.php performs the
// following check to see that the customer is authorized to checkout. Rather than changing the code in that
// core-file, we'll repeat that check here.
//
if ($_SESSION['customers_authorization'] != 0) {
$messageStack->add_session ('header', TEXT_AUTHORIZATION_PENDING_CHECKOUT, 'caution');
zen_redirect (zen_href_link (FILENAME_DEFAULT));
}
... essentially, moving that customers_authorization check to after we know the customer's logged in.
I'll identify the other issue in a follow-on post.
Bookmarks