Ok for anyone interested here is the code that solved the issue
add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'wc_remove_options_text'); function wc_remove_options_text( $args ){ $args['show_option_none'] = false; //Instead of giving it a blank value, you return false return $args; }
Hello is it possible to disable "choose an option" in product page so that the client can only select one of the attributes?
Thanks!
Hi there,
I think that this option can be tweaked in that Product page > Variations > Default Form Values area. For more info please see video.
Have a great weekend!
Thank you but this is not the solution unfortunately. The user can still click the choose an option button.
Ok for anyone interested here is the code that solved the issue
add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'wc_remove_options_text');
function wc_remove_options_text( $args ){
$args['show_option_none'] = false; //Instead of giving it a blank value, you return false
return $args;
}
Thanks for your reply. I'm sure that other clients will find that code useful
Have a great weekend!