选择城市时如何自动填写邮政​​编码/邮政编码,必须从运输区域加载邮政编码

时间:2018-07-31 10:10:21

标签: wordpress woocommerce

我已使用此代码进行城市下拉 我需要自动填写运输区域的邮政编码/邮编

// Define here in the array your desired cities (Here an example of cities)
$option_cities = array(
     '' => __( 'Select your city' ),
    'Ampara' => 'Ampara',
    'Anuradhapura' => 'Anuradhapura',
    'Badulla' => 'Badulla',
    'Batticaloa' => 'Batticaloa',
    'Colombo' => 'Colombo',
    'Vavuniya' => 'Vavuniya'
);

$fields['billing']['billing_city']['type'] = 'select';
$fields['billing']['billing_city']['options'] = $option_cities;
$fields['shipping']['shipping_city']['type'] = 'select';
$fields['shipping']['shipping_city']['options'] = $option_cities;

return $fields;

}

0 个答案:

没有答案