Subcategory display fix

This commit is contained in:
Mike Jolley 2011-10-08 12:14:02 +01:00
parent 27d33c77c9
commit d84ffb141d
2 changed files with 4 additions and 2 deletions

View File

@ -64,6 +64,7 @@ For further documentation on using WooCommerce, please sign up for free at http:
* Added option to show sub-categories when browing categories/the shop page
* Zero tax rate fix
* Filters for tax rates
* Fixes to find rate function
= 1.0.3 - 06/10/2011 =
* Several minor fixes/tweaks

View File

@ -1072,10 +1072,11 @@ function woocommerce_demo_store() {
* display product sub categories as thumbnails
**/
function woocommerce_product_subcategories() {
global $woocommerce, $columns, $loop, $wp_query;
global $woocommerce, $columns, $loop, $wp_query, $wp_the_query;
if ($wp_query !== $wp_the_query) return; // Detect main query
if (!is_product_category() && !is_shop()) return;
if (is_product_category() && get_option('woocommerce_show_subcategories')=='no') return;
if (is_shop() && get_option('woocommerce_shop_show_subcategories')=='no') return;