Support » Plugin: WOOF - Products Filter for WooCommerce » Slider range is e.g. 10^20 instead of 10-20

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mediawebster

    (@mediawebster)

    Hello

    try in file – \wp-content\plugins\woocommerce-products-filter\ext\meta_filter\html_types\slider\index.php – change function create_meta_query

        public function create_meta_query(){
            $curr_request=$this->check_current_request();
            if($curr_request){  
                $curr_range=array();
                $curr_range=explode("^",$curr_request);
                $from=0;
                $to=0;
                $from= floatval($curr_range[0]); 
                if(count($curr_range)>1){
                    $to= floatval($curr_range[1]);                 
                }else{
                    $range=explode("^",$this->range,2);
                    $to=$range[1];
                }
                $type=apply_filters('woof_slider_meta_query_type','numeric',$this->meta_key);
                $meta=array(
                    'key' => $this->meta_key,
                    'value'   => array( $from, $to ),
    		'type'    => $type,
                    'compare'=>'BETWEEN',
                );    
                return $meta;
            }else{
                return false;
            }
        }

    Thanks, but something must be wrong here. This change caused site to crash with fatal error.

    Plugin Support mediawebster

    (@mediawebster)

    Hello

    It looks like you’re doing something wrong

    I took this code from working site

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