WooCommerce has a nice feature which allows you to duplicate a product and create new products starting from there. This saves a lot of time to shop managers and administrators.

But they are the only two (roles) who can duplicate products by default.

What if somebody needs the same feature, like a vendor?

There’s a filter in WooCommerce which you can use to change the capability needed to use this feature.

We know that vendors created with WooCommerce Product Vendors have the capability edit_products which allows them to edit their own products.

So, open your functions.php file located in wp-content/themes/your-theme-name/ and add this code at the end of the file:

This will allow any user who has the capability edit_products to duplicate products. It includes Administrators, Shop Managers, Vendors, or any other customer user role created with other plugins.

7 replies
  1. Enrico Buttignol
    Enrico Buttignol says:

    Ciao, grazie per questa spiegazione.
    Sapresti indicarmi gentilmente cosa dovrei scrivere per rimuovere completamente la funzione “duplicate” di WooCommerce?

    Grazie
    -Enrico

    Reply
  2. PRrONTO
    PRrONTO says:

    Is there a way of duplicating vendors for a particular product (I run a marketplace) instead of duplicating products for vendors?
    I think that will be more useful to me.
    Thanks

    Reply
  3. Szabolcs Sz
    Szabolcs Sz says:

    Thank you Nicola for the great post,

    I’m struggling with this because the snippet does seem to work for the vendors on my site.
    I ‘ve found this exact solution from different sources, added to my child theme’s functions.php (I do have other actions running fine from the child theme’s functions.php).

    I use user role editor and the
    edit_products capability is granted for the vendors. I did try to disable the user role editor plugin in case if that is the culprit but it wasn’t.

    Any advice? Thanks.

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply