在Woocommerce中,如果选择了特定的状态字段,我试图隐藏结帐邮政编码字段。
我正在遵循以下代码:Show or hide checkout postcode field based on chosen city in WooCommerce
此代码由@LoicTheAztec爵士编写,我已经更改了这些值
jQuery(function($){
var bc = '#billing_city_field input',
sc = '#shipping_city_field input',
收件人
jQuery(function($){
var bc = '#billing_state_field input',
sc = '#shipping_state_field input',
但是它不起作用。
我想在状态为Newyork时显示邮政编码(带有必填字段),而对于所有其他状态,它将隐藏。
需要帮助。 问候。