spree-contrib / spree_multi_currency

Provides UI to allow configuring multiple currencies in Spree.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
41 stars 117 forks source link

[Critical] Wrong shipment calculation during currency change #41

Open mbajur opened 9 years ago

mbajur commented 9 years ago

Hello i have encountered a really bad issue with spree_multi_currency picker which lets shop clients to cheat with shipping pricing.

Let's say i have two shipping methods defined:

And now, if user makes an order in EUR currency and, on checkout/shipping page, changes a currency to USD, shipment costs are 5 USD instead of 10 USD, basically shipment costs stays the same but currency changes which can produce a really bad issues and financial costs for shop owners.

mbajur commented 8 years ago

There is also another issue, probably related to this bug:

Let's say shop has two currencies defined: EUR (default) and USD. If user changes current_currency to USD and makes an order, after address step of checkout (on shipment method step) - prices are being converted to EUR but currency stays the same. So, if product costs are EUR - 5 and USD - 10, all the prices displayed on shipping step (in order summary, right colmn) are 5$ instead of 10$ (which is a mix of 5 EUR and $ dolar sign). The only way to fix that is to change currency using currency picker to EUR and then back to USD.

That's also the only way to fix that from the rails console side (2 x order.update_attribute(:currency)).

Do you guys have any idea what the hell is going on and what can i do about it? That's happening on a production site and i'm not able to fix that. Even after few hours of browsing spree/spre_multi_commerce code trying to understand how it all works.

Thanks in advance.

nobicycle commented 8 years ago

I tested the Checkout screen at the Delivery stage of the process. The UPS Ground (EUR) rate was 8 EUR and the UPS Ground (USD rate was I had set at 3 USD.

When switching between EUR and USD and back, the displayed figures were all updated correctly except for two fields: 1.Shipping Method rate remained displayed as 8 USD even when switching to EUR or USD.

  1. Order Total was wrong. The Item Total had 8 added to it when switching to USD.

See screenshot. Notice USD values but EUR Delivery Method screenshot_2015-11-08_02-03-49