Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
After updating WooCommerce Multilingual (WCML) to version 5.3.4, the client received PHP warnings related to an undefined property in WooCommerce payment gateways. Downgrading to version 5.3.3.1 resolved the warnings.
Solution:
We acknowledged the issue as known and informed the client that our developers were working on a permanent fix. We directed the client to our errata page for more details: https://wpml.org/errata/woocommerce-checkout-add-ons-and-woocommerce-paypal-payments-fees-not-added-to-paypal-in-multicurrency-setup/. We also updated the client that WCML 5.3.5 was being prepared for release, which should address the issue: https://wpml.org/errata/woocommerce-multilingual-5-3-4-gateway-issues/.

If you're experiencing this issue, we recommend checking the related known issues and verifying the version of the permanent fix. It's also important to confirm that you have installed the latest versions of themes and plugins. If the solution provided here is irrelevant to your case, either because it's outdated or not applicable, please open a new support ticket. We highly recommend visiting our known issues page for the most current information.

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 4 replies, has 3 voices.

Last updated by Dražen Duvnjak 9 months ago.

Assisted by: Dražen Duvnjak.

Author Posts
February 20, 2024 at 5:16 pm #15324215

johannesB-16

Hi,
after updating WCML to version version 5.3.4, I recieve a lot of PHP warnings:

Got error 'PHP message: PHP Warning: Undefined property: WooCommerce::$payment_gateways in /var/www/vhosts/****/httpdocs/wp-content/****/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php on line 118', referer: hidden link

Now I downgrade to version 5.3.3.1 and instantly the warning is gone.

February 21, 2024 at 8:07 pm #15330354

Lucas Vidal de Andrade
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with first debugging steps or if I can perhaps help with the issue quickly.

Even though this error has been resolved in the latest WCML update, I'll ask you to check your code that is described in this errata, to make sure yours is updated.

https://wpml.org/forums/topic/php-warning-undefined-property-woocommercepayment_gateways/

If it's something different than the final version described in the errata, please share it.

February 22, 2024 at 7:15 am #15331194

johannesB-16

Hi and thanks for the reply.

I've updated to Version 5.3.4 again and this my code says this on line 38-41:

* Since WC 8.5 we have `wc_payment_gateways_initialized` to load our code only when
* needed. Before that, we have to use `wp_loaded` and get the instance ourselves,
* which causes gateways to be loaded on every request.
*/
$hook = version_compare( WC_VERSION, '8.5', '>=' )
? 'wc_payment_gateways_initialized'
: 'wp_loaded';
add_action( $hook, [ $this, 'init_gateways' ] );

PHP Warnings are coming up again.

wcml.png
February 22, 2024 at 11:32 am #15333188

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

I checked further and it seems it is a known issue and our devs are working on a permanent fix.

- https://wpml.org/errata/woocommerce-checkout-add-ons-and-woocommerce-paypal-payments-fees-not-added-to-paypal-in-multicurrency-setup/

I am not sure if you have any other issues than just a warning message, if not I will keep this ticket escalated and update you when there is a version with a permanent fix released.

Hope this makes sense.

Regards,
Drazen

February 22, 2024 at 1:06 pm #15333687

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

just to update you, we are preparing the release today or in the next few days for his issue, WCML 5.3.5.

Rlated errata page:
- https://wpml.org/errata/woocommerce-multilingual-5-3-4-gateway-issues/

Regards,
Drazen

February 23, 2024 at 9:51 am #15336817

johannesB-16

Thanks, after installing the Version 5.3.5 it seems to be fixed.