This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to configure WooCommerce PDF Invoices to generate invoices in different languages using WPML, but you can't save the settings for each language. The PDF always generates information in English, and the button cannot be translated because the page settings are not saved.
Solution:
Firstly, it's important to note that the WooCommerce PDF Invoices plugin by Andrew Benbow is not officially compatible with WPML. We recommend using a compatible plugin like WooCommerce PDF Invoices and Packing Slips Professional.
However, as a workaround, you can try the following steps:
1. Open
.../wp-content/plugins/woocommerce-pdf-invoice/classes/class-pdf-send-pdf-class.php
2. Look for line 183 and replace:
// Get the WooCommerce order_id<br />$order_id = $order->get_id();
with:
// Get the WooCommerce order_id<br />$order_id = $order->get_id();<br /><br />// WPML workaround for compsupp-7811<br />$order_lang = $order->get_meta('wpml_language', true);<br />$settings['pdf_termsid'] = apply_filters('wpml_object_id', $settings['pdf_termsid'], 'page', TRUE, $order_lang);
This code should help translate the page_ID based on the order language.
If this solution does not resolve your issue or seems outdated, please check the related known issues and ensure you have the latest versions of themes and plugins installed. If necessary, do not hesitate to open a new support ticket at WPML support forum for further assistance.
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.