WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Variation products disable

[Resolved] Variation products disable

  • Hi

    There’s any way I can disable Variation products support in WooCommerce Product admin and in general?

    I try the following code:

    function ns_variable_product_type_selector( $types, $product_type ) {
    	unset($types['grouped']);
    	unset($types['external']);
    	unset($types['variable']);
    	return $types;
    }
    add_filter('product_type_selector', 'ns_variable_product_type_selector', 1, 2);

    And External and Grouped disable but not Variable.

    Any suggestion please?

    Thanks in advance

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mike Jolley

    @mikejolley

    add_filter('product_type_selector', 'remove_variable_products', 10, 2);
    
    function remove_variable_products( $types ) {
    
    unset( $types['variable'] );
    
    return $types;
    }

    Wow! Incredible, the difference it’s just the priority argument in add_filter.

    Thanks Mike!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Variation products disable’ is closed to new replies.