Allowed sku search to return > 1 result.
This commit is contained in:
parent
357e35006c
commit
eb26d41ee9
|
@ -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;
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue