Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 58
  1. #31
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,520
    Plugin Contributions
    88

    Default Re: Different Total Displayed

    @todoonada and @OldNGrey, what's the value in use for Configuration :: My Store :: Currency Conversion Ratio?

  2. #32
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    257
    Plugin Contributions
    6

    Default Re: Different Total Displayed

    Item #608 products_price = 118.7727
    Configuration :: My Store :: Currency Conversion Ratio = 1.025
    OldNGrey
    ZC158a PHP 8.2.15
    MySQL 10.6.16-MariaDB

  3. #33
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,520
    Plugin Contributions
    88

    Default Re: Different Total Displayed

    @OldNGrey and @todoonada, please see this PR: https://github.com/zencart/zencart/pull/6319

    I've verified that the changes correct each of the issues identified in this thread and would appreciate some 3rd-party validation!

  4. #34
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    123
    Plugin Contributions
    5

    Default Re: Different Total Displayed

    Using this PR, I did some testing changing all I can, price, tax display and value... As long as I use main currency, calculation was all good. But when using another currency, things get weird...
    Second currency rate is 155 and tax is 10%, no decimal. I have two products in cart, one is priced at 48.34 (53.174 with tax) and the other is at 35 (38.5 w.tax).

    When not displaying tax:
    I got in cart product price 1 at 7440 (instead of 7493) and product 2 at 5425 as it should be.
    In last checkout screen, product price 1 is still wrong, but all calculations are correct for these prices (7440 and 5425).

    When displaying prices with tax:
    I got in cart product price 1 at 8215 (instead of 8242) and product 2 at 6045 (instead of 5968).
    In last checkout screen, product price 1 is 8242 and product 2 is 5968 as they should be but subtotal (14260 instead of 14210) and tax (1296 instead of 1292) are wrong. Total is 15035, which I have no idea how it ends to this value...

    I am not sure if it is related to tax calculation, it might be more of a rounding problem when converting currencies.
    Last edited by pilou2; 13 Mar 2024 at 07:51 PM.

  5. #35
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    123
    Plugin Contributions
    5

    Default Re: Different Total Displayed

    Quote Originally Posted by pilou2 View Post
    ...Total is 15035, which I have no idea how it ends to this value...
    I figure this out, 15035 = 14260 + 775 (shipping fee). It is time for me to sleep...

  6. #36
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    257
    Plugin Contributions
    6

    Default Re: Different Total Displayed

    From my testing with the conversion from AUD to EUR, or any other currency I have set, the display for payment information is now correct.
    Thank you Lat9
    OldNGrey
    ZC158a PHP 8.2.15
    MySQL 10.6.16-MariaDB

  7. #37
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    123
    Plugin Contributions
    5

    Default Re: Different Total Displayed

    I think I figured out part of the problem. In my currency with rate 155 (JPY) I use 0 decimal. It seems that currency conversion in cart rounds to 0 decimals before conversion:
    Product price 48.34 becomes 48 which multiply by 155 gives 7440 which is exactly the wrong price I got in cart without tax.
    Second product price 35.00 has 0 as decimal. This is why price after conversion is still right. I don't know where it is in the code yet.

    When displaying prices with tax:
    Product 1: 48.34 x 1.1 = 53.174 ----> 53 x 155 = 8215 Which is what I got.
    Product 2: 35.00 x 1.1 = 38.5 ----> 39 x 155 = 6045 Which is what I got too!

    Rounding to new decimal setting should be done after conversion.

    Calculation in last checkout screen is different and there might be something else to figure out...

  8. #38
    Join Date
    Nov 2006
    Posts
    108
    Plugin Contributions
    0

    Default Re: Different Total Displayed

    Quote Originally Posted by lat9 View Post
    @todoonada and @OldNGrey, what's the value in use for Configuration :: My Store :: Currency Conversion Ratio?
    It is 1.05.
    I only use one currency.

  9. #39
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,520
    Plugin Contributions
    88

    Default Re: Different Total Displayed

    Quote Originally Posted by pilou2 View Post
    I think I figured out part of the problem. In my currency with rate 155 (JPY) I use 0 decimal. It seems that currency conversion in cart rounds to 0 decimals before conversion:
    Product price 48.34 becomes 48 which multiply by 155 gives 7440 which is exactly the wrong price I got in cart without tax.
    Second product price 35.00 has 0 as decimal. This is why price after conversion is still right. I don't know where it is in the code yet.

    When displaying prices with tax:
    Product 1: 48.34 x 1.1 = 53.174 ----> 53 x 155 = 8215 Which is what I got.
    Product 2: 35.00 x 1.1 = 38.5 ----> 39 x 155 = 6045 Which is what I got too!

    Rounding to new decimal setting should be done after conversion.

    Calculation in last checkout screen is different and there might be something else to figure out...
    Thank you for taking the time to check this out. It would help me to reproduce and then correct the issue if I could verify:

    Store currency, number of decimal digits (sounds like 2)
    What is the 1.1 that multiplies the product pricing, for example 48.34 x 1.1 = 53.174
    Store currency, converted to JPY with a 155 conversion rate.

  10. #40
    Join Date
    Jun 2008
    Location
    Japan
    Posts
    123
    Plugin Contributions
    5

    Default Re: Different Total Displayed

    Quote Originally Posted by lat9 View Post
    Thank you for taking the time to check this out. It would help me to reproduce and then correct the issue if I could verify:

    Store currency, number of decimal digits (sounds like 2)
    What is the 1.1 that multiplies the product pricing, for example 48.34 x 1.1 = 53.174
    Store currency, converted to JPY with a 155 conversion rate.

    The main currency is default US$. I use a default cart with demo data to which I added Japanese yen as currency with rate (including factor 1.05) of 155 (155.00000000) and has 0 decimal. Then I modified Tax to apply worldwide and at a 10% rate which makes it easier for debugging. Then, I modified some products prices and one is 48.3400 without tax and the other is 35.0000 without tax too.
    Now, I suppose you understand 48.34 (price w.o.t.) x 1.1 (10% tax).
    1.1 is 1 + 10/100...

    I looked at the code and find some rounding (line 118 in shopping cart header and some in shopping cart class) I can suppress to get correct prices, but then the 'one digit off' bug comes back. I think these rounding were added to correct this bug, but in fact hide it.
    Probably, the right thing to do would be to do a rounding after currency conversion (if necessary) but before any other calculation like adding tax, then a last rounding before displaying.

    I could not find where currency conversion is done for subtotals. It seems subtotal is calculated differently depending on page you are: cart, checkout payment and checkout confirmation... If you know where this currency conversion is done, please let me know.

 

 
Page 4 of 6 FirstFirst ... 23456 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 3 Apr 2020, 07:53 PM
  2. v151 Site that displayed different templates.
    By Malaperth in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Feb 2014, 07:38 PM
  3. v151 order total different from cart total
    By s_p_ike in forum Bug Reports
    Replies: 9
    Last Post: 9 Dec 2012, 09:29 AM
  4. Different Product Listing styles displayed
    By skelly100 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Dec 2009, 11:33 PM
  5. Free shipping for Different sales total for different zones
    By francesca_ph in forum Built-in Shipping and Payment Modules
    Replies: 20
    Last Post: 30 Dec 2008, 05: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