有没有办法在WooCommerce结帐页面中执行此操作 .
我想要的只是WooCommerce结账页面中的自定义textarea字段,当我开始在textarea中写一些内容时,支付网关将自动从paypal更改为check
好吧,假设 #txt1 ,你的textarea的id
#txt1
在你的 functions.php
functions.php
function bh_change_gateway() {?> <script> jQuery('#txt1').keyup(function(){ jQuery( '.payment_methods input.input-radio' ).removeProp('checked'); jQuery( '#your_payment_gateway_id').attr("checked", "checked"); }) </script> <?} add_action('woocommerce_review_order_before_submit','bh_change_gateway' );
谢谢!
1 回答
好吧,假设
#txt1
,你的textarea的id在你的
functions.php
谢谢!