Merge pull request #13623 from woocommerce/fix-13616

Update function should use = not IN
This commit is contained in:
Mike Jolley 2017-03-16 16:46:59 +00:00 committed by GitHub
commit b6126832ad
1 changed files with 1 additions and 1 deletions

View File

@ -1053,7 +1053,7 @@ function wc_update_300_product_visibility() {
}
if ( $outofstock_term = get_term_by( 'name', 'outofstock', 'product_visibility' ) ) {
$wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->term_relationships} SELECT post_id, %d, 0 FROM {$wpdb->postmeta} WHERE meta_key = '_stock_status' AND meta_value IN 'outofstock';", $outofstock_term->term_id ) );
$wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->term_relationships} SELECT post_id, %d, 0 FROM {$wpdb->postmeta} WHERE meta_key = '_stock_status' AND meta_value = 'outofstock';", $outofstock_term->term_id ) );
}
if ( $rating_term = get_term_by( 'name', 'rated-1', 'product_visibility' ) ) {