Skip to content

Commit

Permalink
Merge pull request #14521 from woocommerce/fix/14507
Browse files Browse the repository at this point in the history
wc_update_300_grouped_products update routine needs to unset the post_parent on grouped products
  • Loading branch information
claudiulodro committed Apr 19, 2017
2 parents b13380d + 5d7aa23 commit 3152b35
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion includes/wc-update-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
);
}
}
}
Expand Down

0 comments on commit 3152b35

Please sign in to comment.