YITH WooCommerce Zoom Magnifier - Version 1.1.4

Version Description

  • Tweak: WooCommerce 2.2. support
  • Fixed: Placeholder in product without featured image
  • Fixed: Slider items number options doesn't work
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Zoom Magnifier
Version 1.1.4
Comparing to
See all releases

Code changes from version 1.1.3 to 1.1.4

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 4.0
7
- Stable tag: 1.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -70,6 +70,12 @@ The size of the Zoom Image is automatically setted. If you want to change these
70
 
71
  == Changelog ==
72
 
 
 
 
 
 
 
73
  = 1.1.3 =
74
 
75
  * Added: Support to WC 2.2.2
4
  Tags: zoom, magnifier, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 4.0
7
+ Stable tag: 1.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
70
 
71
  == Changelog ==
72
 
73
+ = 1.1.4 =
74
+
75
+ * Tweak: WooCommerce 2.2. support
76
+ * Fixed: Placeholder in product without featured image
77
+ * Fixed: Slider items number options doesn't work
78
+
79
  = 1.1.3 =
80
 
81
  * Added: Support to WC 2.2.2
class.yith-wcmg-admin.php CHANGED
@@ -440,6 +440,7 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
440
  foreach ( $this->options as $section ) {
441
  foreach ( $section as $value ) {
442
  if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
 
443
  if ( $value['type'] == 'image_width' ) {
444
  add_option( $value['id'] . '_width', $value['std'] );
445
  add_option( $value['id'] . '_height', $value['std'] );
@@ -447,6 +448,19 @@ if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
447
  else {
448
  add_option( $value['id'], $value['std'] );
449
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  }
451
  }
452
  }
440
  foreach ( $this->options as $section ) {
441
  foreach ( $section as $value ) {
442
  if ( isset( $value['std'] ) && isset( $value['id'] ) ) {
443
+
444
  if ( $value['type'] == 'image_width' ) {
445
  add_option( $value['id'] . '_width', $value['std'] );
446
  add_option( $value['id'] . '_height', $value['std'] );
448
  else {
449
  add_option( $value['id'], $value['std'] );
450
  }
451
+
452
+ /* fix item number slider */
453
+
454
+ if($value['id']=='yith_wcmg_slider_items'){
455
+
456
+ $current_value = get_option( 'yith_wcmg_slider_items' );
457
+
458
+ if ( ! isset( $current_value ) || $current_value == null || $current_value === false || ! is_numeric( $current_value ) ) {
459
+ update_option( 'yith_wcmg_slider_items', $value['std'] );
460
+ }
461
+
462
+ }
463
+
464
  }
465
  }
466
  }
class.yith-wcmg.php CHANGED
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
22
  * @var string
23
  * @since 1.0.0
24
  */
25
- public $version = '1.1.3';
26
 
27
  /**
28
  * Plugin object
22
  * @var string
23
  * @since 1.0.0
24
  */
25
+ public $version = '1.1.4';
26
 
27
  /**
28
  * Plugin object
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
6
- * Version: 1.1.3
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images.
6
+ * Version: 1.1.4
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
templates/single-product/product-image-magnifier.php CHANGED
@@ -11,7 +11,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
  global $post, $woocommerce, $product, $is_IE;
13
 
14
- $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
 
 
 
 
 
15
  ?>
16
  <div class="images<?php if($is_IE): ?> ie<?php endif ?>">
17
 
@@ -23,8 +28,6 @@ $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
23
  $image_link = wp_get_attachment_url( get_post_thumbnail_id() );
24
  list( $magnifier_url, $magnifier_width, $magnifier_height ) = wp_get_attachment_image_src( get_post_thumbnail_id(), "shop_magnifier" );
25
 
26
- $placeholder = function_exists('wc_placeholder_img_src') ? wc_placeholder_img_src() : woocommerce_placeholder_img_src();
27
-
28
  echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="yith_magnifier_zoom woocommerce-main-image" title="%s">%s</a>', $magnifier_url, $image_title, $image ), $post->ID );
29
 
30
  } else {
@@ -65,7 +68,7 @@ $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
65
  },
66
  items : {
67
  //width: <?php echo yit_shop_thumbnail_w() + 4 ?>,
68
- visible: <?php echo apply_filters( 'woocommerce_product_thumbnails_columns', get_option( 'yith_wcmg_slider_items', 3 ) ) ?>
69
  }
70
  },
71
 
11
 
12
  global $post, $woocommerce, $product, $is_IE;
13
 
14
+ $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
15
+ $placeholder = function_exists('wc_placeholder_img_src') ? wc_placeholder_img_src() : woocommerce_placeholder_img_src();
16
+
17
+ $slider_items = get_option( 'yith_wcmg_slider_items', 3 );
18
+ if ( !isset($slider_items) || ( $slider_items == null ) ) $slider_items = 3;
19
+
20
  ?>
21
  <div class="images<?php if($is_IE): ?> ie<?php endif ?>">
22
 
28
  $image_link = wp_get_attachment_url( get_post_thumbnail_id() );
29
  list( $magnifier_url, $magnifier_width, $magnifier_height ) = wp_get_attachment_image_src( get_post_thumbnail_id(), "shop_magnifier" );
30
 
 
 
31
  echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="yith_magnifier_zoom woocommerce-main-image" title="%s">%s</a>', $magnifier_url, $image_title, $image ), $post->ID );
32
 
33
  } else {
68
  },
69
  items : {
70
  //width: <?php echo yit_shop_thumbnail_w() + 4 ?>,
71
+ visible: <?php echo apply_filters( 'woocommerce_product_thumbnails_columns', $slider_items ) ?>
72
  }
73
  },
74
 
templates/single-product/product-thumbnails-magnifier.php CHANGED
@@ -24,6 +24,8 @@ if ( $attachment_ids ) {
24
  $loop = 0;
25
  $columns = apply_filters( 'woocommerce_product_thumbnails_columns', get_option( 'yith_wcmg_slider_items', 3 ) );
26
 
 
 
27
  foreach ( $attachment_ids as $attachment_id ) {
28
  $classes = array( 'yith_magnifier_thumbnail' );
29
 
24
  $loop = 0;
25
  $columns = apply_filters( 'woocommerce_product_thumbnails_columns', get_option( 'yith_wcmg_slider_items', 3 ) );
26
 
27
+ if( !isset( $columns ) || $columns == null ) $columns = 3;
28
+
29
  foreach ( $attachment_ids as $attachment_id ) {
30
  $classes = array( 'yith_magnifier_thumbnail' );
31