YITH WooCommerce Zoom Magnifier - Version 1.2.27

Version Description

Download this release

Release Info

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

Code changes from version 1.2.26 to 1.2.27

README.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
- Tested up to: 4.7.2
7
- Stable tag: 1.2.26
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -51,6 +51,10 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
51
 
52
  == Changelog ==
53
 
 
 
 
 
54
  = Version 1.2.26 - Released: Mar 28, 2017 =
55
 
56
  * Fix: YITH Plugin Framework initialization that prevents the plugin update.
3
  Contributors: yithemes
4
  Tags: zoom, magnifier, woocommerce, product image, themes, yit, e-commerce, shop, thumbnail, thumbnail slider, zoom image, carousel, image carousel
5
  Requires at least: 3.5.1
6
+ Tested up to: 4.7.3
7
+ Stable tag: 1.2.27
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
51
 
52
  == Changelog ==
53
 
54
+ = Version 1.2.27 - Released: Apr 05, 2017 =
55
+
56
+ * Fix: Variation images not shown properly.
57
+
58
  = Version 1.2.26 - Released: Mar 28, 2017 =
59
 
60
  * Fix: YITH Plugin Framework initialization that prevents the plugin update.
assets/js/frontend.js CHANGED
@@ -8,7 +8,7 @@ jQuery(document).ready(function ($) {
8
 
9
  var yith_wcmg = $('.images');
10
  var yith_wcmg_zoom = $('.yith_magnifier_zoom');
11
- var yith_wcmg_image = $('.yith_magnifier_zoom img');
12
 
13
  var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
14
  var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
@@ -20,8 +20,16 @@ jQuery(document).ready(function ($) {
20
  yith_wcmg.yith_magnifier(yith_magnifier_options);
21
 
22
  $(document).on('found_variation', 'form.variations_form', function (event, variation) {
 
23
  var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
24
- var image_src = variation.image_src ? variation.image_src : yith_wcmg_default_image;
 
 
 
 
 
 
 
25
 
26
  yith_wcmg_zoom.attr('href', image_magnifier);
27
  yith_wcmg_image.attr('src', image_src);
@@ -45,4 +53,6 @@ jQuery(document).ready(function ($) {
45
 
46
  yith_wcmg.yith_magnifier(yith_magnifier_options);
47
  });
 
 
48
  });
8
 
9
  var yith_wcmg = $('.images');
10
  var yith_wcmg_zoom = $('.yith_magnifier_zoom');
11
+ var yith_wcmg_image = $('.yith_magnifier_zoom img').first();
12
 
13
  var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
14
  var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
20
  yith_wcmg.yith_magnifier(yith_magnifier_options);
21
 
22
  $(document).on('found_variation', 'form.variations_form', function (event, variation) {
23
+
24
  var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
25
+
26
+ var image_src = yith_wcmg_default_image;
27
+ if (ywzm_data.wc_before_3_0 && variation.image_src) {
28
+ image_src = variation.image_src;
29
+ }
30
+ else if (variation.image.src) {
31
+ image_src = variation.image.src;
32
+ }
33
 
34
  yith_wcmg_zoom.attr('href', image_magnifier);
35
  yith_wcmg_image.attr('src', image_src);
53
 
54
  yith_wcmg.yith_magnifier(yith_magnifier_options);
55
  });
56
+
57
+ $('form.variations_form .variations select').trigger('change');
58
  });
assets/js/frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(i){var t=i(".images"),r=i(".yith_magnifier_zoom"),a=i(".yith_magnifier_zoom img"),e=t.find(".yith_magnifier_zoom").attr("href"),n=t.find(".yith_magnifier_zoom img").attr("src");return"undefined"==typeof yith_magnifier_options?!1:(t.yith_magnifier(yith_magnifier_options),void i(document).on("found_variation","form.variations_form",function(i,o){var m=o.image_magnifier?o.image_magnifier:e,f=o.image_src?o.image_src:n;r.attr("href",m),a.attr("src",f),a.attr("srcset",f),a.attr("src-orig",f),t.data("yith_magnifier")&&t.yith_magnifier("destroy"),t.yith_magnifier(yith_magnifier_options)}).on("reset_image",function(i){r.attr("href",e),a.attr("src",n),a.attr("srcset",n),a.attr("src-orig",n),t.data("yith_magnifier")&&t.yith_magnifier("destroy"),t.yith_magnifier(yith_magnifier_options)}))});
1
+ jQuery(document).ready(function(a){var b=a(".images"),c=a(".yith_magnifier_zoom"),d=a(".yith_magnifier_zoom img").first(),e=b.find(".yith_magnifier_zoom").attr("href"),f=b.find(".yith_magnifier_zoom img").attr("src");if("undefined"==typeof yith_magnifier_options)return!1;b.yith_magnifier(yith_magnifier_options),a(document).on("found_variation","form.variations_form",function(a,g){var h=g.image_magnifier?g.image_magnifier:e,i=f;ywzm_data.wc_before_3_0&&g.image_src?i=g.image_src:g.image.src&&(i=g.image.src),c.attr("href",h),d.attr("src",i),d.attr("srcset",i),d.attr("src-orig",i),b.data("yith_magnifier")&&b.yith_magnifier("destroy"),b.yith_magnifier(yith_magnifier_options)}).on("reset_image",function(a){c.attr("href",e),d.attr("src",f),d.attr("srcset",f),d.attr("src-orig",f),b.data("yith_magnifier")&&b.yith_magnifier("destroy"),b.yith_magnifier(yith_magnifier_options)}),a("form.variations_form .variations select").trigger("change")});
assets/js/ywzm_frontend.js ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * frontend.js
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Zoom Magnifier
6
+ */
7
+ jQuery(document).ready(function ($) {
8
+
9
+ var yith_wcmg = $('.images');
10
+ var yith_wcmg_zoom = $('.yith_magnifier_zoom');
11
+ var yith_wcmg_image = $('.yith_magnifier_zoom img').first();
12
+
13
+ var yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href');
14
+ var yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
15
+
16
+ if( typeof yith_magnifier_options == 'undefined' ) {
17
+ return false;
18
+ }
19
+
20
+ yith_wcmg.yith_magnifier(yith_magnifier_options);
21
+
22
+ $(document).on('found_variation', 'form.variations_form', function (event, variation) {
23
+
24
+ var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
25
+
26
+ var image_src = yith_wcmg_default_image;
27
+ if (ywzm_data.wc_before_3_0 && variation.image_src) {
28
+ image_src = variation.image_src;
29
+ }
30
+ else if (variation.image.src) {
31
+ image_src = variation.image.src;
32
+ }
33
+
34
+ yith_wcmg_zoom.attr('href', image_magnifier);
35
+ yith_wcmg_image.attr('src', image_src);
36
+ yith_wcmg_image.attr('srcset', image_src);
37
+ yith_wcmg_image.attr('src-orig', image_src);
38
+
39
+ if (yith_wcmg.data('yith_magnifier')) {
40
+ yith_wcmg.yith_magnifier('destroy');
41
+ }
42
+
43
+ yith_wcmg.yith_magnifier(yith_magnifier_options);
44
+ }).on('reset_image', function (event) {
45
+ yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
46
+ yith_wcmg_image.attr('src', yith_wcmg_default_image);
47
+ yith_wcmg_image.attr('srcset', yith_wcmg_default_image);
48
+ yith_wcmg_image.attr('src-orig', yith_wcmg_default_image);
49
+
50
+ if (yith_wcmg.data('yith_magnifier')) {
51
+ yith_wcmg.yith_magnifier('destroy');
52
+ }
53
+
54
+ yith_wcmg.yith_magnifier(yith_magnifier_options);
55
+ });
56
+
57
+ $('form.variations_form .variations select').trigger('change');
58
+ });
assets/js/ywzm_frontend.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){var b=a(".images"),c=a(".yith_magnifier_zoom"),d=a(".yith_magnifier_zoom img").first(),e=b.find(".yith_magnifier_zoom").attr("href"),f=b.find(".yith_magnifier_zoom img").attr("src");if("undefined"==typeof yith_magnifier_options)return!1;b.yith_magnifier(yith_magnifier_options),a(document).on("found_variation","form.variations_form",function(a,g){var h=g.image_magnifier?g.image_magnifier:e,i=f;ywzm_data.wc_before_3_0&&g.image_src?i=g.image_src:g.image.src&&(i=g.image.src),c.attr("href",h),d.attr("src",i),d.attr("srcset",i),d.attr("src-orig",i),b.data("yith_magnifier")&&b.yith_magnifier("destroy"),b.yith_magnifier(yith_magnifier_options)}).on("reset_image",function(a){c.attr("href",e),d.attr("src",f),d.attr("srcset",f),d.attr("src-orig",f),b.data("yith_magnifier")&&b.yith_magnifier("destroy"),b.yith_magnifier(yith_magnifier_options)}),a("form.variations_form .variations select").trigger("change")});
class.yith-wcmg-frontend.php CHANGED
@@ -8,158 +8,161 @@
8
  */
