• Hello guys is there a way to create a default product when “Add new” button pressed? So when add new button pressed vendor is redirected to the newly created default product rather than directing to the form where he needs to add details manually. Thanks

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

    (@wclovers)

    It’s not necessary to create a default product for the purpose. We can pre-fill add product from with some default data.

    Between, what will be those default contents?

    Thread Starter lasithhh

    (@lasithhh)

    Hi,
    Thanks for the response.
    Product name = this is your product name
    Regular Price = 99.9
    Short description = this is short description
    Description = this is detailed product description
    Featured image = url
    One gallery image = url

    Is it possible to redirect the vendor to the single product page by auto submitting above information, when a user clicked add new button ?

    I want to let him see how this default product looks like (on our single product page ) before he start to add Product information by himself.
    Thanks

    Plugin Author WC Lovers

    (@wclovers)

    Is it possible to redirect the vendor to the single product page by auto submitting above information, when a user clicked add new button ?

    – This will not possible, without adding product it’s not possible to generate “preview”

    As I told you, we can pre-fill Add product form with some default data.

    Why you are not creating such a demo product to show preview to your vendors?

    Thread Starter lasithhh

    (@lasithhh)

    I am planning to create a method to inline edit products directly from the single product page, and now I am trying to connect it with WCFM. So whole process is like below. When a vendor logged into your dashboard he can create a default product by pressing add new button. Then he will be redirect to this product’s page (single product page of the product he just created). Then he can edit this product using my inline editor. Or he can edit it using wcfm editor by going back to wcfm dashboard.
    So is it possible to auto create ( auto submit) a product and redirect to its single product page just by pressing add new button ( basically what I need is skipping submit product details function and preView product function )?
    Hope I am clear this time. Thanks

    Plugin Author WC Lovers

    (@wclovers)

    WCFM Ultimate has product quick edit option from product archive and single product page.

    You may check demo here – https://wcfmmp.wcfmdemos.com/my-account/

    But it’s not possible to edit whole product from here, specially for variable products.

    How to pre-fill Add product form with default data? I really needs this! Thanks in advance

    Plugin Author WC Lovers

    (@wclovers)

    Add this snippet to your site –

    add_filter( 'wcfm_product_manage_fields_general', function( $general_fields, $product_id, $product_type ) {
    	if( !$product_id && isset( $general_fields['pro_title'] ) ) {
    		$general_fields['pro_title']['value'] = 'this is your product name';
    	}
    	return $general_fields;
    }, 50, 3 );
    add_filter( 'wcfm_product_manage_fields_pricing', function( $general_fields, $product_id, $product_type ) {
    	if( !$product_id && isset( $general_fields['regular_price'] ) ) {
    		$general_fields['regular_price']['value'] = '99.99';
    	}
    	return $general_fields;
    }, 50, 3 );
    add_filter( 'wcfm_product_manage_fields_content', function( $general_fields, $product_id, $product_type ) {
    	if( !$product_id && isset( $general_fields['excerpt'] ) ) {
    		$general_fields['excerpt']['value'] = 'this is short description';
    	}
    	if( !$product_id && isset( $general_fields['description'] ) ) {
    		$general_fields['description']['value'] = 'this is detailed product description';
    	}
    	return $general_fields;
    }, 50, 3 );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin – https://ww.wp.xz.cn/plugins/code-snippets/

    Thank you. Support is fast and effective!

    • This reply was modified 5 years, 9 months ago by denkriss.
    Plugin Author WC Lovers

    (@wclovers)

    You are always welcome 😊

    If you get a chance then please leave a review for me.

    Thank You

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

The topic ‘Create a default product when add new button pressed’ is closed to new replies.