Few more missed keys

This commit is contained in:
Mike Jolley 2011-12-24 17:09:43 +00:00
parent fb57cc7e9d
commit 45d78748a1
4 changed files with 8 additions and 8 deletions

View File

@ -339,19 +339,19 @@ function woocommerce_custom_product_orderby( $vars ) {
if (isset( $vars['orderby'] )) :
if ( 'inventory' == $vars['orderby'] ) :
$vars = array_merge( $vars, array(
'meta_key' => 'stock',
'meta_key' => '_stock',
'orderby' => 'meta_value_num'
) );
endif;
if ( 'price' == $vars['orderby'] ) :
$vars = array_merge( $vars, array(
'meta_key' => 'price',
'meta_key' => '_price',
'orderby' => 'meta_value_num'
) );
endif;
if ( 'featured' == $vars['orderby'] ) :
$vars = array_merge( $vars, array(
'meta_key' => 'featured',
'meta_key' => '_featured',
'orderby' => 'meta_value'
) );
endif;
@ -423,11 +423,11 @@ function woocommerce_products_subtype_query($query) {
if ($typenow=='product' && isset($_GET['product_subtype']) && $_GET['product_subtype']) :
if ($_GET['product_subtype']=='downloadable') :
$query->query_vars['meta_value'] = 'yes';
$query->query_vars['meta_key'] = 'downloadable';
$query->query_vars['meta_key'] = '_downloadable';
endif;
if ($_GET['product_subtype']=='virtual') :
$query->query_vars['meta_value'] = 'yes';
$query->query_vars['meta_key'] = 'virtual';
$query->query_vars['meta_key'] = '_virtual';
endif;
endif;
}

View File

@ -611,7 +611,7 @@ function woocommerce_process_product_meta( $post_id, $post ) {
'post_parent' => $post_parent,
'orderby' => 'meta_value_num',
'order' => 'asc',
'meta_key' => 'price',
'meta_key' => '_price',
'posts_per_page'=> 1,
'post_type' => 'product',
'fields' => 'ids'

View File

@ -999,7 +999,7 @@ class woocommerce_product {
'post_parent' => $post_parent,
'orderby' => 'meta_value_num',
'order' => 'asc',
'meta_key' => 'price',
'meta_key' => '_price',
'posts_per_page' => 1,
'post_type' => 'product',
'fields' => 'ids'

View File

@ -61,7 +61,7 @@ class WooCommerce_Widget_Featured_Products extends WP_Widget {
$number = 15;
?>
<?php $query_args = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => 'featured', 'meta_value' => 'yes');
<?php $query_args = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes');
$r = new WP_Query($query_args);