Merge pull request #18761 from woocommerce/fix/18757

Include parent ID when searching for SKUs
This commit is contained in:
Claudiu Lodromanean 2018-02-01 09:41:09 -08:00 committed by GitHub
commit 99463251f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();
}
}
}
}