Merge pull request #14221 from woocommerce/fix/14216
Do not duplicate grouped products, only variations
This commit is contained in:
commit
47a6741707
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue