diff --git a/classes/product.class.php b/classes/product.class.php index c57863eccdc..3e4ba20fe7c 100644 --- a/classes/product.class.php +++ b/classes/product.class.php @@ -670,9 +670,13 @@ class woocommerce_product { $terms = wp_get_post_terms($this->id, 'product_tag'); foreach ($terms as $term) $tags_array[] = $term->term_id; + // Get categories $terms = wp_get_post_terms($this->id, 'product_cat'); foreach ($terms as $term) $cats_array[] = $term->term_id; + // Don't bother if none are set + if ( sizeof($cats_array)==1 && sizeof($tags_array)==1 ) return array(); + // Meta query $meta_query = array(); $meta_query[] = $woocommerce->query->visibility_meta_query(); diff --git a/readme.txt b/readme.txt index 0f53913c535..63414403c06 100644 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo = 1.2.4 - 18/11/2011 = * More sale price logic fixes for variations. Now correctly compares variation's prices. * Clear cache on upgrade/install +* Related product fix when no categories are set = 1.2.3 - 17/11/2011 = * Fix for sale price logic