YITH WooCommerce Ajax Search - Version 1.5.3

Version Description

  • Released: May 25, 2017 = Fix: Plugin Core integration Update: Plugin Core
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Search
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.3

README.txt CHANGED
@@ -3,8 +3,8 @@
3
Contributors: yithemes
4
Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
Requires at least: 4.0.0
6
- Tested up to: 4.7.3
7
- Stable tag: 1.5.2
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -138,6 +138,11 @@ If you have created your own language pack for YITH WooCommerce Ajax Search, or
138
2. YITH WooCommerce Ajax Search in operation displaying WooCommerce search results
139
140
== Changelog ==
141
= 1.5.2 - Released: Mar 31, 2017 =
142
Fix: Query for visible product
143
Update: Plugin Core
3
Contributors: yithemes
4
Tags: woocommerce search by sku, woocommerce search results, woocommerce search shortcode, woocommerce search page, woocommerce search form, woocommerce search filter, woocommerce search products, woocommerce search content, woocommerce search autocomplete, woocommerce advanced search, woocommerce search category, woocommerce search product attributes, woocommerce search by tag, woocommerce search by brand, woocommerce predictive, woocommerce live search, woocommerce single product search, woocommerce site search, woocommerce search tex, tajax, search, woocommerce, products, themes, yit, e-commerce, shop, yith, ajax search, instant search, premium, yithemes, autocomplete, autosuggest, better search, category search, custom search, highlight terms, Live Search, Predictive Search, product search, relevant search, search highlight, search product, suggest, typeahead, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress ecommerce
5
Requires at least: 4.0.0
6
+ Tested up to: 4.7.5
7
+ Stable tag: 1.5.3
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
138
2. YITH WooCommerce Ajax Search in operation displaying WooCommerce search results
139
140
== Changelog ==
141
+
142
+ = 1.5.3 - Released: May 25, 2017 =
143
+ Fix: Plugin Core integration
144
+ Update: Plugin Core
145
+
146
= 1.5.2 - Released: Mar 31, 2017 =
147
Fix: Query for visible product
148
Update: Plugin Core
assets/js/frontend.js CHANGED
@@ -27,7 +27,7 @@ jQuery(document).ready(function ($) {
27
28
el.each(function () {
29
var $t = $(this),
30
- append_to = ( typeof $t.data('append-to') == 'undefined') ? $t.closest('.yith-ajaxsearchform-container') : $t.data('append-to');
31
32
$t.yithautocomplete({
33
minChars : min_chars,
27
28
el.each(function () {
29
var $t = $(this),
30
+ append_to = ( typeof $t.data('append-to') == 'undefined') ? $t.closest('.yith-ajaxsearchform-container') : $t.closest( $t.data('append-to') );
31
32
$t.yithautocomplete({
33
minChars : min_chars,
assets/js/frontend.min.js CHANGED
@@ -1,2 +1,2 @@
1
- jQuery(document).ready(function(b){var a=b(".yith-s"),c="undefined"!=typeof woocommerce_params&&"undefined"!=typeof woocommerce_params.ajax_loader_url?woocommerce_params.ajax_loader_url:yith_wcas_params.loading,d=""==a.data("loader-icon")?c:a.data("loader-icon"),c=b("#yith-searchsubmit"),e=a.data("min-chars");c.on("click",function(){return""==b(this).closest("form").find(".yith-s").val()?!1:!0});0==a.length&&(a=b("#yith-s"));a.each(function(){var a=b(this),c="undefined"==typeof a.data("append-to")?
2
- a.closest(".yith-ajaxsearchform-container"):a.data("append-to");a.yithautocomplete({minChars:e,appendTo:c,triggerSelectOnValidInput:!1,serviceUrl:yith_wcas_params.ajax_url+"?action=yith_ajax_search_products",onSearchStart:function(){a.css({"background-image":"url("+d+")","background-repeat":"no-repeat","background-position":"center right"})},onSelect:function(a){-1!=a.id&&(window.location.href=a.url)},onSearchComplete:function(){a.css("background-image","none")}})})});
1
+ jQuery(document).ready(function(c){var a=c(".yith-s"),d="undefined"!=typeof woocommerce_params&&"undefined"!=typeof woocommerce_params.ajax_loader_url?woocommerce_params.ajax_loader_url:yith_wcas_params.loading,e=""==a.data("loader-icon")?d:a.data("loader-icon"),d=c("#yith-searchsubmit"),f=a.data("min-chars");d.on("click",function(){return""==c(this).closest("form").find(".yith-s").val()?!1:!0});0==a.length&&(a=c("#yith-s"));a.each(function(){var b=c(this),a="undefined"==typeof b.data("append-to")?
2
+ b.closest(".yith-ajaxsearchform-container"):b.closest(b.data("append-to"));b.yithautocomplete({minChars:f,appendTo:a,triggerSelectOnValidInput:!1,serviceUrl:yith_wcas_params.ajax_url+"?action=yith_ajax_search_products",onSearchStart:function(){b.css({"background-image":"url("+e+")","background-repeat":"no-repeat","background-position":"center right"})},onSelect:function(a){-1!=a.id&&(window.location.href=a.url)},onSearchComplete:function(){b.css("background-image","none")}})})});
class.yith-wcas.php CHANGED
@@ -54,8 +54,17 @@ if ( !class_exists( 'YITH_WCAS' ) ) {
54
}else {
55
$this->obj = new YITH_WCAS_Frontend( $this->version );
56
}
57
}
58
- include_once( YITH_WCAS_DIR.'plugin-fw/yit-woocommerce-compatibility.php' );
59
// actions
60
add_action( 'widgets_init', array( $this, 'registerWidgets' ) );
61
54
}else {
55
$this->obj = new YITH_WCAS_Frontend( $this->version );
56
}
57
+ }else{
58
+ if ( class_exists( 'YITH_JetPack' ) ) {
59
+ include_once( YJP_DIR . 'plugin-fw/yit-woocommerce-compatibility.php' );
60
+ } else {
61
+ global $plugin_fw_data;
62
+ $plugin_fw_file = array_shift( $plugin_fw_data );
63
+ require_once( plugin_dir_path( $plugin_fw_file ) . 'yit-woocommerce-compatibility.php' );
64
+ }
65
}
66
+
67
+
68
// actions
69
add_action( 'widgets_init', array( $this, 'registerWidgets' ) );
70
init.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: YITH WooCommerce Ajax Search
4
* Plugin URI: http://yithemes.com/
5
* Description: YITH WooCommerce Ajax Search allows your users to search products in real time.
6
- * Version: 1.5.2
7
* Author: YITHEMES
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-woocommerce-ajax-search
@@ -65,7 +65,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
65
if ( defined( 'YITH_WCAS_VERSION' ) ){
66
return;
67
}else{
68
- define( 'YITH_WCAS_VERSION', '1.5.2' );
69
}
70
71
if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
3
* Plugin Name: YITH WooCommerce Ajax Search
4
* Plugin URI: http://yithemes.com/
5
* Description: YITH WooCommerce Ajax Search allows your users to search products in real time.
6
+ * Version: 1.5.3
7
* Author: YITHEMES
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-woocommerce-ajax-search
65
if ( defined( 'YITH_WCAS_VERSION' ) ){
66
return;
67
}else{
68
+ define( 'YITH_WCAS_VERSION', '1.5.3' );
69
}
70
71
if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
/**
3
* Framework Name: YIT Plugin Framework
4
- * Version: 2.9.62
5
* Author: Yithemes
6
* Text Domain: yith-plugin-fw
7
* Domain Path: /languages/
1
<?php
2
/**
3
* Framework Name: YIT Plugin Framework
4
+ * Version: 2.9.65
5
* Author: Yithemes
6
* Text Domain: yith-plugin-fw
7
* Domain Path: /languages/
plugin-fw/yit-woocommerce-compatibility.php CHANGED
@@ -112,13 +112,8 @@ if ( !function_exists( 'yit_save_prop' ) ) {
112
foreach ( $arg1 as $key => $value ) {
113
yit_set_prop( $object, $key, $value );
114
115
- if ( $is_wc_data ) {
116
- if ( $force_update ) {
117
- $object->save();
118
- } else {
119
- yit_store_changes( $object, $key, $value );
120
- }
121
- } else {
122
if ( yit_wc_check_post_columns( $key ) ) {
123
yit_store_changes( $object->post, $key, $value );
124
} else {
@@ -128,6 +123,10 @@ if ( !function_exists( 'yit_save_prop' ) ) {
128
}
129
}
130
}
131
}
132
}
133
@@ -150,7 +149,7 @@ if ( !function_exists( 'yit_delete_prop' ) ) {
150
$object->delete_meta_data( $key, $value );
151
}
152
153
- yit_store_changes( $object, $key );
154
} else {
155
if ( yit_wc_check_post_columns( $key ) && ( !$value || $object->post->$key == $value ) ) {
156
yit_store_changes( $object->post, $key, '' );
@@ -166,28 +165,30 @@ if ( !function_exists( 'yit_delete_prop' ) ) {
166
if ( !function_exists( 'yit_return_new_attribute_map' ) ) {
167
function yit_return_new_attribute_map() {
168
return array(
169
- 'post_parent' => 'parent_id',
170
- 'post_title' => 'name',
171
- 'post_status' => 'status',
172
- 'post_content' => 'description',
173
- 'post_excerpt' => 'short_description',
174
/* Orders */
175
- 'paid_date' => 'date_paid',
176
- '_paid_date' => '_date_paid',
177
- 'completed_date' => 'date_completed',
178
- '_completed_date' => '_date_completed',
179
- '_order_date' => '_date_created',
180
- 'order_date' => 'date_created',
181
- 'order_total' => 'total',
182
- 'customer_user' => 'customer_id',
183
- '_customer_user' => 'customer_id',
184
/* Products */
185
- 'visibility' => 'catalog_visibility',
186
- '_visibility' => '_catalog_visibility',
187
- 'sale_price_dates_from' => 'date_on_sale_from',
188
- '_sale_price_dates_from' => '_date_on_sale_from',
189
- 'sale_price_dates_to' => 'date_on_sale_to',
190
- '_sale_price_dates_to' => '_date_on_sale_to',
191
/*Coupons*/
192
'coupon_amount' => 'amount',
193
'exclude_product_ids' => 'excluded_product_ids',
@@ -210,15 +211,11 @@ if ( !function_exists( 'yit_store_changes' ) ) {
210
*/
211
$object_reference = $object->get_id();
212
213
- $cache_type = is_a( $object, 'WC_Product' ) ? 'product' : 'order';
214
- $cache_key = $cache_type . '-' . $object_reference;
215
- $cache_group = $cache_type . 's';
216
-
217
$changed_objects[ $object_reference ][ 'object' ] = $object;
218
$changed_objects[ $object_reference ][ 'changes' ][ $key ] = $value;
219
220
221
- wp_cache_set( $cache_key, $object, $cache_group );
222
} else {
223
$changed_objects[ $object->ID ][ $key ] = $value;
224
}
@@ -253,7 +250,7 @@ if ( !function_exists( 'yit_get_orders' ) ) {
253
*
254
*/
255
function yit_get_orders( $args ) {
256
- if ( version_compare( WC()->version, '2.6', '<' ) ) {
257
$args[ 'fields' ] = 'objects';
258
$posts = get_posts( $args );
259
@@ -269,7 +266,7 @@ if ( !function_exists( 'yit_get_products' ) ) {
269
*
270
*/
271
function yit_get_products( $args ) {
272
- if ( version_compare( WC()->version, '2.6', '<' ) ) {
273
$args[ 'fields' ] = 'objects';
274
$posts = get_posts( $args );
275
@@ -319,6 +316,7 @@ if ( !function_exists( 'yit_wc_deprecated_filters' ) ) {
319
'woocommerce_product_weight' => 'woocommerce_product_get_weight',
320
'woocommerce_get_sku' => 'woocommerce_product_get_sku',
321
'woocommerce_get_price' => 'woocommerce_product_get_price',
322
'woocommerce_get_regular_price' => 'woocommerce_product_get_regular_price',
323
'woocommerce_get_sale_price' => 'woocommerce_product_get_sale_price',
324
'woocommerce_product_tax_class' => 'woocommerce_product_get_tax_class',
@@ -556,7 +554,7 @@ if ( !function_exists( 'yit_get_product_image_id' ) ) {
556
557
if ( !function_exists( 'yit_get_refund_amount' ) ) {
558
/**
559
- * @param $refund \WC_Order_Refund
560
* @param $context string
561
*
562
* @return float
@@ -638,7 +636,7 @@ if ( !function_exists( 'yit_add_select2_fields' ) ) {
638
<?php
639
else :
640
if ( $args[ 'data-multiple' ] === false && is_array( $args[ 'data-selected' ] ) ) {
641
- $args[ 'data-selected' ] = current($args[ 'data-selected' ]);
642
}
643
644
?>
@@ -688,7 +686,7 @@ if ( !function_exists( 'yit_datetime_to_timestamp' ) ) {
688
*/
689
function yit_datetime_to_timestamp( $date ) {
690
691
- if ( ! is_int( $date ) ) {
692
$date = strtotime( $date );
693
}
694
112
foreach ( $arg1 as $key => $value ) {
113
yit_set_prop( $object, $key, $value );
114
115
+ if ( !$is_wc_data ) {
116
+
117
if ( yit_wc_check_post_columns( $key ) ) {
118
yit_store_changes( $object->post, $key, $value );
119
} else {
123
}
124
}
125
}
126
+
127
+ if ( $is_wc_data ) {
128
+ $object->save();
129
+ }
130
}
131
}
132
149
$object->delete_meta_data( $key, $value );
150
}
151
152
+ $object->save();
153
} else {
154
if ( yit_wc_check_post_columns( $key ) && ( !$value || $object->post->$key == $value ) ) {
155
yit_store_changes( $object->post, $key, '' );
165
if ( !function_exists( 'yit_return_new_attribute_map' ) ) {
166
function yit_return_new_attribute_map() {
167
return array(
168
+ 'post_parent' => 'parent_id',
169
+ 'post_title' => 'name',
170
+ 'post_status' => 'status',
171
+ 'post_content' => 'description',
172
+ 'post_excerpt' => 'short_description',
173
/* Orders */
174
+ 'paid_date' => 'date_paid',
175
+ '_paid_date' => '_date_paid',
176
+ 'completed_date' => 'date_completed',
177
+ '_completed_date' => '_date_completed',
178
+ '_order_date' => '_date_created',
179
+ 'order_date' => 'date_created',
180
+ 'order_total' => 'total',
181
+ 'customer_user' => 'customer_id',
182
+ '_customer_user' => 'customer_id',
183
/* Products */
184
+ 'visibility' => 'catalog_visibility',
185
+ '_visibility' => '_catalog_visibility',
186
+ 'sale_price_dates_from' => 'date_on_sale_from',
187
+ '_sale_price_dates_from' => '_date_on_sale_from',
188
+ 'sale_price_dates_to' => 'date_on_sale_to',
189
+ '_sale_price_dates_to' => '_date_on_sale_to',
190
+ 'product_attributes' => 'attributes',
191
+ '_product_attributes' => '_attributes',
192
/*Coupons*/
193
'coupon_amount' => 'amount',
194
'exclude_product_ids' => 'excluded_product_ids',
211
*/
212
$object_reference = $object->get_id();
213
214
$changed_objects[ $object_reference ][ 'object' ] = $object;
215
$changed_objects[ $object_reference ][ 'changes' ][ $key ] = $value;
216
217
218
+
219
} else {
220
$changed_objects[ $object->ID ][ $key ] = $value;
221
}
250
*
251
*/
252
function yit_get_orders( $args ) {
253
+ if ( version_compare( WC()->version, '2.7', '<' ) ) {
254
$args[ 'fields' ] = 'objects';
255
$posts = get_posts( $args );
256
266
*
267
*/
268
function yit_get_products( $args ) {
269
+ if ( version_compare( WC()->version, '2.7', '<' ) ) {
270
$args[ 'fields' ] = 'objects';
271
$posts = get_posts( $args );
272
316
'woocommerce_product_weight' => 'woocommerce_product_get_weight',
317
'woocommerce_get_sku' => 'woocommerce_product_get_sku',
318
'woocommerce_get_price' => 'woocommerce_product_get_price',
319
+ 'woocommerce_get_price' => 'woocommerce_product_variation_get_price',
320
'woocommerce_get_regular_price' => 'woocommerce_product_get_regular_price',
321
'woocommerce_get_sale_price' => 'woocommerce_product_get_sale_price',
322
'woocommerce_product_tax_class' => 'woocommerce_product_get_tax_class',
554
555
if ( !function_exists( 'yit_get_refund_amount' ) ) {
556
/**
557
+ * @param $refund \WC_Order_Refund
558
* @param $context string
559
*
560
* @return float
636
<?php
637
else :
638
if ( $args[ 'data-multiple' ] === false && is_array( $args[ 'data-selected' ] ) ) {
639
+ $args[ 'data-selected' ] = current( $args[ 'data-selected' ] );
640
}
641
642
?>
686
*/
687
function yit_datetime_to_timestamp( $date ) {
688
689
+ if ( !is_int( $date ) ) {
690
$date = strtotime( $date );
691
}
692