Allowed sku search to return > 1 result.

This commit is contained in:
Mike Jolley 2012-11-05 12:46:26 +00:00
parent 357e35006c
commit eb26d41ee9
2 changed files with 4 additions and 3 deletions

View File

@ -483,12 +483,12 @@ function woocommerce_admin_product_search( $wp ) {
if( !$sku ) return; if( !$sku ) return;
$id = $wpdb->get_var('SELECT post_id FROM '.$wpdb->postmeta.' WHERE meta_key="_sku" AND meta_value LIKE "%'.$sku.'%";'); $ids = $wpdb->get_col( 'SELECT post_id FROM ' . $wpdb->postmeta . ' WHERE meta_key="_sku" AND meta_value LIKE "%' . $sku . '%";' );
if( !$id ) return; if ( ! $ids ) return;
unset( $wp->query_vars['s'] ); unset( $wp->query_vars['s'] );
$wp->query_vars['p'] = $id; $wp->query_vars['post__in'] = $ids;
$wp->query_vars['sku'] = $sku; $wp->query_vars['sku'] = $sku;
endif; endif;

View File

@ -206,6 +206,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - product_variations_{id} changed to product_variations array * Tweak - product_variations_{id} changed to product_variations array
* Tweak - Coupon description field. * Tweak - Coupon description field.
* Tweak - Exclude up-sells from related products. * Tweak - Exclude up-sells from related products.
* Tweak - Allowed sku search to return > 1 result.
* Fix - Added more error messages for coupons. * Fix - Added more error messages for coupons.
* Fix - Variation sku updating after selection. * Fix - Variation sku updating after selection.