Reported for: WPML String Translation 2.4.2
Resolved in: WPML String Translation 188.8.131.52
When using WooCommerce Multilingual 3.8.6 with WPML 3.5.3 some errors are being displayed (or logged) on the order confirmation page, after placing an order in a secondary language.
The error message is similar to the one below:
PHP Notice: Undefined index: order-received in ../wp-content/plugins/woocommerce-multilingual/inc/class-wcml-endpoints.php on line 155
In addition to the error message, instead of the ‘Order Received’ page with the order details, users are being shown the translated ‘Checkout’ page without any content.
Despite the fact that the orders are, however, fulfilled and notification emails being sent, the clients could get confused and think that the order didn’t go through and send duplicate orders.
We’ve found out that this comes from a change in WPML String Translation 2.4.2. A fix is already on the way but we need to test it well before we release an update.
A way to fix this is to use the beta version 184.108.40.206-b1 for WPML String Translation. It addresses only this particular issue and should not have an impact on anything else. It is, however, a beta version so caution is recommended: backup your site and preferable test it first on a non-production environment.
There is another possible workaround that you can use temporarily and which should not affect the user experience by too much. This workaround involves marking the string corresponding to the ‘order-received’ endpoint as not translate it. You don’t need to delete the string but just untick the ‘translation is complete’ checkbox. Here are the steps for a case when you have English as the default language. The steps are identical if your site uses a different default language.
- Go to WPML -> String Translation
- Search for ‘order-received’ or navigate to the ‘WooCommerce Endpoints’ domain and find the ‘order-received’ string.
- Expand the ‘translations’ section for the ‘order-received’ string
- Uncheck the ‘Translation is complete’ checkbox and click ‘Save’ for all languages
After this, your ‘Order Received’ page will still be translated. It’s just that the endpoint string in the url will not be translated.