Support » Plugin: WooCommerce Event Manager » Hides Other Hidden Products in WooCommerce Backend

  • I noticed that other products that are marked as Hidden in WooCommerce, don’t show up when going to Products in the backend. This seems to be caused by the following code from mep_functions.php:2478

    add_action('parse_query', 'mep_product_tags_sorting_query');
      if (!function_exists('mep_product_tags_sorting_query')) {     
      function mep_product_tags_sorting_query($query) {
          global $pagenow;
          $taxonomy  = 'product_visibility';
          $q_vars    = &$query->query_vars;
          if ( $pagenow == 'edit.php' && isset($q_vars['post_type']) && $q_vars['post_type'] == 'product') {
              $tax_query = array([
                'taxonomy' => 'product_visibility',
                'field' => 'slug',
                'terms' => 'exclude-from-catalog',
                'operator' => 'NOT IN',
                ]);          
                $query->set( 'tax_query', $tax_query );
          }
      
      }
    }
    

    I totally get it that you want to hide your event products in the WooCommerce backend, but please don’t hide other hidden products. E.g. instead of adding the tax_query, you could add a meta_query and exclude products with your link_mep_event meta key. Or you create your own products taxonomy and hide it through it.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.