0

I would like to hide attributes terms or values from variation dropdown list and also enabled not disabled. just hide it from selecting in variations dropdown list because I want To use this variation ID as a single product.

My Example is hide attribute value woocommerce

I found the below code which helps me of what Exactly I need but it makes the attribute value or variation Id disabled and I can't use it anymore as a single product by variation Id

Hide specific product attribute terms on WooCommerce variable product dropdown

1 Answers1

1

If you can hide an option/attribute only in this dropdown then you should have 2 options:

  1. Hide by using CSS

  2. Hide by using JS like this-

    option1)

    $('#test').find('option[text="Domains Num"]').css('display','none'); OR $('#test').find('option[text="Domains Num"]').hide();
    

    option2)

    $('#mySelect option:contains(' + value + ')').css('display','none');
    

In your Js file or footer.php page

Rajeev Singh
  • 1,724
  • 1
  • 6
  • 23
  • Option 1 not working and Option 2, Do I replace value with Domains num to be like that $('#mySelect option:contains(' + Domains Num + ')').css('display','none'); – Sherif Wahid Nov 22 '22 at 17:00