Advanced Woo Search - Version 2.03

Version Description

  • Add - Seamless integration for Elementor plugin search module
  • Add - Widget for Elementor plugin
  • Add - Module for Divi Builder plugin
  • Update - Styles for settings page
Download this release

Release Info

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

Code changes from version 2.02 to 2.03

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.02
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: 4.0.0
12
  */
13
 
14
 
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( 'AWS_VERSION', '2.02' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
@@ -117,6 +117,7 @@ final class AWS_Main {
117
 
118
  // Admin
119
  include_once( 'includes/admin/class-aws-admin.php' );
 
120
  include_once( 'includes/admin/class-aws-admin-fields.php' );
121
  include_once( 'includes/admin/class-aws-admin-options.php' );
122
 
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 2.03
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: 4.2.0
12
  */
13
 
14
 
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '2.03' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
117
 
118
  // Admin
119
  include_once( 'includes/admin/class-aws-admin.php' );
120
+ include_once( 'includes/admin/class-aws-admin-ajax.php' );
121
  include_once( 'includes/admin/class-aws-admin-fields.php' );
122
  include_once( 'includes/admin/class-aws-admin-options.php' );
123
 
assets/css/admin.css CHANGED
@@ -178,4 +178,139 @@ h1.aws-instance-name {
178
  font-weight: 600;
179
  position: relative;
180
  top: -4px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
178
  font-weight: 600;
179
  position: relative;
180
  top: -4px;
181
+ }
182
+
183
+
184
+ /* Table */
185
+ .aws-table {
186
+ margin: 20px 0 10px;
187
+ }
188
+
189
+ .aws-table tr:nth-child(odd) td {
190
+ background: #f9f9f9;
191
+ }
192
+
193
+ .aws-table .aws-name {
194
+ font-weight: 700;
195
+ }
196
+
197
+ .aws-table .aws-current-filter {
198
+ color: #b00000;
199
+ margin-left: 8px;
200
+ font-size: 12px;
201
+ }
202
+
203
+ .aws-table th {
204
+ padding: 9px 7px!important;
205
+ vertical-align: middle;
206
+ }
207
+
208
+ .aws-table td {
209
+ vertical-align: middle;
210
+ padding: 7px;
211
+ line-height: 2em;
212
+ }
213
+
214
+ .aws-table .aws-actions a {
215
+ display: block;
216
+ text-indent: -9999px;
217
+ position: relative;
218
+ padding: 0!important;
219
+ height: 2em!important;
220
+ min-height: 2em!important;
221
+ width: 2em;
222
+ margin-left: 10px;
223
+ }
224
+
225
+ .aws-table .aws-actions a:after {
226
+ speak: none;
227
+ font-weight: 400;
228
+ font-variant: normal;
229
+ text-transform: none;
230
+ -webkit-font-smoothing: antialiased;
231
+ margin: 0;
232
+ text-indent: 0;
233
+ position: absolute;
234
+ top: 0;
235
+ left: 0;
236
+ width: 100%;
237
+ height: 100%;
238
+ text-align: center;
239
+ font-family: Dashicons;
240
+ line-height: 1.85;
241
+ }
242
+
243
+ .aws-table .aws-actions a.edit:after {
244
+ content: "";
245
+ }
246
+
247
+ .aws-table .aws-actions a.delete:after {
248
+ content: "";
249
+ }
250
+
251
+ .aws-table .aws-actions a.delete:hover:after {
252
+ background: rgba(255, 0, 0, 0.2);
253
+ }
254
+
255
+ .aws-table .aws-actions a.copy:after {
256
+ content: "";
257
+ }
258
+
259
+ .aws-insert-instance {
260
+ margin: 20px 0;
261
+
262
+ }
263
+
264
+ .aws-table.aws-table-sources {
265
+ margin: 10px 0 10px;
266
+ width: 500px;
267
+ }
268
+
269
+ .aws-table.aws-table-sources th.aws-active {
270
+ width: 30px;
271
+ }
272
+
273
+ .aws-table.aws-table-sources td.aws-active .aws-yes,
274
+ .aws-table.aws-table-sources td.aws-active .aws-no{
275
+ background-color: #26CC06;
276
+ padding: 1px 7px;
277
+ color: #fff;
278
+ border-radius: 4px;
279
+ position: relative;
280
+ cursor: pointer;
281
+ }
282
+
283
+ .aws-table.aws-table-sources td.aws-active .aws-no {
284
+ background-color: #CC0606;
285
+ }
286
+
287
+ .aws-table.aws-table-sources td.aws-active .aws-yes,
288
+ .aws-table.aws-table-sources td.aws-active.active .aws-no {
289
+ display: none;
290
+ }
291
+
292
+ .aws-table.aws-table-sources td.aws-active.active .aws-yes {
293
+ display: inline;
294
+ }
295
+
296
+ .aws-table.aws-table-sources td.aws-active:after {
297
+ content: "";
298
+ display: none;
299
+ margin: 0 auto;
300
+ width: 20px;
301
+ height: 20px;
302
+ background: url('../img/loader-2.gif') no-repeat 50% 50%;
303
+ }
304
+
305
+ .aws-table.aws-table-sources td.aws-active.loading .aws-yes,
306
+ .aws-table.aws-table-sources td.aws-active.loading .aws-no {
307
+ display: none;
308
+ }
309
+
310
+ .aws-table.aws-table-sources td.aws-active.loading:after {
311
+ display: block;
312
+ }
313
+
314
+ .aws-table.aws-table-sources td.aws-name {
315
+ font-weight: 400;
316
  }
assets/img/loader-2.gif ADDED
Binary file
assets/js/admin.js CHANGED
@@ -130,4 +130,47 @@ jQuery(document).ready(function ($) {
130
  });
131
 
132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  });
130
  });
