You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When used in conjunction with the currencies.liquid snippet and the ajaxify cart drawer in Timber v2.0.1, I've found that conversions can be incorrect in certain circumstances.
Here's an example of steps to recreate:
Assume the shop's default currency is USD.
User selects "JPY" currency from the dropdown - Currency.convertAll("USD", "JPY") is called.
User opens the cart drawer - new currency elements are added to the DOM.
User selects "EUR" currency (not the shop currency nor a previously selected currency) from the dropdown - Currency.convertAll("JPY", "EUR") is called.
The function rightly assumes any new DOM elements from 2) are being converted for the first time, but incorrectly assumes they are in the oldCurrency ("JPY") format. They are actually in the shop currency ("USD");
Incorrect conversion occurs and the currency elements show different prices. Further conversion can make it worse.
Essentially, a lack of the "data-currency" attribute does not always mean that oldCurrency is actually the current currency for that element. (If the data-currency is present however, we should be able to trust that oldCurrency is the current currency for that element as it should be kept in sync).
The text was updated successfully, but these errors were encountered:
ghost
linked a pull request
May 4, 2016
that will
close
this issue
When used in conjunction with the currencies.liquid snippet and the ajaxify cart drawer in Timber v2.0.1, I've found that conversions can be incorrect in certain circumstances.
Here's an example of steps to recreate:
Assume the shop's default currency is USD.
Essentially, a lack of the "data-currency" attribute does not always mean that oldCurrency is actually the current currency for that element. (If the data-currency is present however, we should be able to trust that oldCurrency is the current currency for that element as it should be kept in sync).
The text was updated successfully, but these errors were encountered: