Merge pull request #14221 from woocommerce/fix/14216

Do not duplicate grouped products, only variations
This commit is contained in:
Claudio Sanches 2017-04-10 18:49:28 -03:00 committed by GitHub
commit 47a6741707
1 changed files with 2 additions and 1 deletions

View File

@ -136,7 +136,8 @@ class WC_Admin_Duplicate_Product {
// Save parent product.
$duplicate->save();
if ( ! apply_filters( 'woocommerce_duplicate_product_exclude_children', false ) && ( $product->is_type( 'variable' ) || $product->is_type( 'grouped' ) ) ) {
// Duplicate children of a variable product.
if ( ! apply_filters( 'woocommerce_duplicate_product_exclude_children', false ) && $product->is_type( 'variable' ) ) {
foreach ( $product->get_children() as $child_id ) {
$child = wc_get_product( $child_id );
$child_duplicate = clone $child;