This thread is resolved. Here is a description of the problem and solution.
Problem:
The client reported an issue with WPML multicurrency where, after a sale ends, the product price does not revert to the original price correctly. This problem occurs when the sale end date is reached, and the sale price fields become empty as expected, but the original price displayed is incorrect, seemingly due to a currency calculation error.
The issue is related to the price filter on scheduled event when the default currency is not set for the default language.
Solution:
We provided a workaround to address the issue until a permanent fix is released in a new version of WooCommerce Multilingual (WCML). We recommended adding the following code to the functions.php file of the client's current theme:
/** * @link wpmlsupp-11119 */ function wpmlsupp_11119_remove_price_filter() { global $woocommerce_wpml; $actions_to_remove_back = [ 'wc_before_products_starting_sales' => 'wc_after_products_starting_sales', 'wc_before_products_ending_sales' => 'wc_after_products_ending_sales', ]; if ($woocommerce_wpml instanceof woocommerce_wpml && isset($actions_to_remove_back[current_action()])) { remove_filter('get_post_metadata', [$woocommerce_wpml->multi_currency->prices, 'product_price_filter'], 10); add_action($actions_to_remove_back[current_action()], function () use ($woocommerce_wpml) { add_filter('get_post_metadata', [$woocommerce_wpml->multi_currency->prices, 'product_price_filter'], 10, 4); }); } } add_action('wc_before_products_starting_sales', 'wpmlsupp_11119_remove_price_filter'); add_action('wc_before_products_ending_sales', 'wpmlsupp_11119_remove_price_filter');
We asked the client to let us know if this solution resolved the issue.
Please note that this solution might be outdated or not applicable to your case. If you're experiencing a similar issue and the provided solution does not help, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket with us.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 24 replies, has 4 voices.
Last updated by 1 year, 3 months ago.
Assisted by: Nicolas V..