Merge pull request #18761 from woocommerce/fix/18757
Include parent ID when searching for SKUs
This commit is contained in:
commit
99463251f6
|
@ -479,7 +479,12 @@ class WC_Admin_List_Table_Products extends WC_Admin_List_Table {
|
||||||
$id_from_sku = wc_get_product_id_by_sku( wc_clean( $term ) );
|
$id_from_sku = wc_get_product_id_by_sku( wc_clean( $term ) );
|
||||||
|
|
||||||
if ( $id_from_sku ) {
|
if ( $id_from_sku ) {
|
||||||
$search_ids[] = absint( $id_from_sku );
|
$product = wc_get_product( $id_from_sku );
|
||||||
|
|
||||||
|
if ( $product ) {
|
||||||
|
$search_ids[] = $product->get_id();
|
||||||
|
$search_ids[] = $product->get_parent_id();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue