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
- How to Display Product specific to a category with WooCommerce Plugin? [closed]
- Woocommerce Add Variation Product to Cart from custom link [closed]
- Woocommerce hook after creating order? [closed]
- How do I get WooCommerce to automatically recreate pages? [closed]
- Woocommerce override mini-cart.php not working [closed]
- How to share category taxonomy with custom post type (The Event Calendar plugin)
- WooCommerce – How to Add a Custom Field to Cart Items and Cart Totals [closed]
- Query Posts by Custom Field ‘Price’
- Custom Taxonomy in plugin and template
- Can’t set proper WooCommerce language translation [closed]
- WooCommerce – Load Templates From Plugin For All Template Files
- How to authenticate custom API endpoint in WooCommerce [closed]
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- WooCommerce ‘all’ orders no longer being displayed – how may I debug/fix [closed]
- Create WooCommerce Product Category Programmatically
- Changing Woocommerce Product Description [closed]
- Function to Set Product type in Woocommerce [closed]
- WooCommerce create new product and add to cart on form submit
- User profiles and object associations
- Updating WooCommerce variable product stock issue
- WooCommerce Always Include Shipping Information in Checkout [closed]
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- Add .html extension to custom post type taxonomies
- Add Products to user’s ID Woocommerce
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- How to set value/term of a Woocommerce attribute text field in admin panel?
- Woocommerce different URL for every table placed in the restaurant
- Disable Admin Bar Render on Plugin Page
- how to redirect to my template
- WooCommerce Dynamic Cart Pricing
- Why is this custom taxonomy showing in the database?
- How does WooCommerce display a custom comment_type in Comment Admin?
- How to add product images using script?
- remove custom taxonomy metabox form custom post type
- Woocommerce cart is a non-object inside `admin_post` action [closed]
- How to Build a Movie Library in WordPress 3.x
- $woocommerce->cart is null inside WordPress Rest API
- Add CSS class to add-to-cart button, Woocommerce [closed]
- Custom Post Type causes Page Not Found
- Custom Shipping method not showing in checkout
- Remove action from woocommerce barcode plugin [closed]
- How to delete terms on plugin deactivate?
- Show “Local Pickup” shipping method only for specific Woocommerce product categories [closed]
- Override core woocommerce class
- WooCommerce – Where is functions.php?
- Over write plugin templates
- Woocommerce Shipping module available only for type of products [closed]
- WP Crowdfunding customization [closed]
- WooCommerce – Adding Custom Order Without No Product [closed]
- How to show category images (from plugin) on a regular page (page-example.php)?
- How to prevent action in ajax request, when in admin side?
- Invalid shipping method, WooCommerce [closed]
- taxonomy_template filter do not loads custom taxonomy template properly
- Plugin allowing for artists, events and venues
- Sort products without thumbnail in WooCommerce shop page
- Create or Update thousands of woocommerce products via PHP
- Automatically adding category filter based on search string
- Can’t create term for product attribute
- Add multiple attributes to product from php
- XML sitemap over product variations
- How to add rewrite rules and pagination to retrieve attachments files?
- custom taxonomy and custom post type url conflict
- block countries from shipping to them in WooCommerce [closed]
- Woocommerce sidebar not loading in theme
- Is it possible to set up multistore in Woocommerce? [closed]
- Make specific products accessible only to a user role in WooCommerce
- How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]
- How to edit Image layout in single product page in woocommerce on wordpress?
- How To Hide Filters On Specific Categories with WooCommerce Products Filter(WOOF)
- Woocommerce – Display active variation product price [closed]
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- Show Heirachy of categories in WP Download Monitor
- Custom Taxonomy Tag Search
- Add custom taxonomy to title tag [closed]
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- Need Old Version of plugins
- WooCommerce E-Check payment gateway disappeared when site switched to multi-site
- Manually add order item with fixed product_id in WooCommerce
- Woocommerce email template customization [closed]
- How can I display a contact form for out of stock products in WooCommerce?
- Remove specific product from shop in woocommerce [closed]
- woocommerce_order_status_completed action hook not working [closed]
- How to update billing_email when user_email is updated [closed]
- HTML in WooCommerce settings
- WP plugins for building a database?
- Serve different files depending on OS/Browser
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- WordPress category add image field
- How to configure two SMTP Server for wordpress
- Absolute Image URL in srcset is appended to the upload dir
- Dropdown menu on custom page with product to choose number of products per page
- Where (or when) should I register a new taxonomy?
- Woocommerce plugin for minimum order and add-to-card-step
- Add Product Subtitle to Woocommerce Product Page
- Change wordpress current_time function to different timezone
- Only Homepage not loading properly