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.

This topic contains 6 replies, has 2 voices.

Last updated by Carlos Rojas 1 year, 10 months ago.

Assisted by: Carlos Rojas.

Author Posts
April 24, 2022 at 10:25 pm #11086779

desireeM

woocommerce-multilingual/inc/class-wcml-orders.php

in function get_order_items_language_to_filter

You have this code:

```
/**
* This filter hook allows to override item language to filter.
*
* @since 4.11.0
*
* @param $language string Order item language to filter.
* @param $order WC_Order
*/
return apply_filters( 'wcml_get_order_items_language', $language, $order );
```

where the ordering of things in phpdoc is wrong.
Please change to:

```
/**
* This filter hook allows to override item language to filter.
*
* @since 4.11.0
*
* @param string $language Order item language to filter.
* @param WC_Order $order
*/
return apply_filters( 'wcml_get_order_items_language', $language, $order );
```

April 24, 2022 at 10:28 pm #11086781

desireeM

Same thing in same file also wrong ordering of phpdoc:

/**
* This filter hook allows to override if we need to save adjusted order item.
*
* @since 4.11.0
*
* @param bool True if we should save adjusted order item.
* @param $item WC_Order_Item
* @param $language_to_filter string Language to filter.
*/
$save_adjusted_item = apply_filters( 'wcml_should_save_adjusted_order_item_in_language', true, $item, $language_to_filter );

Should be:

/**
* This filter hook allows to override if we need to save adjusted order item.
*
* @since 4.11.0
*
* @param bool True if we should save adjusted order item.
* @param WC_Order_Item $item
* @param string $language_to_filter Language to filter.
*/
$save_adjusted_item = apply_filters( 'wcml_should_save_adjusted_order_item_in_language', true, $item, $language_to_filter );

Also here:
/**
* This filter hook allows to override if we need to translate order items.
*
* @since 4.11.0
*
* @param bool True if we should to translate order items.
* @param $items WC_Order_Item[] Order items.
* @param $order WC_Order WC Order.
*/
$translate_order_items = apply_filters( 'wcml_should_translate_order_items', $translate_order_items, $items, $order );

should be:

/**
* This filter hook allows to override if we need to translate order items.
*
* @since 4.11.0
*
* @param bool True if we should to translate order items.
* @param WC_Order_Item[] $items Order items.
* @param WC_Order $order WC Order.
*/
$translate_order_items = apply_filters( 'wcml_should_translate_order_items', $translate_order_items, $items, $order );

April 26, 2022 at 2:08 pm #11097557

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+01:00)

Hello,
Thank you for reporting this.

I have escalated this ticket to our 2nd tier of support so our specialists in the 2nd tier can take a deeper look at this.

I will get back to you as soon as I get an answer from them.
Regards,
Carlos

June 1, 2022 at 7:03 am #11359171

desireeM

Hi it's been 1.5 months, I just wanted to check in and ask if/when this is going to be fixed? This is a really minor issue that could be fixed within an hour easily.

June 1, 2022 at 2:18 pm #11363505

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+01:00)

Hi there,

This fixes are already applied in the latest version of WCML 🙂

Regards,
Carlos

June 1, 2022 at 11:39 pm #11366363

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+01:00)

Hi there,

Please don't hesitate to contact us if you need our help in the future with WPML. We will be more than happy to help.

Best regards,
Carlos

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.