131
 
132
 
133
+ // Change option state
134
+
135
+ var changingState = false;
136
+
137
+ $('[data-change-state]').on( 'click', function(e) {
138
+
139
+ e.preventDefault();
140
+
141
+ if ( changingState ) {
142
+ return;
143
+ } else {
144
+ changingState = true;
145
+ }
146
+
147
+ var self = $(this);
148
+ var $parent = self.closest('td');
149
+ var setting = self.data('setting');
150
+ var option = self.data('name');
151
+ var state = self.data('change-state');
152
+
153
+ $parent.addClass('loading');
154
+
155
+ $.ajax({
156
+ type: 'POST',
157
+ url: aws_vars.ajaxurl,
158
+ data: {
159
+ action: 'aws-changeState',
160
+ setting: setting,
161
+ option: option,
162
+ state: state,
163
+ _ajax_nonce: aws_vars.ajax_nonce
164
+ },
165
+ dataType: "json",
166
+ success: function (data) {
167
+ $parent.removeClass('loading');
168
+ $parent.toggleClass('active');
169
+ changingState = false;
170
+ }
171
+ });
172
+
173
+ });
174
+
175
+
176
  });
includes/admin/class-aws-admin-ajax.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! class_exists( 'AWS_Admin_Ajax' ) ) :
8
+
9
+ /**
10
+ * Class for plugin admin ajax hooks
11
+ */
12
+ class AWS_Admin_Ajax {
13
+
14
+ /*
15
+ * Constructor
16
+ */
17
+ public function __construct() {
18
+
19
+ add_action( 'wp_ajax_aws-changeState', array( &$this, 'change_state' ) );
20
+
21
+ }
22
+
23
+ /*
24
+ * Change option state
25
+ */
26
+ public function change_state() {
27
+
28
+ check_ajax_referer( 'aws_admin_ajax_nonce' );
29
+
30
+ $setting = sanitize_text_field( $_POST['setting'] );
31
+ $option = sanitize_text_field( $_POST['option'] );
32
+ $state = sanitize_text_field( $_POST['state'] );
33
+
34
+ $settings = $this->get_settings();
35
+
36
+ $settings[$setting][$option] = $state ? 0 : 1;
37
+
38
+ update_option( 'aws_settings', $settings );
39
+
40
+ do_action( 'aws_cache_clear' );
41
+
42
+ die;
43
+
44
+ }
45
+
46
+ /*
47
+ * Get plugin settings
48
+ */
49
+ private function get_settings() {
50
+ $plugin_options = get_option( 'aws_settings' );
51
+ return $plugin_options;
52
+ }
53
+
54
+ }
55
+
56
+ endif;
57
+
58
+
59
+ new AWS_Admin_Ajax();
includes/admin/class-aws-admin-fields.php CHANGED
@@ -259,6 +259,65 @@ if ( ! class_exists( 'AWS_Admin_Fields' ) ) :
259
  </tr>
260
  <?php break;
261
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  case 'heading': ?>
263
  <tr valign="top">
264
  <th scope="row"><h3 class="aws-heading"><?php echo esc_html( $value['name'] ); ?></h3></th>
259
  </tr>
260
  <?php break;
261
 
