- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPML Multilingual & Multicurrency for WooCommerce 5.3.0
- Đã giải quyết trong
- WooCommerce Multilingual & Multicurrency 5.3.1
- Thẻ chủ đề
- WCML
Tổng quan về lỗi
Nếu bạn đang sử dụng WPML Đa ngôn ngữ & Đa tiền tệ cho WooCommerce và chế độ độc lập của nó với Stripe làm cổng thanh toán, bạn có thể gặp sự cố khi cố gắng thực hiện thanh toán bằng tiền tệ phụ. Cụ thể, cổng thanh toán Stripe có thể không khả dụng trong quá trình thanh toán bằng tiền tệ phụ nếu nó chưa được thiết lập.
Giải pháp tạm thời
Vui lòng đảm bảo đã tạo một bản sao lưu toàn bộ cho trang web của bạn trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-payment-gateway-stripe.php.
- Tìm dòng 78.
- Đổi:
if ( $gateway_settings && isset( $gateway_settings[ $client_currency ] ) ) { $gateway_setting = $gateway_settings[ $client_currency ]; if ( isset( $gateway_setting['publishable_key'] ) && isset( $gateway_setting['secret_key'] ) ) { $settings['publishable_key'] = $gateway_setting['publishable_key']; $settings['secret_key'] = $gateway_setting['secret_key']; } if ( isset( $gateway_setting['test_publishable_key'] ) && isset( $gateway_setting['test_secret_key'] ) ) { $settings['test_publishable_key'] = $gateway_setting['test_publishable_key']; $settings['test_secret_key'] = $gateway_setting['test_secret_key']; } } - Thành:
if ( $gateway_settings && isset( $gateway_settings[ $client_currency ] ) ) { $gateway_setting = $gateway_settings[ $client_currency ]; if ( ! empty( $gateway_setting['publishable_key'] ) && ! empty( $gateway_setting['secret_key'] ) ) { $settings['publishable_key'] = $gateway_setting['publishable_key']; $settings['secret_key'] = $gateway_setting['secret_key']; } if ( ! empty( $gateway_setting['test_publishable_key'] ) && ! empty( $gateway_setting['test_secret_key'] ) ) { $settings['test_publishable_key'] = $gateway_setting['test_publishable_key']; $settings['test_secret_key'] = $gateway_setting['test_secret_key']; } }