Bootstrap Templates Bundle

Saturday, April 4, 2015

How to Override woocommerce widgets

Here, I tried to show how to override WooCommerce Price Filter widget.

At first Add this below code to your functions.php file.  copy the  class-wc-widget-price-filter.php   file from wp-content\plugins\woocommerce\includes\widgets  to your theme file and include that by
include_once  or include get_template_directory()

 Override woocommerce product categories widgets

add_action( 'widgets_init', 'override_woocommerce_widgets', 15 );

function override_woocommerce_widgets() {
  // Ensure our parent class exists to avoid fatal error

    if ( class_exists( 'WC_Widget_Price_Filter' ) ) {
    unregister_widget( 'WC_Widget_Price_Filter' );

    include_once( 'inc/custom-widgets/fengo-class-wc-widget-price-filter.php' ); 
//include get_template_directory() . '/inc/custom-widgets/fengo-class-wc-widget-price-filter.php';

    register_widget( 'Fengo_WC_Widget_Price_Filter' );



  1. Thank you for sharing excellent information. Your website is very cool. Fully useful your blog post... Online shopping site for women's clothing in india

  2. Awesome tutorial!!! Worked like a charm.

  3. This comment has been removed by the author.

  4. When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style.

  5. Very good post, and it's also very informative. Your information on this subject appears to be very good, and the way you have expanded on it makes it easy for a newcomer to understand. I'd like you to keep writing posts and sharing your knowledge with us.


Wokiee React eCommerce Template