Skip to content Skip to sidebar

Open

Topic Tags: WCML

Overview of the issue

When sending Products for translation, they may in some circumstances become stuck.

A key symptom of this particular case is a PHP Warning in the debug.log:

>PHP Warning Undefined array key “values” in /var/www/sites/red-harmonica/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-tp-support.php on line 158

The issue happens when the product has attributes with values that are wholly made of special characters, e.g. “+ & -“, which has no letters.

Workaround

This will be fixed in WCML 5.5.3, but in the meantime you can directly edit the plugin file wp-content/plugins/woocommerce-multilingual/inc/class-wcml-tp-support.php.

Locate this line (line 158 in the current version):

$product_attributes[ $attribute_key ]['value'] = join( ' | ', $attribute['values'] );

and replace it with

$product_attributes[ $attribute_key ]['value'] = isset( $attribute['values'] ) ? join( ' | ', $attribute['values'] ) : $product_attributes[ $attribute_key ]['value'];

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>