2011-08-10 17:11:11 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-11-03 13:31:20 +00:00
|
|
|
* Product Search Widget.
|
2012-08-14 17:37:50 +00:00
|
|
|
*
|
2020-08-05 16:36:24 +00:00
|
|
|
* @package WooCommerce\Widgets
|
2018-03-09 20:29:16 +00:00
|
|
|
* @version 2.3.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Widget product search class.
|
2011-08-10 17:11:11 +00:00
|
|
|
*/
|
2013-05-24 15:51:58 +00:00
|
|
|
class WC_Widget_Product_Search extends WC_Widget {
|
2012-08-14 17:37:50 +00:00
|
|
|
|
|
|
|
/**
|
2015-11-03 13:31:20 +00:00
|
|
|
* Constructor.
|
2012-08-14 17:37:50 +00:00
|
|
|
*/
|
2013-05-24 15:51:58 +00:00
|
|
|
public function __construct() {
|
|
|
|
$this->widget_cssclass = 'woocommerce widget_product_search';
|
2017-08-25 11:07:17 +00:00
|
|
|
$this->widget_description = __( 'A search form for your store.', 'woocommerce' );
|
2013-05-24 15:51:58 +00:00
|
|
|
$this->widget_id = 'woocommerce_product_search';
|
2017-08-25 11:07:17 +00:00
|
|
|
$this->widget_name = __( 'Product Search', 'woocommerce' );
|
2013-05-24 15:51:58 +00:00
|
|
|
$this->settings = array(
|
2018-03-09 20:29:16 +00:00
|
|
|
'title' => array(
|
2013-05-24 15:51:58 +00:00
|
|
|
'type' => 'text',
|
2014-11-15 01:12:59 +00:00
|
|
|
'std' => '',
|
2016-08-27 01:46:45 +00:00
|
|
|
'label' => __( 'Title', 'woocommerce' ),
|
|
|
|
),
|
2013-05-24 15:51:58 +00:00
|
|
|
);
|
2014-11-15 01:12:59 +00:00
|
|
|
|
2013-05-24 15:51:58 +00:00
|
|
|
parent::__construct();
|
2011-08-10 17:11:11 +00:00
|
|
|
}
|
|
|
|
|
2012-08-14 17:37:50 +00:00
|
|
|
/**
|
2016-01-06 18:58:38 +00:00
|
|
|
* Output widget.
|
2012-08-14 17:37:50 +00:00
|
|
|
*
|
|
|
|
* @see WP_Widget
|
2014-11-15 01:12:59 +00:00
|
|
|
*
|
2018-03-09 20:29:16 +00:00
|
|
|
* @param array $args Arguments.
|
|
|
|
* @param array $instance Widget instance.
|
2012-08-14 17:37:50 +00:00
|
|
|
*/
|
2016-04-26 17:26:56 +00:00
|
|
|
public function widget( $args, $instance ) {
|
2014-11-15 01:12:59 +00:00
|
|
|
$this->widget_start( $args, $instance );
|
2012-08-14 17:37:50 +00:00
|
|
|
|
2012-04-16 13:32:58 +00:00
|
|
|
get_product_search_form();
|
2012-08-14 17:37:50 +00:00
|
|
|
|
2014-11-15 01:12:59 +00:00
|
|
|
$this->widget_end( $args );
|
2011-08-10 17:11:11 +00:00
|
|
|
}
|
2013-05-24 15:51:58 +00:00
|
|
|
}
|