Aelia - News badge

Important – Bug in the “product base currency” feature (variable products only)

Following a report from one of our customers, we reviewed the product base currency feature that we introduced recently, and we discovered that it may not always work for variable products.

Issue description

The new feature allows to set the base currency for simple products and product variations, and enter their prices in such currency. All the prices in other currencies, if left empty, are calculated automatically. This new logic, which works correctly in all cases with simple products, fails if variation prices in base currency are left empty (see screenshot below). This is due to how WooCommerce loads the variations, and it results in variation prices to be displayed as zero.

Product Base Currency Feature - Variations Bug

 

Why does that happen?

We tested the new conversion, using product base currency, in multiple scenario, and it works consistently. However, there is a limitation in WooCommerce architecture that doesn’t allow the dynamically calculated prices to be used when determining the price of a variable product.

Technical details

The Currency Switcher converts all product prices dynamically in the appropriate currency as soon as they are loaded. The variation base prices, even if left empty, are populated on the fly. However, some parts of WooCommerce ignore these new prices and load the “raw” ones directly from the database, bypassing our currency conversion mechanism entirely.

Let’s take a variation configured with USD as the base currency, a base price of 100 USD and its “standard” base prices, in EUR, left empty. When the variation is loaded and EUR is the active currency, the Currency Switcher replaces the variation price with 86.65 EUR. This is the correct behaviour, and it works almost everywhere, except in some (unfortunately, critical) cases in which WooCommerce will just load the variation base prices directly from the database, thus loading “blank” and considering the variation “not priced“.

What’s the solution?

We are still working to fix the issue and we will release an update as soon as possible. In the meantime, a workaround is to ensure that variation prices in WooCommerce base currency are always populated. We are aware that this defeats the purpose of the product base currency feature, therefore we are giving this fix the highest priority.

Should you need further information or assistance, please feel free to contact us using our dedicated support portal. Thanks for your patience, and apologies for any inconvenience caused.

The Aelia Team

 

2 replies
    • diego says:

      Hi William, the bug was fixed in an update we released for the Currency Switcher over a year ago. The “Product Base Price” feature now works correctly, it simply requires WooCommerce 2.3 or later (WooCommerce 2.2 is obsolete now, anyway).

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.