This thread is resolved. Here is a description of the problem and solution.
Problem:
You are experiencing an issue with the multi-currency option in WooCommerce when using the Variation Swatches Pro plugin. The currency conversion works correctly for the main product prices, but when changing an attribute variant that affects the price (e.g., color), the additional cost is not converted correctly and adds the same numeric value in a different currency.
Solution:
Step 1: Verify Plugin Compatibility
Ensure that you are using the latest versions of both WPML, WooCommerce, and the Variation Swatches Pro plugin. Compatibility issues often arise from outdated versions.
Step 2: Check WPML Multicurrency Settings
1. Go to WPML > WooCommerce Multilingual & Multicurrency > Multicurrency.
2. Ensure that the conversion rates are set correctly for all currencies.
3. Verify that the settings for rounding and display are appropriate for your needs.
Step 3: Verify Attribute Pricing
1. Go to Products > Attributes in the WordPress admin panel.
2. Ensure that the attribute prices are set correctly in the primary currency (PLN).
Step 4: Custom Code Adjustment
Sometimes, custom code is required to ensure compatibility between different plugins. You might need to add a custom filter to handle the price conversion for attribute variants correctly. Here is an example code snippet that you can add to your theme's `functions.php` file:
add_filter('woocommerce_product_variation_get_price', 'convert_variation_price', 10, 2);<br />add_filter('woocommerce_product_variation_get_regular_price', 'convert_variation_price', 10, 2);<br />add_filter('woocommerce_product_variation_get_sale_price', 'convert_variation_price', 10, 2);<br /><br />function convert_variation_price($price, $variation) {<br /> if(function_exists('wcml_is_multi_currency_on') && wcml_is_multi_currency_on()) {<br /> $price = apply_filters('wcml_raw_price_amount', $price);<br /> }<br /> return $price;<br />}
Step 5: Contact Plugin Support
Since "Variation Swatches Pro" is not listed in our directory of compatible plugins, we recommend reaching out to their support team. They may have specific solutions or patches for this known issue.
If this solution does not resolve your issue or seems irrelevant, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket at WPML support forum.
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 1 reply, has 2 voices.
Last updated by 7 months, 1 week ago.
Assisted by: Mihai Apetrei.