Ecommerce correct checkout logic – zen cart 1.5.8a One-Page Checkout keep guest cart items after card 3 max failures

Author:

Enhancing Guest Checkout Experience Logic

To improve the onsite customer guest checkout experience, consider modifying the logic to save the cart after multiple payment failures and direct customers to a help page for assistance. This approach leaves the task of fraud prevention to merchant processing companies such as Authorize.net, Stripe, or issuing banks.

Modifying the Code: Saving Cart and Redirecting

In the includes/modules/checkout_process.php file, replace the following code:

phpCopy Code

// BEGIN CC SLAM PREVENTION
$slamming_threshold = 3; // max failure

if (!isset($_SESSION['payment_attempt'])) $_SESSION['payment_attempt'] = 0;
$_SESSION['payment_attempt']++;
$zco_notifier->notify('NOTIFY_CHECKOUT_SLAMMING_ALERT', $_SESSION['payment_attempt'], $slamming_threshold);

if ($_SESSION['payment_attempt'] > $slamming_threshold) {
    $zco_notifier->notify('NOTIFY_CHECKOUT_SLAMMING_LOCKOUT');
    //$_SESSION['cart']->reset(TRUE); // keep the cart items after card 3 max failures
    zen_session_destroy();
    zen_redirect(zen_href_link(FILENAME_CONTACT_US)); // redirect Guest to contact us instead of logoff
}
// END CC SLAM PREVENTION

Key Changes:

  • Cart is saved after multiple payment failures using //$_SESSION['cart']->reset(TRUE);
  • Customers are redirected to a help page FILENAME_CONTACT_US for assistance.

By implementing these modifications, you can enhance the guest checkout experience while still relying on external services for fraud prevention.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x