Add product_type on wcfm plugin

Viewed 140

I try to add add groupbuy product type from this plugin on another plugin.

On admin account, it's possible to add "groupbuy" product with all required specific field for this product.

But, I want to allow the vendor (role provided by the plugin WCFM), to add this product, at the moment the groupbuy product is not available on the add panel product. Only "Simple product, Variable product, Grouped product, External product" are available.

My question is how to add this new type product (and with is dedicated form/tab to add specific field) on this plugin.

1 Answers

I have found the following snippet in wcfm forum so try it

add_filter( 'wcfm_product_types', function( $pro_types ) {
    $pro_types['new_product'] = __( 'New Product', 'woocommerce' );
    return $pro_types;
}, 50 );

Where new_product is the product type name and New Product is what your vendors will see as name.

Related