Advanced Woo Search - Version 1.15

Version Description

  • Exclude 'Out of stock' products from search
  • Fix bugs
Download this release

Release Info

Developer Mihail Barinov
Plugin Icon 128x128 Advanced Woo Search
Version 1.15
Comparing to
See all releases

Code changes from version 1.14 to 1.15

advanced-woo-search.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 1.14
7
  Author: ILLID
8
  Text Domain: aws
9
  */
@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  exit;
14
  }
15
 
16
- define( 'AWS_VERSION', '1.14' );
17
 
18
 
19
  define( 'AWS_DIR', dirname( __FILE__ ) );
@@ -138,7 +138,8 @@ final class AWS_Main {
138
  */
139
  public function get_settings( $name ) {
140
  $plugin_options = $this->data['settings'];
141
- return $plugin_options[ $name ];
 
142
  }
143
 
144
  }
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 1.15
7
  Author: ILLID
8
  Text Domain: aws
9
  */
13
  exit;
14
  }
15
 
16
+ define( 'AWS_VERSION', '1.15' );
17
 
18
 
19
  define( 'AWS_DIR', dirname( __FILE__ ) );
138
  */
139
  public function get_settings( $name ) {
140
  $plugin_options = $this->data['settings'];
141
+ $return_value = isset( $plugin_options[ $name ] ) ? $plugin_options[ $name ] : '';
142
+ return $return_value;
143
  }
144
 
145
  }
assets/js/common.js CHANGED
@@ -34,6 +34,7 @@
34
 
35
  if ( searchFor === '' ) {
36
  $(d.resultBlock).html('');
 
37
  return;
38
  }
39
 
@@ -44,11 +45,12 @@
44
 
45
  if ( searchFor.length < d.minChars ) {
46
  $(d.resultBlock).html('');
 
47
  return;
48
  }
49
 
50
  if ( d.showLoader ) {
51
- $searchForm.addClass('processing');
52
  }
53
 
54
  var data = {
@@ -176,13 +178,22 @@
176
 
177
  html += '</ul>';
178
 
179
- $searchForm.removeClass('processing');
 
180
  $(d.resultBlock).html( html );
181
 
182
  $(d.resultBlock).show();
183
 
184
  },
185
 
 
 
 
 
 
 
 
 