9
 
10
  if ( ! defined ( 'YITH_WCMG' ) ) {
11
- exit;
12
  } // Exit if accessed directly
13
 
14
  if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the Frontend behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCMG_Frontend {
22
-
23
-
24
- /**
25
- * Constructor
26
- *
27
- * @access public
28
- * @since 1.0.0
29
- */
30
- public function __construct ( ) {
31
-
32
- // add the action only when the loop is initializate
33
- add_action ( 'template_redirect', array ( $this, 'render' ) );
34
- }
35
-
36
- public function render () {
37
- if ( yith_wcmg_is_enabled () && ! apply_filters ( 'yith_wczm_featured_video_enabled', false ) ) {
38
- //change the templates
39
- remove_action ( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
40
- remove_action ( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
41
- add_action ( 'woocommerce_before_single_product_summary', array ( $this, 'show_product_images' ), 20 );
42
- add_action ( 'woocommerce_product_thumbnails', array ( $this, 'show_product_thumbnails' ), 20 );
43
-
44
- //custom styles and javascripts
45
- add_action ( 'wp_enqueue_scripts', array ( $this, 'enqueue_styles_scripts' ) );
46
-
47
- //add attributes to product variations
48
- add_filter ( 'woocommerce_available_variation', array ( $this, 'available_variation' ), 10, 3 );
49
- }
50
- }
51
-
52
-
53
- /**
54
- * Change product-single.php template
55
- *
56
- * @access public
57
- * @return void
58
- * @since 1.0.0
59
- */
60
- public function show_product_images () {
61
-
62
- /** FIX WOO 2.1 */
63
- $wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
64
- $wc_get_template( 'single-product/product-image-magnifier.php', array (), '', YITH_YWZM_DIR . 'templates/' );
65
- }
66
-
67
-
68
- /**
69
- * Change product-thumbnails.php template
70
- *
71
- * @access public
72
- * @return void
73
- * @since 1.0.0
74
- */
75
- public function show_product_thumbnails () {
76
-
77
- /** FIX WOO 2.1 */
78
- $wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
79
-
80
- $wc_get_template( 'single-product/product-thumbnails-magnifier.php', array (), '', YITH_YWZM_DIR . 'templates/' );
81
- }
82
-
83
-
84
- /**
85
- * Enqueue styles and scripts
86
- *
87
- * @access public
88
- * @return void
89
- * @since 1.0.0
90
- */
91
- public function enqueue_styles_scripts () {
92
- global $post;
93
-
94
- $suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
95
-
96
- wp_register_script ( 'yith-magnifier-slider',
97
- YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix . '.js',
98
- array (
99
- 'jquery',
100
- 'jquery-migrate',
101
- ),
102
- YITH_YWZM_VERSION,
103
- true );
104
-
105
- wp_register_script ( 'yith-magnifier',
106
- YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js',
107
- array ( 'jquery' ),
108
- YITH_YWZM_VERSION,
109
- true );
110
-
111
- wp_register_script ( 'yith_wcmg_frontend',
112
- YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js',
113
- array (
114
- 'jquery',
115
- 'yith-magnifier',
116
- ),
117
- YITH_YWZM_VERSION,
118
- true );
119
-
120
- wp_register_style ( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
121
-
122
- if ( is_product () || ( ! empty( $post->post_content ) && strstr ( $post->post_content, '[product_page' ) ) ) {
123
- wp_enqueue_script ( 'yith-magnifier-slider' );
124
- wp_enqueue_script ( 'yith-magnifier' );
125
- wp_enqueue_script ( 'yith_wcmg_frontend' );
126
-
127
- wp_enqueue_style ( 'yith-magnifier' );
128
-
129
- $css = file_exists ( get_stylesheet_directory () . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri () . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
130
- wp_enqueue_style ( 'yith_wcmg_frontend', $css );
131
- /*
132
- $append_text_css = '.yith_magnifier_zoom_wrap::after {
133
- content: "' . __ ( "Roll over image to zoom in", "yith-woocommerce-zoom-magnifier" ) . '";
134
- margin: 0 auto;
135
- display: inline-block;
136
- text-align:center;
137
- font-size: 10px;
138
- }
139
- ';
140
-
141
- wp_add_inline_style ( 'yith_wcmg_frontend', $append_text_css );
142
- */
143
- }
144
- }
145
-
146
-
147
- /**
148
- * Add attributes to product variations
149
- *
150
- * @access public
151
- * @return void
152
- * @since 1.0.0
153
- */
154
- public function available_variation ( $data, $wc_prod, $variation ) {
155
-
156
- $attachment_id = get_post_thumbnail_id ( version_compare ( WC ()->version, '3.0', '<' ) ? $variation->get_variation_id () : $variation->get_id () );
157
- $attachment = wp_get_attachment_image_src ( $attachment_id, 'shop_magnifier' );
158
-
159
- $data[ 'image_magnifier' ] = $attachment ? current ( $attachment ) : '';
160
-
161
- return $data;
162
- }
163
-
164
- }
 
 
 
165
  }
8
  */
9
 
10
  if ( ! defined ( 'YITH_WCMG' ) ) {
11
+ exit;
12
  } // Exit if accessed directly
13
 
14
  if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the Frontend behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCMG_Frontend {
22
+
23
+
24
+ /**
25
+ * Constructor
26
+ *
27
+ * @access public
28
+ * @since 1.0.0
29
+ */
30
+ public function __construct() {
31
+
32
+ // add the action only when the loop is initializate
33
+ add_action ( 'template_redirect', array( $this, 'render' ) );
34
+ }
35
+
36
+ public function render() {
37
+ if ( yith_wcmg_is_enabled () && ! apply_filters ( 'yith_wczm_featured_video_enabled', false ) ) {
38
+ //change the templates
39
+ remove_action ( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
40
+ remove_action ( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
41
+ add_action ( 'woocommerce_before_single_product_summary', array( $this, 'show_product_images' ), 20 );
42
+ add_action ( 'woocommerce_product_thumbnails', array( $this, 'show_product_thumbnails' ), 20 );
43
+
44
+ //custom styles and javascripts
45
+ add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
46
+
47
+ //add attributes to product variations
48
+ add_filter ( 'woocommerce_available_variation', array( $this, 'available_variation' ), 10, 3 );
49
+ }
50
+ }
51
+
52
+
53
+ /**
54
+ * Change product-single.php template
55
+ *
56
+ * @access public
57
+ * @return void
58
+ * @since 1.0.0
59
+ */
60
+ public function show_product_images() {
61
+
62
+ /** FIX WOO 2.1 */
63
+ $wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
64
+ $wc_get_template( 'single-product/product-image-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
65
+ }
66
+
67
+
68
+ /**
69
+ * Change product-thumbnails.php template
70
+ *
71
+ * @access public
72
+ * @return void
73
+ * @since 1.0.0
74
+ */
75
+ public function show_product_thumbnails() {
76
+
77
+ /** FIX WOO 2.1 */
78
+ $wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
79
+
80
+ $wc_get_template( 'single-product/product-thumbnails-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
81
+ }
82
+
83
+
84
+ /**
85
+ * Enqueue styles and scripts
86
+ *
87
+ * @access public
88
+ * @return void
89
+ * @since 1.0.0
90
+ */
91
+ public function enqueue_styles_scripts() {
92
+ global $post;
93
+
94
+ $suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
95
+
96
+ wp_register_script ( 'ywzm-magnifier-slider',
97
+ YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'jquery.carouFredSel.js' ),
98
+ array(
99
+ 'jquery',
100
+ 'jquery-migrate',
101
+ ),
102
+ '6.2.1',
103
+ true );
104
+
105
+ wp_register_script ( 'ywzm-magnifier',
106
+ YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'yith_magnifier.js' ),
107
+ array( 'jquery' ),
108
+ YITH_YWZM_VERSION,
109
+ true );
110
+
111
+ wp_register_script ( 'ywzm_frontend',
112
+ YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'ywzm_frontend.js' ),
113
+ array(
114
+ 'jquery',
115
+ 'ywzm-magnifier',
116
+ ),
117
+ YITH_YWZM_VERSION,
118
+ true );
119
+
120
+ wp_register_style ( 'ywzm-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
121
+
122
+ if ( is_product () || ( ! empty( $post->post_content ) && strstr ( $post->post_content, '[product_page' ) ) ) {
123
+
124
+ wp_localize_script ( 'ywzm_frontend',
125
+ 'ywzm_data', array(
126
+ 'wc_before_3_0' => version_compare ( WC ()->version, '3.0', '<' ),
127
+ )
128
+ );
129
+
130
+ // Enqueue PrettyPhoto style and script
131
+ $wc_assets_path = str_replace ( array( 'http:', 'https:' ), '', WC ()->plugin_url () ) . '/assets/';
132
+
133
+ // Enqueue scripts
134
+ wp_enqueue_script ( 'prettyPhoto', $wc_assets_path . 'js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), '3.1.6', true );
135
+ wp_enqueue_script ( 'ywzm-magnifier-slider' );
136
+ wp_enqueue_script ( 'ywzm-magnifier' );
137
+ wp_enqueue_script ( 'ywzm_frontend' );
138
+
139
+ // Enqueue Style
140
+ $css = file_exists ( get_stylesheet_directory () . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri () . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
141
+ wp_enqueue_style ( 'ywzm-prettyPhoto', $wc_assets_path . 'css/prettyPhoto.css' );
142
+ wp_enqueue_style ( 'ywzm-magnifier' );
143
+ wp_enqueue_style ( 'ywzm_frontend', $css );
144
+ }
145
+ }
146
+
147
+
148
+ /**
149
+ * Add attributes to product variations
150
+ *
151
+ * @param array $data
152
+ * @param WC_Product_Variable $wc_prod
153
+ * @param WC_Product_Variation $variation
154
+ *
155
+ * @return mixed
156
+ */
157
+ public function available_variation( $data, $wc_prod, $variation ) {
158
+
159
+ $attachment_id = get_post_thumbnail_id ( version_compare ( WC ()->version, '3.0', '<' ) ? $variation->get_variation_id () : $variation->get_id () );
160
+ $attachment = wp_get_attachment_image_src ( $attachment_id, 'shop_magnifier' );
161
+
162
+ $data['image_magnifier'] = $attachment ? current ( $attachment ) : '';
163
+
164
+ return $data;
165
+ }
166
+
167
+ }
168
  }
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
- * Version: 1.2.26
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.26
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -76,7 +76,7 @@ if ( ! function_exists ( 'yith_plugin_registration_hook' ) ) {
76
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
77
 
78
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
79
- defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.2.26' );
80
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
81
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
82
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
+ * Version: 1.2.27
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-zoom-magnifier
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.27
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
76
  register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
77
 
78
  defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
79
+ defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.2.27' );
80
  defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
81
  defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
82
  defined ( 'YITH_YWZM_URL' ) || define ( 'YITH_YWZM_URL', plugins_url ( '/', __FILE__ ) );
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 2.9.58
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.62
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -114,7 +114,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
114
  if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ){
115
  $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
116
  // YITH Plugins text must not be translated
117
- current_user_can( 'manage_options' ) && add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
118
  }
119
  }
120
 
114
  if( ! isset( $admin_page_hooks['yit_plugin_panel'] ) ){
115
  $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
116
  // YITH Plugins text must not be translated
117
+ apply_filters('yit_plugin_panel_menu_page_capability', current_user_can( 'manage_options' )) && add_menu_page( 'yit_plugin_panel', 'YITH Plugins', 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
118
  }
119
  }
120
 
plugin-fw/yit-woocommerce-compatibility.php CHANGED
@@ -179,6 +179,8 @@ if ( !function_exists( 'yit_return_new_attribute_map' ) ) {
179
  '_order_date' => '_date_created',
180
  'order_date' => 'date_created',
181
  'order_total' => 'total',
 
 
182
  /* Products */
183
  'visibility' => 'catalog_visibility',
184
  '_visibility' => '_catalog_visibility',
@@ -186,6 +188,12 @@ if ( !function_exists( 'yit_return_new_attribute_map' ) ) {
186
  '_sale_price_dates_from' => '_date_on_sale_from',
187
  'sale_price_dates_to' => 'date_on_sale_to',
188
  '_sale_price_dates_to' => '_date_on_sale_to',
 
 
 
 
 
 
189
  );
190
  }
191
  }
@@ -680,7 +688,7 @@ if ( !function_exists( 'yit_datetime_to_timestamp' ) ) {
680
  */
681
  function yit_datetime_to_timestamp( $date ) {
682
 
683
- if ( version_compare( WC()->version, '2.7.0', '<' ) ) {
684
  $date = strtotime( $date );
685
  }
686
 
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',
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',
194
+ 'exclude_product_categories' => 'excluded_product_categories',
195
+ 'customer_email' => 'email_restrictions',
196
+ 'expiry_date' => 'date_expires',
197
  );
198
  }
199
  }
688
  */
689
  function yit_datetime_to_timestamp( $date ) {
690
 
691
+ if ( ! is_int( $date ) ) {
692
  $date = strtotime( $date );
693
  }
694
 
templates/single-product/product-thumbnails-magnifier.php CHANGED
@@ -14,8 +14,6 @@ global $post, $product, $woocommerce;
14
  $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
15
 
16
  $attachment_ids = version_compare(WC()->version, '3.0.0', '<') ? $product->get_gallery_attachment_ids() : $product->get_gallery_image_ids();
17
-
18
-
19
  if ( ! empty( $attachment_ids ) ) array_unshift( $attachment_ids, get_post_thumbnail_id() );
20
 
21
  // make sure attachments ids are unique
@@ -63,4 +61,4 @@ if ( $attachment_ids ) {
63
  </div>
64
  <?php
65
  }
66
- ?>
14
  $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
15
 
16
  $attachment_ids = version_compare(WC()->version, '3.0.0', '<') ? $product->get_gallery_attachment_ids() : $product->get_gallery_image_ids();
 
 
17
  if ( ! empty( $attachment_ids ) ) array_unshift( $attachment_ids, get_post_thumbnail_id() );
18
 
19
  // make sure attachments ids are unique
61
  </div>
62
  <?php
63
  }
64
+ ?>