Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Duplicate products
- This topic has 5 replies, 3 voices, and was last updated 4 years, 11 months ago by Craig.
- AuthorPosts
- December 11, 2019 at 2:34 pm #97023sdel_nevoParticipant
Hi Guys
is it possible that when a vendor duplicates a product, the category is not copied (leaving the category empty)
so that they have to assign this into the correct product category before its published.
I have a lot of vendors duplicating products, changing the text ETC. and publishing into the incorrect category because they do not change it
for example
a vendor creates a product called, “40th Birthday card”
adds an image and text
publishes in “Birthday cards”then duplicates this, changes to product tile to “Get well soon”
updates the images and textproduct is then published
this card is also in birthday cards, it should have been changed to “get well soon”
is that possible,
Steve
- December 12, 2019 at 5:15 pm #97233WCFM ForumMember
Hi,
Please add this code to your site for the purpose-
add_action( 'after_wcfm_product_duplicate', function( $new_product_id, $product ) { wp_delete_object_term_relationships( $new_product_id, 'product_cat' ); }, 50, 2 );
Thank You
- December 12, 2019 at 7:25 pm #97256sdel_nevoParticipant
Hi Guys
that’s great, works brilliantly
many thanks
Steve
- December 13, 2019 at 1:14 am #97307CraigParticipant
What file do we add that code to? Our functions.php ?
- December 13, 2019 at 3:40 am #97321sdel_nevoParticipant
Hi Craig
Yes mate
Put it in your functions.pho file
Steve
- December 13, 2019 at 4:06 am #97325CraigParticipant
Awesome thanks Steve!
- AuthorPosts
- The topic ‘Duplicate products’ is closed to new replies.