Answer the question
In order to leave comments, you need to log in
How to connect your price filter in woocommerce?
I have my price filter design, how can I connect it to Woocommerce?
Preferably a standard feature.
Answer the question
In order to leave comments, you need to log in
And so I figured it out myself.
1) Wooconnerce filters are located in the /wp-content/plugins/woocommerce/includes/widgets/ folder, copy the class-wc-widget-price-filter.php file and paste it into your theme, for example, in the inc folder (wp-content/ themes/grad_market/inc/)
2) Edit the previously copied file:
Rename the file, for example: price-widgets.php
Rename the function, for example:
class My_Widget_Price_Filter extends WC_Widget {
Next, at the end of the file, initialize the widget:
function register_price1_widget() {
register_widget( 'My_Widget_Price_Filter' );
}
add_action( 'widgets_init', 'register_price1_widget' );
require get_template_directory() . '/inc/price-widgets.php';
<input id="priceMin" name="min_price" class="min_price" value="5000"> -
<input id="priceMax" name="max_price" value="15000" class="min_price">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question