如何正确地将下拉(选择)输出的数据获取到管理员的Woocommerce订单详细信息部分?
当我这样做的时候,我会得到所有文本框问题的输出,但选择(下拉列表)没有输出。
$this->address_formats = apply_filters(\'woocommerce_localisation_address_formats\', array(
\'default\' => "{question}\\n"
function get_address_fields( $country, $type = \'billing_\' ) {
$locale = $this->get_country_locale();
$fields = array(
\'question\' => array(
\'label\' => __(\'Question?\', \'woocommerce\'),
\'placeholder\' => _x(\'\', \'placeholder\', \'woocommerce\'),
\'required\' => yes,
\'clear\' => yes,
\'type\' => \'select\',
\'option\' => array(
\'yes\' => __(\'yes\', \'woocommerce\' ),
\'no\' => __(\'no\', \'woocommerce\' )
)),
);
当我这样做时,我不会在Woocommerce的订单详细信息中获得任何数据输出
$options[] = array(
\'question\' => array(
\'label\' => __(\'Question?\', \'woocommerce\'),
\'placeholder\' => _x(\'\', \'placeholder\', \'woocommerce\'),
\'required\' => yes,
\'clear\' => yes,
\'type\' => \'select\',
\'options\' => $test_array
)));
$test_array = array(
\'no\' => __(\'yes\', \'woocommerce\' ),
\'yes\' => __(\'no\', \'woocommerce\' )
);