Hide ‘add to cart’ when certain value in dropdown is selected


Need help here please. I am trying to hide the ‘add to cart’ woocommerce button when a user selects a specific item in a dropdown list. I have tried multiple JQuery snippets in both functions.php and through 3rd party plugins but am still struggling to get it to work.

In Functions.php theme file

function load_scripts() {
    <script type="text/javascript">
            $( "select option:selected").each(function(){
add_action('wp_enqueue_scripts', 'load_scripts');

Please can someone assist with simple steps to 1) provide correct code, and 2) insert in the woocommerce.com hosted plarform.

Much appreciated!

Greg 3 months 0 Answers 9 views 0

Leave an answer