WC 3.3.1 New issues with product category display
-
Updated versions of WooCommerce and Storefront. Problem I’m having after update is SOME, not all categories are not displaying as expected. The linked page above is one example. My categories are set to display both subcategories and products, but I have a modification in my child theme because I only want the products displayed for the category being view and not the products of the subcategories. The code for this is below.
This has worked on all categories up until the 3.3.1 update I believe. Now, it works for many still, but not all. Generally, I find that now in a product category that doesn’t have any products, only subcategories, I get the “no products found” message.
Things I’ve tried:
– No caching plugins in use
– Clearing browser caches, WooCommerce counters etc has no effect
– On the errant pages, no changes to display settings has any effect
– If I add a test product to the errant category, the category and subcategories display as expected.
– If I remove my exclude code below, most pages display with products, subcategories and subcategory products as I would expect, BUT, the errant categories display subcategories, but NOT subcategory products, so are still displaying incorrectly based on settings.Help please!
SteveExclude code:
function exclude_product_cat_children($wp_query) { if ( isset ( $wp_query->query_vars['product_cat'] ) && $wp_query->is_main_query()) { $wp_query->set('tax_query', array( array ( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $wp_query->query_vars['product_cat'], 'include_children' => false ) ) ); } } add_filter('pre_get_posts', 'exclude_product_cat_children');
### WordPress Environment ### Home URL: https://sbw.weigoldenterprises.com Site URL: https://sbw.weigoldenterprises.com WC Version: 3.3.1 Log Directory Writable: ? WP Version: 4.9.4 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ? WP Cron: ? Language: en_US ### Server Environment ### Server Info: Apache/2.4.10 (Debian) PHP Version: 5.6.33-0+deb8u1 PHP Post Max Size: 8 MB PHP Time Limit: 30 PHP Max Input Vars: 2000 cURL Version: 7.38.0 OpenSSL/1.0.1t SUHOSIN Installed: – MySQL Version: ? 5.5.49 - We recommend a minimum MySQL version of 5.6. See: WordPress requirements Max Upload Size: 8 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 3.3.1 WC Database Prefix: wp_ MaxMind GeoIP Database: ? The MaxMind GeoIP Database does not exist - Geolocation will not function. You can download and install it manually from https://dev.maxmind.com/geoip/legacy/geolite/ to the path: . Scroll down to "Downloads" and download the "Binary / gzip" file next to "GeoLite Country". Please remember to uncompress GeoIP.dat.gz and upload the GeoIP.dat file only. Total Database Size: 13.48MB Database Data Size: 8.51MB Database Index Size: 4.97MB wp_woocommerce_sessions: Data: 0.05MB + Index: 0.02MB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB wp_commentmeta: Data: 0.02MB + Index: 0.03MB wp_comments: Data: 0.02MB + Index: 0.09MB wp_links: Data: 0.02MB + Index: 0.02MB wp_mgmlp_folders: Data: 0.00MB + Index: 0.01MB wp_options: Data: 3.02MB + Index: 0.11MB wp_postmeta: Data: 3.06MB + Index: 3.52MB wp_posts: Data: 1.52MB + Index: 0.31MB wp_rg_form: Data: 0.02MB + Index: 0.00MB wp_rg_form_meta: Data: 0.08MB + Index: 0.00MB wp_rg_form_view: Data: 0.02MB + Index: 0.03MB wp_rg_incomplete_submissions: Data: 0.02MB + Index: 0.02MB wp_rg_lead: Data: 0.02MB + Index: 0.03MB wp_rg_lead_detail: Data: 0.02MB + Index: 0.06MB wp_rg_lead_detail_long: Data: 0.02MB + Index: 0.00MB wp_rg_lead_meta: Data: 0.02MB + Index: 0.05MB wp_rg_lead_notes: Data: 0.02MB + Index: 0.03MB wp_sentry_groups: Data: 0.02MB + Index: 0.00MB wp_termmeta: Data: 0.05MB + Index: 0.03MB wp_terms: Data: 0.02MB + Index: 0.03MB wp_term_relationships: Data: 0.11MB + Index: 0.08MB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB wp_usermeta: Data: 0.02MB + Index: 0.03MB wp_users: Data: 0.02MB + Index: 0.05MB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB ### Post Type Counts ### acf-field: 7 acf-field-group: 3 attachment: 236 content_block: 5 customize_changeset: 8 mgmlp_media_folder: 71 nav_menu_item: 46 page: 13 post: 3 product: 762 product_variation: 252 revision: 46 shop_order: 1 ultimate_slider: 5 wccpf: 1 ### Security ### Secure connection (HTTPS): ?Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates. Hide errors from visitors: ?Error messages should not be shown to visitors. ### Active Plugins (11) ### Gravity Forms: by rocketgenius – 2.2.5 Advanced Custom Fields PRO: by Elliot Condon – 5.6.8 Content Blocks (Custom Post Widget): by Johan van der Wijk – 3.0.3 WordPress Media Library Folders: by Max Foundry – 4.1.1 Slider Ultimate: by Etoile Web Design – 1.0.21 – Not tested with the active version of WooCommerce Woo Product Images Slider: by DesirePress – 1.3.0 – Not tested with the active version of WooCommerce WooCommerce Authorize.Net AIM Gateway: by SkyVerge – 3.12.2 – 3.13.0 is available – Not tested with the active version of WooCommerce WooCommerce PayPal Powered by Braintree Gateway: by WooCommerce – 2.1.1 WooCommerce - Gravity Forms Product Add-Ons: by Lucas Stark – 3.2.5 – 3.2.9 is available – Not tested with the active version of WooCommerce WooCommerce - Store Toolkit: by Visser Labs – 1.7.9 WooCommerce: by Automattic – 3.3.1 ### Settings ### API Enabled: ? Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) ### WC Pages ### Shop base: #57 - /?page_id=57 Cart: #7 - /?page_id=7 Checkout: #2436 - /?page_id=2436 My account: ? Page ID is set but the page does not exist Terms and conditions: #2438 - /?page_id=2438 ### Theme ### Name: Storefront Child - SBW Specific Version: 1.0.0 Author URL: https://www.weigoldenterprises.com Child Theme: ? Parent Theme Name: Storefront Parent Theme Version: 2.2.7 Parent Theme Author URL: https://woocommerce.com/ WooCommerce Support: ? ### Templates ### Overrides: – ### Templates ### thumbnail: medium: medium_large: large: woocommerce_thumbnail: woocommerce_single: woocommerce_thumbnail_2x: shop_thumbnail: shop_catalog: shop_single: ### Authorize.Net AIM ### Environment: Test Debug Mode: Save to Log ### Braintree (PayPal) ### Environment: Tokenization Enabled: – Debug Mode: Off
The page I need help with: [log in to see the link]
- The topic ‘WC 3.3.1 New issues with product category display’ is closed to new replies.