Plugin Author
ILLID
(@mihail-barinov)
I found the solution for you. But you will need to make some little changes in the plugin source code.I will also add them with the next plugin release.
So please open advanced-woo-search/includes/class-aws-search.php file, find line
$this->data['sql'] = $sql;
and replace it with
$sql = apply_filters( 'aws_search_query_string', $sql );
$this->data['sql'] = $sql;
After please use following code snippet
add_filter( 'aws_search_query_array', 'my_aws_search_query_array' );
function my_aws_search_query_array( $query ) {
global $wpdb;
$date = '2014-01-01 00:00:00';
$table = $wpdb->prefix . AWS_INDEX_TABLE_NAME;
$query['select'] = str_replace( 'ID', $table . '.ID', $query['select'] );
$query['search'] .= "AND {$table}.ID = {$wpdb->posts}.ID AND {$wpdb->posts}.post_date > STR_TO_DATE('{$date}', '%Y-%m-%d %H:%i:%s')";
return $query;
}
add_filter( 'aws_search_query_string', 'my_aws_search_query_string' );
function my_aws_search_query_string( $sql ) {
global $wpdb;
$sql = str_replace( 'FROM', 'FROM ' . $wpdb->posts . ',', $sql );
return $sql;
}
replace ‘2014-01-01 00:00:00’ with the needed date. In the search results you will see only products that are no older than this date.
You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.
Also after adding this code you will need to go to the plugin settings page and click ‘Clear cache’ button.