Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default currency problem with GV during checkout

    Please note, this is not a clean 1.3.6 install so please verify!

    During checkout, if the customer has a balance and is checking out with a currency other than the store currency, an error is triggered if the customer doesn't input the default currency amount - even though it is displayed in their chosen currency.

    That makes no sense, I know... so here's an example:

    Default currency: USD
    Selected currency: CAD (1 CAD = 0.85 USD)

    GV balance: CAD$100

    During checkout, customer tries to apply CAD$100 to the order, but is told they don't have that much. If the customer chooses exactly CAD$85 or less, it is ok. This leads me to belive that internally, it is comparing the USD value.

    I'll try to investigate to see if I can find the solution... but could someone pleaes confirm?

    As a customer, choose a currency worth less than the store/default currency, and order a gift cert.

    Then order something else and try to apply the full amount to the order during checkout.

    - Steven

  2. #2
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: currency problem with GV during checkout

    Yikes... from glancing at the code, it looks like currencies and credits aren't friends in the order_total.php routines.

    I haven't tested thoroughly yet, but it seems that if you are operating in a currency other than the store currency, and you have total credits equal to the order total, that you will still be asked to finish payment, provided the user currency is worth less than store currency. This isn't supposed to be the case... payment should be bypassed if the credits cover it.

    What's worse is if the currency is worth more than the store currency!!! In this case, a user could have less than enough to cover the order, but ZenCart will bypass payment assuming enough is there.

    It seems like the entire credits system ignores currencies!!!

    Please tell me I'm out to lunch on this.

    - Steven

  3. #3
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: currency problem with GV during checkout

    I think I've fixed the GV problem... but similar issues may (and probably do) exist with other credits (coupons, for example). Also I have confirmed that the problems described above exist on a fresh 1.3.6 install so please take this seriously.

    To fix GV:

    open /includes/modules/order_total/ot_gv.php

    find the function called "pre_confirmation_check" and change the line
    Code:
    global $order;
    to
    Code:
    global $order, $currencies;
    and change the line
    Code:
    if ($_SESSION['cot_gv'] > $this->user_has_gv_account($_SESSION['customer_id'])) {
    to
    Code:
    if ($_SESSION['cot_gv'] > $currencies->value($this->user_has_gv_account($_SESSION['customer_id']))) {
    Then find the function called "calculate_credit" and change the lines:
    Code:
        global $db, $order;
        $gv_payment_amount = $_SESSION['cot_gv'];
    to
    Code:
        global $db, $order, $currencies;
        $gv_payment_amount = $currencies->value($_SESSION['cot_gv'], true, DEFAULT_CURRENCY);
    - Steven

  4. #4
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: currency problem with GV during checkout

    Looking into this further, it seems that coupons are handled correctly... its just the give voucher system that didn't do it properly. After a full day testing from every angle I could think of, my relatively simple fixes above work with no side effects. The only thing I think could be a problem is if a user is checking out with a GV at the same moment the admin updates the currency rates... a better fix might be to NOT allow customers to choose how much of a GV to use - just assume they want to use all of it against the price. This is because the problem (or potential one) is only introduced because of user input... the user is working in one currency, but the DB is handled in another.

    This really should get fixed in short-order though, even though it only applies to multi-currency stores using GV... but considering those are two toted features of Zen, it would be nice if they played nice together.

    I don't know if this bug existed pre-1.3.5... amazing nobody discovered it if it did.

    - Steven
    Last edited by s_mack; 20 Nov 2006 at 12:27 AM.

  5. #5
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: currency problem with GV during checkout

    Hi,

    Thanks for the bug report, and for posting a fix as well :)

    It is suprisong that the bug has gone un-noticed for so long. Will make sure it gets into the next release.

  6. #6
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: currency problem with GV during checkout

    Happy to be of service.

 

 

Similar Threads

  1. How do I set MYR currency instead of USD during checkout process?
    By smokey2376 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 6
    Last Post: 20 Nov 2012, 12:12 PM
  2. Problem: Shipping Method Changed During Checkout
    By Droid in forum General Questions
    Replies: 1
    Last Post: 6 May 2011, 03:08 AM
  3. Problem getting past step 1 of 3 during checkout
    By xxDXxx in forum General Questions
    Replies: 1
    Last Post: 15 Feb 2008, 04:14 AM
  4. Replies: 12
    Last Post: 30 Nov 2007, 05:54 AM
  5. Time outs during Checkout - DB problem? Help?
    By buzzville in forum General Questions
    Replies: 14
    Last Post: 12 May 2007, 09:40 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