Hey, all. How could I implement conditional logic on the form fields for WooCommerce?I have the following array and the woocommerce\_form\_field, so how could I, for example, create another form field based on the option selected, or simply echoing a statement? Thanks!
Edit: Sorry that Reddit code is a mess, but I tried to fix it.
$options = array(
“” => __(‘Select Option’),
“OP1” => “Option1”,
“OP1” => “Option2”,
“OP2” => “Option3”,
“OP3” => “Option4”,
“OP4” => “Option5″,
);
woocommerce_form_field(‘form_field_name’, array(
‘type’ => ‘select’,
‘class’ => array(‘my-field-class form-row-wide’),
‘label’ => __(”, $domain),
‘required’ => true,
‘options’ => $options,
),”
);
​
[ad_2]