Woocommerce Products Slider - Version 1.3

Version Description

  • 31/01/2015 add - default empty thubnail.
    • 31/01/2015 fix - slider comlumn number fix for desktop.
Download this release

Release Info

Developer paratheme
Plugin Icon 128x128 Woocommerce Products Slider
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

css/no-thumb.png ADDED
Binary file
includes/wcps-meta.php CHANGED
@@ -100,6 +100,9 @@ function meta_boxes_wcps_input( $post ) {
100
  $wcps_items_thumb_size = get_post_meta( $post->ID, 'wcps_items_thumb_size', true );
101
  $wcps_items_thumb_max_hieght = get_post_meta( $post->ID, 'wcps_items_thumb_max_hieght', true );
102
 
 
 
 
103
 
104
 
105
 
@@ -397,6 +400,75 @@ function meta_boxes_wcps_input( $post ) {
397
 
398
  </li>
399
  <li style="display: none;" class="box3 tab-box ">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
  <div class="option-box">
401
  <p class="option-title">Filter Slider Content.</p>
402
  <p class="option-info"></p>
@@ -628,7 +700,7 @@ function meta_boxes_wcps_save( $post_id ) {
628
  $wcps_items_thumb_size = sanitize_text_field( $_POST['wcps_items_thumb_size'] );
629
  $wcps_items_thumb_max_hieght = sanitize_text_field( $_POST['wcps_items_thumb_max_hieght'] );
630
 
631
-
632
 
633
 
634
 
@@ -667,6 +739,8 @@ function meta_boxes_wcps_save( $post_id ) {
667
  update_post_meta( $post_id, 'wcps_items_thumb_size', $wcps_items_thumb_size );
668
  update_post_meta( $post_id, 'wcps_items_thumb_max_hieght', $wcps_items_thumb_max_hieght );
669
 
 
 
670
 
671
 
672
  }
100
  $wcps_items_thumb_size = get_post_meta( $post->ID, 'wcps_items_thumb_size', true );
101
  $wcps_items_thumb_max_hieght = get_post_meta( $post->ID, 'wcps_items_thumb_max_hieght', true );
102
 
103
+ $wcps_items_empty_thumb = get_post_meta( $post->ID, 'wcps_items_empty_thumb', true );
104
+
105
+
106
 
107
 
108
 
400
 
401
  </li>
402
  <li style="display: none;" class="box3 tab-box ">
403
+
404
+ <div class="option-box">
405
+ <p class="option-title">Empty Thumbnail</p>
406
+ <p class="option-info"></p>
407
+ <input type="text" name="wcps_items_empty_thumb" id="wcps_items_empty_thumb" value="<?php if(!empty($wcps_items_empty_thumb)) echo $wcps_items_empty_thumb; ?>" /><br />
408
+ <input id="wcps_items_empty_thumb_upload" class="wcps_items_empty_thumb_upload button" type="button" value="Upload Image" />
409
+ <br />
410
+
411
+
412
+ <?php
413
+ if(empty($wcps_items_empty_thumb))
414
+ {
415
+ ?>
416
+ <img class="wcps_items_empty_thumb_display" width="300px" src="<?php echo wcps_plugin_url.'css/no-thumb.png'; ?>" />
417
+ <?php
418
+ }
419
+ else
420
+ {
421
+ ?>
422
+ <img class="wcps_items_empty_thumb_display" width="300px" src="<?php echo $wcps_items_empty_thumb; ?>" />
423
+ <?php
424
+ }
425
+ ?>
426
+
427
+
428
+
429
+
430
+
431
+ <script>
432
+ jQuery(document).ready(function($){
433
+
434
+ var custom_uploader;
435
+
436
+ jQuery('#wcps_items_empty_thumb_upload').click(function(e) {
437
+
438
+ e.preventDefault();
439
+
440
+ //If the uploader object has already been created, reopen the dialog
441
+ if (custom_uploader) {
442
+ custom_uploader.open();
443
+ return;
444
+ }
445
+
446
+ //Extend the wp.media object
447
+ custom_uploader = wp.media.frames.file_frame = wp.media({
448
+ title: 'Choose Image',
449
+ button: {
450
+ text: 'Choose Image'
451
+ },
452
+ multiple: false
453
+ });
454
+
455
+ //When a file is selected, grab the URL and set it as the text field's value
456
+ custom_uploader.on('select', function() {
457
+ attachment = custom_uploader.state().get('selection').first().toJSON();
458
+ jQuery('#wcps_items_empty_thumb').val(attachment.url);
459
+ jQuery('.wcps_items_empty_thumb_display').attr('src',attachment.url);
460
+ });
461
+
462
+ //Open the uploader dialog
463
+ custom_uploader.open();
464
+
465
+ });
466
+
467
+
468
+ })
469
+ </script>
470
+ </div>
471
+
472
  <div class="option-box">
473
  <p class="option-title">Filter Slider Content.</p>
474
  <p class="option-info"></p>
700
  $wcps_items_thumb_size = sanitize_text_field( $_POST['wcps_items_thumb_size'] );
701
  $wcps_items_thumb_max_hieght = sanitize_text_field( $_POST['wcps_items_thumb_max_hieght'] );
702
 
703
+ $wcps_items_empty_thumb = sanitize_text_field( $_POST['wcps_items_empty_thumb'] );
704
 
705
 
706
 
739
  update_post_meta( $post_id, 'wcps_items_thumb_size', $wcps_items_thumb_size );
740
  update_post_meta( $post_id, 'wcps_items_thumb_max_hieght', $wcps_items_thumb_max_hieght );
741
 
742
+ update_post_meta( $post_id, 'wcps_items_empty_thumb', $wcps_items_empty_thumb );
743
+
744
 
745
 
746
  }
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Woocommerce Products Slider ===
2
  Contributors: paratheme
3
  Donate link: http://paratheme.com
4
- Tags: carousel, product, slider, woocommerce, carousel slider, product slider, woocommerce slider, Woocommerce Product slider, featured product slider
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
- Stable tag: 1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -92,7 +92,10 @@ then paste this shortcode anywhere in your page to display slider<br />
92
 
93
  == Changelog ==
94
 
95
-
 
 
 
96
  = 1.2 =
97
  * 10/12/2015 Remove featured marker update as text.
98
  * 10/12/2015 Update flat theme.
1
  === Woocommerce Products Slider ===
2
  Contributors: paratheme
3
  Donate link: http://paratheme.com
4
+ Tags: carousel, product, slider, woocommerce, carousel slider, product slider, woocommerce slider, Woocommerce Product slider, featured product slider, sale product slider, best sale product slider, top product slider
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
+ Stable tag: 1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
92
 
93
  == Changelog ==
94
 
95
+ = 1.3 =
96
+ * 31/01/2015 add - default empty thubnail.
97
+ * 31/01/2015 fix - slider comlumn number fix for desktop.
98
+
99
  = 1.2 =
100
  * 10/12/2015 Remove featured marker update as text.
101
  * 10/12/2015 Update flat theme.
themes/flat/index.php CHANGED
@@ -42,6 +42,8 @@ function wcps_body_flat($post_id)
42
  $wcps_items_thumb_size = get_post_meta( $post_id, 'wcps_items_thumb_size', true );
43
  $wcps_items_thumb_max_hieght = get_post_meta( $post_id, 'wcps_items_thumb_max_hieght', true );
44
 
 
 
45
  $wcps_ribbon_name = 'none';
46
 
47
 
@@ -237,6 +239,12 @@ function wcps_body_flat($post_id)
237
 
238
  $wcps_thumb_url = $wcps_thumb['0'];
239
 
 
 
 
 
 
 
240
 
241
  $currency = get_woocommerce_currency_symbol();
242
 
@@ -263,7 +271,7 @@ function wcps_body_flat($post_id)
263
 
264
 
265
  $wcps_body.= '<div class="wcps-items" >';
266
- $wcps_body.= '<div style="max-height:'.$wcps_items_thumb_max_hieght.';" class="wcps-items-thumb"><a href="'.get_permalink().'"><img src="'.$wcps_thumb_url.'" /></a>';
267
  if($wcps_featured=="yes")
268
  {
269
  $wcps_body.= '<div class="wcps-featured">Featured</div>';
@@ -292,8 +300,8 @@ function wcps_body_flat($post_id)
292
  $("#wcps-'.$post_id.'").owlCarousel({
293
 
294
  items : '.$wcps_column_number.', //10 items above 1000px browser width
295
- itemsDesktop : [1000,5], //5 items between 1000px and 901px
296
- itemsDesktopSmall : [900,3], // betweem 900px and 601px
297
  itemsTablet: [600,2], //2 items between 600 and 0
298
  itemsMobile : [479,'.$wcps_column_number_mobile.'],
299
  navigationText : ["",""],
42
  $wcps_items_thumb_size = get_post_meta( $post_id, 'wcps_items_thumb_size', true );
43
  $wcps_items_thumb_max_hieght = get_post_meta( $post_id, 'wcps_items_thumb_max_hieght', true );
44
 
45
+ $wcps_items_empty_thumb = get_post_meta( $post_id, 'wcps_items_empty_thumb', true );
46
+
47
  $wcps_ribbon_name = 'none';
48
 
49
 
239
 
240
  $wcps_thumb_url = $wcps_thumb['0'];
241
 
242
+ if(empty($wcps_thumb_url))
243
+ {
244
+ $wcps_thumb_url = $wcps_items_empty_thumb;
245
+ }
246
+
247
+
248
 
249
  $currency = get_woocommerce_currency_symbol();
250
 
271
 
272
 
273
  $wcps_body.= '<div class="wcps-items" >';
274
+ $wcps_body.= '<div style="max-height:'.$wcps_items_thumb_max_hieght.';" class="wcps-items-thumb"><a href="'.get_permalink().'"><img alt="'.get_the_title().'" src="'.$wcps_thumb_url.'" /></a>';
275
  if($wcps_featured=="yes")
276
  {
277
  $wcps_body.= '<div class="wcps-featured">Featured</div>';
300
  $("#wcps-'.$post_id.'").owlCarousel({
301
 
302
  items : '.$wcps_column_number.', //10 items above 1000px browser width
303
+ itemsDesktop : [1000,'.$wcps_column_number.'], //5 items between 1000px and 901px
304
+ itemsDesktopSmall : [900,2], // betweem 900px and 601px
305
  itemsTablet: [600,2], //2 items between 600 and 0
306
  itemsMobile : [479,'.$wcps_column_number_mobile.'],
307
  navigationText : ["",""],
themes/rossi/index.php CHANGED
@@ -41,6 +41,8 @@ function wcps_body_rossi($post_id)
41
  $wcps_items_thumb_size = get_post_meta( $post_id, 'wcps_items_thumb_size', true );
42
  $wcps_items_thumb_max_hieght = get_post_meta( $post_id, 'wcps_items_thumb_max_hieght', true );
43
 
 
 
44
  $wcps_ribbon_name = 'none';
45
 
46
 
@@ -232,6 +234,12 @@ function wcps_body_rossi($post_id)
232
 
233
  $wcps_thumb_url = $wcps_thumb['0'];
234
 
 
 
 
 
 
 
235
  $currency = get_woocommerce_currency_symbol();
236
 
237
 
@@ -258,7 +266,7 @@ function wcps_body_rossi($post_id)
258
  $wcps_body.= '
259
  <div class="wcps-items" >
260
 
261
- <div style="max-height:'.$wcps_items_thumb_max_hieght.';" class="wcps-items-thumb"><a href="'.get_permalink().'"><img src="'.$wcps_thumb_url.'" /></a>';
262
 
263
  if($wcps_featured=="yes")
264
  {
@@ -288,8 +296,8 @@ function wcps_body_rossi($post_id)
288
  $("#wcps-'.$post_id.'").owlCarousel({
289
 
290
  items : '.$wcps_column_number.', //10 items above 1000px browser width
291
- itemsDesktop : [1000,5], //5 items between 1000px and 901px
292
- itemsDesktopSmall : [900,3], // betweem 900px and 601px
293
  itemsTablet: [600,2], //2 items between 600 and 0
294
  itemsMobile : [479,'.$wcps_column_number_mobile.'],
295
  navigationText : ["",""],
41
  $wcps_items_thumb_size = get_post_meta( $post_id, 'wcps_items_thumb_size', true );
42
  $wcps_items_thumb_max_hieght = get_post_meta( $post_id, 'wcps_items_thumb_max_hieght', true );
43
 
44
+ $wcps_items_empty_thumb = get_post_meta( $post_id, 'wcps_items_empty_thumb', true );
45
+
46
  $wcps_ribbon_name = 'none';
47
 
48
 
234
 
235
  $wcps_thumb_url = $wcps_thumb['0'];
236
 
237
+ if(empty($wcps_thumb_url))
238
+ {
239
+ $wcps_thumb_url = $wcps_items_empty_thumb;
240
+ }
241
+
242
+
243
  $currency = get_woocommerce_currency_symbol();
244
 
245
 
266
  $wcps_body.= '
267
  <div class="wcps-items" >
268
 
269
+ <div style="max-height:'.$wcps_items_thumb_max_hieght.';" class="wcps-items-thumb"><a href="'.get_permalink().'"><img alt="'.get_the_title().'" src="'.$wcps_thumb_url.'" /></a>';
270
 
271
  if($wcps_featured=="yes")
272
  {
296
  $("#wcps-'.$post_id.'").owlCarousel({
297
 
298
  items : '.$wcps_column_number.', //10 items above 1000px browser width
299
+ itemsDesktop : [1000,'.$wcps_column_number.'], //5 items between 1000px and 901px
300
+ itemsDesktopSmall : [900,2], // betweem 900px and 601px
301
  itemsTablet: [600,2], //2 items between 600 and 0
302
  itemsMobile : [479,'.$wcps_column_number_mobile.'],
303
  navigationText : ["",""],
woocommerce-products-slider.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Woocommerce Products Slider
4
  Plugin URI: http://paratheme.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.2
7
  Author: paratheme
8
  Author URI: http://paratheme.com
9
  License: GPLv2 or later
@@ -38,7 +38,7 @@ function wcps_init_scripts()
38
  wp_enqueue_script('jquery');
39
  wp_enqueue_script('wcps_js', plugins_url( '/js/scripts.js' , __FILE__ ) , array( 'jquery' ));
40
 
41
- wp_localize_script('wcps_js', 'wcps_ajax', array( 'wcps_ajaxurl' => admin_url( 'admin-ajax.php')));
42
  wp_enqueue_style('wcps_style', wcps_plugin_url.'css/style.css');
43
 
44
  wp_enqueue_script('owl.carousel', plugins_url( '/js/owl.carousel.js' , __FILE__ ) , array( 'jquery' ));
@@ -57,23 +57,13 @@ function wcps_init_scripts()
57
  // Style for themes
58
  wp_enqueue_style('wcps-style-flat', wcps_plugin_url.'themes/flat/style.css');
59
  wp_enqueue_style('wcps-style-rossi', wcps_plugin_url.'themes/rossi/style.css');
60
- wp_enqueue_style('wcps-style-saiga', wcps_plugin_url.'themes/saiga/style.css');
61
- wp_enqueue_style('wcps-style-sako', wcps_plugin_url.'themes/sako/style.css');
62
- wp_enqueue_style('wcps-style-ruger', wcps_plugin_url.'themes/ruger/style.css');
63
- wp_enqueue_style('wcps-style-anti-ruger', wcps_plugin_url.'themes/anti-ruger/style.css');
64
-
65
- //Style for font
66
- wp_register_style( 'Raleway', 'http://fonts.googleapis.com/css?family=Raleway:900');
67
- wp_enqueue_style( 'Raleway' );
68
-
69
 
70
-
71
  }
72
  add_action("init","wcps_init_scripts");
73
 
74
 
75
-
76
-
77
 
78
 
79
 
@@ -82,7 +72,7 @@ register_activation_hook(__FILE__, 'wcps_activation');
82
 
83
  function wcps_activation()
84
  {
85
- $wcps_version= "1.2";
86
  update_option('wcps_version', $wcps_version); //update plugin version.
87
 
88
  $wcps_customer_type= "free"; //customer_type "free"
3
  Plugin Name: Woocommerce Products Slider
4
  Plugin URI: http://paratheme.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.3
7
  Author: paratheme
8
  Author URI: http://paratheme.com
9
  License: GPLv2 or later
38
  wp_enqueue_script('jquery');
39
  wp_enqueue_script('wcps_js', plugins_url( '/js/scripts.js' , __FILE__ ) , array( 'jquery' ));
40
 
41
+ //wp_localize_script('wcps_js', 'wcps_ajax', array( 'wcps_ajaxurl' => admin_url( 'admin-ajax.php')));
42
  wp_enqueue_style('wcps_style', wcps_plugin_url.'css/style.css');
43
 
44
  wp_enqueue_script('owl.carousel', plugins_url( '/js/owl.carousel.js' , __FILE__ ) , array( 'jquery' ));
57
  // Style for themes
58
  wp_enqueue_style('wcps-style-flat', wcps_plugin_url.'themes/flat/style.css');
59
  wp_enqueue_style('wcps-style-rossi', wcps_plugin_url.'themes/rossi/style.css');
 
 
 
 
 
 
 
 
 
60
 
 
61
  }
62
  add_action("init","wcps_init_scripts");
63
 
64
 
65
+ // to work upload button on user profile
66
+ add_action( 'admin_enqueue_scripts', 'wp_enqueue_media' );
67
 
68
 
69
 
72
 
73
  function wcps_activation()
74
  {
75
+ $wcps_version= "1.3";
76
  update_option('wcps_version', $wcps_version); //update plugin version.
77
 
78
  $wcps_customer_type= "free"; //customer_type "free"