Child theme – new product type not visible

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Child theme – new product type not visible

Viewing 1 reply thread
  • Author
    Posts
    • #32234
      inspire
      Participant

      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’ );

    • #32268
      WCFM Forum
      Member

      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

Viewing 1 reply thread
  • The topic ‘Child theme – new product type not visible’ is closed to new replies.