Version Description
- Update - Speed-up index process
- Update - Speed-up search
- Update - Generatepress theme integration
- Update - Ocean WP theme integration
- Update - Get shortcodes content during the index
- Add - awsShowingResults js event
- Fix - Search page bug with multiple searches per load
Download this release
Release Info
Developer | Mihail Barinov |
Plugin | Advanced Woo Search |
Version | 1.86 |
Comparing to | |
See all releases |
Code changes from version 1.85 to 1.86
- advanced-woo-search.php +2 -2
- assets/js/common.js +18 -9
- includes/class-aws-integrations.php +80 -0
- includes/class-aws-search-page.php +7 -1
- includes/class-aws-search.php +28 -3
- includes/class-aws-table.php +51 -28
- readme.txt +10 -1
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.
|
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', '1.
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
3 |
/*
|
4 |
Plugin Name: Advanced Woo Search
|
5 |
Description: Advance ajax WooCommerce product search.
|
6 |
+
Version: 1.86
|
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', '1.86' );
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
assets/js/common.js
CHANGED
@@ -218,6 +218,10 @@
|
|
218 |
|
219 |
methods.showResultsBlock();
|
220 |
|
|
|
|
|
|
|
|
|
221 |
},
|
222 |
|
223 |
showResultsBlock: function() {
|
@@ -321,24 +325,29 @@
|
|
321 |
var check = false;
|
322 |
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
323 |
return check;
|
324 |
-
}
|
325 |
|
326 |
};
|
327 |
|
328 |
|
329 |
-
var self
|
330 |
-
$searchForm
|
331 |
-
$searchField
|
332 |
-
$searchButton
|
333 |
-
haveResults
|
334 |
-
|
335 |
-
|
|
|
336 |
keyupTimeout,
|
337 |
cachedResponse = new Array();
|
338 |
|
339 |
-
|
340 |
var ajaxUrl = ( self.data('url') !== undefined ) ? self.data('url') : false;
|
341 |
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
if ( options === 'relayout' ) {
|
344 |
var d = self.data(pluginPfx);
|
218 |
|
219 |
methods.showResultsBlock();
|
220 |
|
221 |
+
if ( eShowResults ) {
|
222 |
+
self[0].dispatchEvent( eShowResults );
|
223 |
+
}
|
224 |
+
|
225 |
},
|
226 |
|
227 |
showResultsBlock: function() {
|
325 |
var check = false;
|
326 |
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
327 |
return check;
|
328 |
+
},
|
329 |
|
330 |
};
|
331 |
|
332 |
|
333 |
+
var self = $(this),
|
334 |
+
$searchForm = self.find('.aws-search-form'),
|
335 |
+
$searchField = self.find('.aws-search-field'),
|
336 |
+
$searchButton = self.find('.aws-search-btn'),
|
337 |
+
haveResults = false,
|
338 |
+
eShowResults = false,
|
339 |
+
requests = Array(),
|
340 |
+
searchFor = '',
|
341 |
keyupTimeout,
|
342 |
cachedResponse = new Array();
|
343 |
|
|
|
344 |
var ajaxUrl = ( self.data('url') !== undefined ) ? self.data('url') : false;
|
345 |
|
346 |
+
if ( document.createEvent ){
|
347 |
+
eShowResults = document.createEvent("Event");
|
348 |
+
eShowResults.initEvent('awsShowingResults', true, true);
|
349 |
+
eShowResults.eventName = 'awsShowingResults';
|
350 |
+
}
|
351 |
|
352 |
if ( options === 'relayout' ) {
|
353 |
var d = self.data(pluginPfx);
|
includes/class-aws-integrations.php
CHANGED
@@ -90,6 +90,11 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
90 |
add_filter( 'et_pb_fullwidth_menu_shortcode_output', array( $this, 'divi_builder_search_module' ) );
|
91 |
add_action( 'wp_head', array( $this, 'head_js_integration' ) );
|
92 |
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
// Wholesale plugin hide certain products
|
@@ -365,6 +370,64 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
365 |
|
366 |
<?php }
|
367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
/*
|
369 |
* Porto theme seamless integration
|
370 |
*/
|
@@ -466,6 +529,16 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
466 |
public function generate_navigation_search_output( $html ) {
|
467 |
if ( function_exists( 'aws_get_search_form' ) ) {
|
468 |
$html = '<style>.navigation-search .aws-container .aws-search-form{height: 60px;} .navigation-search .aws-container{margin-right: 60px;} .navigation-search .aws-container .search-field{border:none;} </style>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
$html .= '<div class="navigation-search">' . aws_get_search_form( false ) . '</div>';
|
470 |
$html = str_replace( 'aws-search-field', 'aws-search-field search-field', $html );
|
471 |
}
|
@@ -502,6 +575,12 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
502 |
$selectors[] = '.site-search .woocommerce-product-search';
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
return $selectors;
|
506 |
|
507 |
}
|
@@ -527,6 +606,7 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
|
|
527 |
?>
|
528 |
|
529 |
<script>
|
|
|
530 |
window.addEventListener('load', function() {
|
531 |
var forms = document.querySelectorAll("<?php echo $forms_selector; ?>");
|
532 |
|
90 |
add_filter( 'et_pb_fullwidth_menu_shortcode_output', array( $this, 'divi_builder_search_module' ) );
|
91 |
add_action( 'wp_head', array( $this, 'head_js_integration' ) );
|
92 |
|
93 |
+
// Ocean wp theme
|
94 |
+
if ( class_exists( 'OCEANWP_Theme_Class' ) ) {
|
95 |
+
add_action( 'wp_head', array( $this, 'oceanwp_head_action' ) );
|
96 |
+
}
|
97 |
+
|
98 |
}
|
99 |
|
100 |
// Wholesale plugin hide certain products
|
370 |
|
371 |
<?php }
|
372 |
|
373 |
+
/*
|
374 |
+
* Ocean wp theme
|
375 |
+
*/
|
376 |
+
public function oceanwp_head_action() { ?>
|
377 |
+
|
378 |
+
<style>
|
379 |
+
.oceanwp-theme #searchform-header-replace .aws-container {
|
380 |
+
padding-right: 45px;
|
381 |
+
padding-top: 15px;
|
382 |
+
}
|
383 |
+
.oceanwp-theme #searchform-overlay .aws-container {
|
384 |
+
position: absolute;
|
385 |
+
top: 50%;
|
386 |
+
left: 0;
|
387 |
+
margin-top: -33px;
|
388 |
+
width: 100%;
|
389 |
+
text-align: center;
|
390 |
+
}
|
391 |
+
.oceanwp-theme #searchform-overlay .aws-container form {
|
392 |
+
position: static;
|
393 |
+
}
|
394 |
+
|
395 |
+
.oceanwp-theme #searchform-overlay a.search-overlay-close {
|
396 |
+
top: -100px;
|
397 |
+
}
|
398 |
+
|
399 |
+
</style>
|
400 |
+
|
401 |
+
<script>
|
402 |
+
|
403 |
+
window.addEventListener('load', function() {
|
404 |
+
|
405 |
+
window.setTimeout(function(){
|
406 |
+
var formOverlay = document.querySelector("#searchform-overlay form");
|
407 |
+
if ( formOverlay ) {
|
408 |
+
formOverlay.innerHTML += '<a href="#" class="search-overlay-close"><span></span></a>';
|
409 |
+
}
|
410 |
+
}, 300);
|
411 |
+
|
412 |
+
jQuery(document).on( 'click', 'a.search-overlay-close', function (e) {
|
413 |
+
|
414 |
+
jQuery( '#searchform-overlay' ).removeClass( 'active' );
|
415 |
+
jQuery( '#searchform-overlay' ).fadeOut( 200 );
|
416 |
+
|
417 |
+
setTimeout( function() {
|
418 |
+
jQuery( 'html' ).css( 'overflow', 'visible' );
|
419 |
+
}, 400);
|
420 |
+
|
421 |
+
jQuery( '.aws-search-result' ).hide();
|
422 |
+
|
423 |
+
} );
|
424 |
+
|
425 |
+
}, false);
|
426 |
+
|
427 |
+
</script>
|
428 |
+
|
429 |
+
<?php }
|
430 |
+
|
431 |
/*
|
432 |
* Porto theme seamless integration
|
433 |
*/
|
529 |
public function generate_navigation_search_output( $html ) {
|
530 |
if ( function_exists( 'aws_get_search_form' ) ) {
|
531 |
$html = '<style>.navigation-search .aws-container .aws-search-form{height: 60px;} .navigation-search .aws-container{margin-right: 60px;} .navigation-search .aws-container .search-field{border:none;} </style>';
|
532 |
+
$html .= '<script>
|
533 |
+
window.addEventListener("awsShowingResults", function(e) {
|
534 |
+
var links = document.querySelectorAll(".aws_result_link");
|
535 |
+
if ( links ) {
|
536 |
+
for (var i = 0; i < links.length; i++) {
|
537 |
+
links[i].className += " search-item";
|
538 |
+
}
|
539 |
+
}
|
540 |
+
}, false);
|
541 |
+
</script>';
|
542 |
$html .= '<div class="navigation-search">' . aws_get_search_form( false ) . '</div>';
|
543 |
$html = str_replace( 'aws-search-field', 'aws-search-field search-field', $html );
|
544 |
}
|
575 |
$selectors[] = '.site-search .woocommerce-product-search';
|
576 |
}
|
577 |
|
578 |
+
// ocean wp theme
|
579 |
+
if ( class_exists( 'OCEANWP_Theme_Class' ) ) {
|
580 |
+
$selectors[] = '#searchform-header-replace form';
|
581 |
+
$selectors[] = '#searchform-overlay form';
|
582 |
+
}
|
583 |
+
|
584 |
return $selectors;
|
585 |
|
586 |
}
|
606 |
?>
|
607 |
|
608 |
<script>
|
609 |
+
|
610 |
window.addEventListener('load', function() {
|
611 |
var forms = document.querySelectorAll("<?php echo $forms_selector; ?>");
|
612 |
|
includes/class-aws-search-page.php
CHANGED
@@ -289,6 +289,10 @@ if ( ! class_exists( 'AWS_Search_Page' ) ) :
|
|
289 |
*/
|
290 |
private function search( $s, $query ) {
|
291 |
|
|
|
|
|
|
|
|
|
292 |
$posts_array = (array) aws_search( $s );
|
293 |
$posts_per_page = apply_filters( 'aws_posts_per_page', $query->get( 'posts_per_page' ) );
|
294 |
$post_array_products = $posts_array['products'];
|
@@ -309,11 +313,13 @@ if ( ! class_exists( 'AWS_Search_Page' ) ) :
|
|
309 |
|
310 |
$this->data['all_products'] = $post_array_products;
|
311 |
|
312 |
-
|
313 |
'all' => $post_array_products,
|
314 |
'products' => $products
|
315 |
);
|
316 |
|
|
|
|
|
317 |
}
|
318 |
|
319 |
/*
|
289 |
*/
|
290 |
private function search( $s, $query ) {
|
291 |
|
292 |
+
if ( isset( $this->data['search_res'] ) ) {
|
293 |
+
return $this->data['search_res'];
|
294 |
+
}
|
295 |
+
|
296 |
$posts_array = (array) aws_search( $s );
|
297 |
$posts_per_page = apply_filters( 'aws_posts_per_page', $query->get( 'posts_per_page' ) );
|
298 |
$post_array_products = $posts_array['products'];
|
313 |
|
314 |
$this->data['all_products'] = $post_array_products;
|
315 |
|
316 |
+
$this->data['search_res'] = array(
|
317 |
'all' => $post_array_products,
|
318 |
'products' => $products
|
319 |
);
|
320 |
|
321 |
+
return $this->data['search_res'];
|
322 |
+
|
323 |
}
|
324 |
|
325 |
/*
|
includes/class-aws-search.php
CHANGED
@@ -500,14 +500,39 @@ if ( ! class_exists( 'AWS_Search' ) ) :
|
|
500 |
$show_featured = AWS()->get_settings( 'show_featured' );
|
501 |
|
502 |
|
503 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
504 |
|
505 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
|
507 |
-
if( !
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
continue;
|
509 |
}
|
510 |
|
|
|
|
|
511 |
/**
|
512 |
* Filter additional product data
|
513 |
* @since 1.60
|
500 |
$show_featured = AWS()->get_settings( 'show_featured' );
|
501 |
|
502 |
|
503 |
+
if ( function_exists( 'wc_get_products' ) ) {
|
504 |
+
|
505 |
+
$posts_items = wc_get_products( array(
|
506 |
+
'numberposts' => -1,
|
507 |
+
'posts_per_page' => -1,
|
508 |
+
'status' => 'publish',
|
509 |
+
'include' => $posts_ids,
|
510 |
+
'ignore_sticky_posts' => true,
|
511 |
+
'suppress_filters' => true,
|
512 |
+
'no_found_rows' => 1,
|
513 |
+
'lang' => ''
|
514 |
+
));
|
515 |
|
516 |
+
} else {
|
517 |
+
|
518 |
+
$posts_items = $posts_ids;
|
519 |
+
|
520 |
+
}
|
521 |
+
|
522 |
+
foreach ( $posts_items as $post_item ) {
|
523 |
|
524 |
+
if ( ! is_object( $post_item ) ) {
|
525 |
+
$product = wc_get_product( $post_item );
|
526 |
+
} else {
|
527 |
+
$product = $post_item;
|
528 |
+
}
|
529 |
+
|
530 |
+
if ( ! is_a( $product, 'WC_Product' ) ) {
|
531 |
continue;
|
532 |
}
|
533 |
|
534 |
+
$post_id = method_exists( $product, 'get_id' ) ? $product->get_id() : $post_item;
|
535 |
+
|
536 |
/**
|
537 |
* Filter additional product data
|
538 |
* @since 1.60
|
includes/class-aws-table.php
CHANGED
@@ -106,37 +106,54 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
106 |
}
|
107 |
|
108 |
$index_meta = apply_filters( 'aws_index_meta', $index_meta );
|
109 |
-
$posts_per_page = apply_filters( 'aws_index_posts_per_page',
|
110 |
|
|
|
111 |
|
112 |
-
|
113 |
-
'posts_per_page' => $posts_per_page,
|
114 |
-
'fields' => 'ids',
|
115 |
-
'post_type' => 'product',
|
116 |
-
'post_status' => 'publish',
|
117 |
-
'offset' => $index_meta['offset'],
|
118 |
-
'ignore_sticky_posts' => true,
|
119 |
-
'suppress_filters' => true,
|
120 |
-
'no_found_rows' => 1,
|
121 |
-
'orderby' => 'ID',
|
122 |
-
'order' => 'DESC',
|
123 |
-
'lang' => ''
|
124 |
-
);
|
125 |
|
|
|
126 |
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
-
|
130 |
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
$queued_posts[] = absint( $post_id );
|
137 |
-
}
|
138 |
|
139 |
-
$this->fill_table( $
|
140 |
|
141 |
$index_meta['offset'] = absint( $index_meta['offset'] + $posts_per_page );
|
142 |
|
@@ -308,7 +325,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
308 |
/**
|
309 |
* Products that will be indexed
|
310 |
* @since 1.79
|
311 |
-
* @param array $posts Array of products IDs
|
312 |
*/
|
313 |
$posts = apply_filters( 'aws_index_product_ids', $posts );
|
314 |
|
@@ -319,19 +336,23 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
319 |
*/
|
320 |
$apply_filters = apply_filters( 'aws_index_apply_filters', false );
|
321 |
|
322 |
-
foreach ( $posts as $
|
323 |
|
324 |
$data = array();
|
325 |
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
|
|
330 |
|
331 |
if( ! is_a( $product, 'WC_Product' ) ) {
|
332 |
continue;
|
333 |
}
|
334 |
|
|
|
|
|
|
|
335 |
|
336 |
$lang = '';
|
337 |
|
@@ -364,6 +385,8 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
364 |
|
365 |
if ( $apply_filters ) {
|
366 |
$content = apply_filters( 'the_content', $content, $data['id'] );
|
|
|
|
|
367 |
}
|
368 |
|
369 |
// Get all child products if exists
|
106 |
}
|
107 |
|
108 |
$index_meta = apply_filters( 'aws_index_meta', $index_meta );
|
109 |
+
$posts_per_page = apply_filters( 'aws_index_posts_per_page', 20 );
|
110 |
|
111 |
+
if ( $status !== 'start' ) {
|
112 |
|
113 |
+
$posts = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
+
if ( function_exists( 'wc_get_products' ) ) {
|
116 |
|
117 |
+
$posts = wc_get_products( array(
|
118 |
+
'numberposts' => $posts_per_page,
|
119 |
+
'posts_per_page' => $posts_per_page,
|
120 |
+
'status' => 'publish',
|
121 |
+
'offset' => $index_meta['offset'],
|
122 |
+
'ignore_sticky_posts' => true,
|
123 |
+
'suppress_filters' => true,
|
124 |
+
'no_found_rows' => 1,
|
125 |
+
'orderby' => 'ID',
|
126 |
+
'order' => 'DESC',
|
127 |
+
'lang' => ''
|
128 |
+
));
|
129 |
|
130 |
+
} else {
|
131 |
|
132 |
+
$queued_posts = get_posts( array(
|
133 |
+
'posts_per_page' => $posts_per_page,
|
134 |
+
'fields' => 'ids',
|
135 |
+
'post_type' => 'product',
|
136 |
+
'post_status' => 'publish',
|
137 |
+
'offset' => $index_meta['offset'],
|
138 |
+
'ignore_sticky_posts' => true,
|
139 |
+
'suppress_filters' => true,
|
140 |
+
'no_found_rows' => 1,
|
141 |
+
'orderby' => 'ID',
|
142 |
+
'order' => 'DESC',
|
143 |
+
'lang' => ''
|
144 |
+
) );
|
145 |
+
|
146 |
+
if ( $queued_posts && count( $queued_posts ) ) {
|
147 |
+
foreach( $queued_posts as $post_id ) {
|
148 |
+
$posts[] = absint( $post_id );
|
149 |
+
}
|
150 |
+
}
|
151 |
|
152 |
+
}
|
153 |
|
154 |
+
if ( $posts && count( $posts ) > 0 ) {
|
|
|
|
|
155 |
|
156 |
+
$this->fill_table( $posts );
|
157 |
|
158 |
$index_meta['offset'] = absint( $index_meta['offset'] + $posts_per_page );
|
159 |
|
325 |
/**
|
326 |
* Products that will be indexed
|
327 |
* @since 1.79
|
328 |
+
* @param array $posts Array of products IDs or product objects
|
329 |
*/
|
330 |
$posts = apply_filters( 'aws_index_product_ids', $posts );
|
331 |
|
336 |
*/
|
337 |
$apply_filters = apply_filters( 'aws_index_apply_filters', false );
|
338 |
|
339 |
+
foreach ( $posts as $post_item ) {
|
340 |
|
341 |
$data = array();
|
342 |
|
343 |
+
if ( ! is_object( $post_item ) ) {
|
344 |
+
$product = wc_get_product( $post_item );
|
345 |
+
} else {
|
346 |
+
$product = $post_item;
|
347 |
+
}
|
348 |
|
349 |
if( ! is_a( $product, 'WC_Product' ) ) {
|
350 |
continue;
|
351 |
}
|
352 |
|
353 |
+
$data['terms'] = array();
|
354 |
+
$data['id'] = method_exists( $product, 'get_id' ) ? $product->get_id() : $post_item;
|
355 |
+
|
356 |
|
357 |
$lang = '';
|
358 |
|
385 |
|
386 |
if ( $apply_filters ) {
|
387 |
$content = apply_filters( 'the_content', $content, $data['id'] );
|
388 |
+
} else {
|
389 |
+
$content = do_shortcode( $content );
|
390 |
}
|
391 |
|
392 |
// Get all child products if exists
|
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.3
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -104,6 +104,15 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
|
|
104 |
|
105 |
== Changelog ==
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
= 1.85 =
|
108 |
* Add - Seamless integration with Divi builder
|
109 |
* Add - Seamless integration for Shopkeeper theme
|
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.3
|
7 |
+
Stable tag: 1.86
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
104 |
|
105 |
== Changelog ==
|
106 |
|
107 |
+
= 1.86 =
|
108 |
+
* Update - Speed-up index process
|
109 |
+
* Update - Speed-up search
|
110 |
+
* Update - Generatepress theme integration
|
111 |
+
* Update - Ocean WP theme integration
|
112 |
+
* Update - Get shortcodes content during the index
|
113 |
+
* Add - awsShowingResults js event
|
114 |
+
* Fix - Search page bug with multiple searches per load
|
115 |
+
|
116 |
= 1.85 =
|
117 |
* Add - Seamless integration with Divi builder
|
118 |
* Add - Seamless integration for Shopkeeper theme
|