262
+ case 'table': ?>
263
+
264
+ <?php
265
+ $table_head = isset( $value['table_head'] ) && $value['table_head'] ? $value['table_head'] : '';
266
+ ?>
267
+
268
+ <tr valign="top">
269
+
270
+ <th scope="row"><?php echo esc_html( $value['name'] ); ?></th>
271
+
272
+ <td>
273
+
274
+ <span class="description"><?php echo wp_kses_post( $value['desc'] ); ?></span><br><br>
275
+
276
+ <table class="aws-table aws-table-sources widefat" cellspacing="0">
277
+
278
+ <thead>
279
+ <tr>
280
+ <th class="aws-name"><?php echo esc_html( $table_head ); ?></th>
281
+ <th class="aws-actions"></th>
282
+ <th class="aws-active"></th>
283
+ </tr>
284
+ </thead>
285
+
286
+ <tbody>
287
+
288
+ <?php $table_options = isset( $plugin_options[ $value['id'] ] ) ? $plugin_options[ $value['id'] ] : array(); ?>
289
+
290
+ <?php if ( is_array( $table_options ) ) { ?>
291
+
292
+ <?php foreach ( $value['choices'] as $val => $fchoices ) { ?>
293
+
294
+ <?php
295
+ $active_class = isset( $table_options[$val] ) && $table_options[$val] ? 'active' : '';
296
+ $label = is_array( $fchoices ) ? $fchoices['label'] : $fchoices;
297
+ ?>
298
+
299
+ <tr>
300
+ <td class="aws-name"><?php echo esc_html( $label ); ?></td>
301
+ <td class="aws-actions"></td>
302
+ <td class="aws-active <?php echo $active_class; ?>">
303
+ <span data-change-state="1" data-setting="<?php echo esc_attr( $value['id'] ); ?>" data-name="<?php echo esc_attr( $val ); ?>" class="aws-yes" title="<?php echo esc_attr__( 'Disable this source', 'advanced-woo-search' ); ?>"><?php echo esc_html__( 'Yes', 'advanced-woo-search' ); ?></span>
304
+ <span data-change-state="0" data-setting="<?php echo esc_attr( $value['id'] ); ?>" data-name="<?php echo esc_attr( $val ); ?>" class="aws-no" title="<?php echo esc_attr__( 'Enable this source', 'advanced-woo-search' ); ?>"><?php echo esc_html__( 'No', 'advanced-woo-search' ); ?></span>
305
+ </td>
306
+ </tr>
307
+ <?php } ?>
308
+
309
+ <?php } ?>
310
+
311
+ </tbody>
312
+
313
+ </table>
314
+
315
+ </td>
316
+
317
+ </tr>
318
+
319
+ <?php break;
320
+
321
  case 'heading': ?>
322
  <tr valign="top">
323
  <th scope="row"><h3 class="aws-heading"><?php echo esc_html( $value['name'] ); ?></h3></th>
includes/admin/class-aws-admin-options.php CHANGED
@@ -26,7 +26,18 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
26
 
27
  foreach ( $section as $values ) {
28
 
29
- if ( $values['type'] === 'heading' ) {
 
 
 
 
 
 
 
 
 
 
 
30
  continue;
31
  }
32
 
@@ -69,7 +80,7 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
69
 
70
  foreach ( $options[$current_tab] as $values ) {
71
 
72
- if ( $values['type'] === 'heading' ) {
73
  continue;
74
  }
75
 
@@ -206,12 +217,45 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
206
  );
207
 
208
  $options['general'][] = array(
209
- "name" => __( "Search in", "advanced-woo-search" ),
210
- "desc" => __( "Search source: Drag&drop sources to activate or deactivate them.", "advanced-woo-search" ),
211
- "id" => "search_in",
212
- "value" => "title,content,sku,excerpt",
213
- "choices" => array( "title", "content", "sku", "excerpt", "category", "tag", "id" ),
214
- "type" => "sortable"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  );
216
 
217
  $options['general'][] = array(
@@ -474,30 +518,6 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
474
  )
475
  );
476
 
