Found solution for this problem.
It turned out that woocommerce affects post_type
query variable in pre_get_posts
filter without checking that another post_type
has been requested. It’s done in WC_Query.product_query
method:
if ( ! $q->is_tax( 'product_cat' ) && ! $q->is_tax( 'product_tag' ) )
$q->set( 'post_type', 'product' );
Fix for this problem is simple. You just need to check that product
post type has been actually requested in the beginning of product_query
method:
// Check that product post type has been requested
if ($q->get('post_type') != 'product')
return;
After that everything works fine.
Update:
Fix has been merged into woocommerce master branch: https://github.com/woothemes/woocommerce/pull/4582.
Related Posts:
- Get product attribute for Simple product in WooCommerce
- Get product categories and add them to a custom taxonomy
- Only return taxonomies that are linked to a category & product
- Hide prices and checkout functionality in woocommerce
- Custom Taxonomy in plugin and template
- How to authenticate custom API endpoint in WooCommerce [closed]
- Function to Set Product type in Woocommerce [closed]
- Add .html extension to custom post type taxonomies
- Custom Post Type causes Page Not Found
- Override core woocommerce class
- WooCommerce – Where is functions.php?
- Woocommerce Shipping module available only for type of products [closed]
- WooCommerce – Adding Custom Order Without No Product [closed]
- Plugin allowing for artists, events and venues
- XML sitemap over product variations
- custom taxonomy and custom post type url conflict
- How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]
- Add custom taxonomy to title tag [closed]
- How can I display a contact form for out of stock products in WooCommerce?
- HTML in WooCommerce settings
- Where (or when) should I register a new taxonomy?
- How I can get custom field’s current value?
- Override Javascript in a Plugin?
- WooCommerce Custom Product to checkout
- Woocommerce – How to populate custom select field with stored values on checkout page?
- Want wp_get_post_terms return in arbitrarily order, how to do?
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- How to enable specific plugin only based around shop manager role?
- Why required field not working in Country dropdown in WooCommerce –
- How to check current user before all actions and filters?
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- I want to disable Cash on delivery based on product tag in woocommerce Checkout Page [closed]
- Is there a way to create custom product templates based on category on WooCommerce?
- WooCommerce specifc variations for specific user role [closed]
- How to add checkboxes for a woocommerce product? [closed]
- how to do login using woocommerce rest api From android
- Redirect to another page using contact form 7? [closed]
- woocommerce with custom post type
- How to get a list of bundled products using wp_query in woocommerce
- WooCommerce – set session with new cart item meta when updating cart item quantity [closed]
- How to get the particular product quantity in orders in Woocommerce [closed]
- Woocommerce singe product custom gallery output works just on the first slide
- How to include a custom field in the woocommerce email?
- Remove Pagination for Product Category Pages WooCommerce
- Custom template for all woo commerce categories
- Is it possible to instantiate a new WC_Cart?
- Sell access to form [closed]
- I want to filter my products with attributes [closed]
- Automatic recurring payment using YITH subscription and Dokan Stripe
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- Change Dashboard URL from wp-admin to wp-admin/index.php
- How To Use do_shortcode with WooCommerce One Page Checkout
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- Need to edit author permissions | custom taxonomy
- Hide fields in woocommerce settings
- Visual composer custom element error
- woocommerce: Customize email with item total count
- Plugin which unlock free gift when you reach some amount in cart
- Save order without sending the invoice / order details woocommerce [closed]
- Optimise wordpress database using SQL after deleting registered images from Media Folder
- is there a way to display product gallery images via cdn
- show wc_add notices on particular page in woo commerce custom plugin development
- How to assign a specific service to a specific provider based on location
- Custom Taxonomy is Missing (Or Limiting) Items
- Make modification of add_to_cart button specific to single page
- How to get the checkout form data from checkout page when place-order button is clicked
- Product Page loads terribly slow when product gallery images are added
- How to make WooCommerce multiple filter with custom meta fields
- One WooCommerce Store to multi distributor sites
- Custom form data not displaying in cart page?
- best way to handle subscriptions with a licence?
- Is there a request for products plugin for WooCommerce
- woocommerce with external ftp site
- Object of class WP_Error could not be converted to string in /formatting.php
- WordPress eMails not working
- Add WooCommerce vendor slug to auto-generated SKU
- Why is my custom taxonomy image not displaying?
- Custom plugin issue – Notice: Trying to get property of non-object in
- fetch price from different table woocommerce
- Cannot save a custom meta field in quick edit
- how to make settings page for woocommerce plugin?
- redirect to a custom page
- Change value of Points earned in product data
- Problem with conditional woocommerce custom checkout field
- Get custom term link archive with prefix
- change product image url in widgets & shop page
- How woo-commerce store Product Data value in DB?
- Not getting result using ajax on wordpress
- Which WordPress version to use for improved plugin compatibility? [closed]
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- How can I add the custom taxonomy categories to the posts and pages?
- How to list the categories by custom taxonomy created?
- Move related products after product summary? [closed]
- Turning Existing Eccommerce Site into Multi-SIte
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- Woocommerce disable checkout on specific day
- Translate text for empty product
- Create Custom Coupon Type
- Add different sizes packaging boxes to orders plugin
- A multi-section WordPress store [closed]