Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Child theme – new product type not visible
Tagged: Child theme, not visible, product type
- This topic has 1 reply, 2 voices, and was last updated 6 years, 2 months ago by WCFM Forum.
- AuthorPosts
- September 22, 2018 at 1:54 pm #32234inspireParticipant
Hello,
Congrats for the wonderful plugin.
Please help me to make visible a new product type in your interface.
I use a child theme and the code from below. Unfortunately the new product type is not visible in your interface, is just visible in WP-admin interface.Thank you!
function register_simple_rental_product_type() {
/**
* This should be in its own separate file.
*/
class WC_Product_Simple_Rental extends WC_Product_Simple {public function __construct( $product ) {
$this->product_type = ‘simple_rental’;
parent::__construct( $product );
}
}
}
add_action( ‘init’, ‘register_simple_rental_product_type’ );
function add_simple_rental_product( $types ){// Key should be exactly the same as in the class product_type parameter
$types[ ‘simple_rental’ ] = __( ‘Simple Rental’ );return $types;
}
add_filter( ‘product_type_selector’, ‘add_simple_rental_product’ ); - September 22, 2018 at 5:21 pm #32268WCFM ForumMember
Hi,
Please use this code for the purpose –
function wcfm_custom_product_type( $product_types ) { $product_types[ 'simple_rental' ] = __( 'Simple Rental' ); return $product_types; } add_filter( 'wcfm_product_types', 'wcfm_custom_product_type', 500 );
Thank You
- AuthorPosts
- The topic ‘Child theme – new product type not visible’ is closed to new replies.