477
- $options['results'][] = array(
478
- "name" => __( "Show categories archive", "advanced-woo-search" ),
479
- "desc" => __( "Include categories archives pages to search result.", "advanced-woo-search" ),
480
- "id" => "show_cats",
481
- "value" => 'false',
482
- "type" => "radio",
483
- 'choices' => array(
484
- 'true' => __( 'On', 'advanced-woo-search' ),
485
- 'false' => __( 'Off', 'advanced-woo-search' ),
486
- )
487
- );
488
-
489
- $options['results'][] = array(
490
- "name" => __( "Show tags archive", "advanced-woo-search" ),
491
- "desc" => __( "Include tags archives pages to search results.", "advanced-woo-search" ),
492
- "id" => "show_tags",
493
- "value" => 'false',
494
- "type" => "radio",
495
- 'choices' => array(
496
- 'true' => __( 'On', 'advanced-woo-search' ),
497
- 'false' => __( 'Off', 'advanced-woo-search' ),
498
- )
499
- );
500
-
501
  $options['results'][] = array(
502
  "name" => __( "Show sale badge", "advanced-woo-search" ),
503
  "desc" => __( "Show sale badge for products in search results.", "advanced-woo-search" ),
26
 
27
  foreach ( $section as $values ) {
28
 
29
+ if ( isset( $values['type'] ) && $values['type'] === 'heading' ) {
30
+ continue;
31
+ }
32
+
33
+ if ( isset( $values['type'] ) && $values['type'] === 'table' && empty( $values['value'] ) ) {
34
+ continue;
35
+ }
36
+
37
+ if ( isset( $values['type'] ) && ( $values['type'] === 'checkbox' || $values['type'] === 'table' ) ) {
38
+ foreach ( $values['choices'] as $key => $val ) {
39
+ $default_settings[ $values['id'] ][$key] = sanitize_text_field( $values['value'][$key] );
40
+ }
41
  continue;
42
  }
43
 
80
 
81
  foreach ( $options[$current_tab] as $values ) {
82
 
83
+ if ( $values['type'] === 'heading' || $values['type'] === 'table' ) {
84
  continue;
85
  }
86
 
217
  );
218
 
219
  $options['general'][] = array(
220
+ "name" => __( "Search in", "advanced-woo-search" ),
221
+ "desc" => __( "Click on status icon to enable or disable search source.", "advanced-woo-search" ),
222
+ "table_head" => __( 'Search Source', 'advanced-woo-search' ),
223
+ "id" => "search_in",
224
+ "value" => array(
225
+ 'title' => 1,
226
+ 'content' => 1,
227
+ 'sku' => 1,
228
+ 'excerpt' => 1,
229
+ 'category' => 0,
230
+ 'tag' => 0,
231
+ 'id' => 0,
232
+ ),
233
+ "choices" => array(
234
+ "title" => __( "Title", "advanced-woo-search" ),
235
+ "content" => __( "Content", "advanced-woo-search" ),
236
+ "sku" => __( "SKU", "advanced-woo-search" ),
237
+ "excerpt" => __( "Short description", "advanced-woo-search" ),
238
+ "category" => __( "Category", "advanced-woo-search" ),
239
+ "tag" => __( "Tag", "advanced-woo-search" ),
240
+ "id" => __( "ID", "advanced-woo-search" ),
241
+ ),
242
+ "type" => "table"
243
+ );
244
+
245
+ $options['general'][] = array(
246
+ "name" => __( "Archive pages", "advanced-woo-search" ),
247
+ "desc" => __( "Search for taxonomies and displayed their archive pages in search results.", "advanced-woo-search" ),
248
+ 'table_head' => __( 'Archive Pages', 'advanced-woo-search' ),
249
+ "id" => "search_archives",
250
+ "value" => array(
251
+ 'archive_category' => 0,
252
+ 'archive_tag' => 0,
253
+ ),
254
+ "choices" => array(
255
+ "archive_category" => __( "Category", "advanced-woo-search" ),
256
+ "archive_tag" => __( "Tag", "advanced-woo-search" ),
257
+ ),
258
+ "type" => "table"
259
  );
260
 
261
  $options['general'][] = array(
518
  )
519
  );
520
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  $options['results'][] = array(
522
  "name" => __( "Show sale badge", "advanced-woo-search" ),
523
  "desc" => __( "Show sale badge for products in search results.", "advanced-woo-search" ),
includes/class-aws-integrations.php CHANGED
@@ -56,6 +56,8 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
56
  }
57
  }
58
 
 
 
59
  //add_action('woocommerce_product_query', array( $this, 'woocommerce_product_query' ) );
60
 
61
  if ( class_exists( 'BM' ) ) {
@@ -126,6 +128,7 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
126
  // Elementor pro
127
  if ( defined( 'ELEMENTOR_PRO_VERSION' ) ) {
128
  add_action( 'wp_footer', array( $this, 'elementor_pro_popup' ) );
 
129
  }
130
 
131
  }
@@ -168,6 +171,23 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
168
 
169
  }
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  /*
172
  * B2B market plugin
173
  */
@@ -664,6 +684,48 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
664
 
665
  <?php }
666
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
667
  /*
668
  * Porto theme seamless integration
669
  */
56
  }
57
  }
58
 
59
+ $this->includes();
60
+
61
  //add_action('woocommerce_product_query', array( $this, 'woocommerce_product_query' ) );
62
 
63
  if ( class_exists( 'BM' ) ) {
128
  // Elementor pro
129
  if ( defined( 'ELEMENTOR_PRO_VERSION' ) ) {
130
  add_action( 'wp_footer', array( $this, 'elementor_pro_popup' ) );
131
+ add_filter( 'elementor/widget/render_content', array( $this, 'elementor_render_content' ), 10, 2 );
132
  }
133
 
134
  }
171
 
172
  }
173
 
174
+ /**
175
+ * Include files
176
+ */
177
+ public function includes() {
178
+
179
+ // Elementor plugin widget
180
+ if ( defined( 'ELEMENTOR_VERSION' ) ) {
181
+ include_once( AWS_DIR . '/includes/modules/elementor-widget/class-elementor-aws-init.php' );
182
+ }
183
+
184
+ // Divi module
185
+ if ( defined( 'ET_BUILDER_PLUGIN_DIR' ) ) {
186
+ include_once( AWS_DIR . '/includes/modules/divi/class-divi-aws-module.php' );
187
+ }
188
+
189
+ }
190
+
191
  /*
192
  * B2B market plugin
193
  */
684
 
685
  <?php }
686
 
