- 状态
- 已解决
- 报告针对
- WPML Multilingual & Multicurrency for WooCommerce 5.5.4
- 解决于
- WPML Multilingual & Multicurrency for WooCommerce 5.5.5
- 相关插件/主题
- WooCommerce PayPal Payments
- 主题标签
- Compatibility, WCML
问题概述
将 WooCommerce PayPal Payments 与 WPML 一起使用时,在将 WooCommerce Multilingual & 多货币更新至 5.5.4 版本后,您可能会遇到致命错误。
Warning: Undefined array key "ppcp-gateway" in /wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-currencies-payment-gateways.php on line 161
Fatal error: Uncaught Error: Call to a member function get_setting() on null
临时解决方法
在继续操作之前,请确保对站点进行完整备份。
- 打开 …/wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-currencies-payment-gateways.php 文件。
- 找到第 152 行。
- 将:
if ( in_array( $id, array_keys( $this->supported_gateways ), true ) ) { - 替换为:
if ( in_array( $id, array_keys( $this->supported_gateways ), true ) && in_array( $id, array_keys( $this->payment_gateways ), true ) ) {