Advanced Woo Search - Version 2.28

Version Description

( 2021-05-24 ) = * Update - Tested with WC 5.3 * Update - Index table improvement. Add a new index * Fix - Bug with search results for translated terms archive pages

Download this release

Release Info

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

Code changes from version 2.27 to 2.28

advanced-woo-search.php CHANGED
@@ -3,12 +3,12 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 2.27
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
10
  WC requires at least: 3.0.0
11
- WC tested up to: 5.2.0
12
  */
13
 
14
 
@@ -96,7 +96,7 @@ final class AWS_Main {
96
  */
97
  private function define_constants() {
98
 
99
- $this->define( 'AWS_VERSION', '2.27' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 2.28
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
10
  WC requires at least: 3.0.0
11
+ WC tested up to: 5.3.0
12
  */
13
 
14
 
96
  */
97
  private function define_constants() {
98
 
99
+ $this->define( 'AWS_VERSION', '2.28' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
includes/class-aws-table.php CHANGED
@@ -315,7 +315,8 @@ if ( ! class_exists( 'AWS_Table' ) ) :
315
  lang VARCHAR(20) NOT NULL DEFAULT 0,
316
  KEY id (id),
317
  {$terms_key}
318
- KEY term_id (term_id)
 
319
  ) $charset_collate;";
320
 
321
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
315
  lang VARCHAR(20) NOT NULL DEFAULT 0,
316
  KEY id (id),
317
  {$terms_key}
318
+ KEY term_id (term_id),
319
+ UNIQUE KEY source_term (id,term,term_source,lang)
320
  ) $charset_collate;";
321
 
322
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
includes/class-aws-tax-search.php CHANGED
@@ -120,6 +120,19 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
120
  $relevance_query = '0';
121
  }
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  $sql = "
124
  SELECT
125
  distinct($wpdb->terms.name),
@@ -174,14 +187,7 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
174
 
175
  $parent = '';
176
 
177
- if ( function_exists( 'wpml_object_id_filter' ) ) {
178
- $term = wpml_object_id_filter( $result->term_id, $result->taxonomy );
179
- if ( $term != $result->term_id ) {
180
- continue;
181
- }
182
- } else {
183
- $term = get_term( $result->term_id, $result->taxonomy );
184
- }
185
 
186
  if ( $term != null && !is_wp_error( $term ) ) {
187
  $term_link = get_term_link( $term );
120
  $relevance_query = '0';
121
  }
122
 
123
+ $lang = isset( $_REQUEST['lang'] ) ? sanitize_text_field( $_REQUEST['lang'] ) : '';
124
+ if ( $lang ) {
125
+ $terms = get_terms( array(
126
+ 'taxonomy' => $this->taxonomy,
127
+ 'hide_empty' => true,
128
+ 'fields' => 'ids',
129
+ 'lang' => $lang
130
+ ) );
131
+ if ( $terms ) {
132
+ $search_query .= sprintf( " AND ( " . $wpdb->terms . ".term_id IN ( %s ) )", implode( ',', $terms ) );
133
+ }
134
+ }
135
+
136
  $sql = "
137
  SELECT
138
  distinct($wpdb->terms.name),
187
 
188
  $parent = '';
189
 
190
+ $term = get_term( $result->term_id, $result->taxonomy );
 
 
 
 
 
 
 
191
 
192
  if ( $term != null && !is_wp_error( $term ) ) {
193
  $term_link = get_term_link( $term );
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: 5.7
7
- Stable tag: 2.27
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -167,6 +167,11 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
170
  = 2.27 ( 2021-05-10 ) =
171
  * Fix - WOOF - WooCommerce Products Filter plugin integration
172
  * Dev - Fix posts_per_page filter for search results page
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: 5.7
7
+ Stable tag: 2.28
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
167
 
168
  == Changelog ==
169
 
170
+ = 2.28 ( 2021-05-24 ) =
171
+ * Update - Tested with WC 5.3
172
+ * Update - Index table improvement. Add a new index
173
+ * Fix - Bug with search results for translated terms archive pages
174
+
175
  = 2.27 ( 2021-05-10 ) =
176
  * Fix - WOOF - WooCommerce Products Filter plugin integration
177
  * Dev - Fix posts_per_page filter for search results page