687
+ /*
688
+ * Elementor replace search form widget
689
+ */
690
+ public function elementor_render_content( $content, $widget ) {
691
+ if ( method_exists( $widget, 'get_name' ) && $widget->get_name() === 'search-form' ) {
692
+ if ( method_exists( $widget, 'get_settings' ) ) {
693
+ $settings = $widget->get_settings();
694
+ if ( is_array( $settings ) && isset( $settings['skin'] ) && $settings['skin'] === 'full_screen' ) {
695
+ $content = '<style>
696
+ .elementor-search-form--skin-full_screen .elementor-search-form__container {
697
+ overflow: hidden;
698
+ }
699
+ .elementor-search-form--full-screen .aws-container {
700
+ width: 100%;
701
+ }
702
+ .elementor-search-form--full-screen .aws-container .aws-search-form {
703
+ height: auto !important;
704
+ }
705
+ .elementor-search-form--full-screen .aws-container .aws-search-form .aws-search-btn.aws-form-btn {
706
+ display: none;
707
+ }
708
+ .elementor-search-form--full-screen .aws-container .aws-search-field {
709
+ border-bottom: 1px solid #fff !important;
710
+ font-size: 50px !important;
711
+ text-align: center !important;
712
+ line-height: 1.5 !important;
713
+ color: #7a7a7a !important;
714
+ }
715
+ .elementor-search-form--full-screen .aws-container .aws-search-field:focus {
716
+ background-color: transparent !important;
717
+ }
718
+ </style>' . $content;
719
+ $content = str_replace( array( '<form', '</form>' ), array( '<div', '</div>' ), $content );
720
+ $content = preg_replace( '/(<input[\S\s]*?elementor-search-form__input[\S\s]*?\>)/i', aws_get_search_form( false ), $content );
721
+ return $content;
722
+ }
723
+ }
724
+ return aws_get_search_form( false );
725
+ }
726
+ return $content;
727
+ }
728
+
729
  /*
730
  * Porto theme seamless integration
731
  */
includes/class-aws-search.php CHANGED
@@ -121,13 +121,22 @@ if ( ! class_exists( 'AWS_Search' ) ) :
121
  }
122
  }
123
 
124
- $show_cats = AWS()->get_settings( 'show_cats' );
125
- $show_tags = AWS()->get_settings( 'show_tags' );
126
- $results_num = $keyword ? apply_filters( 'aws_page_results', 100 ) : AWS()->get_settings( 'results_num' );
127
- $search_in = AWS()->get_settings( 'search_in' );
128
- $outofstock = AWS()->get_settings( 'outofstock' );
129
-
130
- $search_in_arr = explode( ',', AWS()->get_settings( 'search_in' ) );
 
 
 
 
 
 
 
 
 
131
 
132
  // Search in title if all options is disabled
133
  if ( ! $search_in ) {
121
  }
122
  }
123
 
124
+ $search_archives = AWS()->get_settings( 'search_archives' );
125
+ $show_cats = ( isset( $search_archives['archive_category'] ) && $search_archives['archive_category'] ) ? 'true' : 'false';
126
+ $show_tags = ( isset( $search_archives['archive_tag'] ) && $search_archives['archive_tag'] ) ? 'true' : 'false';
127
+ $results_num = $keyword ? apply_filters( 'aws_page_results', 100 ) : AWS()->get_settings( 'results_num' );
128
+ $search_in = AWS()->get_settings( 'search_in' );
129
+ $outofstock = AWS()->get_settings( 'outofstock' );
130
+
131
+ if ( is_array( $search_in ) ) {
132
+ foreach( $search_in as $search_in_source => $search_in_active ) {
133
+ if ( $search_in_active ) {
134
+ $search_in_arr[] = $search_in_source;
135
+ }
136
+ }
137
+ } else {
138
+ $search_in_arr = explode( ',', $search_in );
139
+ }
140
 
141
  // Search in title if all options is disabled
142
  if ( ! $search_in ) {
includes/class-aws-versions.php CHANGED
@@ -310,6 +310,40 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
310
 
311
  }
312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
  }
314
 
315
  update_option( 'aws_plugin_ver', AWS_VERSION );
310
 
311
  }
312
 
