- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPML Multilingual & Multicurrency for WooCommerce 4.12.0
- Đã giải quyết trong
- WCML 5.1.0
Tổng quan về lỗi
WPML Multilingual & Multicurrency for WooCommerce cho phép bạn thiết lập một tài khoản BACS khác cho mỗi loại tiền tệ. Tuy nhiên, WCML hiện đang liệt kê tất cả các tài khoản BACS khác nhau của cửa hàng bạn trên trang xác nhận đơn hàng và trong email thay vì tài khoản hợp lệ cho ngôn ngữ đã chọn.
Giải pháp tạm thời
Vui lòng tạo một bản sao lưu đầy đủ cho trang web của bạn trước khi tiếp tục.
- Mở /wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-payment-gateway-bacs.php.
- Tìm dòng 35.
- Thay thế:
if ( $gateway_setting && 'all' !== $gateway_setting['value'] ) { if ( 'all_in' === $gateway_setting['value'] ) { $bacs_accounts_currencies = get_option( WCML_WC_Gateways::WCML_BACS_ACCOUNTS_CURRENCIES_OPTION, [] ); foreach ( $bacs_accounts_currencies as $account_key => $currency ) { if ( $gateway_setting['currency'] === $currency ) { $allowed_accounts[] = $accounts[ $account_key ]; } } } else { $allowed_accounts[] = $accounts[ $gateway_setting['value'] ]; } } return $allowed_accounts ? $allowed_accounts : $accounts; - Bằng:
if ( $gateway_setting && 'all' !== $gateway_setting['value'] ) { $woocurrency = get_woocommerce_currency(); // to get default currency if ( 'all_in' === $gateway_setting['value'] ) { $bacs_accounts_currencies = get_option( WCML_WC_Gateways::WCML_BACS_ACCOUNTS_CURRENCIES_OPTION, [] ); foreach ( $bacs_accounts_currencies as $account_key => $currency ) { if ( $gateway_setting['currency'] === $currency ) { $allowed_accounts[] = $accounts[ $account_key ]; } if ( $gateway_setting['currency'] === NULL && $woocurrency && $woocurrency === $currency ) { //new condition for default currency $allowed_accounts[] = $accounts[ $account_key ]; } } } else { $allowed_accounts[] = $accounts[ $gateway_setting['value'] ]; } } return $allowed_accounts ? $allowed_accounts : $accounts; - Đi tới WooCommerce > WooCommerce Multilingual & Multicurrency > Đa tiền tệ
- Chỉnh sửa các loại tiền tệ khác nhau được thêm vào trong phần “Tiền tệ”
- Bật tùy chọn “Cổng thanh toán” cho mỗi loại tiền tệ
- Lưu các thay đổi