我需要在WooCommerce运费计算器中设置默认国家(美国)。有人可以建议我如何仅在WooCommerce运费计算器中而不在结帐字段中设置默认国家(美国)。
jQuery('#calc_shipping_country option[value=US]').attr('selected','selected');
jQuery(function ($) {
var $country_input = $(this).find('#calc_shipping_country');
$country_input.val('IN');
});
尝试此代码