WooCommerce - excelling eCommerce
How to list only grouped products in WooCommerce's categories (3 posts)

  1. Machi
    Posted 2 years ago #

    we are using a WooCommerce plugin with grouped products on our website. Basically we have one "parent" - grouped product and its variations are listed as a simple "standalone" product. It is automatically imported so we are unable to import it as variations which should theoretically solve the problem.

    The only issue is that WooCommerce displays all products in category listing, grouped products together with simple products. Is there please a way how to list just grouped products in these listing? See a sample please: http://rkbtechnika.cz/kategorie-produktu/kim-tec/servisni-chemie/cistici-pripravky/

    Thanks a lot, Jakub


  2. Zafi
    Posted 1 year ago #

    Hi Machi

    Did you manage to get this sorted, I have same requirement.

  3. andreybs11
    Posted 1 year ago #


    Add the below snippet inside your functions.php file

    function filter_grouped_products( $query ) {
      if ( !is_admin() && is_shop() && $query->is_main_query() ) {
        $query->set('post_type', 'product');
        $product_type = array(
          'taxonomy' => 'product_type',
          'field' => 'slug',
          'terms' => 'grouped'
        $query->set('tax_query', array($product_type) );
    add_action('pre_get_posts', 'filter_grouped_products');


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic