Advanced Woo Search - Version 2.67

Version Description

( 2022-11-14 ) = * Update - Tested with WC 7.1 * Update - Flatsome theme support * Fix - Search results page filtering by product attributes * Dev - Add aws_sync_index_table filter

Download this release

Release Info

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

Code changes from version 2.66 to 2.67

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.66
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: 7.0.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.66' );
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.67
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: 7.1.0
12
  */
13
 
14
 
96
  */
97
  private function define_constants() {
98
 
99
+ $this->define( 'AWS_VERSION', '2.67' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
includes/class-aws-integrations.php CHANGED
@@ -233,11 +233,6 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
233
  add_filter( 'aws_posts_per_page', array( $this, 'wc_product_table_posts_per_page' ) );
234
  }
235
 
236
- // Flatsome theme remove search page blocl
237
- if ( isset( $_GET['type_aws'] ) && function_exists( 'flatsome_pages_in_search_results' ) ) {
238
- remove_action('woocommerce_after_main_content','flatsome_pages_in_search_results', 10);
239
- }
240
-
241
  // WP all import finish
242
  //add_action( 'pmxi_after_xml_import', array( $this, 'pmxi_after_xml_import' ) );
243
 
@@ -397,6 +392,11 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
397
  include_once( AWS_DIR . '/includes/modules/class-aws-avada.php' );
398
  }
399
 
 
 
 
 
 
400
  }
401
 
402
  /*
233
  add_filter( 'aws_posts_per_page', array( $this, 'wc_product_table_posts_per_page' ) );
234
  }
235
 
 
 
 
 
 
236
  // WP all import finish
237
  //add_action( 'pmxi_after_xml_import', array( $this, 'pmxi_after_xml_import' ) );
238
 
392
  include_once( AWS_DIR . '/includes/modules/class-aws-avada.php' );
393
  }
394
 
395
+ // Flatsome theme
396
+ if ( 'Flatsome' === $this->current_theme ) {
397
+ include_once( AWS_DIR . '/includes/modules/class-aws-flatsome.php' );
398
+ }
399
+
400
  }
401
 
402
  /*
includes/class-aws-order.php CHANGED
@@ -225,7 +225,7 @@ if ( ! class_exists( 'AWS_Order' ) ) :
225
 
226
  if ( ! is_wp_error( $product_terms ) && ! empty( $product_terms ) ) {
227
  foreach ( $product_terms as $product_term ) {
228
- $product_terms_array[] = $product_term->slug;
229
  }
230
  }
231
 
225
 
226
  if ( ! is_wp_error( $product_terms ) && ! empty( $product_terms ) ) {
227
  foreach ( $product_terms as $product_term ) {
228
+ $product_terms_array[] = ! empty( $attr_filter[$attr_name]['terms'] ) && preg_match( '/[a-z]/', $attr_filter[$attr_name]['terms'][0] ) ? $product_term->slug : $product_term->term_id;
229
  }
230
  }
231
 
includes/class-aws-table.php CHANGED
@@ -599,13 +599,21 @@ if ( ! class_exists( 'AWS_Table' ) ) :
599
 
600
  global $wpdb;
601
 
602
- $sunc = AWS()->get_settings( 'autoupdates' );
 
 
 
 
 
 
 
 
603
 
604
  if ( AWS_Helpers::is_table_not_exist() ) {
605
  $this->create_table();
606
  }
607
 
608
- if ( $sunc === 'false' ) {
609
  return;
610
  }
611
 
599
 
600
  global $wpdb;
601
 
602
+ $sync = AWS()->get_settings( 'autoupdates' );
603
+
604
+ /**
605
+ * Enable or not automatical product data sync with index table
606
+ * @since 2.67
607
+ * @param boolean $sync
608
+ * @param integer $product_id
609
+ */
610
+ $sync = apply_filters( 'aws_sync_index_table', $sync, $product_id );
611
 
612
  if ( AWS_Helpers::is_table_not_exist() ) {
613
  $this->create_table();
614
  }
615
 
616
+ if ( $sync === 'false' ) {
617
  return;
618
  }
619
 
includes/modules/class-aws-flatsome.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Flatsome Theme and Flatsome UX Builder support
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
+ }
9
+
10
+ if ( ! class_exists( 'AWS_Flatsome' ) ) :
11
+
12
+ /**
13
+ * Class
14
+ */
15
+ class AWS_Flatsome {
16
+
17
+ /**
18
+ * Main AWS_Flatsome Instance
19
+ *
20
+ * Ensures only one instance of AWS_Flatsome is loaded or can be loaded.
21
+ *
22
+ * @static
23
+ * @return AWS_Flatsome - Main instance
24
+ */
25
+ protected static $_instance = null;
26
+
27
+ /**
28
+ * Main AWS_Flatsome Instance
29
+ *
30
+ * Ensures only one instance of AWS_Flatsome is loaded or can be loaded.
31
+ *
32
+ * @static
33
+ * @return AWS_Flatsome - Main instance
34
+ */
35
+ public static function instance() {
36
+ if ( is_null( self::$_instance ) ) {
37
+ self::$_instance = new self();
38
+ }
39
+ return self::$_instance;
40
+ }
41
+
42
+ /**
43
+ * Constructor
44
+ */
45
+ public function __construct() {
46
+
47
+ // Remove search page block
48
+ if ( isset( $_GET['type_aws'] ) && function_exists( 'flatsome_pages_in_search_results' ) ) {
49
+ remove_action('woocommerce_after_main_content','flatsome_pages_in_search_results', 10);
50
+ }
51
+
52
+ add_action( 'wp_loaded', array( $this, 'add_ux_builder_shortcodes' ) );
53
+
54
+ }
55
+
56
+ /*
57
+ * Add shortcodes to UX Builder
58
+ */
59
+ public function add_ux_builder_shortcodes() {
60
+
61
+ if ( function_exists('add_ux_builder_shortcode' ) && function_exists('flatsome_ux_builder_thumbnail' ) ) {
62
+
63
+ add_ux_builder_shortcode( 'aws_search_form', array(
64
+ 'name' => __( 'Advanced Woo Search' ),
65
+ 'thumbnail' => flatsome_ux_builder_thumbnail( 'search' ),
66
+ 'wrap' => false,
67
+ 'allow_in' => array( 'text_box' ),
68
+ 'category' => __( 'Shop' ),
69
+ ) );
70
+
71
+ }
72
+
73
+ }
74
+
75
+ }
76
+
77
+ endif;
78
+
79
+ AWS_Flatsome::instance();
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: 6.1
7
- Stable tag: 2.66
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -168,6 +168,12 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
 
171
  = 2.66 ( 2022-10-31 ) =
172
  * Add - Support for XStore theme
173
  * Update - Integration with WooCommerce Product Filter by WooBeWoo plugin
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: 6.1
7
+ Stable tag: 2.67
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
168
 
169
  == Changelog ==
170
 
171
+ = 2.67 ( 2022-11-14 ) =
172
+ * Update - Tested with WC 7.1
173
+ * Update - Flatsome theme support
174
+ * Fix - Search results page filtering by product attributes
175
+ * Dev - Add aws_sync_index_table filter
176
+
177
  = 2.66 ( 2022-10-31 ) =
178
  * Add - Support for XStore theme
179
  * Update - Integration with WooCommerce Product Filter by WooBeWoo plugin