313
+ if ( version_compare( $current_version, '2.03', '<' ) ) {
314
+
315
+ $settings = get_option( 'aws_settings' );
316
+
317
+ if ( $settings ) {
318
+
319
+ if ( isset( $settings['search_in'] ) && is_string( $settings['search_in'] ) ) {
320
+ $current_search_in = explode( ',', $settings['search_in'] );
321
+ $new_search_in = array();
322
+ $options_array = AWS_Admin_Options::include_options();
323
+ foreach( $options_array['general'] as $def_option ) {
324
+ if ( isset( $def_option['id'] ) && $def_option['id'] === 'search_in' && isset( $def_option['choices'] ) ) {
325
+ foreach( $def_option['choices'] as $choice_key => $choice_label ) {
326
+ $new_search_in[$choice_key] = in_array( $choice_key, $current_search_in ) ? 1 : 0;
327
+ }
328
+ $settings['search_in'] = $new_search_in;
329
+ break;
330
+ }
331
+ }
332
+ update_option( 'aws_settings', $settings );
333
+ }
334
+
335
+ if ( ! isset( $settings['search_archives'] ) ) {
336
+ $new_search_archives = array();
337
+ $new_search_archives['archive_category'] = ( isset( $settings['show_cats'] ) && $settings['show_cats'] === 'true' ) ? 1 : 0;
338
+ $new_search_archives['archive_tag'] = ( isset( $settings['show_tags'] ) && $settings['show_tags'] === 'true' ) ? 1 : 0;
339
+ $settings['search_archives'] = $new_search_archives;
340
+ update_option( 'aws_settings', $settings );
341
+ }
342
+
343
+ }
344
+
345
+ }
346
+
347
  }
348
 
349
  update_option( 'aws_plugin_ver', AWS_VERSION );
