Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    106
    Plugin Contributions
    0

    Default [not a bug] Allowing a customer to complete checkout process with zero total order

    I know this thread was closed previously (http://www.zen-cart.com/showthread.p...ro-total-order), but I need to reopen.

    I have tried both Dr. Byte's suggestion and Wilt's suggestion and I still get an error when customer uses gift certificate, coupons, store credit, reward points and any combination that results in a $0.00 amount.

    I use PayPal to process payments and I need checkout to bypass going to PayPal when the order total is zero. PayPal gives this error:

    "An error occurred when we tried to contact the payment processor. Please try again, select an alternate payment method, or contact the store owner for assistance. (10401) 10401 Transaction refused because of an invalid argument. See additional error messages for details. - Order total is invalid."

    I have the proper logic in includes/classes/order_total.php but it doesn't seem to bypass the payment method. Is there any other way to bypass the payment method??? Or maybe this code needs to be altered?

    // pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the
    // credits available are greater than the order total. If they are then a variable (credit_covers) is set to
    // true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order
    // total, we don't want to go to paypal etc.
    //
    function pre_confirmation_check($returnOrderTotalOnly = FALSE) {
    global $order, $credit_covers;
    if (MODULE_ORDER_TOTAL_INSTALLED) {
    $total_deductions = 0;
    reset($this->modules);
    $orderInfoSaved = $order->info;
    while (list(, $value) = each($this->modules)) {
    $class = substr($value, 0, strrpos($value, '.'));
    if ( $GLOBALS[$class]->credit_class ) {
    $order_total = $GLOBALS[$class]->get_order_total();
    if (is_array($order_total)) $order_total = $order_total['total'];
    $deduction = $GLOBALS[$class]->pre_confirmation_check($order_total);
    $total_deductions = $total_deductions + $deduction;
    // echo 'class = ' . $class . "<br>";
    // echo 'order-total = ' . $order_total . "<br>";
    // echo 'deduction = ' . $deduction . "<br>";
    }
    else
    {
    $GLOBALS[$class]->process();
    $GLOBALS[$class]->output = array();
    }
    }
    $calculatedOrderTotal = $order->info['total'];
    $order->info = $orderInfoSaved;
    // echo "orderTotal = {$order->info['total']}";
    // echo "TotalDeductions = {$total_deductions}";
    // do not set when Free Charger is being used
    $difference = $order->info['total'] - $total_deductions;
    if ( $difference <= 0.009 && $_SESSION['payment'] != 'freecharger') {
    $credit_covers = true;
    }
    if ($returnOrderTotalOnly == TRUE) return $calculatedOrderTotal;
    }
    }

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Allowing a customer to complete checkout process with zero total order

    Please click Reply below and answer all the questions in the Posting Tips section.

    Also include exact steps to configure a brand new store to reproduce the same symptoms consistently.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2012
    Posts
    106
    Plugin Contributions
    0

    Default Re: Allowing a customer to complete checkout process with zero total order

    Thanks for responding, Dr. Byte. I have a lot of addons so I'm sure one of these addons probably affected the zero dollar checkout logic. It would take a lot of work to configure a brand new store to get it to where my store is now. So rather than waste your time, I figured out a workaround. Though it probably isn't the best way to do it, it works for me. I enabled the check/money order payment option and changed that to read as a payment option when the order total is $0. As soon as the customer checks out with a $0 order, it seems to kick in the Gift Certificate/Coupon Payment Method.

 

 

Similar Threads

  1. v139h Store Credit addon problem - does not complete order when using coupon to zero
    By AvaAdorn in forum All Other Contributions/Addons
    Replies: 13
    Last Post: 23 Oct 2012, 03:14 AM
  2. Customer Address not showing on order (or through the checkout process)
    By scamp in forum Managing Customers and Orders
    Replies: 8
    Last Post: 7 Feb 2010, 12:59 AM
  3. Order with no payment (Despite customer not completing checkout process)
    By BigNath in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 18 Dec 2009, 03:01 PM
  4. Allowing a customer to complete checkout process with zero total order.
    By sonjamichelle in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 5 Jun 2009, 05:22 PM
  5. Zero total weight in Cart not allowing to proceed to step 2
    By jpuckey in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 16 Jul 2006, 11:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR