YITH WooCommerce Ajax Product Filter - Version 2.0.3

Version Description

  • Added: Support to Sortable attribute
  • Fixed: Color lost after change widget style
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

README.txt CHANGED
@@ -4,15 +4,15 @@ Contributors: yithemes
4
  Tags: woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.2.2
7
- Stable tag: 2.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- YITH WooCommerce Ajax Product Filter offers the perfect way to search among all the products of your shop.
12
 
13
  == Description ==
14
 
15
- = Search for the exact product you are looking for =
16
 
17
  A powerful plugin: YITH WooCommerce Ajax Product Filter lets you apply the filters you need to display the correct variations of the products you are looking for.
18
  Choose among color, label, list and dropdown and your research will display those precise products that suit perfectly your needs.
@@ -20,7 +20,7 @@ An extremely helpful plugin to help customers find what they really want.
20
 
21
 
22
  Working demos are available here:
23
- **[LIVE DEMO 1](http://preview.yithemes.com/room09/shop/)** - **[LIVE DEMO 2](http://preview.yithemes.com/bazar/shop/)**
24
 
25
  Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter/).
26
 
@@ -66,6 +66,11 @@ After renaming the files, you can update/translate the .po file following the cl
66
 
67
  == Changelog ==
68
 
 
 
 
 
 
69
  = 2.0.2 =
70
 
71
  * Fixed: Empty filters appear after update to 2.0.0
4
  Tags: woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.2.2
7
+ Stable tag: 2.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
12
 
13
  == Description ==
14
 
15
+ = Filter for the exact product you are looking for =
16
 
17
  A powerful plugin: YITH WooCommerce Ajax Product Filter lets you apply the filters you need to display the correct variations of the products you are looking for.
18
  Choose among color, label, list and dropdown and your research will display those precise products that suit perfectly your needs.
20
 
21
 
22
  Working demos are available here:
23
+ **[LIVE DEMO 1](http://live.yithemes.com/globe/shop/?layout-shop=sidebar-right)** - **[LIVE DEMO 2](http://preview.yithemes.com/bazar/shop/)**
24
 
25
  Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter/).
26
 
66
 
67
  == Changelog ==
68
 
69
+ = 2.0.3 =
70
+
71
+ * Added: Support to Sortable attribute
72
+ * Fixed: Color lost after change widget style
73
+
74
  = 2.0.2 =
75
 
76
  * Fixed: Empty filters appear after update to 2.0.0
includes/class.yith-wcan-admin.php CHANGED
@@ -2,17 +2,19 @@
2
  /**
3
  * Admin class
4
  *
5
- * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
  * @version 1.3.2
8
  */
9
 
10
- if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
 
 
11
 
12
- if( !class_exists( 'YITH_WCAN_Admin' ) ) {
13
  /**
14
- * Admin class.
15
- * The class manage all the admin behaviors.
16
  *
17
  * @since 1.0.0
18
  */
@@ -36,30 +38,30 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
36
  /**
37
  * @var string Official plugin documentation
38
  */
39
- protected $_official_documentation = 'https://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter' ;
40
 
41
  /**
42
  * @var string Official plugin landing page
43
  */
44
- protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-ajax-product-filter' ;
45
 
46
- /**
47
  * @var string Official plugin landing page
48
  */
49
- protected $_premium_live = 'http://plugins.yithemes.com/yith-woocommerce-ajax-product-filter/shop/' ;
50
-
51
- /**
52
- * Constructor
53
- *
54
- * @access public
55
- * @since 1.0.0
56
- */
57
- public function __construct( $version ) {
58
  $this->version = $version;
59
 
60
- //Actions
61
- add_action( 'init', array( $this, 'init' ) );
62
- add_action('wp_ajax_yith_wcan_select_type', array( $this, 'ajax_print_terms') );
63
 
64
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
65
  add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
@@ -76,37 +78,38 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
76
 
77
  // YITH WCAN Loaded
78
  do_action( 'yith_wcan_loaded' );
79
- }
80
-
81
-
82
- /**
83
- * Init method:
84
- * - default options
85
- *
86
- * @access public
87
- * @since 1.0.0
88
- */
89
- public function init() {}
90
-
91
-
92
- /**
93
- * Enqueue admin styles and scripts
94
- *
95
- * @access public
96
- * @return void
97
- * @since 1.0.0
98
- */
99
- public function enqueue_styles_scripts() {
 
100
  global $pagenow;
101
 
102
- if( 'widgets.php' == $pagenow || 'admin.php' == $pagenow ) {
103
  wp_enqueue_style( 'wp-color-picker' );
104
  wp_enqueue_style( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/css/admin.css', array( 'yit-plugin-style' ), $this->version );
105
 
106
  wp_enqueue_script( 'wp-color-picker' );
107
- wp_enqueue_script( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/js/yith-wcan-admin.js', array('jquery', 'wp-color-picker'), $this->version, true );
108
  }
109
- }
110
 
111
  /**
112
  * Print terms for the element selected
@@ -116,24 +119,25 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
116
  * @since 1.0.0
117
  */
118
  public function ajax_print_terms() {
119
- $type = $_POST['value'];
120
  $attribute = $_POST['attribute'];
121
- $return = array('message' => '', 'content' => $_POST);
122
 
123
- $terms = get_terms( 'pa_' . $attribute, array('hide_empty'=>'0') );
124
 
125
  $return['content'] = yith_wcan_attributes_table(
126
  $type,
127
  $attribute,
128
  $_POST['id'],
129
  $_POST['name'],
130
- json_decode($_POST['value']),
131
  false
132
  );
133
 
134
- echo json_encode($return);
135
  die();
136
  }
 
137
  /**
138
  * Add a panel under YITH Plugins tab
139
  *
@@ -143,6 +147,7 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
143
  * @use /Yit_Plugin_Panel class
144
  * @see plugin-fw/lib/yit-plugin-panel.php
145
  */
 
146
  public function register_panel() {
147
 
148
  if ( ! empty( $this->_panel ) ) {
@@ -175,56 +180,56 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
175
  $this->_panel = new YIT_Plugin_Panel( $args );
176
  }
177
 
178
- public function premium_tab(){
179
  require_once( YITH_WCAN_DIR . 'templates/admin/premium.php' );
180
  }
181
 
182
  /**
183
- * Action Links
184
- *
185
- * add the action links to plugin admin page
186
- *
187
- * @param $links | links plugin array
188
- *
189
- * @return mixed Array
190
- * @since 1.0
191
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
192
- * @return mixed
193
- * @use plugin_action_links_{$plugin_file_name}
194
- */
195
  public function action_links( $links ) {
196
- $premium_live_text = defined( 'YITH_WCAN_FREE_INIT' ) ? __( 'Premium live demo', 'yith_wc_product_vendors' ) : __( 'Live demo', 'yith_wc_product_vendors' );
197
- $links[] = '<a href="' . $this->_premium_live . '" target="_blank">' . $premium_live_text . '</a>';
198
-
199
- if ( defined( 'YITH_WCAN_FREE_INIT' ) ) {
200
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith_wc_product_vendors' ) . '</a>';
201
- }
202
-
203
- return $links;
204
- }
205
-
206
- /**
207
- * plugin_row_meta
208
- *
209
- * add the action links to plugin admin page
210
- *
211
- * @param $plugin_meta
212
- * @param $plugin_file
213
- * @param $plugin_data
214
- * @param $status
215
- *
216
- * @return Array
217
- * @since 1.0
218
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
219
- * @use plugin_row_meta
220
- */
221
- public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
222
-
223
- if( ( defined( 'YITH_WCAN_INIT' ) && YITH_WCAN_INIT == $plugin_file ) || ( defined( 'YITH_WCAN_FREE_INIT' ) && YITH_WCAN_FREE_INIT == $plugin_file ) ){
224
  $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith_wc_product_vendors' ) . '</a>';
225
  }
226
- return $plugin_meta;
227
- }
228
 
229
  /**
230
  * Get the premium landing uri
@@ -239,6 +244,10 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
239
 
240
  public function register_pointer() {
241
 
 
 
 
 
242
  if ( ! class_exists( 'YIT_Pointers' ) ) {
243
  include_once( 'plugin-fw/lib/yit-pointers.php' );
244
  }
@@ -250,7 +259,7 @@ if( !class_exists( 'YITH_WCAN_Admin' ) ) {
250
 
251
  $plugin_name = __( 'YITH WooCommerce Ajax Product Filter', 'yith_wc_ajxnav' );
252
 
253
- $premium_message = sprintf('%s, <a href="%s" target"_blank">%s</a>.', __('YITH WooCommerce Product Filter has been updated with new available options', 'yith_wc_ajxnav' ), $this->_premium_landing, __( 'discover the PREMIUM version', 'yith_wc_ajxnav' ) );
254
 
255
  $args = array();
256
  foreach ( array( 'plugins', 'update' ) as $screen ) {
2
  /**
3
  * Admin class
4
  *
5
+ * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
  * @version 1.3.2
8
  */
9
 
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
 
14
+ if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
15
  /**
16
+ * Admin class.
17
+ * The class manage all the admin behaviors.
18
  *
19
  * @since 1.0.0
20
  */
38
  /**
39
  * @var string Official plugin documentation
40
  */
41
+ protected $_official_documentation = 'https://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter';
42
 
43
  /**
44
  * @var string Official plugin landing page
45
  */
46
+ protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-ajax-product-filter';
47
 
48
+ /**
49
  * @var string Official plugin landing page
50
  */
51
+ protected $_premium_live = 'http://plugins.yithemes.com/yith-woocommerce-ajax-product-filter/shop/';
52
+
53
+ /**
54
+ * Constructor
55
+ *
56
+ * @access public
57
+ * @since 1.0.0
58
+ */
59
+ public function __construct( $version ) {
60
  $this->version = $version;
61
 
62
+ //Actions
63
+ add_action( 'init', array( $this, 'init' ) );
64
+ add_action( 'wp_ajax_yith_wcan_select_type', array( $this, 'ajax_print_terms' ) );
65
 
66
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
67
  add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
78
 
79
  // YITH WCAN Loaded
80
  do_action( 'yith_wcan_loaded' );
81
+ }
82
+
83
+
84
+ /**
85
+ * Init method:
86
+ * - default options
87
+ *
88
+ * @access public
89
+ * @since 1.0.0
90
+ */
91
+ public function init() {
92
+ }
93
+
94
+
95
+ /**
96
+ * Enqueue admin styles and scripts
97
+ *
98
+ * @access public
99
+ * @return void
100
+ * @since 1.0.0
101
+ */
102
+ public function enqueue_styles_scripts() {
103
  global $pagenow;
104
 
105
+ if ( 'widgets.php' == $pagenow || 'admin.php' == $pagenow ) {
106
  wp_enqueue_style( 'wp-color-picker' );
107
  wp_enqueue_style( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/css/admin.css', array( 'yit-plugin-style' ), $this->version );
108
 
109
  wp_enqueue_script( 'wp-color-picker' );
110
+ wp_enqueue_script( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/js/yith-wcan-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
111
  }
112
+ }
113
 
114
  /**
115
  * Print terms for the element selected
119
  * @since 1.0.0
120
  */
121
  public function ajax_print_terms() {
122
+ $type = $_POST['value'];
123
  $attribute = $_POST['attribute'];
124
+ $return = array( 'message' => '', 'content' => $_POST );
125
 
126
+ $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
127
 
128
  $return['content'] = yith_wcan_attributes_table(
129
  $type,
130
  $attribute,
131
  $_POST['id'],
132
  $_POST['name'],
133
+ json_decode( $_POST['value'] ),
134
  false
135
  );
136
 
137
+ echo json_encode( $return );
138
  die();
139
  }
140
+
141
  /**
142
  * Add a panel under YITH Plugins tab
143
  *
147
  * @use /Yit_Plugin_Panel class
148
  * @see plugin-fw/lib/yit-plugin-panel.php
149
  */
150
+
151
  public function register_panel() {
152
 
153
  if ( ! empty( $this->_panel ) ) {
180
  $this->_panel = new YIT_Plugin_Panel( $args );
181
  }
182
 
183
+ public function premium_tab() {
184
  require_once( YITH_WCAN_DIR . 'templates/admin/premium.php' );
185
  }
186
 
187
  /**
188
+ * Action Links
189
+ *
190
+ * add the action links to plugin admin page
191
+ *
192
+ * @param $links | links plugin array
193
+ *
194
+ * @return mixed Array
195
+ * @since 1.0
196
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
197
+ * @return mixed
198
+ * @use plugin_action_links_{$plugin_file_name}
199
+ */
200
  public function action_links( $links ) {
201
+ $premium_live_text = defined( 'YITH_WCAN_FREE_INIT' ) ? __( 'Premium live demo', 'yith_wc_product_vendors' ) : __( 'Live demo', 'yith_wc_product_vendors' );
202
+ $links[] = '<a href="' . $this->_premium_live . '" target="_blank">' . $premium_live_text . '</a>';
203
+
204
+ if ( defined( 'YITH_WCAN_FREE_INIT' ) ) {
205
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith_wc_product_vendors' ) . '</a>';
206
+ }
207
+
208
+ return $links;
209
+ }
210
+
211
+ /**
212
+ * plugin_row_meta
213
+ *
214
+ * add the action links to plugin admin page
215
+ *
216
+ * @param $plugin_meta
217
+ * @param $plugin_file
218
+ * @param $plugin_data
219
+ * @param $status
220
+ *
221
+ * @return Array
222
+ * @since 1.0
223
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
224
+ * @use plugin_row_meta
225
+ */
226
+ public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
227
+
228
+ if ( ( defined( 'YITH_WCAN_INIT' ) && YITH_WCAN_INIT == $plugin_file ) || ( defined( 'YITH_WCAN_FREE_INIT' ) && YITH_WCAN_FREE_INIT == $plugin_file ) ) {
229
  $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith_wc_product_vendors' ) . '</a>';
230
  }
231
+ return $plugin_meta;
232
+ }
233
 
234
  /**
235
  * Get the premium landing uri
244
 
245
  public function register_pointer() {
246
 
247
+ if( defined( 'YITH_WCAN_PREMIUM' ) && YITH_WCAN_PREMIUM ){
248
+ return;
249
+ }
250
+
251
  if ( ! class_exists( 'YIT_Pointers' ) ) {
252
  include_once( 'plugin-fw/lib/yit-pointers.php' );
253
  }
259
 
260
  $plugin_name = __( 'YITH WooCommerce Ajax Product Filter', 'yith_wc_ajxnav' );
261
 
262
+ $premium_message = sprintf( '%s, <a href="%s" target"_blank">%s</a>.', __( 'YITH WooCommerce Product Filter has been updated with new available options', 'yith_wc_ajxnav' ), $this->_premium_landing, __( 'discover the PREMIUM version', 'yith_wc_ajxnav' ) );
263
 
264
  $args = array();
265
  foreach ( array( 'plugins', 'update' ) as $screen ) {
init.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
- * Description: YITH WooCommerce Ajax Navigation allows user to filter products in Shop page without reloading the page.
6
- * Version: 2.0.2
7
  * Author: yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_ajxnav
@@ -65,7 +65,7 @@ if ( defined( 'YITH_WCAN_VERSION' ) ) {
65
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
66
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
67
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
68
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '2.0.2' );
69
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
70
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
71
 
2
  /**
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
+ * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 2.0.3
7
  * Author: yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_ajxnav
65
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
66
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
67
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
68
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '2.0.3' );
69
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
70
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
71
 
plugin-fw/lib/yit-cpt-unlimited.php CHANGED
@@ -1630,7 +1630,7 @@ class YIT_CPT_Unlimited {
1630
  class: 'multi-uploader add-new-h2',
1631
  'data-uploader_title': '<?php printf( __( 'Add %s from images', 'yith-plugin-fw' ), $label_plural ) ?>',
1632
  'data-uploader_button_text': '<?php printf( __( 'Add %s', 'yith-plugin-fw' ), $label_plural ) ?>'
1633
- }).text('<?php _e( 'Add with multiupload', 'yith-plugin-fw' ) ?>');
1634
 
1635
  var spinner = $('<span />', {
1636
  class: 'spinner',
1630
  class: 'multi-uploader add-new-h2',
1631
  'data-uploader_title': '<?php printf( __( 'Add %s from images', 'yith-plugin-fw' ), $label_plural ) ?>',
1632
  'data-uploader_button_text': '<?php printf( __( 'Add %s', 'yith-plugin-fw' ), $label_plural ) ?>'
1633
+ }).text('<?php _e( 'Upload multiple files', 'yith-plugin-fw' ) ?>');
1634
 
1635
  var spinner = $('<span />', {
1636
  class: 'spinner',
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -295,7 +295,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
295
  <form method="post">
296
  <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
297
  <input type="hidden" name="yit-action" value="reset" />
298
- <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to Default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
299
  </form>
300
  <p>&nbsp;</p>
301
  <?php endif ?>
295
  <form method="post">
296
  <?php $warning = __( 'If you continue with this action, you will reset all options in this page.', 'yith-plugin-fw' ) ?>
297
  <input type="hidden" name="yit-action" value="reset" />
298
+ <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
299
  </form>
300
  <p>&nbsp;</p>
301
  <?php endif ?>
plugin-fw/lib/yit-plugin-subpanel.php CHANGED
@@ -145,7 +145,7 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
145
  <form method="post">
146
  <?php $warning = __( 'If you continue with this action, you will reset all the options in this page.', 'yith-plugin-fw' ) ?>
147
  <input type="hidden" name="yit-action" value="reset" />
148
- <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to Default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
149
  </form>
150
  <p>&nbsp;</p>
151
  <?php endif ?>
145
  <form method="post">
146
  <?php $warning = __( 'If you continue with this action, you will reset all the options in this page.', 'yith-plugin-fw' ) ?>
147
  <input type="hidden" name="yit-action" value="reset" />
148
+ <input type="submit" name="yit-reset" class="button-secondary" value="<?php _e( 'Reset to default', 'yith-plugin-fw' ) ?>" onclick="return confirm('<?php echo $warning . '\n' . __( 'Are you sure?', 'yith-plugin-fw' ) ?>');" />
149
  </form>
150
  <p>&nbsp;</p>
151
  <?php endif ?>
plugin-fw/templates/metaboxes/types/icon-list.php CHANGED
@@ -23,7 +23,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
23
 
24
  $current_options = wp_parse_args( $args['value'], $args['std'] );
25
  $current_icon = YIT_Icon()->get_icon_data( $current_options['icon'] );
26
- $current_icon = YIT_Icon()->get_icon_data( $std['icon'] );
27
 
28
  $options['icon'] = YIT_Plugin_Common::get_icon_list();
29
 
@@ -88,7 +88,7 @@ $options['icon'] = YIT_Plugin_Common::get_icon_list();
88
  <?php if( $std['select'] == 'custom' ) : ?>
89
  <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options['select']['custom'], $std['custom'] ) ?>
90
  <?php else: ?>
91
- <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $current_icon ) ?>
92
  <?php endif; ?>
93
  </div>
94
 
23
 
24
  $current_options = wp_parse_args( $args['value'], $args['std'] );
25
  $current_icon = YIT_Icon()->get_icon_data( $current_options['icon'] );
26
+ $std_icon = YIT_Icon()->get_icon_data( $std['icon'] );
27
 
28
  $options['icon'] = YIT_Plugin_Common::get_icon_list();
29
 
88
  <?php if( $std['select'] == 'custom' ) : ?>
89
  <?php printf( __( '(Default: %s <img src="%s"/>)', 'yith-plugin-fw' ), $options['select']['custom'], $std['custom'] ) ?>
90
  <?php else: ?>
91
+ <?php printf( __( '(Default: <i %s></i> )', 'yith-plugin-fw' ), $std_icon ) ?>
92
  <?php endif; ?>
93
  </div>
94
 
widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -22,6 +22,7 @@ class YITH_WCAN_Navigation_Widget extends WP_Widget {
22
  function __construct() {
23
  $widget_ops = array( 'classname' => 'yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Filter the product list without reloading the page', 'yith_wc_ajxnav' ) );
24
  $control_ops = array( 'width' => 400, 'height' => 350 );
 
25
  parent::__construct( 'yith-woo-ajax-navigation', __( 'YITH WooCommerce Ajax Product Filter', 'yith_wc_ajxnav' ), $widget_ops, $control_ops );
26
  }
27
 
@@ -860,5 +861,51 @@ class YITH_WCAN_Navigation_Widget extends WP_Widget {
860
  return $instance;
861
  }
862
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  }
864
  }
22
  function __construct() {
23
  $widget_ops = array( 'classname' => 'yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Filter the product list without reloading the page', 'yith_wc_ajxnav' ) );
24
  $control_ops = array( 'width' => 400, 'height' => 350 );
25
+ add_action('wp_ajax_yith_wcan_select_type', array( $this, 'ajax_print_terms') );
26
  parent::__construct( 'yith-woo-ajax-navigation', __( 'YITH WooCommerce Ajax Product Filter', 'yith_wc_ajxnav' ), $widget_ops, $control_ops );
27
  }
28
 
861
  return $instance;
862
  }
863
 
864
+ /**
865
+ * Print terms for the element selected
866
+ *
867
+ * @access public
868
+ * @return void
869
+ * @since 1.0.0
870
+ */
871
+ public function ajax_print_terms() {
872
+ $type = $_POST['value'];
873
+ $attribute = $_POST['attribute'];
874
+ $return = array( 'message' => '', 'content' => $_POST );
875
+
876
+ $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
877
+
878
+ $settings = $this->get_settings();
879
+ $widget_settings = $settings[ $this->number ];
880
+ $value = '';
881
+
882
+ if( 'label' == $type ){
883
+ $value = $widget_settings['labels'];
884
+ }
885
+
886
+ elseif( 'color' == $type ){
887
+ $value = $widget_settings['colors'];
888
+ }
889
+
890
+ elseif( 'multicolor' == $type ) {
891
+ $value = $widget_settings['multicolor'];
892
+ }
893
+
894
+ if ( $type ) {
895
+ $return['content'] = yith_wcan_attributes_table(
896
+ $type,
897
+ $attribute,
898
+ $_POST['id'],
899
+ $_POST['name'],
900
+ $value,
901
+ false
902
+ );
903
+ }
904
+
905
+
906
+ echo json_encode( $return );
907
+ die();
908
+ }
909
+
910
  }
911
  }