d_query_arg( $wp->query_string, '', home_url( $wp->request ) ) ); } else { $form_action = preg_replace( '%\/page/[0-9]+%', '', home_url( trailingslashit( $wp->request ) ) ); } wc_get_template( 'content-widget-price-filter.php', array( 'form_action' => $form_action, 'step' => $step, 'min_price' => $min_price, 'max_price' => $max_price, 'current_min_price' => $current_min_price, 'current_max_price' => $current_max_price, ) ); $this->widget_end( $args ); } /** * Get filtered min price for current products. * * @return int */ protected function get_filtered_price() { global $wpdb; $args = WC()->query->get_main_query()->query_vars; $tax_query = isset( $args['tax_query'] ) ? $args['tax_query'] : array(); $meta_query = isset( $args['meta_query'] ) ? $args['meta_query'] : array(); if ( ! is_post_type_archive( 'product' ) && ! empty( $args['taxonomy'] ) && ! empty( $args['term'] ) ) { $tax_query[] = WC()->query->get_main_tax_query(); } foreach ( $meta_query + $tax_query as $key => $query ) { if ( ! empty( $query['price_filter'] ) || ! empty( $query['rating_filter'] ) ) { unset( $meta_query[ $key ] ); } } $meta_query = new WP_Meta_Query( $meta_query ); $tax_query = new WP_Tax_Query( $tax_query ); $search = WC_Query::get_main_search_query_sql(); $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' ); $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' ); $search_query_sql = $search ? ' AND ' . $search : ''; $sql = " SELECT min( min_price ) as min_price, MAX( max_price ) as max_price FROM {$wpdb->wc_product_meta_lookup} WHERE product_id IN ( SELECT ID FROM {$wpdb->posts} " . $tax_query_sql['join'] . $meta_query_sql['join'] . " WHERE {$wpdb->posts}.post_type IN ('" . implode( "','", array_map( 'esc_sql', apply_filters( 'woocommerce_price_filter_post_type', array( 'product' ) ) ) ) . "') AND {$wpdb->posts}.post_status = 'publish' " . $tax_query_sql['where'] . $meta_query_sql['where'] . $search_query_sql . ' )'; $sql = apply_filters( 'woocommerce_price_filter_sql', $sql, $meta_query_sql, $tax_query_sql ); return $wpdb->get_row( $sql ); // WPCS: unprepared SQL ok. } } term, $taxonomy, $visited = array() ) { $parent = get_term( $term, $taxonomy ); if ( is_wp_error( $parent ) ) { return $parent; } $chain = ''; if ( $parent->parent && ( $parent->parent !== $parent->term_id ) && ! in_array( $parent->parent, $visited, true ) ) { $visited[] = $parent->parent; $chain .= jetpack_get_term_parents( $parent->parent, $taxonomy, $visited ); } $chain .= '' . $parent->name . ''; return $chain; }
Fatal error: Uncaught Error: Class 'WC_Widget_Price_Filter' not found in /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/class-wp-widget-factory.php:61 Stack trace: #0 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/widgets.php(115): WP_Widget_Factory->register('WC_Widget_Price...') #1 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-content/plugins/woocommerce/includes/wc-widget-functions.php(39): register_widget('WC_Widget_Price...') #2 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/class-wp-hook.php(287): wc_register_widgets('') #3 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #4 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #5 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/widgets.php(1795): do_action('widgets_init') #6 /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-inclu in /home/barcel17/formacio.iniciativabarcelonaopendata.cat/wp-includes/class-wp-widget-factory.php on line 61