1

大家好,我有麻烦了!

我想问你如何为波纹管函数 field_cliente 的每个选项制作 1 个条件代码:

function field_cliente( $fields) {
    $fields['billing']['billing_cliente'] = array (
        'label' => __('Tipo di Cliente', 'woocommerce'),
        'id' => '_select', 
        'type' => 'select',
        'options' => array (
            'default' => __( 'Seleziona', 'woocommerce' ),
            'one' => __( 'Privato', 'woocommerce' ),
            'two' => __( 'Azienda', 'woocommerce' ),
            'three' => __( 'Impresa Individuale', 'woocommerce' )
        )
    );

    return $fields;
}

例如:

If "One" {
    add_filter(' ..');
    etc...
}

if "Two" {
    add_filter(' ..');
}

我需要知道这样做的方式,因为我正在尝试为客户端在网页结帐中选择的每个条件展示过滤器

4

0 回答 0