186
  onFocus: function( event ) {
187
  if ( searchFor !== '' ) {
188
  $(d.resultBlock).show();
34
 
35
  if ( searchFor === '' ) {
36
  $(d.resultBlock).html('');
37
+ methods.hideLoader();
38
  return;
39
  }
40
 
45
 
46
  if ( searchFor.length < d.minChars ) {
47
  $(d.resultBlock).html('');
48
+ methods.hideLoader();
49
  return;
50
  }
51
 
52
  if ( d.showLoader ) {
53
+ methods.showLoader();
54
  }
55
 
56
  var data = {
178
 
179
  html += '</ul>';
180
 
181
+ methods.hideLoader();
182
+
183
  $(d.resultBlock).html( html );
184
 
185
  $(d.resultBlock).show();
186
 
187
  },
188
 
189
+ showLoader: function() {
190
+ $searchForm.addClass('processing');
191
+ },
192
+
193
+ hideLoader: function() {
194
+ $searchForm.removeClass('processing');
195
+ },
196
+
197
  onFocus: function( event ) {
198
  if ( searchFor !== '' ) {
199
  $(d.resultBlock).show();
includes/class-aws-admin.php CHANGED
@@ -152,7 +152,7 @@ class AWS_Admin {
152
  <tr valign="top">
153
  <th scope="row"><?php echo $value['name']; ?></th>
154
  <td>
155
- <input type="text" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo isset( $plugin_options[ $value['id'] ] ) ? stripslashes( $plugin_options[ $value['id'] ] ) : ''; ?>">
156
  <br><span class="description"><?php echo $value['desc']; ?></span>
157
  </td>
158
  </tr>
152
  <tr valign="top">
153
  <th scope="row"><?php echo $value['name']; ?></th>
154
  <td>
155
+ <input type="text" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo isset( $plugin_options[ $value['id'] ] ) ? stripslashes( $plugin_options[ $value['id'] ] ) : ''; ?>">
156
  <br><span class="description"><?php echo $value['desc']; ?></span>
157
  </td>
158
  </tr>
includes/class-aws-table.php CHANGED
@@ -197,11 +197,15 @@ if ( ! class_exists( 'AWS_Table' ) ) :
197
 
198
  $product = wc_get_product( $id );
199
 
 
 
 
 
200
  $sku = $product->get_sku();
201
 
202
  $title = apply_filters( 'the_title', get_the_title( $id ) );
203
  $content = apply_filters( 'the_content', get_post_field( 'post_content', $id ) );
204
- $excerpt = apply_filters( 'get_the_excerpt', get_post_field( 'post_excerpt', $id ) );
205
  $cat_names = $this->get_terms_names_list( $id, 'product_cat' );
206
  $tag_names = $this->get_terms_names_list( $id, 'product_tag' );
207
 
197
 
198
  $product = wc_get_product( $id );
199
 
200
+ if ( $product->stock_status === 'outofstock' ) {
201
+ continue;
202
+ }
203
+
204
  $sku = $product->get_sku();
205
 
206
  $title = apply_filters( 'the_title', get_the_title( $id ) );
207
  $content = apply_filters( 'the_content', get_post_field( 'post_content', $id ) );
208
+ $excerpt = get_post_field( 'post_excerpt', $id );
209
  $cat_names = $this->get_terms_names_list( $id, 'product_cat' );
210
  $tag_names = $this->get_terms_names_list( $id, 'product_tag' );
211
 
includes/widget.php CHANGED
@@ -22,7 +22,12 @@ class AWS_Widget extends WP_Widget {
22
  */
23
  function widget( $args, $instance ) {
24
  extract( $args );
25
- $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base );
 
 
 
 
 
26
 
27
  echo $before_widget;
28
  echo $before_title;
22
  */
23
  function widget( $args, $instance ) {
24
  extract( $args );
25
+
26
+ $title = apply_filters( 'widget_title',
27
+ ( ! empty( $instance['title'] ) ? $instance['title'] : '' ),
28
+ $instance,
29
+ $this->id_base
30
+ );
31
 
32
  echo $before_widget;
33
  echo $before_title;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
- Stable tag: 1.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -35,6 +35,7 @@ Advanced Woo Search - powerful live search plugin for WooCommerce. Just start ty
35
  * **Filters**. Switch between tabs to show different search results
36
  * **Unlimited** amount of search form instances
37
  * **Anvanced settings page** with lot of options
 
38
  * **Exclude** spicific products by its categories or tags from search results
39
  * Ability to specify **source of image** for search results: featured image, gallery, product content, product short description or set default image if there is no other images
40
  * Support for **WooCommerce Brands plugin**
@@ -70,6 +71,10 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
70
 
71
  == Changelog ==
72
 
 
 
 
 
73
  = 1.14 =
74
  * Fix number of search results on search page
75
  * Exclude draft products from search
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
+ Stable tag: 1.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
35
  * **Filters**. Switch between tabs to show different search results
36
  * **Unlimited** amount of search form instances
37
  * **Anvanced settings page** with lot of options
38
+ * **Smooth scroll** for search results
39
  * **Exclude** spicific products by its categories or tags from search results
40
  * Ability to specify **source of image** for search results: featured image, gallery, product content, product short description or set default image if there is no other images
41
  * Support for **WooCommerce Brands plugin**
71
 
72
  == Changelog ==
73
 
74
+ = 1.15 =
75
+ * Exclude 'Out of stock' products from search
76
+ * Fix bugs
77
+
78
  = 1.14 =
79
  * Fix number of search results on search page
80
  * Exclude draft products from search