Hide subcategories when filtering

This commit is contained in:
Mike Jolley 2011-10-27 12:17:08 +01:00
parent cfce068796
commit fc9c7b7be4
2 changed files with 5 additions and 2 deletions

View File

@ -71,7 +71,8 @@ For further documentation on using WooCommerce, please sign up for free at http:
* Fixed menu order when logged in as a shop manager
* Added SKU column to order data
* Removed output buffering from loop
* Add proudct % coupons
* Add product % coupons
* Filtering hides subcategories
* Lots of other minor fixes
= 1.1.2 - 23/10/2011 =

View File

@ -1082,10 +1082,12 @@ function woocommerce_demo_store() {
* display product sub categories as thumbnails
**/
function woocommerce_product_subcategories() {
global $woocommerce, $woocommerce_loop, $wp_query, $wp_the_query;
global $woocommerce, $woocommerce_loop, $wp_query, $wp_the_query, $_chosen_attributes;
if ($wp_query !== $wp_the_query) return; // Detect main query
if (sizeof($_chosen_attributes)>0 || (isset($_GET['max_price']) && isset($_GET['min_price']))) return; // Don't show when filtering
if (is_search()) return;
if (!is_product_category() && !is_shop()) return;
if (is_product_category() && get_option('woocommerce_show_subcategories')=='no') return;