By default, when you duplicate a product, the new product will use the same group and fields as the original product. This can cause difficulties if you want to be able to edit the new product’s groups and fields without affecting the original product’s groups and fields.
If you’d like to create duplicate groups and fields when you duplicate a product, which can be edited without affecting the original group and field, then just add the following snippet:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|* Duplicate groups and fields when duplicating products|
|add_filter( 'pewc_duplicate_fields', '__return_true' );|