Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Argentina/Buenos_Aires (GMT-03:00)

This topic contains 6 replies, has 0 voices.

Last updated by Otto 1 week, 3 days ago.

Assisted by: Otto.

Author Posts
April 21, 2025 at 1:47 am #16950494

codem

Background of the issue:
I am working on a site under development using WooCommerce and WooCommerce Subscription and WPML. I am trying to ensure that the currency format is displayed correctly across different parts of the site.

Symptoms:
In the WooCommerce subscription list, the currency format changes based on the admin panel language. During renewal payments, the decimal amount is charged incorrectly depending on the admin language. This issue also occurs on the WooCommerce 'My Account – Orders' page on the frontend.

Questions:
How can I ensure the currency format remains consistent in the WooCommerce subscription list regardless of the admin panel language?
What steps can I take to prevent incorrect decimal amounts being charged during renewal payments?
How can I resolve the currency format issue on the WooCommerce 'My Account – Orders' page?

April 23, 2025 at 12:43 pm #16959724

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

I apologize for the delay in responding. I will take care of this ticket; the reply time will be shorter now.

Please try the following:

  • Set Consistent Currency Formatting:

    • Navigate to WooCommerce → WooCommerce Multilingual & Multicurrency → Multicurrency.
    • Click the pencil icon next to each currency to customize formatting options, including decimal separators and number of decimals.
    • Ensure that these settings are consistent across all languages to prevent discrepancies.

    Reference: Multi-Currency Features for WooCommerce

  • Configure Decimal Precision:

    • Go to WooCommerce → Settings → General.
    • Set the 'Number of decimals' to match the precision required for your currencies (e.g., 2 for most currencies, more if needed).
    • Ensure that this setting aligns with your currency formatting to avoid rounding issues.

    Reference: Forum Discussion on Currency Rounding

  • Best Regards,
    Otto

    April 25, 2025 at 3:06 am #16966584

    codem

    Dear Otto.

    The currency settings are correctly configured as shown in the attached file.
    Also, the number of decimals is different for each currency — KRW and JPY have 0, while USD has 2.
    Are you saying that even if the default language is Korean and the default currency is KRW, the number of decimals in the currency options should still be set to 2?

    Best Regards.

    Thanks.

    Screenshot 2025-04-25 at 12.05.57 PM.png
    Screenshot 2025-04-25 at 12.02.16 PM.png
    Screenshot 2025-04-25 at 12.02.27 PM.png
    April 25, 2025 at 12:29 pm #16968532

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Hello,

    Thanks. The settings look correct.

    Does the problem only happen with subscriptions? Other order types are OK?

    I suggest you try this to help us identify if it might be a conflict with another plugin or theme that is causing the problem.
    **IMPORTANT:** Please try this in a staging environment or at least with a backup of your site files and database before continuing.
    Disable all plugins except WooCommerce, WooCommerce Subscriptions if needed, WPML-related, and temporarily change the theme to a default WordPress theme such as Twenty Twenty-five.
    Is the issue resolved with these settings? If so, please reactivate one by one to see which conflicts.

    Best Regards,
    Otto

    April 28, 2025 at 1:28 am #16972891

    codem

    Dear Otto.

    As you suggested, I deactivated all other plugins and switched to the default theme, but the same issue still occurs as shown in the attachment.

    Is it not possible for you to reproduce this issue internally within WPML?
    When you test it, does everything work normally?

    If needed, I can also provide access information to a test site.
    I would appreciate a quick check on this.

    Best Regards.

    Thanks.

    Screenshot 2025-04-28 at 10.25.12 AM.png
    Screenshot 2025-04-28 at 10.24.52 AM.png
    Screenshot 2025-04-28 at 10.24.43 AM.png
    Screenshot 2025-04-28 at 10.24.34 AM.png
    April 28, 2025 at 12:37 pm #16974852

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Hello,

    I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue.
    It would be better to a testing site where the issue is replicated.

    The information you will enter is private which means only you and I can see and have access to it.
    Maybe I'll need to replicate your site locally. For this, I'll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site.
    This will allow me to create a copy of your site and your content.
    Once the problem is resolved I will delete the local site.

    **IMPORTANT**
    - Please make a backup of site files and database before providing us access.
    - If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields.

    Best Regards,
    Otto

    April 30, 2025 at 12:52 pm #16984006

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Thank you!

    I managed to see the problem. Before escalating the issue to our second-tier support, can you please update WooCommerce Subscriptions to the latest version on the test site?

    Best Regards,
    Otto

    May 1, 2025 at 9:34 am #16986230

    codem

    Desr Otto.

    I’ve updated the WooCommerce Subscriptions plugin to the latest version.

    Please check it as soon as you can.

    Best Regards.

    Thanks.

    May 1, 2025 at 11:30 am #16986434

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Hello,

    I managed to reproduce the problem without Woocommerce Subscriptions.

    The number of decimals in the orders page behaves this way:
    - If you set the languages that match the default currency => the decimal points are OK for all the currencies
    - If you switch to another language => the default currency decimal points use the decimal points of that language's currency, and the rest are OK

    If I enable all currencies in all languages in WooCommerce > WooCommerce Multilingual & Multicurrency > Multicurrency > Currencies, it behaves correctly in all languages.

    Can you give this a try? Is this a suitable workaround for you? Take into account that you can decide which currency to display first in each language.

    Best Regards,
    Otto

    May 1, 2025 at 11:54 am #16986471

    codem

    Dear Otto.

    I checked the details you explained.
    However, the client's request is to fix the currency for each language page.
    They want to use a specific currency fixed for each language.

    Best Regards.

    Thanks.

    May 1, 2025 at 8:15 pm #16987340

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Hello,

    Thanks.

    I escalated the issue to our second-tier support. They'll try to provide a workaround within a few days. If it is not possible, they will escalate the issue to our development team. In this case, the solution will take longer.

    I'll get back to you as soon as I have news.

    Best Regards,
    Otto

    May 15, 2025 at 6:13 pm #17038420

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Hello,

    I am reaching out just to let you know that the issue has been escalated to our development team. Sadly, we can't provide a workaround at this stage.

    I'll keep you posted about the progress of the solution.

    Best Regards,
    Otto

    June 4, 2025 at 12:11 pm #17106188

    Otto
    WPML Supporter since 09/2015

    Languages: English (English ) Spanish (Español )

    Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

    Hello,

    Our dev team took a look at the issue and made some progress.

    But the solution won't be available in the next release (WCML 5.5) because the issue is complex, and the solution needs to be refined and tested thoroughly.

    For now, if you have a testing environment you can give it a try to this (hacky) workaround:

    Add this to the theme's functions.php file or to a dedicated plugin:

    add_action( 'wp', function() { // First viable action hook: `send_headers`, but `wp` might be more correct.
        if ( \WCML\Orders\Helper::isOrderListAdminScreen() || is_account_page() ) {
    
            // This filter is fired in \WC_Data_Store_WP::filter_raw_meta_data
            // when DataStores\Orders\OrdersTableDataStore::init_order_record is fired.
            add_filter( 'woocommerce_data_store_wp_post_read_meta', function( $metaData, $maybeOrder, $callingObject ) {
    
                if ( $callingObject instanceof \WC_Order_Data_Store_Interface ) {
                    /** @var \WC_Abstract_Order $maybeOrder */
    
                    static $currentOrder;
    
                    // We need to pass the order object reference
                    // because it's not initialized yet with the data
                    // at this stage.
                    $filterCallback = function( $currency ) use ( &$maybeOrder ) {
                        $orderCurrency = $maybeOrder->get_currency();
    
                        return $orderCurrency ?: $currency;
                    };
    
                    if ( $currentOrder !== $maybeOrder ) {
                        // This filter hook comes from \WCML_Multi_Currency_Prices::get_context_currency_code.
                        // The name is misleading...
                        // Not sure we should create a new one because the method may be changed/removed in the future.
                        remove_all_filters( 'wcml_filter_currency_position' );
                        add_filter( 'wcml_filter_currency_position', $filterCallback );
    
                        $currentOrder = $maybeOrder;
                    }
    
                    // Ideally we should have an action to remove our filter on `wcml_filter_currency_position`
                    // but I could not find any viable one...
                }
    
                return $metaData;
            }, 10, 3 );
        }
    } );

    This should fix the rounding issue in the backend.

    To fix it also in the front end we need to change:
    wp-content/plugins/woocommerce-multilingual/inc/currencies/class-wcml-multi-currency-prices.php line 785

    from:

    	public function filter_wc_price_args_on_order_admin_screen( $args ) {
    		if ( OrdersHelper::isOrderListAdminScreen() ) {
    			$args = $this->filter_wc_price_args( $args );
    		}
    		return $args;
    	}

    to:

    	public function filter_wc_price_args_on_order_admin_screen( $args ) {
    		if ( OrdersHelper::isOrderListAdminScreen() || is_account_page() ) {
    			$args = $this->filter_wc_price_args( $args );
    		}
    		return $args;
    	}

    As mentioned, this is just a first draft workaround, not ready for production. But if you are willing to try in a testing site, your feedback will be really useful.

    Best Regards,
    Otto