includes/modules/divi/class-divi-aws-module.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('et_builder_ready', 'aws_divi_register_modules');
4
+ function aws_divi_register_modules() {
5
+
6
+ if ( class_exists( 'ET_Builder_Module' ) ):
7
+
8
+ class Divi_AWS_Module extends ET_Builder_Module {
9
+
10
+ public $slug = 'aws';
11
+ public $vb_support = 'partial';
12
+
13
+ public function init() {
14
+ $this->name = esc_html__( 'Advanced Woo Search', 'advanced-woo-search' );
15
+ }
16
+
17
+ public function get_fields() {
18
+
19
+ wp_enqueue_style(
20
+ 'aws-divi',
21
+ AWS_URL . '/includes/modules/divi/divi.css', array(), AWS_VERSION
22
+ );
23
+
24
+ return array(
25
+ 'placeholder' => array(
26
+ 'label' => esc_html__( 'Placeholder', 'advanced-woo-search' ),
27
+ 'type' => 'text',
28
+ 'option_category' => 'basic_option',
29
+ 'description' => esc_html__( 'Add placeholder text or leave empty to use default.', 'advanced-woo-search' ),
30
+ 'toggle_slug' => 'main_content',
31
+ ),
32
+ );
33
+ }
34
+
35
+ public function render( $unprocessed_props, $content = null, $render_slug ) {
36
+ if ( function_exists( 'aws_get_search_form' ) ) {
37
+ $search_form = aws_get_search_form( false );
38
+ if ( $this->props['placeholder'] ) {
39
+ $search_form = preg_replace( '/placeholder="([\S\s]*?)"/i', 'placeholder="' . $this->props['placeholder'] . '"', $search_form );
40
+ }
41
+ return $search_form;
42
+ }
43
+ return '';
44
+ }
45
+
46
+ }
47
+
48
+ new Divi_AWS_Module;
49
+
50
+ endif;
51
+
52
+ }
includes/modules/divi/divi.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .et-db #et-boc .et-l .et-fb-modules-list .aws:before {
2
+ content: "}";
3
+ color: #b76d9e;
4
+ }
includes/modules/elementor-widget/class-elementor-aws-init.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * AWS plugin elementor widgets init
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
+ }
9
+
10
+ if ( ! class_exists( 'AWS_Elementor_Init' ) ) :
11
+
12
+ /**
13
+ * Class for main plugin functions
14
+ */
15
+ class AWS_Elementor_Init {
16
+
17
+ /**
18
+ * @var AWS_Elementor_Init The single instance of the class
19
+ */
20
+ protected static $_instance = null;
21
+
22
+ /**
23
+ * Main AWS_Elementor_Init Instance
24
+ *
25
+ * Ensures only one instance of AWS_Elementor_Init is loaded or can be loaded.
26
+ *
27
+ * @static
28
+ * @return AWS_Elementor_Init - Main instance
29
+ */
30
+ public static function instance() {
31
+ if ( is_null( self::$_instance ) ) {
32
+ self::$_instance = new self();
33
+ }
34
+ return self::$_instance;
35
+ }
36
+
37
+ /**
38
+ * Constructor
39
+ */
40
+ public function __construct() {
41
+ add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_elementor_widgets' ) );
42
+ add_action( 'elementor/editor/after_enqueue_styles', array( $this, 'filter_editor_styles' ) );
43
+ add_action( 'elementor/preview/enqueue_styles', array( $this, 'filter_editor_styles' ) );
44
+ }
45
+
46
+ /**
47
+ * Register elementor widget
48
+ */
49
+ public function register_elementor_widgets() {
50
+ include_once( 'class-elementor-aws-widget.php' );
51
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new \Elementor_AWS_Widget() );
52
+ }
53
+
54
+ /**
55
+ * Enqueue editor filter styles
56
+ */
57
+ public function filter_editor_styles() {
58
+
59
+ wp_enqueue_style(
60
+ 'aws-icons',
61
+ AWS_URL . '/includes/modules/elementor-widget/elementor.css', array(), AWS_VERSION
62
+ );
63
+
64
+ }
65
+
66
+ }
67
+
68
+ endif;
69
+
70
+ AWS_Elementor_Init::instance();
includes/modules/elementor-widget/class-elementor-aws-widget.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Elementor AWS Widget.
5
+ *
6
+ * Elementor widget to add AWS search form
7
+ *
8
+ * @since 1.0.0
9
+ */
10
+ class Elementor_AWS_Widget extends \Elementor\Widget_Base {
11
+
12
+ /**
13
+ * Get widget name.
14
+ *
15
+ * @since 1.0.0
16
+ * @access public
17
+ *
18
+ * @return string Widget name.
19
+ */
20
+ public function get_name() {
21
+ return 'aws';
22
+ }
23
+
24
+ /**
25
+ * Get widget title.
26
+ *
27
+ * @since 1.0.0
28
+ * @access public
29
+ *
30
+ * @return string Widget title.
31
+ */
32
+ public function get_title() {
33
+ return __( 'Advanced Woo Search', 'advanced-woo-search' );
34
+ }
35
+
36
+ /**
37
+ * Get widget icon.
38
+ *
39
+ * @since 1.0.0
40
+ * @access public
41
+ *
42
+ * @return string Widget icon.
43
+ */
44
+ public function get_icon() {
45
+ return 'aws-elementor-icon';
46
+ }
47
+
48
+ /**
49
+ * Get widget categories.
50
+ *
51
+ * @since 1.0.0
52
+ * @access public
53
+ *
54
+ * @return array Widget categories.
55
+ */
56
+ public function get_categories() {
57
+ return array( 'general', 'woocommerce-elements' );
58
+ }
59
+
60
+ /**
61
+ * Register widget controls.
62
+ *
63
+ * @since 1.0.0
64
+ * @access protected
65
+ */
66
+ protected function _register_controls() {
67
+
68
+ $this->start_controls_section(
69
+ 'content_section',
70
+ array(
71
+ 'label' => __( 'Content', 'advanced-woo-search' ),
72
+ 'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
73
+ )
74
+ );
75
+
76
+ $this->add_control(
77
+ 'placeholder',
78
+ array(
79
+ 'label' => __( 'Placeholder', 'advanced-woo-search' ),
80
+ 'type' => \Elementor\Controls_Manager::TEXT,
81
+ 'input_type' => 'text',
82
+ 'placeholder' => '',
83
+ )
84
+ );
85
+
86
+ $this->end_controls_section();
87
+
88
+ }
89
+
90
+ /**
91
+ * Render widget output on the frontend.
92
+ *
93
+ * @since 1.0.0
94
+ * @access protected
95
+ */
96
+ protected function render() {
97
+
98
+ $settings = $this->get_settings_for_display();
99
+
100
+ if ( function_exists( 'aws_get_search_form' ) ) {
101
+ $search_form = aws_get_search_form( false );
102
+ if ( $settings['placeholder'] ) {
103
+ $search_form = preg_replace( '/placeholder="([\S\s]*?)"/i', 'placeholder="' . $settings['placeholder'] . '"', $search_form );
104
+ }
105
+ echo $search_form;
106
+ }
107
+
108
+ }
109
+
110
+ }
includes/modules/elementor-widget/elementor.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ .aws-elementor-icon:before {
3
+ content: '';
4
+ display: block;
5
+ width: 1em;
6
+ height: 1em;
7
+ margin: 0 auto;
8
+ background-position: center;
9
+ background-repeat: no-repeat;
10
+ background-size: contain;
11
+ background-image: url("data:image/svg+xml,%3Csvg height='40px' viewBox='0 0 64 64' width='40px' xmlns='http://www.w3.org/2000/svg' style=' fill: %23b76d9e; stroke: %23b76d9e;%0A'%3E%3Cdefs id='defs3848'%3E%3C/defs%3E%3Cg id='layer1'%3E%3Cg id='g5183' transform='translate(25.5,-27)'%3E%3Ccircle class='fil0 str1' cx='0.73810571' cy='53.392174' id='circle15' r='20.063322' style='clip-rule:evenodd;fill:none;fill-rule:evenodd;stroke-width:3;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision'%3E%3C/circle%3E%3Cline class='fil0 str2' id='line25' style='clip-rule:evenodd;fill:none;fill-rule:evenodd;stroke-width:3.99974346;stroke-linecap:round;stroke-linejoin:round;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision' x1='15.617603' x2='30.305107' y1='68.559662' y2='83.151169'%3E%3C/line%3E%3Cpath class='fil0 str0' d='m -12.701441,53.392174 c 0,-7.391751 6.047795,-13.439547 13.43954602,-13.439547' id='path281' style='clip-rule:evenodd;fill:none;fill-rule:evenodd;stroke-width:2.00005412;stroke-linecap:round;stroke-linejoin:round;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); /*background-image: url("data:image/svg+xml,%3Csvg height='40px' viewBox='0 0 64 64' width='40px' xmlns='http://www.w3.org/2000/svg' style=' stroke: %234498c6;%0A'%3E%3Cdefs id='defs3848'%3E%3C/defs%3E%3Cg id='layer1'%3E%3Cg id='g5183' transform='translate(25.5,-27)'%3E%3Ccircle class='fil0 str1' cx='0.73810571' cy='53.392174' id='circle15' r='20.063322' style='clip-rule:evenodd;fill:none;fill-rule:evenodd;stroke-width:2.00005412;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision'%3E%3C/circle%3E%3Cline class='fil0 str2' id='line25' style='clip-rule:evenodd;fill:none;fill-rule:evenodd;stroke-width:3.99974346;stroke-linecap:round;stroke-linejoin:round;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision' x1='15.617603' x2='30.305107' y1='68.559662' y2='83.151169'%3E%3C/line%3E%3Cpath class='fil0 str0' d='m -12.701441,53.392174 c 0,-7.391751 6.047795,-13.439547 13.43954602,-13.439547' id='path281' style='clip-rule:evenodd;fill:none;fill-rule:evenodd;stroke-width:2.00005412;stroke-linecap:round;stroke-linejoin:round;image-rendering:optimizeQuality;shape-rendering:geometricPrecision;text-rendering:geometricPrecision'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E");*/
12
+ }
languages/advanced-woo-search.pot CHANGED
@@ -341,22 +341,6 @@ msgstr ""
341
  msgid "What to show in product description?"
342
  msgstr ""
343
 
344
- #: includes/options.php:117
345
- msgid "Show categories archive"
346
- msgstr ""
347
-
348
- #: includes/options.php:118
349
- msgid "Include categories archives pages to search result."
350
- msgstr ""
351
-
352
- #: includes/options.php:129
353
- msgid "Show tags archive"
354
- msgstr ""
355
-
356
- #: includes/options.php:130
357
- msgid "Include tags archives pages to search results."
358
- msgstr ""
359
-
360
  #: includes/options.php:141
361
  msgid "Show sale badge"
362
  msgstr ""
@@ -397,10 +381,6 @@ msgstr ""
397
  msgid "Search in"
398
  msgstr ""
399
 
400
- #: includes/options.php:176
401
- msgid "Search source: Drag&drop sources to activate or deactivate them."
402
- msgstr ""
403
-
404
  #: includes/options.php:30
405
  msgid "Show out-of-stock"
406
  msgstr ""
@@ -458,4 +438,43 @@ msgstr ""
458
 
459
  #. Author of the plugin
460
  msgid "ILLID"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
  msgstr ""
341
  msgid "What to show in product description?"
342
  msgstr ""
343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  #: includes/options.php:141
345
  msgid "Show sale badge"
346
  msgstr ""
381
  msgid "Search in"
382
  msgstr ""
383
 
 
 
 
 
384
  #: includes/options.php:30
385
  msgid "Show out-of-stock"
386
  msgstr ""
438
 
439
  #. Author of the plugin
440
  msgid "ILLID"
441
+ msgstr ""
442
+
443
+ msgid "Placeholder"
444
+ msgstr ""
445
+
446
+ msgid "Add placeholder text or leave empty to use default."
447
+ msgstr ""
448
+
449
+ msgid "Disable this source"
450
+ msgstr ""
451
+
452
+ msgid "Enable this source"
453
+ msgstr ""
454
+
455
+ msgid "Yes"
456
+ msgstr ""
457
+
458
+ msgid "No"
459
+ msgstr ""
460
+
461
+ msgid "Click on status icon to enable or disable search source."
462
+ msgstr ""
463
+
464
+ msgid "Search Source"
465
+ msgstr ""
466
+
467
+ msgid "Category"
468
+ msgstr ""
469
+
470
+ msgid "Tag"
471
+ msgstr ""
472
+
473
+ msgid "ID"
474
+ msgstr ""
475
+
476
+ msgid "Archive pages"
477
+ msgstr ""
478
+
479
+ msgid "Search for taxonomies and displayed their archive pages in search results."
480
  msgstr ""
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.4
7
- Stable tag: 2.02
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -104,6 +104,12 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
104
 
105
  == Changelog ==
106
 
 
 
 
 
 
 
107
  = 2.02 =
108
  * Add - German language translation
109
  * Update - Show re-index table notice only for relevant users
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.4
7
+ Stable tag: 2.03
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
104
 
105
  == Changelog ==
106
 
107
+ = 2.03 =
108
+ * Add - Seamless integration for Elementor plugin search module
109
+ * Add - Widget for Elementor plugin
110
+ * Add - Module for Divi Builder plugin
111
+ * Update - Styles for settings page
112
+
113
  = 2.02 =
114
  * Add - German language translation
115
  * Update - Show re-index table notice only for relevant users