• Resolved kyledoesit

    (@kyledoesit)


    I am very impressed with this plugin! I am having an issue with divi compatibility. The shop category page was built using the divi theme builder with woo products module. It doesn’t appear that this is filtering the visible products and am wondering if there is a way to get this working properly. I’ll assist in any way I can!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to add the line:

    
        add_filter( 'woocommerce_shortcode_products_query', array($this, 'filter_shortcode_products_query' ));
    

    after the line:

    
        add_filter('get_search_query', array($this, 'shop_order_search_label' ));
    

    and add the code:

    
    public function filter_shortcode_products_query($query_args) {
    
        $values = $this->getSelectedValues();
        $pIds = $this->getFoundProductIds();
    
        if (count($values) > 0){
          $query_args['post__in'] = count($pIds) > 0 ? $pIds : array(-1); // -1 to display a "no products found" message
        }
        
        if (count($values) > 0){
          Pektsekye_YMM()->register('selected_values', $values);
        }
              
        return $query_args;		
      }
    

    before the line:

    
      public function applyFilter(){
    

    in the file:
    wp-content/plugins/ymm-search/Controller/Product.php

    With this modification it should filter products that are displayed with the [products] shortcode.

    Stanislav

    Thread Starter kyledoesit

    (@kyledoesit)

    You are a rockstar! Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Compatibility with Divi woocommerce modules’ is closed to new replies.