Woocommerce Products Slider - Version 1.12.14

Version Description

  • 04/07/2017 add - Product query for Catalog visibility.
Download this release

Release Info

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

Code changes from version 1.12.13 to 1.12.14

includes/meta.php CHANGED
@@ -164,6 +164,10 @@ function meta_boxes_wcps_input( $post ) {
164
$wcps_product_on_sale = get_post_meta( $post->ID, 'wcps_product_on_sale', true );
165
if(empty($wcps_product_on_sale)){ $wcps_product_on_sale = 'no'; }
166
167
$wcps_grid_items = get_post_meta( $post->ID, 'wcps_grid_items', true );
168
$wcps_grid_items_hide = get_post_meta( $post->ID, 'wcps_grid_items_hide', true );
169
@@ -679,7 +683,12 @@ function meta_boxes_wcps_input( $post ) {
679
<p class="option-info"><?php _e('On Sale Product display', wcps_textdomain);?></p>
680
<label><input <?php if($wcps_product_on_sale=="yes") echo "checked";?> type="radio" name="wcps_product_on_sale" value="yes" />Yes</label>
681
<label><input <?php if($wcps_product_on_sale=="no") echo "checked";?> type="radio" name="wcps_product_on_sale" value="no" />No</label>
682
-
683
684
685
</div>
@@ -1536,6 +1545,7 @@ function meta_boxes_wcps_save( $post_id ) {
1536
1537
$wcps_product_featured = sanitize_text_field( $_POST['wcps_product_featured'] );
1538
$wcps_product_on_sale = sanitize_text_field( $_POST['wcps_product_on_sale'] );
1539
1540
1541
//$wcps_cat_display = sanitize_text_field( $_POST['wcps_cat_display'] );
@@ -1652,7 +1662,8 @@ function meta_boxes_wcps_save( $post_id ) {
1652
update_post_meta( $post_id, 'wcps_slider_animatein', $wcps_slider_animatein );
1653
1654
update_post_meta( $post_id, 'wcps_product_featured', $wcps_product_featured );
1655
- update_post_meta( $post_id, 'wcps_product_on_sale', $wcps_product_on_sale );
1656
1657
1658
//update_post_meta( $post_id, 'wcps_cat_display', $wcps_cat_display );
164
$wcps_product_on_sale = get_post_meta( $post->ID, 'wcps_product_on_sale', true );
165
if(empty($wcps_product_on_sale)){ $wcps_product_on_sale = 'no'; }
166
167
+ $wcps_product_visibility = get_post_meta( $post->ID, 'wcps_product_visibility', true );
168
+ if(empty($wcps_product_visibility)){ $wcps_product_visibility = 'visible'; }
169
+
170
+
171
$wcps_grid_items = get_post_meta( $post->ID, 'wcps_grid_items', true );
172
$wcps_grid_items_hide = get_post_meta( $post->ID, 'wcps_grid_items_hide', true );
173
683
<p class="option-info"><?php _e('On Sale Product display', wcps_textdomain);?></p>
684
<label><input <?php if($wcps_product_on_sale=="yes") echo "checked";?> type="radio" name="wcps_product_on_sale" value="yes" />Yes</label>
685
<label><input <?php if($wcps_product_on_sale=="no") echo "checked";?> type="radio" name="wcps_product_on_sale" value="no" />No</label>
686
+
687
+ <p class="option-info"><?php _e('Catalog visibility', wcps_textdomain);?></p>
688
+ <label><input <?php if($wcps_product_visibility=="visible") echo "checked";?> type="radio" name="wcps_product_visibility" value="visible" />Shop and search results</label>
689
+ <label><input <?php if($wcps_product_visibility=="catalog") echo "checked";?> type="radio" name="wcps_product_visibility" value="catalog" />Shop only</label>
690
+ <label><input <?php if($wcps_product_visibility=="search") echo "checked";?> type="radio" name="wcps_product_visibility" value="search" />Search results only</label>
691
+ <label><input <?php if($wcps_product_visibility=="hidden") echo "checked";?> type="radio" name="wcps_product_visibility" value="hidden" />Hidden</label>
692
693
694
</div>
1545
1546
$wcps_product_featured = sanitize_text_field( $_POST['wcps_product_featured'] );
1547
$wcps_product_on_sale = sanitize_text_field( $_POST['wcps_product_on_sale'] );
1548
+ $wcps_product_visibility = sanitize_text_field( $_POST['wcps_product_visibility'] );
1549
1550
1551
//$wcps_cat_display = sanitize_text_field( $_POST['wcps_cat_display'] );
1662
update_post_meta( $post_id, 'wcps_slider_animatein', $wcps_slider_animatein );
1663
1664
update_post_meta( $post_id, 'wcps_product_featured', $wcps_product_featured );
1665
+ update_post_meta( $post_id, 'wcps_product_on_sale', $wcps_product_on_sale );
1666
+ update_post_meta( $post_id, 'wcps_product_visibility', $wcps_product_visibility );
1667
1668
1669
//update_post_meta( $post_id, 'wcps_cat_display', $wcps_cat_display );
readme.txt CHANGED
@@ -4,7 +4,7 @@
4
Tags: carousel, product, slider, woocommerce, carousel slider, product slider, woocommerce slider, Woocommerce Product slider
5
Requires at least: 3.8
6
Tested up to: 4.8
7
- Stable tag: 1.12.13
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -92,6 +92,10 @@ then paste this shortcode anywhere in your page to display slider<br />
92
93
== Changelog ==
94
95
= 1.12.13 =
96
* 01/07/2017 add - Slider Auto Play Timeout update issue fixed.
97
4
Tags: carousel, product, slider, woocommerce, carousel slider, product slider, woocommerce slider, Woocommerce Product slider
5
Requires at least: 3.8
6
Tested up to: 4.8
7
+ Stable tag: 1.12.14
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
92
93
== Changelog ==
94
95
+
96
+ = 1.12.14 =
97
+ * 04/07/2017 add - Product query for Catalog visibility.
98
+
99
= 1.12.13 =
100
* 01/07/2017 add - Slider Auto Play Timeout update issue fixed.
101
templates/query.php CHANGED
@@ -63,21 +63,108 @@ if ( ! defined('ABSPATH')) exit; // if direct access
63
if($wcps_product_on_sale=='yes'){
64
65
$meta_query[] = array(
66
- array(
67
- 'key' => '_visibility',
68
- 'value' => array('catalog', 'visible'),
69
- 'compare' => 'IN'
70
- ),
71
- array(
72
- 'key' => '_sale_price',
73
- 'value' => 0,
74
- 'compare' => '>',
75
- 'type' => 'NUMERIC'
76
- )
77
);
78
79
}
80
81
82
$query_args = array (
83
'post_type' => 'product',
63
if($wcps_product_on_sale=='yes'){
64
65
$meta_query[] = array(
66
+ 'relation' => 'OR',
67
+ array( // Simple products type
68
+ 'key' => '_sale_price',
69
+ 'value' => 0,
70
+ 'compare' => '>',
71
+ 'type' => 'numeric'
72
+ ),
73
+ array( // Variable products type
74
+ 'key' => '_min_variation_sale_price',
75
+ 'value' => 0,
76
+ 'compare' => '>',
77
+ 'type' => 'numeric'
78
+ )
79
);
80
81
}
82
83
+
84
+ if($wcps_product_visibility=='visible'){
85
+
86
+ $tax_query[] = array(
87
+ 'taxonomy' => 'product_visibility',
88
+ 'field' => 'name',
89
+ 'terms' => 'exclude-from-catalog',
90
+ 'operator' => 'NOT IN',
91
+ );
92
+
93
+ $tax_query[] = array(
94
+ 'taxonomy' => 'product_visibility',
95
+ 'field' => 'name',
96
+ 'terms' => 'exclude-from-search',
97
+ 'operator' => 'NOT IN',
98
+ );
99
+
100
+
101
+ }
102
+ elseif($wcps_product_visibility=='catalog'){
103
+
104
+
105
+
106
+ $tax_query[] = array(
107
+ 'taxonomy' => 'product_visibility',
108
+ 'field' => 'name',
109
+ 'terms' => 'exclude-from-catalog',
110
+ 'operator' => 'NOT IN',
111
+ );
112
+
113
+ $tax_query[] = array(
114
+ 'taxonomy' => 'product_visibility',
115
+ 'field' => 'name',
116
+ 'terms' => 'exclude-from-search',
117
+ 'operator' => 'IN',
118
+ );
119
+
120
+
121
+ }
122
+ elseif($wcps_product_visibility=='search'){
123
+
124
+
125
+
126
+ $tax_query[] = array(
127
+ 'taxonomy' => 'product_visibility',
128
+ 'field' => 'name',
129
+ 'terms' => 'exclude-from-catalog',
130
+ 'operator' => 'IN',
131
+ );
132
+
133
+ $tax_query[] = array(
134
+ 'taxonomy' => 'product_visibility',
135
+ 'field' => 'name',
136
+ 'terms' => 'exclude-from-search',
137
+ 'operator' => 'NOT IN',
138
+ );
139
+
140
+
141
+
142
+ }
143
+ elseif($wcps_product_visibility=='hidden'){
144
+
145
+
146
+
147
+ $tax_query[] = array(
148
+ 'taxonomy' => 'product_visibility',
149
+ 'field' => 'name',
150
+ 'terms' => 'exclude-from-catalog',
151
+ 'operator' => 'IN',
152
+ );
153
+
154
+ $tax_query[] = array(
155
+ 'taxonomy' => 'product_visibility',
156
+ 'field' => 'name',
157
+ 'terms' => 'exclude-from-search',
158
+ 'operator' => 'IN',
159
+ );
160
+
161
+
162
+ }
163
+
164
+
165
+ //echo '<pre>'.var_export($tax_query, true).'</pre>';
166
+ //echo '<pre>'.var_export($meta_query, true).'</pre>';
167
+
168
169
$query_args = array (
170
'post_type' => 'product',
templates/variables.php CHANGED
@@ -137,7 +137,7 @@ if ( ! defined('ABSPATH')) exit; // if direct access
137
138
$wcps_product_featured = get_post_meta( $post_id, 'wcps_product_featured', true );
139
$wcps_product_on_sale = get_post_meta( $post_id, 'wcps_product_on_sale', true );
140
-
141
142
$wcps_items_cat_font_size = get_post_meta( $post_id, 'wcps_items_cat_font_size', true );
143
$wcps_items_cat_text_align = get_post_meta( $post_id, 'wcps_items_cat_text_align', true );
137
138
$wcps_product_featured = get_post_meta( $post_id, 'wcps_product_featured', true );
139
$wcps_product_on_sale = get_post_meta( $post_id, 'wcps_product_on_sale', true );
140
+ $wcps_product_visibility = get_post_meta( $post_id, 'wcps_product_visibility', true );
141
142
$wcps_items_cat_font_size = get_post_meta( $post_id, 'wcps_items_cat_font_size', true );
143
$wcps_items_cat_text_align = get_post_meta( $post_id, 'wcps_items_cat_text_align', true );
templates/wcps-title.php CHANGED
@@ -7,6 +7,8 @@
7
8
if ( ! defined('ABSPATH')) exit; // if direct access
9
10
$title_text = apply_filters( 'wcps_filter_title', get_the_title(get_the_ID()) );
11
12
$html.= '<div class="wcps-items-title" ><a style="color:'.$wcps_items_title_color.';font-size:'.$wcps_items_title_font_size.'" href="'.$permalink.'">'.$title_text.'</a></div>';
7
8
if ( ! defined('ABSPATH')) exit; // if direct access
9
10
+
11
+
12
$title_text = apply_filters( 'wcps_filter_title', get_the_title(get_the_ID()) );
13
14
$html.= '<div class="wcps-items-title" ><a style="color:'.$wcps_items_title_color.';font-size:'.$wcps_items_title_font_size.'" href="'.$permalink.'">'.$title_text.'</a></div>';
woocommerce-products-slider.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Woocommerce Products Slider
4
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
5
Description: Fully responsive and mobile ready Carousel Slider for your woo-commerce product. unlimited slider anywhere via short-codes and easy admin setting.
6
- Version: 1.12.13
7
Author: pickplugins
8
Author URI: http://pickplugins.com
9
Text Domain: woocommerce-products-slider
@@ -27,7 +27,7 @@ class WoocommerceProductsSlider{
27
define('wcps_conatct_url', 'http://pickplugins.com/contact/' );
28
define('wcps_qa_url', 'http://pickplugins.com/questions/' );
29
define('wcps_plugin_name', 'Woocommerce Products Slider' );
30
- define('wcps_plugin_version', '1.12.13' );
31
define('wcps_customer_type', 'free' ); // pro & free
32
define('wcps_share_url', 'https://wordpress.org/plugins/woocommerce-products-slider/' );
33
define('wcps_tutorial_video_url', '//www.youtube.com/embed/B0sOSp3h9fE?rel=0' );
3
Plugin Name: Woocommerce Products Slider
4
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
5
Description: Fully responsive and mobile ready Carousel Slider for your woo-commerce product. unlimited slider anywhere via short-codes and easy admin setting.
6
+ Version: 1.12.14
7
Author: pickplugins
8
Author URI: http://pickplugins.com
9
Text Domain: woocommerce-products-slider
27
define('wcps_conatct_url', 'http://pickplugins.com/contact/' );
28
define('wcps_qa_url', 'http://pickplugins.com/questions/' );
29
define('wcps_plugin_name', 'Woocommerce Products Slider' );
30
+ define('wcps_plugin_version', '1.12.14' );
31
define('wcps_customer_type', 'free' ); // pro & free
32
define('wcps_share_url', 'https://wordpress.org/plugins/woocommerce-products-slider/' );
33
define('wcps_tutorial_video_url', '//www.youtube.com/embed/B0sOSp3h9fE?rel=0' );