Woocommerce Products Slider - Version 1.13.5

Version Description

  • 2020-03-17 add - query only featured, on-sale, in-stock products.
Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Woocommerce Products Slider
Version 1.13.5
Comparing to
See all releases

Code changes from version 1.13.4 to 1.13.5

includes/class-metabox-wcps-hook.php CHANGED
@@ -526,6 +526,7 @@ if(!function_exists('wcps_metabox_content_query_product')) {
526
$taxonomies = !empty($query['taxonomies']) ? $query['taxonomies'] : array();
527
$taxonomy_relation = !empty($query['taxonomy_relation']) ? $query['taxonomy_relation'] : 'OR';
528
529
530
531
@@ -580,7 +581,7 @@ if(!function_exists('wcps_metabox_content_query_product')) {
580
$terms = isset($taxonomies[$taxonomy]['terms']) ? $taxonomies[$taxonomy]['terms'] : array();
581
$terms_relation = isset($taxonomies[$taxonomy]['terms_relation']) ? $taxonomies[$taxonomy]['terms_relation'] : 'IN';
582
583
- if(!in_array($taxonomy, $wcps_allowed_taxonomies)) continue;
584
//if($taxonomy != 'product_cat' && $taxonomy != 'product_tag') continue;
585
586
$the_taxonomy = get_taxonomy($taxonomy);
@@ -873,9 +874,10 @@ if(!function_exists('wcps_metabox_content_query_product')) {
873
'value' => $hide_out_of_stock,
874
'default' => 'no_check',
875
'args' => array(
876
'no'=>__('Include','woocommerce-products-slider'),
877
'yes'=>__('Exclude','woocommerce-products-slider'),
878
- 'no_check'=>__('No check','woocommerce-products-slider'),
879
880
),
881
);
@@ -891,11 +893,12 @@ if(!function_exists('wcps_metabox_content_query_product')) {
891
'details' => __('Include or exclude featured products from query.','woocommerce-products-slider'),
892
'type' => 'radio',
893
'value' => $product_featured,
894
- 'default' => 'no',
895
'args' => array(
896
'yes'=>__('Include','woocommerce-products-slider'),
897
'no'=>__('Exclude','woocommerce-products-slider'),
898
- 'no_check'=>__('No check','woocommerce-products-slider'),
899
),
900
);
901
@@ -910,19 +913,39 @@ if(!function_exists('wcps_metabox_content_query_product')) {
910
'details' => __('Include or exclude on-sale products from query.','woocommerce-products-slider'),
911
'type' => 'radio',
912
'value' => $on_sale,
913
- 'default' => 'no',
914
'args' => array(
915
'yes'=>__('Include','woocommerce-products-slider'),
916
'no'=>__('Exclude','woocommerce-products-slider'),
917
- 'no_check'=>__('No check','woocommerce-products-slider'),
918
919
),
920
);
921
922
$settings_tabs_field->generate_field($args);
923
924
925
926
927
928
526
$taxonomies = !empty($query['taxonomies']) ? $query['taxonomies'] : array();
527
$taxonomy_relation = !empty($query['taxonomy_relation']) ? $query['taxonomy_relation'] : 'OR';
528
529
+ $query_only = isset($query['query_only']) ? $query['query_only'] : '';
530
531
532
581
$terms = isset($taxonomies[$taxonomy]['terms']) ? $taxonomies[$taxonomy]['terms'] : array();
582
$terms_relation = isset($taxonomies[$taxonomy]['terms_relation']) ? $taxonomies[$taxonomy]['terms_relation'] : 'IN';
583
584
+ //if(!in_array($taxonomy, $wcps_allowed_taxonomies)) continue;
585
//if($taxonomy != 'product_cat' && $taxonomy != 'product_tag') continue;
586
587
$the_taxonomy = get_taxonomy($taxonomy);
874
'value' => $hide_out_of_stock,
875
'default' => 'no_check',
876
'args' => array(
877
+ 'no_check'=>__('No check','woocommerce-products-slider'),
878
'no'=>__('Include','woocommerce-products-slider'),
879
'yes'=>__('Exclude','woocommerce-products-slider'),
880
+
881
882
),
883
);
893
'details' => __('Include or exclude featured products from query.','woocommerce-products-slider'),
894
'type' => 'radio',
895
'value' => $product_featured,
896
+ 'default' => 'no_check',
897
'args' => array(
898
+ 'no_check'=>__('No check','woocommerce-products-slider'),
899
'yes'=>__('Include','woocommerce-products-slider'),
900
'no'=>__('Exclude','woocommerce-products-slider'),
901
+
902
),
903
);
904
913
'details' => __('Include or exclude on-sale products from query.','woocommerce-products-slider'),
914
'type' => 'radio',
915
'value' => $on_sale,
916
+ 'default' => 'no_check',
917
'args' => array(
918
+ 'no_check'=>__('No check','woocommerce-products-slider'),
919
'yes'=>__('Include','woocommerce-products-slider'),
920
'no'=>__('Exclude','woocommerce-products-slider'),
921
+
922
923
),
924
);
925
926
$settings_tabs_field->generate_field($args);
927
928
+ $query_only_args = apply_filters('wcps_query_only_args',
929
+ array(
930
+ 'no_check'=>__('No check','woocommerce-products-slider'),
931
+ 'on_sale'=>__('On sale','woocommerce-products-slider'),
932
+ 'featured'=>__('Featured','woocommerce-products-slider'),
933
+ 'in_stock'=>__('In stock','woocommerce-products-slider'),
934
+ )
935
+ );
936
937
+ $args = array(
938
+ 'id' => 'query_only',
939
+ 'parent' => 'wcps_options[query]',
940
+ 'title' => __('Query only?','woocommerce-products-slider'),
941
+ 'details' => __('Choose option you want to display only products based on options.','woocommerce-products-slider'),
942
+ 'type' => 'radio',
943
+ 'value' => $query_only,
944
+ 'default' => 'no_check',
945
+ 'args' => $query_only_args,
946
+ );
947
948
+ $settings_tabs_field->generate_field($args);
949
950
951
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
Tags: product slider, woocommerce slider, woo slider, woo product carousel slider, woocommerce product slider
5
Requires at least: 3.8
6
Tested up to: 5.3
7
- Stable tag: 1.13.4
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -141,6 +141,9 @@ then paste this shortcode anywhere in your page to display slider<br />
141
142
== Changelog ==
143
144
= 1.13.4 =
145
* 2020-03-17 fix - default thumbnail missing issue fixed.
146
4
Tags: product slider, woocommerce slider, woo slider, woo product carousel slider, woocommerce product slider
5
Requires at least: 3.8
6
Tested up to: 5.3
7
+ Stable tag: 1.13.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
141
142
== Changelog ==
143
144
+ = 1.13.5 =
145
+ * 2020-03-17 add - query only featured, on-sale, in-stock products.
146
+
147
= 1.13.4 =
148
* 2020-03-17 fix - default thumbnail missing issue fixed.
149
templates/wcps-slider/wcps-slider-hook.php CHANGED
@@ -84,6 +84,7 @@ function wcps_slider_main_items($args){
84
85
$on_sale = isset($query['on_sale']) ? $query['on_sale'] : 'no';
86
$product_ids = isset($query['product_ids']) ? $query['product_ids'] : '';
87
88
//if(empty($post_id)) return;
89
$query_args = array();
@@ -165,6 +166,34 @@ function wcps_slider_main_items($args){
165
$query_args['post__in'] = $product_ids;
166
}
167
168
//echo '<pre>'.var_export($query_orderby, true).'</pre>';
169
170
84
85
$on_sale = isset($query['on_sale']) ? $query['on_sale'] : 'no';
86
$product_ids = isset($query['product_ids']) ? $query['product_ids'] : '';
87
+ $query_only = isset($query['query_only']) ? $query['query_only'] : 'no_check';
88
89
//if(empty($post_id)) return;
90
$query_args = array();
166
$query_args['post__in'] = $product_ids;
167
}
168
169
+
170
+ if($query_only == 'on_sale'){
171
+ $wc_get_product_ids_on_sale = wc_get_product_ids_on_sale();
172
+ $query_args['post__in'] = $wc_get_product_ids_on_sale;
173
+
174
+ }elseif($query_only == 'featured'){
175
+
176
+ $tax_query[] = array(
177
+ 'taxonomy' => 'product_visibility',
178
+ 'field' => 'name',
179
+ 'terms' => 'featured',
180
+ 'operator' => 'IN',
181
+ );
182
+
183
+ }elseif($query_only == 'in_stock'){
184
+
185
+ $tax_query[] = array(
186
+ 'taxonomy' => 'product_visibility',
187
+ 'field' => 'name',
188
+ 'terms' => 'outofstock',
189
+ 'operator' => 'NOT IN',
190
+ );
191
+
192
+ }
193
+
194
+
195
+
196
+
197
//echo '<pre>'.var_export($query_orderby, true).'</pre>';
198
199
woocommerce-products-slider.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: PickPlugins Product Slider for WooCommerce
4
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
5
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
6
- Version: 1.13.4
7
WC requires at least: 3.0.0
8
WC tested up to: 3.9
9
Author: PickPlugins
@@ -23,7 +23,7 @@ class WoocommerceProductsSlider{
23
define('wcps_plugin_url', plugins_url('/', __FILE__) );
24
define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
25
define('wcps_plugin_name', 'PickPlugins Product Slider' );
26
- define('wcps_plugin_version', '1.13.4' );
27
28
require_once( wcps_plugin_dir . 'includes/class-post-types.php');
29
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
@@ -87,7 +87,7 @@ class WoocommerceProductsSlider{
87
function cron_recurrence_interval($schedules){
88
89
$schedules['1minute'] = array(
90
- 'interval' => 120,
91
'display' => __('1 Minute', 'woocommerce-products-slider')
92
);
93
@@ -98,7 +98,9 @@ class WoocommerceProductsSlider{
98
99
public function _activation(){
100
101
-
102
do_action( 'wcps_plugin_activation' );
103
104
}
3
Plugin Name: PickPlugins Product Slider for WooCommerce
4
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
5
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
6
+ Version: 1.13.5
7
WC requires at least: 3.0.0
8
WC tested up to: 3.9
9
Author: PickPlugins
23
define('wcps_plugin_url', plugins_url('/', __FILE__) );
24
define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
25
define('wcps_plugin_name', 'PickPlugins Product Slider' );
26
+ define('wcps_plugin_version', '1.13.5' );
27
28
require_once( wcps_plugin_dir . 'includes/class-post-types.php');
29
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
87
function cron_recurrence_interval($schedules){
88
89
$schedules['1minute'] = array(
90
+ 'interval' => 40,
91
'display' => __('1 Minute', 'woocommerce-products-slider')
92
);
93
98
99
public function _activation(){
100
101
+ $class_wcps_post_types = new class_wcps_post_types();
102
+ $_posttype_wcps = $class_wcps_post_types->_posttype_wcps();
103
+ flush_rewrite_rules();
104
do_action( 'wcps_plugin_activation' );
105
106
}