• Resolved jalvkb

    (@jalvkb)


    Hi,

    I want to add new custom product type in WCFM using code only, Please provide documentation link or list of hooks/filters using which i can add new product type, product type tab, its form and when submit product form all data saved to Database

    Please help me ASAP

    Thanks in Advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WC Lovers

    (@wclovers)

    HI,

    You will require just this code to add new product type under WCFM Product Manager –

    add_filter( 'wcfm_product_types', function( $pro_types ) {
    	$pro_types['test_pro'] = __( 'Test Pro', 'wcfm' );
    	return $pro_types;
    }, 50 );

    Thank You

    Thread Starter jalvkb

    (@jalvkb)

    Hi,

    Thanks for the reply

    I used filter as you mentioned(wcfm_product_types) to add new custom product type, then i added new custom fields to product form and now i want to save that field’s data to my tables when form is submitted.

    So using which hook, i can do this ?

    Plugin Author WC Lovers

    (@wclovers)

    HI,

    Well, if you have created custom field using WCFM custom fields – https://wclovers.com/knowledgebase/wcfm-custom-fields/
    then those will be automatically saved, no additional code will require.

    Otherwise you may use this hook to save additional data – do_action( 'after_wcfm_products_manage_meta_save', $new_product_id, $wcfm_products_manage_form_data );

    Thank You

    Thread Starter jalvkb

    (@jalvkb)

    Ok, Thanks a lot for the help.

    Plugin Author WC Lovers

    (@wclovers)

    You are always welcome 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Add new custom product type’ is closed to new replies.