Include parent ID when searching for SKUs

This commit is contained in:
Mike Jolley 2018-02-01 17:31:40 +00:00
parent 997e8aefde
commit 98b24fdc31
1 changed files with 6 additions and 1 deletions

View File

@ -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 ) );
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();
}
}
}
}