WPML
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.

  1. Mở /wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-payment-gateway-bacs.php.
  2. Tìm dòng 35.
  3. 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; 
  4. 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; 
  5. Đi tới WooCommerce > WooCommerce Multilingual & Multicurrency > Đa tiền tệ
  6. 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ệ”
  7. Bật tùy chọn “Cổng thanh toán” cho mỗi loại tiền tệ
  8. Lưu các thay đổi

Tất cả các lỗi đã ghi nhận →