更新时间:2023-12-01 17:37:46
我刚刚找到了解决方案.在 class-wc-cheque.php
文件中,使用 add_filter('woocommerce_payment_gateways', 'add_cheque_gateway' );
挂钩支票或支票"(疯狂英国人)选项.所以解决方案只是将此代码添加到我的 functions.php
文件中:
I just found the solution. In the class-wc-cheque.php
file, the check or "cheque" (crazy brits) option is hooked using add_filter('woocommerce_payment_gateways', 'add_cheque_gateway' );
. So the solution was simply to add this code to my functions.php
file:
if(!is_user_logged_in()){
remove_filter('woocommerce_payment_gateways', 'add_cheque_gateway' );
}
希望这会有所帮助!