widget_cssclass = 'woocommerce widget_product_search'; $this->widget_description = __( 'A Search box for products only.', 'woocommerce' ); $this->widget_id = 'woocommerce_product_search'; $this->widget_name = __( 'WooCommerce Product Search', 'woocommerce' ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Search Products', 'woocommerce' ), 'label' => __( 'Title', 'woocommerce' ) ) ); parent::__construct(); } /** * widget function. * * @see WP_Widget * @access public * @param array $args * @param array $instance * @return void */ function widget( $args, $instance ) { extract( $args ); $title = $instance['title']; $title = apply_filters('widget_title', $title, $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; get_product_search_form(); echo $after_widget; } } register_widget( 'WC_Widget_Product_Search' );