Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Auto create default product when vendor will register.
Tagged: default product
- This topic has 5 replies, 2 voices, and was last updated 5 years, 3 months ago by WCFM Forum.
- AuthorPosts
- September 10, 2019 at 5:42 pm #81064Jose SolsonaParticipant
Hi!
Exist the posibility to auto create a default product when vendor register on the site?Someway with third party plugin or same like…
Is it possible?
- September 14, 2019 at 11:04 pm #81669WCFM ForumMember
Hi,
Well, this is off course possible to add a default product for vendors just after registration.
But, what will be configuration for that product?
Thank You
- September 16, 2019 at 3:16 pm #81938Jose SolsonaParticipant
I need a product with the next caracteristics:
Name: Pagar con tarjeta
Price: 1€
Description: No description
No shipping (because desactivated)
No attributes (because desactivated)That’s all.
- September 19, 2019 at 4:11 pm #82436WCFM ForumMember
Hi,
Please add this code to your site –
add_action( 'wcfmmp_new_store_created', function( $member_id, $wcfmmp_settings ) { $product_args = array( 'post_title' => 'Pagar con tarjeta', 'post_status' => 'publish', 'post_type' => 'product', 'post_author' => $member_id, 'post_name' => sanitize_title('Pagar con tarjeta') ); $new_product_id = wp_insert_post( $product_args, true ); update_post_meta( $new_product_id, '_wcfm_product_author', $member_id ); // Set Product Type wp_set_object_terms( $new_product_id, 'simple', 'product_type' ); // Set Price update_post_meta( $new_product_id, '_regular_price', '1' ); update_post_meta( $new_product_id, '_price', '1' ); }, 50, 2 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- September 19, 2019 at 10:27 pm #82549Jose SolsonaParticipant
thanks you, it worked!
- September 21, 2019 at 9:45 pm #82832WCFM ForumMember
Great … you are welcome 🙂
- AuthorPosts
- The topic ‘Auto create default product when vendor will register.’ is closed to new replies.