Overview of the Issue
When using WPML Multilingual & Multicurrency for WooCommerce 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
This issue is fixed in WooCommerce Multilingual & Multicurrency 5.5.1. Updating solves it on your site, so you only need this workaround if you can’t update yet.
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 );
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question