Version Description
- Add - Seamless integration for Woodmart theme
- Update - Admin ajax requests
- Fix - Synonyms search for taxonomies archives
Download this release
Release Info
Developer | Mihail Barinov |
Plugin | Advanced Woo Search |
Version | 2.07 |
Comparing to | |
See all releases |
Code changes from version 2.06 to 2.07
- advanced-woo-search.php +2 -2
- includes/admin/class-aws-admin-ajax.php +1 -1
- includes/class-aws-helpers.php +24 -1
- includes/class-aws-integrations.php +42 -0
- includes/class-aws-tax-search.php +2 -20
- readme.txt +7 -2
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: 2.
|
7 |
Author: ILLID
|
8 |
Author URI: https://advanced-woo-search.com/
|
9 |
Text Domain: advanced-woo-search
|
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
-
define( 'AWS_VERSION', '2.
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
3 |
/*
|
4 |
Plugin Name: Advanced Woo Search
|
5 |
Description: Advance ajax WooCommerce product search.
|
6 |
+
Version: 2.07
|
7 |
Author: ILLID
|
8 |
Author URI: https://advanced-woo-search.com/
|
9 |
Text Domain: advanced-woo-search
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
+
define( 'AWS_VERSION', '2.07' );
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
includes/admin/class-aws-admin-ajax.php
CHANGED
@@ -39,7 +39,7 @@ if ( ! class_exists( 'AWS_Admin_Ajax' ) ) :
|
|
39 |
|
40 |
do_action( 'aws_cache_clear' );
|
41 |
|
42 |
-
|
43 |
|
44 |
}
|
45 |
|
39 |
|
40 |
do_action( 'aws_cache_clear' );
|
41 |
|
42 |
+
wp_send_json_success( '1' );
|
43 |
|
44 |
}
|
45 |
|
includes/class-aws-helpers.php
CHANGED
@@ -486,10 +486,28 @@ if ( ! class_exists( 'AWS_Helpers' ) ) :
|
|
486 |
|
487 |
}
|
488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
/*
|
490 |
* Add synonyms
|
491 |
*/
|
492 |
-
static public function get_synonyms( $str_array ) {
|
493 |
|
494 |
$synonyms = AWS()->get_settings( 'synonyms' );
|
495 |
$synonyms_array = array();
|
@@ -517,7 +535,12 @@ if ( ! class_exists( 'AWS_Helpers' ) ) :
|
|
517 |
$synonym_array = explode( ',', $synonyms_string );
|
518 |
|
519 |
if ( $synonym_array && ! empty( $synonym_array ) ) {
|
|
|
520 |
$synonym_array = array_map( array( 'AWS_Helpers', 'normalize_string' ), $synonym_array );
|
|
|
|
|
|
|
|
|
521 |
foreach ( $synonym_array as $synonym_item ) {
|
522 |
|
523 |
if ( $synonym_item && isset( $str_array[$synonym_item] ) ) {
|
486 |
|
487 |
}
|
488 |
|
489 |
+
/*
|
490 |
+
* Singularize terms
|
491 |
+
* @param string $search_term Search term
|
492 |
+
* @return string Singularized search term
|
493 |
+
*/
|
494 |
+
static public function singularize( $search_term ) {
|
495 |
+
|
496 |
+
$search_term_len = strlen( $search_term );
|
497 |
+
$search_term_norm = AWS_Plurals::singularize( $search_term );
|
498 |
+
|
499 |
+
if ( $search_term_norm && $search_term_len > 3 && strlen( $search_term_norm ) > 2 ) {
|
500 |
+
$search_term = $search_term_norm;
|
501 |
+
}
|
502 |
+
|
503 |
+
return $search_term;
|
504 |
+
|
505 |
+
}
|
506 |
+
|
507 |
/*
|
508 |
* Add synonyms
|
509 |
*/
|
510 |
+
static public function get_synonyms( $str_array, $singular = false ) {
|
511 |
|
512 |
$synonyms = AWS()->get_settings( 'synonyms' );
|
513 |
$synonyms_array = array();
|
535 |
$synonym_array = explode( ',', $synonyms_string );
|
536 |
|
537 |
if ( $synonym_array && ! empty( $synonym_array ) ) {
|
538 |
+
|
539 |
$synonym_array = array_map( array( 'AWS_Helpers', 'normalize_string' ), $synonym_array );
|
540 |
+
if ( $singular ) {
|
541 |
+
$synonym_array = array_map( array( 'AWS_Helpers', 'singularize' ), $synonym_array );
|
542 |
+
}
|
543 |
+
|
544 |
foreach ( $synonym_array as $synonym_item ) {
|
545 |
|
546 |
if ( $synonym_item && isset( $str_array[$synonym_item] ) ) {
|
includes/class-aws-integrations.php
CHANGED
@@ -125,6 +125,10 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
125 |
add_action( 'wp_head', array( $this, 'jupiter_head_action' ) );
|
126 |
}
|
127 |
|
|
|
|
|
|
|
|
|
128 |
// Elementor pro
|
129 |
if ( defined( 'ELEMENTOR_PRO_VERSION' ) ) {
|
130 |
add_action( 'wp_footer', array( $this, 'elementor_pro_popup' ) );
|
@@ -668,6 +672,40 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
668 |
|
669 |
<?php }
|
670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
/*
|
672 |
* Elementor popup search form init
|
673 |
*/
|
@@ -891,6 +929,10 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
891 |
$selectors[] = '.responsive-searchform';
|
892 |
}
|
893 |
|
|
|
|
|
|
|
|
|
894 |
return $selectors;
|
895 |
|
896 |
}
|
125 |
add_action( 'wp_head', array( $this, 'jupiter_head_action' ) );
|
126 |
}
|
127 |
|
128 |
+
if ( 'Woodmart' === $this->current_theme ) {
|
129 |
+
add_action( 'wp_head', array( $this, 'woodmart_head_action' ) );
|
130 |
+
}
|
131 |
+
|
132 |
// Elementor pro
|
133 |
if ( defined( 'ELEMENTOR_PRO_VERSION' ) ) {
|
134 |
add_action( 'wp_footer', array( $this, 'elementor_pro_popup' ) );
|
672 |
|
673 |
<?php }
|
674 |
|
675 |
+
/*
|
676 |
+
* Woodmart theme
|
677 |
+
*/
|
678 |
+
public function woodmart_head_action() { ?>
|
679 |
+
|
680 |
+
<style>
|
681 |
+
|
682 |
+
.woodmart-search-full-screen .aws-container .aws-search-form {
|
683 |
+
padding-top: 0;
|
684 |
+
padding-right: 0;
|
685 |
+
padding-bottom: 0;
|
686 |
+
padding-left: 0;
|
687 |
+
height: 110px;
|
688 |
+
border: none;
|
689 |
+
background-color: transparent;
|
690 |
+
box-shadow: none;
|
691 |
+
}
|
692 |
+
|
693 |
+
.woodmart-search-full-screen .aws-container .aws-search-field {
|
694 |
+
color: #333;
|
695 |
+
text-align: center;
|
696 |
+
font-weight: 600;
|
697 |
+
font-size: 48px;
|
698 |
+
}
|
699 |
+
|
700 |
+
.woodmart-search-full-screen .aws-container .aws-search-form .aws-form-btn,
|
701 |
+
.woodmart-search-full-screen .aws-container .aws-search-form.aws-show-clear.aws-form-active .aws-search-clear {
|
702 |
+
display: none !important;
|
703 |
+
}
|
704 |
+
|
705 |
+
</style>
|
706 |
+
|
707 |
+
<?php }
|
708 |
+
|
709 |
/*
|
710 |
* Elementor popup search form init
|
711 |
*/
|
929 |
$selectors[] = '.responsive-searchform';
|
930 |
}
|
931 |
|
932 |
+
if ( 'Woodmart' === $this->current_theme ) {
|
933 |
+
$selectors[] = '.woodmart-search-form form, form.woodmart-ajax-search';
|
934 |
+
}
|
935 |
+
|
936 |
return $selectors;
|
937 |
|
938 |
}
|
includes/class-aws-tax-search.php
CHANGED
@@ -68,7 +68,7 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
|
|
68 |
|
69 |
$filtered_terms_full = $wpdb->prepare( '( name LIKE %s )', '%' . $wpdb->esc_like( $this->search_string_unfiltered ) . '%' );
|
70 |
|
71 |
-
$search_array = array_map( array(
|
72 |
$search_array = $this->synonyms( $search_array );
|
73 |
$search_array = $this->get_search_array( $search_array );
|
74 |
|
@@ -374,24 +374,6 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
|
|
374 |
return $wpdb->prepare('%s', $name);
|
375 |
}
|
376 |
|
377 |
-
/*
|
378 |
-
* Singularize terms
|
379 |
-
* @param string $search_term Search term
|
380 |
-
* @return string Singularized search term
|
381 |
-
*/
|
382 |
-
private function singularize( $search_term ) {
|
383 |
-
|
384 |
-
$search_term_len = strlen( $search_term );
|
385 |
-
$search_term_norm = AWS_Plurals::singularize( $search_term );
|
386 |
-
|
387 |
-
if ( $search_term_norm && $search_term_len > 3 && strlen( $search_term_norm ) > 2 ) {
|
388 |
-
$search_term = $search_term_norm;
|
389 |
-
}
|
390 |
-
|
391 |
-
return $search_term;
|
392 |
-
|
393 |
-
}
|
394 |
-
|
395 |
/*
|
396 |
* Add synonyms
|
397 |
* @param array $search_terms Search term
|
@@ -407,7 +389,7 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
|
|
407 |
$new_search_terms[$search_term] = 1;
|
408 |
}
|
409 |
|
410 |
-
$new_search_terms = AWS_Helpers::get_synonyms( $new_search_terms );
|
411 |
|
412 |
return array_keys( $new_search_terms );
|
413 |
|
68 |
|
69 |
$filtered_terms_full = $wpdb->prepare( '( name LIKE %s )', '%' . $wpdb->esc_like( $this->search_string_unfiltered ) . '%' );
|
70 |
|
71 |
+
$search_array = array_map( array( 'AWS_Helpers', 'singularize' ), $this->search_terms );
|
72 |
$search_array = $this->synonyms( $search_array );
|
73 |
$search_array = $this->get_search_array( $search_array );
|
74 |
|
374 |
return $wpdb->prepare('%s', $name);
|
375 |
}
|
376 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
/*
|
378 |
* Add synonyms
|
379 |
* @param array $search_terms Search term
|
389 |
$new_search_terms[$search_term] = 1;
|
390 |
}
|
391 |
|
392 |
+
$new_search_terms = AWS_Helpers::get_synonyms( $new_search_terms, true );
|
393 |
|
394 |
return array_keys( $new_search_terms );
|
395 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Mihail Barinov
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GSE37FC4Y7CEY
|
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 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -111,6 +111,11 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
|
|
|
|
114 |
= 2.06 =
|
115 |
* Fix - Search results layout positions
|
116 |
* Fix - Search results page query
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GSE37FC4Y7CEY
|
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.5
|
7 |
+
Stable tag: 2.07
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 2.07 =
|
115 |
+
* Add - Seamless integration for Woodmart theme
|
116 |
+
* Update - Admin ajax requests
|
117 |
+
* Fix - Synonyms search for taxonomies archives
|
118 |
+
|
119 |
= 2.06 =
|
120 |
* Fix - Search results layout positions
|
121 |
* Fix - Search results page query
|