Hide subcategories when filtering
This commit is contained in:
parent
cfce068796
commit
fc9c7b7be4
|
@ -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
|
* Fixed menu order when logged in as a shop manager
|
||||||
* Added SKU column to order data
|
* Added SKU column to order data
|
||||||
* Removed output buffering from loop
|
* Removed output buffering from loop
|
||||||
* Add proudct % coupons
|
* Add product % coupons
|
||||||
|
* Filtering hides subcategories
|
||||||
* Lots of other minor fixes
|
* Lots of other minor fixes
|
||||||
|
|
||||||
= 1.1.2 - 23/10/2011 =
|
= 1.1.2 - 23/10/2011 =
|
||||||
|
|
|
@ -1082,10 +1082,12 @@ function woocommerce_demo_store() {
|
||||||
* display product sub categories as thumbnails
|
* display product sub categories as thumbnails
|
||||||
**/
|
**/
|
||||||
function woocommerce_product_subcategories() {
|
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 ($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_search()) return;
|
||||||
if (!is_product_category() && !is_shop()) return;
|
if (!is_product_category() && !is_shop()) return;
|
||||||
if (is_product_category() && get_option('woocommerce_show_subcategories')=='no') return;
|
if (is_product_category() && get_option('woocommerce_show_subcategories')=='no') return;
|
||||||
|
|
Loading…
Reference in New Issue