Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress Woocommerce:限制装运状态,但不影响开票状态_Wordpress_Woocommerce - Fatal编程技术网

Wordpress Woocommerce:限制装运状态,但不影响开票状态

Wordpress Woocommerce:限制装运状态,但不影响开票状态,wordpress,woocommerce,Wordpress,Woocommerce,我需要限制国家(澳大利亚)在发货地址在结帐。 我不希望它限制计费状态。我希望所有的澳大利亚州都出现在账单字段中 该站点正在运行WC v4.2 我使用以下内容来限制计费和发货: // Only sell to Western Australia function sell_one_state( $states ) { $states['AU'] = array( 'WA' => __( 'Western Australia', 'woocommerce' ), );

我需要限制国家(澳大利亚)在发货地址在结帐。 我不希望它限制计费状态。我希望所有的澳大利亚州都出现在账单字段中

该站点正在运行WC v4.2

我使用以下内容来限制计费和发货:

// Only sell to Western Australia
function sell_one_state( $states ) {
   $states['AU'] = array(
      'WA' => __( 'Western Australia', 'woocommerce' ),
   );
   return $states;
}
add_filter( 'woocommerce_states', 'sell_one_state' );
但这既包括运输也包括计费

我尝试使用以下内容来限制装运状态,但没有任何效果:

// Only ship to Western Australia
function ship_wa_state_only( $states ) {
   $states[ 'AU' ] = array( 
       'WA' => __( 'Western Australia', 'woocommerce' ) 
   );
   return $states;
}
add_filter( 'woocommerce_countries_shipping_country_states', 'ship_wa_state_only' );
我遇到的另一个问题是shipping calculator是根据账单状态进行计算的。有没有办法根据送货地址计算

有没有办法满足我的需要