Skip Navigation

Open

Reported for: WooCommerce Multilingual & Multicurrency 5.5.0

Topic Tags: Compatibility, WCML

Overview of the issue

When using WooCommerce Multilingual with WPML, you might experience the following fatal error when saving product translations using the native WordPress editor:

PHP Fatal error: Uncaught TypeError: Cannot access offset of type WP_Post in isset or empty in .../wp-content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-element-translation.php:282

Workaround

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

  • Open the …/wp-content/plugins/woocommerce-multilingual/classes/Synchronization/Hooks.php file.
  • Look for line 184.
  • Replace:
    $originalLanguage = $this->manager->getElementLanguage( $originalProduct );
            
  • With:
    $originalLanguage = $this->manager->getElementLanguage( $originalProduct->ID );
            

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>