Remove entire variable dropdown menu altogether
-
I would like the option to remove the entire variable drop down menu(s) whenever there is only 1 option for every variation. The pseudo code:
if( all variation options only have 1 value ) { remove all variation menu dropdowns }
I found something but it also removed the add to cart button and quantity, and it did so indiscriminately:function removing_variable_add_to_cart_template(){ global $product; // Only for variable products if( $product->is_type( 'variable' ) ){ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); } }
I’ve shown a pic here.
Here’s the page I took the screenshot on, a page where the code would be necessary.Now, you may be thinking, but what is the point? If there is only 1 variation, why not just make it a simple product? I can explain in a reply if asked, as it’s pretty much useless information. In short, variable products have functionality that I need.
The page I need help with: [log in to see the link]
- The topic ‘Remove entire variable dropdown menu altogether’ is closed to new replies.