Currently working on a project for an existing woocommerce shop. I noticed exactly the same thing. Old products have this meta_key, new products do not. Also noticed the meta_value is no longer updated..
So after a quick search i found the following info.
A big focus for the WooCommerce dev team in 3.0 and especially in the upcoming 3.1 release is performance improvement.
Doing queries on meta data requires extra SQL joins and is quite inefficient at scale. Querying WP terms is much more efficient and as a result, much faster.
So they moved visibility and feature settings to a new product visibility taxonomy.
Here a simple example to get featured products with Woo 3.0+
$meta_query = WC()->query->get_meta_query();
$tax_query = WC()->query->get_tax_query();
$tax_query[] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN',
);
$product_args = array(
'post_type' => 'product',
'post_status' => 'publish',
'posts_per_page' => '-1',
'orderby' => 'modified',
'order' => 'DESC',
'meta_query' => $meta_query,
'tax_query' => $tax_query,
);
Best regards,
Bjorn
-
This reply was modified 7 years, 4 months ago by
bjornwebdesign. Reason: typo