Skip to content Skip to sidebar

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 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 1 reply, has 0 voices.

Last updated by Andreas W. 1 year, 2 months ago.

Assisted by: Andreas W..

Author Posts
February 14, 2025 at 2:01 pm #16706717

matejZ-6

Background of the issue:
I am trying to generate WooCommerce PDF invoices on my production site, but I encounter a critical error when WPML is enabled. The same setup works perfectly on localhost. Additionally, WPML is attempting to load a Slovak localization file that returns a 404 error, which may be related to the issue. URLs: ❌ hidden link → 404 Not Found, ✅ hidden link → Loads correctly. Error occurs in:

php get_payment_method() ) : ?> <tr class="payment-method"> <th>payment_method_title(); ?></th> <td>payment_method(); ?></td> </tr>  

Symptoms:
I am experiencing a fatal error:

Fatal error: wpo_wcpdf_dynamic_translate(): Argument #1 ($string) must be of type string, null given, called in /wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocumentMethods.php on line 501

. WPML might be returning `NULL` instead of the correct translated string for the payment method. On production,

$this->get_payment_method()

and

$this->payment_method_title()

return `NULL`, while on localhost they return valid strings.

Questions:
Why is WPML returning `NULL` for payment methods only on production?
Is the missing `sk.json` file (404) causing translation failures? How can we fix this?
Is there a way to exclude WooCommerce PDF invoices from WPML's String Translation system?
Are there any known issues with WPML and WooCommerce PDF Invoices & Packing Slips related to payment method translation?
Can you guide us on how to debug this further?

February 19, 2025 at 2:57 am #16721601

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

Hello,

There are currently no known issues:
https://wpml.org/plugin/pdf-invoices-and-packing-slips-for-woocommerce-2/

Could you please revise your WooCommerce Payment methods and verify that they all have a title given?

Best regards
Andreas

The topic ‘[Closed] WPML Causes Fatal Error with WooCommerce PDF Invoices & 404 on Localization File’ is closed to new replies.