Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Low order fee in trouble with custom payment module

    We have a custom payment module that the developer is not anymore maintaining it. We noted now that we are getting error when using low order fee. We haven't used that earlier, so no idea if it has ever worked. It looks like it calculates the md5 hash wrong, or passes some wrong values, only if the order sum is under 50 euro (our low order limit) and thus we are quite sure that the problem occurs only when using low order fee.

    Here under are the two parts of the code that are about low order fee, is there something that doesn't match ZC 1.5?

    <code>
    function process_button() {

    global $db, $order, $currencies, $currency, $products, $shipping;

    $items = sizeof($order->products);

    if( $_SESSION['shipping']['cost'] AND $_SESSION['shipping']['cost'] > 0 )
    {
    $items++;
    }

    if(
    (
    MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION == 'both' OR
    ($order->delivery['country_id'] == STORE_COUNTRY AND MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION == 'national') OR
    ($order->delivery['country_id'] != STORE_COUNTRY AND MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION == 'international')
    ) AND
    MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true' AND
    $order->info['subtotal'] < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER AND
    MODULE_ORDER_TOTAL_LOWORDERFEE_FEE > 0
    )
    {
    $items++;
    }

    if($GLOBALS['ot_gv']->output[0]['value'] && $GLOBALS['ot_gv']->output[0]['value'] != "")
    {
    $items++;
    }
    </code>

    and

    <code>
    if(
    (
    MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION == 'both' OR
    ($order->delivery['country_id'] == STORE_COUNTRY AND MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION == 'national') OR
    ($order->delivery['country_id'] != STORE_COUNTRY AND MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION == 'international')
    ) AND
    MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true' AND
    $order->info['subtotal'] < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER AND
    MODULE_ORDER_TOTAL_LOWORDERFEE_FEE > 0
    )
    {
    $loworderfeetax = zen_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
    $params["ITEM_TITLE[$i]"] = MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE;
    $params["ITEM_NO[$i]"] = $i;
    $params["ITEM_AMOUNT[$i]"] = 1;

    if(DISPLAY_PRICE_WITH_TAX == "true")
    {
    $params["ITEM_PRICE[$i]"] = number_format(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE + zen_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $loworderfeetax), 2, ".", "");
    }
    else
    {
    $params["ITEM_PRICE[$i]"] = MODULE_ORDER_TOTAL_LOWORDERFEE_FEE;
    }

    $params["ITEM_TAX[$i]"] = $loworderfeetax;
    $params["ITEM_DISCOUNT[$i]"] = 0;
    $params["ITEM_TYPE[$i]"] = 3;
    $i++;
    }

    </code>

    Both of the above code samples belong to the function process_button().
    (Not sure how to put these code samples here nicely, trying with tag <code>)
    I may be blond but at least I found Zen.

  2. #2
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: Low order fee in trouble with custom payment module

    Maybe we could edit the code so that it wouldn't specify the low order fee but it would be a bulk of everything else than products total or shipping?
    I may be blond but at least I found Zen.

  3. #3
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Low order fee in trouble with custom payment module

    Not sure how much help I'll be, but I can tell already that more information is needed. If there is an error, then it would help to know what the error says. So is there something in the logs directory associated with trying to process a low order fee type item?

    Also, not sure what you meant by your second post, but if you wanted you might be able to make it simple, but it more than likely won't be. :) possibly the simplest would be to collect the costs of that type of business through some other route if the developer is no longer making updates or supporting the mod. Perhaps there is something else available to do the same thing?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: Low order fee in trouble with custom payment module

    There is only an error on the payment provider website that it is making a "gateway error" but in the debug logs are nothing.
    By testing this happens only when the low-order fee is on and the sum of the order is so that the low-order fee is added.
    I may be blond but at least I found Zen.

 

 

Similar Threads

  1. Low Order Fee not working with Authorize.net AIM
    By Feznizzle in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 Mar 2014, 12:00 AM
  2. Multiple Payment Types Per Order With Custom Module?
    By user2037 in forum Addon Payment Modules
    Replies: 0
    Last Post: 25 Jul 2011, 04:45 PM
  3. Low Order Fee Module
    By bearlymakinit in forum General Questions
    Replies: 3
    Last Post: 15 Sep 2010, 06:09 AM
  4. Low Order Fee with Coupon?
    By jensurge in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 3 Jan 2009, 07:16 AM
  5. Low order fee when paying with gift certificate
    By tesfu in forum General Questions
    Replies: 2
    Last Post: 28 Oct 2007, 04:15 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