V
V
Vadim Sverdlik2021-10-01 20:42:41
WordPress
Vadim Sverdlik, 2021-10-01 20:42:41

How to remove the "Select an option" item in the dropdown list in Woocommerce Wordpress?

in the Product Card, where the parameters of the product are selected, there is this item "Select an option", you need to remove it and in order for those values ​​that are substituted in the list of parameters, it turns out to remove it everywhere except select , where the values ​​are taken from the drop-down list (screen)

add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'wc_remove_options_text');
function wc_remove_options_text( $args ){
$args['show_option_none'] = '';
return $args;
}

this function helps a lot, but if you click the "Clear filter" button, then this item is returned, how to remove it in this case?

615748716a243977246492.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
virus7, 2021-10-08
@virus7

in variations set the default value
616054bf57b50815885132.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question