Change WordPress user roles and capabilities › Forums › How to or FAQ › Duplicate product – shop manager › Reply To: Duplicate product – shop manager
14/04/2021 at 06:51
#7532
Vladimir
Keymaster
Hi Michele,
WooCommerce by default uses ‘manage_woocommerce’ capability for ‘Duplicate’ link under products. It’s possible to replace it with something other using provide custom filter ‘woocommerce_duplicate_product_capability’, like this:
add_filter('woocommerce_duplicate_product_capability', 'wc_duplicate_product_cap', 10, 1);
function wc_duplicate_product_cap( $cap ) {
$cap = 'edit_products';
return $cap;
}