WPML
Status
Waiting for author
Topic tags
Compatibility

Overview of the issue

When using WooCommerce PDF Invoices by Andrew Benbow for generating invoices, the PDF always displays the terms page in the primary language. Additionally, you cannot save language-specific settings for the terms page, preventing proper translation.

Workaround

Please, make sure of having a full site backup of your site before proceeding.


  • Open the …/wp-content/plugins/woocommerce-pdf-invoice/classes/class-pdf-send-pdf-class.php file.

  • Look for line 183.

  • Replace:
    // Get the WooCommerce order_id
    $order_id   	= $order->get_id();
            


  • With:
    // Get the WooCommerce order_id
    $order_id   	= $order->get_id();
    
    // WPML workaround for compsupp-7811
    $order_lang = $order->get_meta( 'wpml_language', true );
    $settings['pdf_termsid'] = apply_filters( 'wpml_object_id', $settings['pdf_termsid'], 'page', TRUE, $order_lang );
            

All known issues →