Posts

WooCommerce Shipping Pricing for Currency Switcher – WC 2.4.3 fix

Shipping Pricing Integration Add-on for WooCommerce Currency Switcher has been updated to version 1.1.9.150813. This update brings the following improvements and fixes:

  • Improved compatibility with WooCommerce 2.4.3. The latest version of WooCommerce changed the logic used to load shipping methods, and may cause infinite recursion issues in some circumstances. We added a safeguard against this issue.

How to get latest version

New customers

Simply place your order and you will get the latest version.

Existing customers

You should be able to download the updated file using the link you received with your order. If the link doesn’t work, please contact Support to receive the latest version. Thanks.

WooCommerce Shipping Pricing for Currency Switcher 1.1.8.150811

Shipping Pricing Integration Add-on for WooCommere Currency Switcher has been updated to version 1.1.8.150811. This update brings the following improvements and fixes:

  • Updated requirements checking class. The new class can now automatically install some of the requirements.
  • Modified logic used to enable shipping prices entered manually in each currency. The new logic separates the “shipping method enabled” setting from the “shipping prices in specific currency” setting, avoiding conflicts and simplifying testing.
  • Improved user interface.
  • Fixed minor bugs in requirements checking and verification of shipping availability.

How to get latest version

New customers

Simply place your order and you will get the latest version.

Existing customers

You should be able to download the updated file using the link you received with your order. If the link doesn’t work, please contact Support to receive the latest version. Thanks.

news icon

WooCommerce 2.4 – Dealing with the new price cache

WooCommerce 2.4 price cache – Pros and cons

If you wrote a WooCommerce plugin that works with product prices, and found out that it returns incorrect results when you process variable products, the cause could be the new price caching logic added in WooCommerce 2.4. This new logic, which is not extensively documented, was introduced to increase performance of sites with complex variable products (i.e. products with 20 variations or more).

To reduce processing and calculations, when WooCommerce retrieves the prices of a variable product , it stores them in a dedicated cache, and returns the stored data from that moment on, until the product is modified. When this happens, none of the hooks associated with product price calculations runs, and your code is will probably not run as it should. For example, if your plugin returns different prices depending on custom criteria, you will notice that this no longer happens, and that you will always see the same prices. Those prices come from the cache.

Two of our plugins were affected by this new caching mechanism: our multi-currency solution, the Currency Switcher, and our Prices by Country plugin. In both cases, we had to find a way to work around the limitation of having static prices shown to the customer, while still trying to keep the performance at a good level. Our plugins are now up to date, as we announced earlier, and we thought of sharing our approach, so that it can benefit other developers.

Solutions

Based on our tests, there are two solutions to this issue. The first is the best compromise between flexibility and performance, while the second can come useful if your code absolutely needs to get “raw”, live data.

1. Change the cache key for the prices, depending on your criteria

This solution allows to keep the price caching in place, while still keeping the data dynamic, choosing the correct one depending on arbitrary criteria. For example, suppose that a variable product should show two different set of prices:

  • Prices for wholesalers
  • Prices for the public

Your criteria, in this case, would be “customer is wholesaler“. You can then use it to ensure that the correct prices are loaded for the product. You can find an example showing how you can do this here: WooCommerce 2.4 – Price cache workaround – Dynamic key.

2. Disable the price cache entirely

This solution is no longer applicable as of WooCommerce 2.5

This solution will always give you access to live product prices, but it will disable price caching entirely. We would recommend not to use it, unless necessary. You can find the code here: WooCommerce 2.4 – Price cache workaround – Disable cache.

Conclusion

The new price caching system was unexpected and, although we understand why it was introduced, it can cause quite a bit of confusion. We hope that our examples will help you getting your product back on track, and add full compatibility with WooCommerce 2.4. If you have any questions, please feel free to contact us. You can also leave your feedback in the comments section, below.

The Aelia Team

news icon

WooCommerce 2.4 – Product Compatibility Status

WooCommerce 2.4 was released on the 8th of August 2015. As it always happens, the WooCommerce team released a couple of updates shortly after the main update. We started our testing process when WooCommerce 2.4 Beta2 became available, to ensure that our plugins would be compatible with the new version as soon as it became available.

As of today, we haven’t encountered specific issues, but we will keep running more tests, to check if any unexpected and/or undocumented breaking change was introduced, like it happened with WooCommece 2.3.

Important

We strongly recommend to install WooCommerce 2.4 on a test site first, and check that all installed plugins are working correctly, before updating your live site.

Compatibility status

Currency Switcher

We are addressing an issue related to an undocumented breaking change in WooCommerce, which may cause variable products to be displayed with wrong prices. We will release an update shortly to address this bug.

Our flagship product, the WooCommerce Currency Switcher, has been updated to version 3.7.8.150810, to address an issue caused by a new price caching logic. If you are running an older version, simply download and install the update using the link you received with your order, or from the My Account section on our site, and everything should work fine.

Currency Switcher Add-ons

Tax Display by Country

Compatible. The changes added to WooCommerce 2.4.x should not affect this product.

Prices by Country

Compatible since version 1.6.5.150811. Previous versions may display incorrect prices on variable products, due to the same issue that affected our Currency Switcher.

Payment Gateways

EU VAT Assistant

Compatible.

Blacklister

Testing in progress. This plugin does not include features that should be affected by the changes in WooCommerce 2.4.

We will keep testing our products to make sure that any issue which might still exist is fixed quickly and efficiently. Should you find any, please feel free to report it using our support portal: Aelia Support Portal. Thanks for your time and collaboration.

The Aelia Team

WooCommerce PayPal Express Extended 1.0.4.150713

WooCommerce PayPal Express – What’s new

Our PayPal Express Extended Gateway for WooCommerce has been updated to version 1.0.4.150713. This update brings the following improvements and fixes:

  • Fixed bug in handling of PayPal Express settings. The bug caused the gateway to use the “sandbox” environment instead of the production one, even when the latter was enabled.

How to get latest version

New customers

Simply place your order and you will get the latest version.

Existing customers

You should be able to download the updated file using the link you received with your order. If the link doesn’t work, please contact Support to receive the latest version. Thanks.