WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Variation products disable (3 posts)

  1. deryck
    Member
    Posted 2 years ago #

    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/

  2. Mike Jolley
    Member
    Plugin Author

    Posted 2 years ago #

    add_filter('product_type_selector', 'remove_variable_products', 10, 2);
    
    function remove_variable_products( $types ) {
    
    unset( $types['variable'] );
    
    return $types;
    }
  3. deryck
    Member
    Posted 2 years ago #

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

    Thanks Mike!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic