在 Woocommerce 中,如果選擇了特定的城市字段,我會嘗試隱藏結帳郵政編碼字段。如果公司字段為空,我發(fā)現(xiàn)了一個隱藏計費電話的工作代碼:add_action( 'woocommerce_after_checkout_form', 'conditionally_hide_show_checkout_field', 9999 );function conditionally_hide_show_checkout_field() {wc_enqueue_js( " jQuery('#billing_company').keyup(function() { if (jQuery(this).val().length == 0) { jQuery('#billing_phone').hide(); } else { jQuery('#billing_phone').show(); } }).keyup();");}我不知道如何更改此代碼以在選擇特定賬單城市時隱藏所需的郵政編碼字段。任何幫助表示贊賞。
- 1 回答
- 0 關注
- 93 瀏覽
添加回答
舉報
0/150
提交
取消