Hide ‘Downloadable’ and ‘Virtual’ checkbox options from Variations?
-
I am trying hide / unset the ‘Downloadable’ and ‘Virtual’ checkbox options from Woocommerce entirely. I have managed to unset them everywhere EXCEPT in the Woocommerce Variations Panel.
Looking in the Woocommerce plugin files I can see an action hook called ‘woocommerce_variation_options’ which seems to spit out the options for these checkboxes. I can obviously do a “dirty” injection of CSS here but whats the correct method to unset these checkboxes in the variations product panel?
I am looking for something like this:
add_action( 'woocommerce_variation_options', 'my_customize_variation_fields_func', 10, 3 ); function my_customize_variation_fields_func( $loop, $variation_data, $variation ){ // Remove / Unset "Virtual" checkbox // Remove / Unset "Downloadable" checkbox }
I have tried using
unset( $variation[ 'virtual' ] );
here but does not work as it has in another filter hook (product_type_options)? Any help / advice appreciated ??
- The topic ‘Hide ‘Downloadable’ and ‘Virtual’ checkbox options from Variations?’ is closed to new replies.