Display only grouped products in related products

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 1 reply thread
  • Author
    Posts
    • #103689
      paattal
      Participant

      Hello,

      I use this woocommerce snippet to display only grouped products in all woocommerce page :

      add_filter( 'woocommerce_product_query_tax_query', 'only_grouped_products', 20, 1 );
      function only_grouped_products( $tax_query ){
          $tax_query[] = array(
              'taxonomy'  => 'product_type',
              'field'     => 'name',
              'terms'     => array('grouped'),
          );
          return $tax_query;
      }

      That’s works fine on store page and I thought have the same feature in single product but not, all store products are still displayed in related products.

      Can you help me.

      Thank you

    • #105737
      WCFM Forum
      Keymaster

      Hi,

      all store products are still displayed in related products.

      – You have to use separate query filter for related products.

      Thank you

Viewing 1 reply thread
  • You must be logged in to reply to this topic.