Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was unable to see the 'Place Order' button on the WooCommerce checkout page when viewing the site in the Arabic language. A PHP fatal error related to an unknown format specifier was identified in the debug log.
Solution:
We resolved the issue by following the steps outlined in our documentation on PHP 8 PHP Fatal error: Uncaught ValueError: Unknown format specifier in. The specific string causing the issue was located in the file

/wp-content/plugins/woocommerce/templates/checkout/payment.php

on line 44. We re-translated the string in WPML > String Translation, ensuring that the placeholder tags "%1$s" and "%2$s" were kept the same in the translation.

If you're experiencing a similar issue, we recommend you try the same solution. However, please note that this solution might be irrelevant if it's outdated or not applicable to your case. If the problem persists, we highly recommend checking related known issues on WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Should you need further assistance, please do not hesitate to open a new support ticket in the 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 6 replies, has 2 voices.

Last updated by Long Nguyen 1 year, 2 months ago.

Assisted by: Long Nguyen.

Author Posts
March 28, 2024 at 1:24 am #15458549

tarekS-7

I am trying to: place order but button not showing on translate language

Link to a page where the issue can be seen: woocommerce checkout page for Arabic

I expected to see: place order button on checkout page for Arabic language

Instead, I got: Place order button not showing on translate language

March 28, 2024 at 1:31 am #15458556

tarekS-7

Dears,

The problem happens with PHP version 8.1 or 8.2. But working with PHP version 7.4

March 28, 2024 at 1:32 am #15458565

tarekS-7

The page working properly with English but keeps loading with Arabic

March 28, 2024 at 4:08 am #15458653

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Tarek,

Thank you for contacting WPML support, I’m happy to help you with this issue.

I suggest you update WooCommerce, WooCommerce Multilingual plugins to the new version and follow the documentation below to find the button string and translate it in WPML > String Translation to see if it helps.
https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/

If it does not help, 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 have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/

Looking forward to your reply.
Thanks

March 28, 2024 at 6:42 am #15458734

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

When loading the Checkout page in Arabic language, I see there is a fatal error in the debug log:

[28-Mar-2024 04:57:24 UTC] PHP Fatal error:  Uncaught ValueError: Unknown format specifier "Ł" in /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/templates/checkout/payment.php:44
Stack trace:
#0 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/templates/checkout/payment.php(44): printf()
#1 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/u75461569...')
#2 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/wc-template-functions.php(2405): wc_get_template()
#3 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/class-wp-hook.php(324): woocommerce_checkout_payment()
#4 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#5 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/plugin.php(517): WP_Hook->do_action()
#6 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/themes/flatsome/woocommerce/checkout/form-checkout.php(94): do_action()
#7 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/u75461569...')
#8 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php(372): wc_get_template()
#9 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php(69): WC_Shortcode_Checkout::checkout()
#10 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(72): WC_Shortcode_Checkout::output()
#11 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(95): WC_Shortcodes::shortcode_wrapper()
#12 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/shortcodes.php(433): WC_Shortcodes::checkout()
#13 [internal function]: do_shortcode_tag()
#14 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/shortcodes.php(273): preg_replace_callback()
#15 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/class-wp-hook.php(324): do_shortcode()
#16 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#17 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/post-template.php(256): apply_filters()
#18 /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/themes/flatsome/page.php(33): the_content()
#19 /home/u754615691/domains/accesslife.co/public_html/staging/wp-includes/template-loader.php(106): include('/home/u75461569...')
#20 /home/u754615691/domains/accesslife.co/public_html/staging/wp-blog-header.php(19): require_once('/home/u75461569...')
#21 /home/u754615691/domains/accesslife.co/public_html/staging/index.php(17): require('/home/u75461569...')
#22 {main}
  thrown in /home/u754615691/domains/accesslife.co/public_html/staging/wp-content/plugins/woocommerce/templates/checkout/payment.php on line 44

Following the documentation https://wpml.org/errata/php-8-php-fatal-error-uncaught-valueerror-unknown-format-specifier-in/
I fix the issue on your staging site by re-translating the string in the file /wp-content/plugins/woocommerce/templates/checkout/payment.php line 44

"Since your browser does not support JavaScript, or it is disabled, please ensure you click the %1$sUpdate Totals%2$s button before placing your order. You may be charged more than the amount stated above if you fail to do so."

in WPML > String Translation. You should keep the same placeholder tag "%1$s" and "%2$s" in the translation string.

Looking forward to your reply.
Thanks

March 28, 2024 at 8:21 am #15459267

tarekS-7

Thanks for your support could you please guide me how to retranslate the file again in order to implement it on my main website?

March 28, 2024 at 8:37 am #15459323

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

On your live site, please follow steps:

- Go to WPML > String Translation > Search for the keyword "Since your browser does not support JavaScript".
- Re-translate the string and keep the placeholder in the translation string. For example:

نظرًا لأن متصفحك لا يدعم JavaScript، أو أنه معطل، يرجى التأكد من النقر فوق الزر %1$s تحديث الإجماليات %2$s قبل تقديم طلبك. قد يتم تحصيل رسوم منك أكثر من المبلغ المذكور أعلاه إذا فشلت في القيام بذلك .

Please check the attached screenshot.

Looking forward to your reply.
Thanks

String Translation ‹ AccessLife — WordPress 2024-03-28 15-33-54.png
April 4, 2024 at 3:39 am #15480880

tarekS-7

No Thanks