如何在 WordPress 上的 WooCommerce 运行 中解决 "Gateway disabled: PayPal Standard does not support your store currency."?

How can I solve "Gateway disabled: PayPal Standard does not support your store currency." in WooCommerce running on WordPress?

我在一个使用 WordPress 和 Woocommerce 插件的网站上工作,我想使用 PayPal 作为支付网关,但每次我尝试时都会收到消息“网关已禁用:PayPal 标准不支持您的商店货币”设置贝宝。我住在肯尼亚,货币是(肯尼亚先令),PayPal 不支持。我已经阅读了很多文章,解释了如何通过在我的主题 functions.php 上添加一些代码来解决这个问题(甚至解释了 here)。

我不想使用 child 主题,有没有地方可以直接修改 WooCommerce 插件中的代码?在我的 functions.php 文件中使用以下代码无效。

add_filter( ‘woocommerce_paypal_supported_currencies’, ‘add_paypal_valid_currency’ );
function add_paypal_valid_currency( $currencies ) {
array_push ( $currencies , ‘Ksh’ ); /* YOUR CURRENCY */
return $currencies;
}

要使用 PayPal,交易必须以受支持的 PayPal 货币计价,例如美元或欧元。

所以,改变你的商店商店使用这样的货币。修改代码以强制启用 PayPal Standard,即使您使用的是不受支持的货币也只会导致结帐错误,因为 PayPal 将拒绝以 KSH 计价的交易。

当使用受支持的货币时,如果付款人有其他一些当地货币(例如 KSH)的资金来源,转换将在 PayPal 结账时显示给他们。