Merge pull request #14521 from woocommerce/fix/14507

wc_update_300_grouped_products update routine needs to unset the post_parent on grouped products
This commit is contained in:
Claudiu Lodromanean 2017-04-19 10:16:12 -07:00 committed by GitHub
commit 3152b35406
1 changed files with 12 additions and 1 deletions

View File

@ -1020,7 +1020,18 @@ function wc_update_300_grouped_products() {
'post_type' => 'product',
'fields' => 'ids',
) );
add_post_meta( $parent_id, '_children', $children_ids, true );
update_post_meta( $parent_id, '_children', $children_ids );
// Update children to remove the parent.
$wpdb->update(
$wpdb->posts,
array(
'post_parent' => 0,
),
array(
'post_parent' => $parent_id,
)
);
}
}
}