• Resolved jomonter

    (@jomonter)


    Hello I need help in include class personalize in options mi actuality code is this

    add_filter( ‘woocommerce_checkout_fields’ , ‘extra_field’ );
    function extra_field( $fields ) {

    $documentos = array(
    ” => ‘Seleccione Tipo de Documento’,

    );

    $fields[‘billing’][‘tipo_documento’] = array(
    ‘input_class’ => array( ‘estilo select-display’),
    ‘label’ => __(‘Tipo de documento’, ‘woocommerce’),
    ‘required’ => true,
    ‘class’ => array(‘woocommerce-form-row woocommerce-form-row–wide form-row form-row-wide’)
    );

    $fields[‘billing’][‘tipo_documento’][‘type’] = ‘select’;
    $fields[‘billing’][‘tipo_documento’][‘options’] = $documentos;

    $fields[‘billing’][‘documento’] = array(
    ‘input_class’ => array( ‘estilo select-display’),
    ‘label’ => __(‘Documento’, ‘woocommerce’),
    ‘required’ => true,
    ‘class’ => array(‘form-row-first’),
    ‘options’ => array(
    ‘hola’
    )
    );

    $documento = array(
    ‘0’ => __(‘Seleccione Documento’, ‘woocommerce’),
    ‘J’ => __(‘J’, ‘abe-documento’),
    ‘V’ => __(‘V’, ‘abe-documento’),
    ‘E’ => __(‘E’, ‘abe-documento’),
    ‘P’ => __(‘P’, ‘abe-documento’),
    );

    $fields[‘billing’][‘documento’][‘type’] = ‘select’;
    $fields[‘billing’][‘documento’][‘options’] = $documento;
    $fields[‘billing’][‘documento’][‘options’][‘class’] = ‘abe-documento’;

    $fields[‘billing’][‘documento_id’] = array(
    ‘required’ => true,
    ‘label’ => __(‘ ‘, ‘woocommerce’),
    ‘placeholder’ => ‘33355777’,
    ‘class’ => array(‘form-row-last’)
    );
    return $fields;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How include class in optios’ is closed to new replies.