From ade147ccc29a0d41622c715c2f74636f06733041 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 10 Apr 2017 21:45:57 +0100 Subject: [PATCH] Do not duplicate grouped products, only variations Fixes #14216 --- includes/admin/class-wc-admin-duplicate-product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/admin/class-wc-admin-duplicate-product.php b/includes/admin/class-wc-admin-duplicate-product.php index c20d30bd606..2f3cc61f2c6 100644 --- a/includes/admin/class-wc-admin-duplicate-product.php +++ b/includes/admin/class-wc-admin-duplicate-product.php @@ -135,7 +135,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;