- Status
- Resolvido
- Relatado para
- WPML Multilingual & Multicurrency for WooCommerce 5.3.0
- Resolvido em
- WooCommerce Multilingual & Multicurrency 5.3.1
- Tags de tópico
- WCML
Visão geral do problema
Se você estiver usando o WPML Multilingual & Multimoeda para WooCommerce e seu modo autônomo com o Stripe como gateway de pagamento, poderá encontrar problemas ao tentar fazer pagamentos em uma moeda secundária. Especificamente, o gateway de pagamento Stripe pode não estar disponível durante o checkout na moeda secundária se não estiver configurado.
Solução alternativa
Por favor, certifique-se de ter um backup completo do seu site antes de prosseguir.
- Abra o arquivo …/wp-content/plugins/woocommerce-multilingual/classes/multi-currency/payment-gateways/class-wcml-payment-gateway-stripe.php.
- Procure a linha 78.
- Altere:
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']; } } - Para:
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']; } }