Okay
  Public Ticket #1608603
Disable "Choose an option" in product page
Closed

Comments

  •  5
    geeckin0s started the conversation

    Hello is it possible to disable "choose an option" in product page so that the client can only select one of the attributes?

    Thanks!

  • [deleted] replied

    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!

  •  5
    geeckin0s replied

    Thank you but this is not the solution unfortunately. The user can still click the choose an option button.

  •  5
    geeckin0s replied

    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;
    }

  • [deleted] replied

    Thanks for your reply. I'm sure that other clients will find that code useful

    Have a great weekend!