includes/api/class-wc-rest-products-controller.php 1 location
|
@@ 1057-1059 (lines=3) @@
|
| 1054 |
|
|
| 1055 |
|
// Product parent ID for groups. |
| 1056 |
|
$parent_id = 0; |
| 1057 |
|
if ( isset( $request['parent_id'] ) ) { |
| 1058 |
|
$parent_id = wp_update_post( array( 'ID' => $product->id, 'post_parent' => absint( $request['parent_id'] ) ) ); |
| 1059 |
|
} |
| 1060 |
|
|
| 1061 |
|
// Update parent if grouped so price sorting works and stays in sync with the cheapest child. |
| 1062 |
|
if ( $parent_id > 0 || 'grouped' === $product_type ) { |
includes/cli/class-wc-cli-product.php 1 location
|
@@ 1294-1296 (lines=3) @@
|
| 1291 |
|
} |
| 1292 |
|
|
| 1293 |
|
// Product parent ID for groups |
| 1294 |
|
if ( isset( $data['parent_id'] ) ) { |
| 1295 |
|
wp_update_post( array( 'ID' => $product_id, 'post_parent' => absint( $data['parent_id'] ) ) ); |
| 1296 |
|
} |
| 1297 |
|
|
| 1298 |
|
// Update parent if grouped so price sorting works and stays in sync with the cheapest child |
| 1299 |
|
$_product = wc_get_product( $product_id ); |