YITH WooCommerce Quick View - Version 1.3.14

Version Description

Released 28 October 2019

  • New: Support for WooCommerce 3.8
  • New: Support for WordPress 5.3
  • Update: Plugin framework
  • Fix: fatal error (Uncaught Error: Call to undefined function curl_init() )
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Quick View
Version 1.3.14
Comparing to
See all releases

Code changes from version 1.3.12 to 1.3.14

Files changed (116) hide show
  1. README.txt +251 -238
  2. assets/css/yith-quick-view.css +155 -155
  3. assets/js/frontend.js +184 -184
  4. assets/js/frontend.min.js +7 -7
  5. includes/class.yith-wcqv-admin.php +230 -230
  6. includes/class.yith-wcqv-frontend.php +393 -393
  7. includes/class.yith-wcqv.php +156 -156
  8. init.php +134 -134
  9. languages/yith-woocommerce-quick-view-it_IT.po +585 -585
  10. languages/yith-woocommerce-quick-view.pot +274 -274
  11. plugin-fw/assets/css/admin.css +196 -196
  12. plugin-fw/assets/css/codemirror/codemirror.css +260 -260
  13. plugin-fw/assets/css/colorbox.css +65 -65
  14. plugin-fw/assets/css/metaboxes.css +720 -720
  15. plugin-fw/assets/css/yit-plugin-panel.css +482 -482
  16. plugin-fw/assets/css/yit-upgrade-to-pro.css +76 -76
  17. plugin-fw/assets/css/yit-upgrader.css +21 -21
  18. plugin-fw/assets/css/yith-fields.css +2157 -2114
  19. plugin-fw/assets/css/yith-select2-no-wc.css +740 -740
  20. plugin-fw/assets/js/codemirror/codemirror.js +5799 -5799
  21. plugin-fw/assets/js/codemirror/javascript.js +630 -630
  22. plugin-fw/assets/js/how-to.js +6 -6
  23. plugin-fw/assets/js/how-to.min.js +1 -1
  24. plugin-fw/assets/js/jquery.colorbox.js +1104 -1104
  25. plugin-fw/assets/js/jquery.colorbox.min.js +33 -33
  26. plugin-fw/assets/js/metabox.js +137 -137
  27. plugin-fw/assets/js/metabox.min.js +7 -7
  28. plugin-fw/assets/js/multisite-updater.js +222 -222
  29. plugin-fw/assets/js/yit-cpt-unlimited.js +79 -78
  30. plugin-fw/assets/js/yit-cpt-unlimited.min.js +2 -2
  31. plugin-fw/assets/js/yit-plugin-panel.js +151 -151
  32. plugin-fw/assets/js/yit-plugin-panel.min.js +7 -7
  33. plugin-fw/assets/js/yit-wp-pointer.js +82 -82
  34. plugin-fw/assets/js/yit-wp-pointer.min.js +6 -6
  35. plugin-fw/assets/js/yith-colorpicker.min.js +11 -0
  36. plugin-fw/assets/js/yith-enhanced-select-wc-2.6.js +147 -147
  37. plugin-fw/assets/js/yith-enhanced-select-wc-2.6.min.js +5 -5
  38. plugin-fw/assets/js/yith-enhanced-select.js +197 -197
  39. plugin-fw/assets/js/yith-fields.js +705 -702
  40. plugin-fw/assets/js/yith-fields.min.js +25 -1
  41. plugin-fw/init.php +126 -126
  42. plugin-fw/languages/yith-plugin-fw-es_ES.po +1314 -1314
  43. plugin-fw/languages/yith-plugin-fw-it_IT.po +1380 -1380
  44. plugin-fw/languages/yith-plugin-fw.pot +878 -878
  45. plugin-fw/lib/yit-ajax.php +265 -265
  46. plugin-fw/lib/yit-assets.php +102 -99
  47. plugin-fw/lib/yit-cpt-unlimited.php +1780 -1774
  48. plugin-fw/lib/yit-debug.php +269 -269
  49. plugin-fw/lib/yit-icons.php +1144 -1144
  50. plugin-fw/lib/yit-metabox.php +671 -671
  51. plugin-fw/lib/yit-plugin-common.php +1259 -1259
  52. plugin-fw/lib/yit-plugin-gradients.php +535 -535
  53. plugin-fw/lib/yit-plugin-panel-wc.php +658 -651
  54. plugin-fw/lib/yit-plugin-panel.php +1046 -1046
  55. plugin-fw/lib/yit-plugin-subpanel.php +175 -175
  56. plugin-fw/lib/yit-pointers.php +389 -389
  57. plugin-fw/lib/yit-upgrade.php +100 -100
  58. plugin-fw/lib/yit-video.php +205 -205
  59. plugin-fw/lib/yith-system-status.php +37 -15
  60. plugin-fw/templates/fields/ajax-posts.php +109 -109
  61. plugin-fw/templates/fields/ajax-products.php +23 -23
  62. plugin-fw/templates/fields/ajax-terms.php +131 -131
  63. plugin-fw/templates/fields/buttons.php +27 -27
  64. plugin-fw/templates/fields/checkbox.php +28 -28
  65. plugin-fw/templates/fields/colorpicker.php +32 -32
  66. plugin-fw/templates/fields/customtabs.php +150 -150
  67. plugin-fw/templates/fields/datepicker.php +24 -24
  68. plugin-fw/templates/fields/hidden.php +29 -29
  69. plugin-fw/templates/fields/html.php +16 -16
  70. plugin-fw/templates/fields/icons.php +63 -63
  71. plugin-fw/templates/fields/image-gallery.php +40 -40
  72. plugin-fw/templates/fields/number.php +35 -35
  73. plugin-fw/templates/fields/onoff.php +26 -26
  74. plugin-fw/templates/fields/preview.php +17 -17
  75. plugin-fw/templates/fields/resources/select2-wc-2.6.php +31 -31
  76. plugin-fw/templates/fields/resources/select2.php +43 -43
  77. plugin-fw/templates/fields/select-buttons.php +44 -44
  78. plugin-fw/templates/fields/select-images.php +51 -51
  79. plugin-fw/templates/fields/select-mailchimp.php +30 -30
  80. plugin-fw/templates/fields/select.php +47 -47
  81. plugin-fw/templates/fields/sep.php +13 -13
  82. plugin-fw/templates/fields/sidebarlist.php +28 -28
  83. plugin-fw/templates/fields/sidebars.php +62 -62
  84. plugin-fw/templates/fields/simple-text.php +19 -19
  85. plugin-fw/templates/fields/slider.php +27 -27
  86. plugin-fw/templates/fields/text-array.php +28 -28
  87. plugin-fw/templates/fields/text-button.php +49 -49
  88. plugin-fw/templates/fields/text.php +27 -27
  89. plugin-fw/templates/fields/textarea-codemirror.php +25 -25
  90. plugin-fw/templates/fields/textarea-editor.php +37 -37
  91. plugin-fw/templates/fields/textarea.php +25 -25
  92. plugin-fw/templates/fields/title.php +16 -16
  93. plugin-fw/templates/fields/toggle-element.php +6 -5
  94. plugin-fw/templates/fields/upload.php +28 -28
  95. plugin-fw/templates/metaboxes/field-row.php +44 -44
  96. plugin-fw/templates/metaboxes/tab.php +112 -112
  97. plugin-fw/templates/metaboxes/types/icon-list.php +136 -136
  98. plugin-fw/templates/panel/infobox.php +35 -35
  99. plugin-fw/templates/panel/panel-field-container.php +41 -41
  100. plugin-fw/templates/panel/woocommerce/woocommerce-form.php +21 -21
  101. plugin-fw/templates/panel/woocommerce/woocommerce-option-row.php +33 -33
  102. plugin-fw/templates/panel/woocommerce/woocommerce-panel.php +15 -15
  103. plugin-fw/templates/panel/woocommerce/woocommerce-upload.php +59 -59
  104. plugin-fw/templates/sysinfo/system-information-panel.php +41 -12
  105. plugin-fw/yit-deactive-plugin.php +34 -34
  106. plugin-fw/yit-functions.php +1389 -1389
  107. plugin-fw/yit-plugin-registration-hook.php +23 -23
  108. plugin-fw/yit-plugin.php +237 -237
  109. plugin-fw/yit-woocommerce-compatibility.php +739 -739
  110. plugin-options/premium-options.php +9 -9
  111. plugin-options/settings-options.php +96 -96
  112. templates/admin/premium.php +372 -372
  113. templates/yith-quick-view-content.php +28 -28
  114. templates/yith-quick-view.php +29 -29
  115. uninstall.php +13 -13
  116. wpml-config.xml +4 -4
README.txt CHANGED
@@ -1,239 +1,252 @@
1
- === Plugin Name ===
2
- Contributors: yithemes
3
- Tags: woocommerce, quick view, woocommerce quick view, products quick view
4
- Requires at least: 4.0
5
- Tested up to: 5.2
6
- Stable tag: 1.3.12
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
- This plugin adds the possibility to have a quick preview of the products right from product list
11
-
12
- == Description ==
13
- Sometimes the halfway is better: what if you are looking to a product in a list and its image is still too small?
14
-
15
- You have to open its product page, waiting for its loading and finally observe what you are interested into.
16
- So why don't use a simple way to look immediately at the product's distinctiveness? Here it is what Quick View can offer you.
17
-
18
- People are more attracted to what they can see clearly. And often the classic product lists are not enough to understand the real value of a product.
19
- That's when Quick View strikes successfully! Your clients will be free to look in a better way your products, reading also a small description with all the most important features and qualities you want to underline.
20
- In this way, they will be more focused on what they really want and they will proceed easily to the purchase step.
21
-
22
- **Main features:**
23
-
24
- * Add a button in product loop to open a modal window with the product summary using ajax
25
- * Choose to enable the prettyPhoto lightbox for images in quick view
26
- * Customize style of modal
27
-
28
-
29
- Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woocommerce-quick-view/).
30
-
31
- == Installation ==
32
-
33
- 1. Unzip the downloaded zip file.
34
- 2. Upload the plugin folder into the `wp-content/plugins/` directory of your WordPress site.
35
- 3. Activate `YITH WooCommerce Quick View` from Plugins page.
36
-
37
- == Screenshots ==
38
-
39
- 1. The plugin admin page.
40
- 2. The quick view button in shop page.
41
- 3. The quick view modal.
42
-
43
- == Changelog ==
44
-
45
- = 1.3.12 = Released Jul 31 - 2019
46
-
47
- * New: Support to WooCommerce 3.7.0 RC1
48
- * New: Plugin admin panel style
49
- * Update: Plugin Core
50
-
51
- = 1.3.11 = Released Jun 12 - 2019
52
-
53
- * Update: Plugin Core
54
-
55
- = 1.3.10 = Released Jun 11 - 2019
56
-
57
- * New: Support to WooCommerce 3.6.4
58
- * New: Support to WordPress 5.2.1
59
- * Update: Plugin Core
60
-
61
- = 1.3.9 = Released Apr 23 - 2019
62
-
63
- * New: Support to WooCommerce 3.6.1
64
- * Update: Plugin Core
65
-
66
- = 1.3.8 = Released Apr 02 - 2019
67
-
68
- * New: Support to WooCommerce 3.6.0 RC1
69
- * Update: Plugin Core
70
- * Fix: Style issue on Storefront theme
71
-
72
- = 1.3.7 = Released Feb 21 - 2019
73
-
74
- * New: Support to WooCommerce 3.5.5
75
- * New: Support to WordPress 5.1.0
76
- * Update: Plugin Core
77
- * Fix: Conflict with YITH WooCommerce Gift Card form in checkout page
78
-
79
- = 1.3.6 = Released Dec 06 - 2018
80
-
81
- * New: Support to WooCommerce 3.5.2
82
- * New: Support to WordPress 5.0.0
83
- * Update: Plugin Core
84
-
85
- = 1.3.5 = Released Oct 24 - 2018
86
-
87
- * New: Support to WooCommerce 3.5.0
88
- * Update: Plugin Core
89
-
90
- = 1.3.4 = Released Oct 05 - 2018
91
-
92
- * New: Support to WooCommerce 3.5.0 RC1
93
- * New: Compatibility with YITH WooCommerce Gift Card
94
- * Update: Plugin Core
95
-
96
- = 1.3.3 = Released Sep 27 - 2018
97
-
98
- * Update: Plugin Core
99
- * Dev: New filter "yith_wcqv_show_quick_view_button"
100
-
101
- = 1.3.2 = Released Sep 12 - 2018
102
-
103
- * New: Support to WooCommerce 3.4.5
104
- * New: Support to WordPress 4.9.8
105
- * Update: Plugin Core
106
- * Fix: Now is possible use shortcode [yith_quick_view] without specify the "product_id" parameter
107
-
108
- = 1.3.1 = Released May 30 - 2018
109
-
110
- * New: Support to WooCommerce 3.4.0
111
- * New: Support to WordPress 4.9.6
112
- * Update: Plugin Core
113
- * Fix: Product image zoom in Quick View modal
114
- * Fix: Removed redirect to single product page after add to cart
115
- * Fix: WPML compatibility issue
116
-
117
- = 1.3.0 = Released Feb 01 - 2018
118
-
119
- * New: Support to WooCommerce 3.3.0
120
- * New: Support to WordPress 4.9.2
121
- * Update: Plugin Core
122
-
123
- = 1.2.2 = Released Oct 11 - 2017
124
-
125
- * New: Support to WooCommerce 3.2.0 RC2
126
- * New: Support to WordPress 4.8.2
127
- * Fix: Compatibility issue with YITH WooCommerce Product Bundles
128
- * Update: Plugin Core
129
-
130
- = 1.2.1 = Released Apr 05 - 2017
131
-
132
- * Fix: Compatibility issue with YITH WooCommerce Wishlist
133
- * Update: Plugin Core
134
-
135
- = 1.2.0 = Released Mar 31 - 2017
136
-
137
- * New: Support to WordPress 4.7.3
138
- * New: Support to WooCommerce 3.0.0 RC2
139
- * New: Shortcode [yith_quick_view product_id="" label=""] for print "quick view" button of specified product
140
- * Update: Plugin Core
141
-
142
- = 1.1.4 = Released Oct 24 - 2016
143
-
144
- * Fix: Status code 404 for "Quick View" on single product page
145
-
146
- = 1.1.3 = Released Oct 20 - 2016
147
-
148
- * New: Support to WooCommerce 2.6.5
149
- * New: Support to WordPress 4.6.1
150
- * Update: Plugin Core.
151
- * Fix: Responsive style.
152
- * Fix: Add inline css using WordPress function wp_add_inline_style.
153
-
154
- = 1.1.2 = Released Jun 10 - 2016
155
-
156
- * New: Added minimized js files. Plugin loads full files version if the constant "SCRIPT_DEBUG" is defined and is true.
157
- * New: Support to WooCommerce 2.6 RC1
158
- * Update: Plugin Core
159
-
160
- = 1.1.1 = Released Apr 18 - 2016
161
-
162
- * New: Compatibility with WordPress 4.5
163
- * Update: Plugin Core
164
-
165
- = 1.1.0 = Released Oct 30 - 2015
166
-
167
- * New: Compatibility with YITH WooCommerce Wishlist
168
- * New: Compatibility with YITH WooCommerce Badge Management
169
- * New: Italian Language
170
- * Update: Language file .pot. Changed textdomain to yith-wcqv to yith-woocommerce-quick-view
171
- * Update: Plugin Core
172
-
173
- = 1.0.8 = Released Aug 24 - 2015
174
-
175
- * Fix: Main template issue
176
-
177
- = 1.0.7 = Released Aug 21 - 2015
178
-
179
- * New: Compatibility with Wordpress 4.3
180
- * New: WPML config xml
181
- * Update: Language file .pot
182
- * Fix: Default variation select
183
-
184
- = 1.0.6 = Released Aug 12 - 2015
185
-
186
- * Update: Plugin Core
187
-
188
- = 1.0.5 = Released Aug 11 - 2015
189
-
190
- * New: Compatibility with WooCommerce 2.4
191
- * Update: Plugin Core
192
- * Update: Language file
193
-
194
- = 1.0.4 = Released May 18 - 2015
195
-
196
- * New option for enable quick view also in mobile device
197
- * Compatibility with Wordpress 4.2.2
198
- * Minor bug fix
199
- * Update Plugin Core
200
- * Update Language file
201
-
202
- = 1.0.3 = Released Mar 11 - 2015
203
-
204
- * Minor bug fix
205
- * Update Plugin Core
206
-
207
- = 1.0.2 = Released Mar 06 - 2015
208
-
209
- * New: Action yith_quick_view_custom_style_scripts
210
- * New: Filter 'yith_quick_view_loader_gif
211
-
212
- = 1.0.1 = Released Feb 26 - 2015
213
-
214
- * Minor bug fix
215
-
216
- = 1.0.0 = Released Feb 17 - 2015
217
-
218
- * Initial release
219
-
220
- == Suggestions ==
221
-
222
- If you have suggestions about how to improve YITH WooCommerce Quick View, you can [write us](mailto:plugins@yithemes.com "Your Inspiration Themes") so we can bundle them into YITH WooCommerce Quick View.
223
-
224
- == Translators ==
225
-
226
- = Available Languages =
227
- * English
228
- * Italian
229
-
230
- If you can't find this plugin in your language and want to translate it, use the dedicated tool at [Translating WordPress](https://translate.wordpress.org/locale/it/default/wp-plugins/yith-woocommerce-quick-view "Translating WordPress").
231
- Or, if you have created your own language pack, or have an update for an existing one, you can send it as an email attachment from our [Contacts page](http://yithemes.com/contact/ "Your Inspiration Themes") and we will bundle into YITH WooCommerce Quick View.
232
-
233
- == Upgrade notice ==
234
-
235
- = 1.3.12 = Released Jul 31 - 2019
236
-
237
- * New: Support to WooCommerce 3.7.0 RC1
238
- * New: Plugin admin panel style
239
* Update: Plugin Core
1
+ === Plugin Name ===
2
+ Contributors: yithemes
3
+ Tags: woocommerce, quick view, woocommerce quick view, products quick view
4
+ Requires at least: 4.0
5
+ Tested up to: 5.3
6
+ Stable tag: 1.3.14
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ This plugin adds the possibility to have a quick preview of the products right from product list
11
+
12
+ == Description ==
13
+ Sometimes the halfway is better: what if you are looking to a product in a list and its image is still too small?
14
+
15
+ You have to open its product page, waiting for its loading and finally observe what you are interested into.
16
+ So why don't use a simple way to look immediately at the product's distinctiveness? Here it is what Quick View can offer you.
17
+
18
+ People are more attracted to what they can see clearly. And often the classic product lists are not enough to understand the real value of a product.
19
+ That's when Quick View strikes successfully! Your clients will be free to look in a better way your products, reading also a small description with all the most important features and qualities you want to underline.
20
+ In this way, they will be more focused on what they really want and they will proceed easily to the purchase step.
21
+
22
+ **Main features:**
23
+
24
+ * Add a button in product loop to open a modal window with the product summary using ajax
25
+ * Choose to enable the prettyPhoto lightbox for images in quick view
26
+ * Customize style of modal
27
+
28
+
29
+ Full documentation is available [here](http://yithemes.com/docs-plugins/yith-woocommerce-quick-view/).
30
+
31
+ == Installation ==
32
+
33
+ 1. Unzip the downloaded zip file.
34
+ 2. Upload the plugin folder into the `wp-content/plugins/` directory of your WordPress site.
35
+ 3. Activate `YITH WooCommerce Quick View` from Plugins page.
36
+
37
+ == Screenshots ==
38
+
39
+ 1. The plugin admin page.
40
+ 2. The quick view button in shop page.
41
+ 3. The quick view modal.
42
+
43
+ == Changelog ==
44
+
45
+ = 1.3.14 = Released 28 October 2019
46
+
47
+ * New: Support for WooCommerce 3.8
48
+ * New: Support for WordPress 5.3
49
+ * Update: Plugin framework
50
+ * Fix: fatal error (Uncaught Error: Call to undefined function curl_init() )
51
+
52
+ = 1.3.13 = Released 26 August 2019
53
+
54
+ * Update: plugin core
55
+ * Fix: fatal error (Uncaught Error: Call to undefined function curl_init() )
56
+
57
+
58
+ = 1.3.12 = Released 31 July 2019
59
+
60
+ * New: Support to WooCommerce 3.7.0 RC1
61
+ * New: Plugin admin panel style
62
+ * Update: Plugin Core
63
+
64
+ = 1.3.11 = Released 12 June 2019
65
+
66
+ * Update: Plugin Core
67
+
68
+ = 1.3.10 = Released 11 June 2019
69
+
70
+ * New: Support to WooCommerce 3.6.4
71
+ * New: Support to WordPress 5.2.1
72
+ * Update: Plugin Core
73
+
74
+ = 1.3.9 = Released 23 April 2019
75
+
76
+ * New: Support to WooCommerce 3.6.1
77
+ * Update: Plugin Core
78
+
79
+ = 1.3.8 = Released 02 April 2019
80
+
81
+ * New: Support to WooCommerce 3.6.0 RC1
82
+ * Update: Plugin Core
83
+ * Fix: Style issue on Storefront theme
84
+
85
+ = 1.3.7 = Released 21 February 2019
86
+
87
+ * New: Support to WooCommerce 3.5.5
88
+ * New: Support to WordPress 5.1.0
89
+ * Update: Plugin Core
90
+ * Fix: Conflict with YITH WooCommerce Gift Card form in checkout page
91
+
92
+ = 1.3.6 = Released 06 December 2018
93
+
94
+ * New: Support to WooCommerce 3.5.2
95
+ * New: Support to WordPress 5.0.0
96
+ * Update: Plugin Core
97
+
98
+ = 1.3.5 = Released 24 October 2018
99
+
100
+ * New: Support to WooCommerce 3.5.0
101
+ * Update: Plugin Core
102
+
103
+ = 1.3.4 = Released 05 October 2018
104
+
105
+ * New: Support to WooCommerce 3.5.0 RC1
106
+ * New: Compatibility with YITH WooCommerce Gift Card
107
+ * Update: Plugin Core
108
+
109
+ = 1.3.3 = Released 27 September 2018
110
+
111
+ * Update: Plugin Core
112
+ * Dev: New filter "yith_wcqv_show_quick_view_button"
113
+
114
+ = 1.3.2 = Released 12 September 2018
115
+
116
+ * New: Support to WooCommerce 3.4.5
117
+ * New: Support to WordPress 4.9.8
118
+ * Update: Plugin Core
119
+ * Fix: Now is possible use shortcode [yith_quick_view] without specify the "product_id" parameter
120
+
121
+ = 1.3.1 = Released 30 May 2018
122
+
123
+ * New: Support to WooCommerce 3.4.0
124
+ * New: Support to WordPress 4.9.6
125
+ * Update: Plugin Core
126
+ * Fix: Product image zoom in Quick View modal
127
+ * Fix: Removed redirect to single product page after add to cart
128
+ * Fix: WPML compatibility issue
129
+
130
+ = 1.3.0 = Released 01 February 2018
131
+
132
+ * New: Support to WooCommerce 3.3.0
133
+ * New: Support to WordPress 4.9.2
134
+ * Update: Plugin Core
135
+
136
+ = 1.2.2 = Released 11 October 2017
137
+
138
+ * New: Support to WooCommerce 3.2.0 RC2
139
+ * New: Support to WordPress 4.8.2
140
+ * Fix: Compatibility issue with YITH WooCommerce Product Bundles
141
+ * Update: Plugin Core
142
+
143
+ = 1.2.1 = Released 05 April 2017
144
+
145
+ * Fix: Compatibility issue with YITH WooCommerce Wishlist
146
+ * Update: Plugin Core
147
+
148
+ = 1.2.0 = Released 31 March 2017
149
+
150
+ * New: Support to WordPress 4.7.3
151
+ * New: Support to WooCommerce 3.0.0 RC2
152
+ * New: Shortcode [yith_quick_view product_id="" label=""] for print "quick view" button of specified product
153
+ * Update: Plugin Core
154
+
155
+ = 1.1.4 = Released 24 October 2016
156
+
157
+ * Fix: Status code 404 for "Quick View" on single product page
158
+
159
+ = 1.1.3 = Released 20 October 2016
160
+
161
+ * New: Support to WooCommerce 2.6.5
162
+ * New: Support to WordPress 4.6.1
163
+ * Update: Plugin Core.
164
+ * Fix: Responsive style.
165
+ * Fix: Add inline css using WordPress function wp_add_inline_style.
166
+
167
+ = 1.1.2 = Released 10 June 2016
168
+
169
+ * New: Added minimized js files. Plugin loads full files version if the constant "SCRIPT_DEBUG" is defined and is true.
170
+ * New: Support to WooCommerce 2.6 RC1
171
+ * Update: Plugin Core
172
+
173
+ = 1.1.1 = Released 18 April 2016
174
+
175
+ * New: Compatibility with WordPress 4.5
176
+ * Update: Plugin Core
177
+
178
+ = 1.1.0 = Released 30 October 2015
179
+
180
+ * New: Compatibility with YITH WooCommerce Wishlist
181
+ * New: Compatibility with YITH WooCommerce Badge Management
182
+ * New: Italian Language
183
+ * Update: Language file .pot. Changed textdomain to yith-wcqv to yith-woocommerce-quick-view
184
+ * Update: Plugin Core
185
+
186
+ = 1.0.8 = Released 24 August 2015
187
+
188
+ * Fix: Main template issue
189
+
190
+ = 1.0.7 = Released 21 August 2015
191
+
192
+ * New: Compatibility with Wordpress 4.3
193
+ * New: WPML config xml
194
+ * Update: Language file .pot
195
+ * Fix: Default variation select
196
+
197
+ = 1.0.6 = Released 12 August 2015
198
+
199
+ * Update: Plugin Core
200
+
201
+ = 1.0.5 = Released 11 August 2015
202
+
203
+ * New: Compatibility with WooCommerce 2.4
204
+ * Update: Plugin Core
205
+ * Update: Language file
206
+
207
+ = 1.0.4 = Released 18 May 2015
208
+
209
+ * New option for enable quick view also in mobile device
210
+ * Compatibility with Wordpress 4.2.2
211
+ * Minor bug fix
212
+ * Update Plugin Core
213
+ * Update Language file
214
+
215
+ = 1.0.3 = Released 11 March 2015
216
+
217
+ * Minor bug fix
218
+ * Update Plugin Core
219
+
220
+ = 1.0.2 = Released 06 March 2015
221
+
222
+ * New: Action yith_quick_view_custom_style_scripts
223
+ * New: Filter 'yith_quick_view_loader_gif
224
+
225
+ = 1.0.1 = Released 26 February 2015
226
+
227
+ * Minor bug fix
228
+
229
+ = 1.0.0 = Released 17 February 2015
230
+
231
+ * Initial release
232
+
233
+ == Suggestions ==
234
+
235
+ If you have suggestions about how to improve YITH WooCommerce Quick View, you can [write us](mailto:plugins@yithemes.com "Your Inspiration Themes") so we can bundle them into YITH WooCommerce Quick View.
236
+
237
+ == Translators ==
238
+
239
+ = Available Languages =
240
+ * English
241
+ * Italian
242
+
243
+ If you can't find this plugin in your language and want to translate it, use the dedicated tool at [Translating WordPress](https://translate.wordpress.org/locale/it/default/wp-plugins/yith-woocommerce-quick-view "Translating WordPress").
244
+ Or, if you have created your own language pack, or have an update for an existing one, you can send it as an email attachment from our [Contacts page](http://yithemes.com/contact/ "Your Inspiration Themes") and we will bundle into YITH WooCommerce Quick View.
245
+
246
+ == Upgrade notice ==
247
+
248
+ = 1.3.12 = Released 31 Jul 2019
249
+
250
+ * New: Support to WooCommerce 3.7.0 RC1
251
+ * New: Plugin admin panel style
252
* Update: Plugin Core
assets/css/yith-quick-view.css CHANGED
@@ -1,156 +1,156 @@
1
- /*=======================
2
- * MODAL POPUP STYLE
3
- ========================*/
4
-
5
- html.yith-quick-view-is-open,
6
- html.yith-quick-view-is-open body {
7
- overflow: hidden;
8
- }
9
-
10
- #yith-quick-view-modal {
11
- position: fixed;
12
- visibility: hidden;
13
- top: 0;
14
- left: 0;
15
- right: 0;
16
- bottom: 0;
17
- z-index: 1400;
18
- opacity: 0;
19
- text-align: center;
20
- -webkit-transition: all 0.3s;
21
- -moz-transition: all 0.3s;
22
- transition: all 0.3s;
23
- }
24
-
25
- #yith-quick-view-modal:before {
26
- content: '';
27
- display: inline-block;
28
- vertical-align: middle;
29
- height: 100%;
30
- width: 0;
31
- }
32
-
33
- #yith-quick-view-modal .yith-quick-view-overlay {
34
- position: absolute;
35
- top: 0;
36
- right: 0;
37
- bottom: 0;
38
- left: 0;
39
- background: rgba( 0, 0, 0, 0.8);
40
- }
41
-
42
- #yith-quick-view-modal .yith-wcqv-wrapper {
43
- display: inline-block;
44
- vertical-align: middle;
45
- visibility: hidden;
46
- -webkit-backface-visibility: hidden;
47
- -moz-backface-visibility: hidden;
48
- backface-visibility: hidden;
49
- text-align: left;
50
- height: 600px;
51
- width: 1000px;
52
- }
53
-
54
- #yith-quick-view-modal .yith-wcqv-main {
55
- -webkit-transform: translateY(20%);
56
- -moz-transform: translateY(20%);
57
- -ms-transform: translateY(20%);
58
- transform: translateY(20%);
59
- opacity: 0;
60
- height: 100%;
61
- -webkit-transition: all 0.3s;
62
- -moz-transition: all 0.3s;
63
- transition: all 0.3s;
64
- -webkit-box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2);
65
- box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2);
66
- }
67
-
68
- #yith-quick-view-modal.open,
69
- #yith-quick-view-modal.open .yith-wcqv-wrapper {
70
- visibility: visible;
71
- opacity: 1;
72
- }
73
-
74
- #yith-quick-view-modal #yith-quick-view-content {
75
- height: 100%;
76
- }
77
-
78
- #yith-quick-view-modal .yith-wcqv-main:after,
79
- #yith-quick-view-modal .yith-wcqv-main:before {
80
- content: '';
81
- display: table;
82
- clear: both;
83
- }
84
- #yith-quick-view-modal.open .yith-wcqv-main {
85
- -webkit-transform: translateY(0);
86
- -moz-transform: translateY(0);
87
- -ms-transform: translateY(0);
88
- transform: translateY(0);
89
- opacity: 1;
90
- height: 100%;
91
- overflow-y: scroll;
92
- position: relative;
93
- }
94
- #yith-quick-view-close {
95
- border: 1px solid;
96
- position: absolute;
97
- top: 5px;
98
- right: 5px;
99
- width: 20px;
100
- height: 20px;
101
- text-align: center;
102
- line-height: 18px;
103
- z-index: 2;
104
- opacity: 0.5;
105
- }
106
- #yith-quick-view-close:hover {
107
- opacity: 1;
108
- transition: all 0.2s ease;
109
- -webkit-transition: all 0.2s ease;
110
- -moz-transition: all 0.2s ease;
111
- -ms-transition: all 0.2s ease;
112
- }
113
- #yith-quick-view-content div.images {
114
- width: 40%;
115
- float: left;
116
- opacity: 1 !important;
117
- margin: 0;
118
- }
119
- #yith-quick-view-content div.summary {
120
- margin: 0;
121
- padding: 15px;
122
- width: 60%;
123
- float: left;
124
- }
125
- #yith-quick-view-content div.woocommerce-product-rating:after,
126
- #yith-quick-view-content div.woocommerce-product-rating:before {
127
- content: '';
128
- display: table;
129
- clear: both;
130
- }
131
- #yith-quick-view-content div.woocommerce-product-rating a.woocommerce-review-link {
132
- display: none;
133
- }
134
- #yith-quick-view-content .onsale {
135
- top: 5px;
136
- right: auto;
137
- left: 5px;
138
- }
139
-
140
- li.product .yith-wcqv-button .blockUI.blockOverlay:before {
141
- background: none;
142
- }
143
-
144
- @media( max-width: 480px ) {
145
- #yith-quick-view-content div.images,
146
- #yith-quick-view-content div.summary {
147
- width: 100%;
148
- float: none;
149
- }
150
- #yith-quick-view-content div.summary {
151
- margin: 0;
152
- padding: 15px;
153
- width: 100%;
154
- float: left;
155
- }
156
}
1
+ /*=======================
2
+ * MODAL POPUP STYLE
3
+ ========================*/
4
+
5
+ html.yith-quick-view-is-open,
6
+ html.yith-quick-view-is-open body {
7
+ overflow: hidden;
8
+ }
9
+
10
+ #yith-quick-view-modal {
11
+ position: fixed;
12
+ visibility: hidden;
13
+ top: 0;
14
+ left: 0;
15
+ right: 0;
16
+ bottom: 0;
17
+ z-index: 1400;
18
+ opacity: 0;
19
+ text-align: center;
20
+ -webkit-transition: all 0.3s;
21
+ -moz-transition: all 0.3s;
22
+ transition: all 0.3s;
23
+ }
24
+
25
+ #yith-quick-view-modal:before {
26
+ content: '';
27
+ display: inline-block;
28
+ vertical-align: middle;
29
+ height: 100%;
30
+ width: 0;
31
+ }
32
+
33
+ #yith-quick-view-modal .yith-quick-view-overlay {
34
+ position: absolute;
35
+ top: 0;
36
+ right: 0;
37
+ bottom: 0;
38
+ left: 0;
39
+ background: rgba( 0, 0, 0, 0.8);
40
+ }
41
+
42
+ #yith-quick-view-modal .yith-wcqv-wrapper {
43
+ display: inline-block;
44
+ vertical-align: middle;
45
+ visibility: hidden;
46
+ -webkit-backface-visibility: hidden;
47
+ -moz-backface-visibility: hidden;
48
+ backface-visibility: hidden;
49
+ text-align: left;
50
+ height: 600px;
51
+ width: 1000px;
52
+ }
53
+
54
+ #yith-quick-view-modal .yith-wcqv-main {
55
+ -webkit-transform: translateY(20%);
56
+ -moz-transform: translateY(20%);
57
+ -ms-transform: translateY(20%);
58
+ transform: translateY(20%);
59
+ opacity: 0;
60
+ height: 100%;
61
+ -webkit-transition: all 0.3s;
62
+ -moz-transition: all 0.3s;
63
+ transition: all 0.3s;
64
+ -webkit-box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2);
65
+ box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.2);
66
+ }
67
+
68
+ #yith-quick-view-modal.open,
69
+ #yith-quick-view-modal.open .yith-wcqv-wrapper {
70
+ visibility: visible;
71
+ opacity: 1;
72
+ }
73
+
74
+ #yith-quick-view-modal #yith-quick-view-content {
75
+ height: 100%;
76
+ }
77
+
78
+ #yith-quick-view-modal .yith-wcqv-main:after,
79
+ #yith-quick-view-modal .yith-wcqv-main:before {
80
+ content: '';
81
+ display: table;
82
+ clear: both;
83
+ }
84
+ #yith-quick-view-modal.open .yith-wcqv-main {
85
+ -webkit-transform: translateY(0);
86
+ -moz-transform: translateY(0);
87
+ -ms-transform: translateY(0);
88
+ transform: translateY(0);
89
+ opacity: 1;
90
+ height: 100%;
91
+ overflow-y: scroll;
92
+ position: relative;
93
+ }
94
+ #yith-quick-view-close {
95
+ border: 1px solid;
96
+ position: absolute;
97
+ top: 5px;
98
+ right: 5px;
99
+ width: 20px;
100
+ height: 20px;
101
+ text-align: center;
102
+ line-height: 18px;
103
+ z-index: 2;
104
+ opacity: 0.5;
105
+ }
106
+ #yith-quick-view-close:hover {
107
+ opacity: 1;
108
+ transition: all 0.2s ease;
109
+ -webkit-transition: all 0.2s ease;
110
+ -moz-transition: all 0.2s ease;
111
+ -ms-transition: all 0.2s ease;
112
+ }
113
+ #yith-quick-view-content div.images {
114
+ width: 40%;
115
+ float: left;
116
+ opacity: 1 !important;
117
+ margin: 0;
118
+ }
119
+ #yith-quick-view-content div.summary {
120
+ margin: 0;
121
+ padding: 15px;
122
+ width: 60%;
123
+ float: left;
124
+ }
125
+ #yith-quick-view-content div.woocommerce-product-rating:after,
126
+ #yith-quick-view-content div.woocommerce-product-rating:before {
127
+ content: '';
128
+ display: table;
129
+ clear: both;
130
+ }
131
+ #yith-quick-view-content div.woocommerce-product-rating a.woocommerce-review-link {
132
+ display: none;
133
+ }
134
+ #yith-quick-view-content .onsale {
135
+ top: 5px;
136
+ right: auto;
137
+ left: 5px;
138
+ }
139
+
140
+ li.product .yith-wcqv-button .blockUI.blockOverlay:before {
141
+ background: none;
142
+ }
143
+
144
+ @media( max-width: 480px ) {
145
+ #yith-quick-view-content div.images,
146
+ #yith-quick-view-content div.summary {
147
+ width: 100%;
148
+ float: none;
149
+ }
150
+ #yith-quick-view-content div.summary {
151
+ margin: 0;
152
+ padding: 15px;
153
+ width: 100%;
154
+ float: left;
155
+ }
156
}
assets/js/frontend.js CHANGED
@@ -1,185 +1,185 @@
1
- /**
2
- * frontend.js
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Quick View
6
- * @version 1.0.0
7
- */
8
-
9
- jQuery(document).ready(function($){
10
- "use strict";
11
-
12
- if( typeof yith_qv === 'undefined' ) {
13
- return;
14
- }
15
-
16
- var qv_modal = $(document).find( '#yith-quick-view-modal' ),
17
- qv_overlay = qv_modal.find( '.yith-quick-view-overlay'),
18
- qv_content = qv_modal.find( '#yith-quick-view-content' ),
19
- qv_close = qv_modal.find( '#yith-quick-view-close' ),
20
- qv_wrapper = qv_modal.find( '.yith-wcqv-wrapper'),
21
- qv_wrapper_w = qv_wrapper.width(),
22
- qv_wrapper_h = qv_wrapper.height(),
23
- center_modal = function() {
24
-
25
- var window_w = $(window).width(),
26
- window_h = $(window).height(),
27
- width = ( ( window_w - 60 ) > qv_wrapper_w ) ? qv_wrapper_w : ( window_w - 60 ),
28
- height = ( ( window_h - 120 ) > qv_wrapper_h ) ? qv_wrapper_h : ( window_h - 120 );
29
-
30
- qv_wrapper.css({
31
- 'left' : (( window_w/2 ) - ( width/2 )),
32
- 'top' : (( window_h/2 ) - ( height/2 )),
33
- 'width' : width + 'px',
34
- 'height' : height + 'px'
35
- });
36
- };
37
-
38
-
39
- /*==================
40
- *MAIN BUTTON OPEN
41
- ==================*/
42
-
43
- $.fn.yith_quick_view = function() {
44
-
45
- $(document).off( 'click', '.yith-wcqv-button' ).on( 'click', '.yith-wcqv-button', function(e){
46
- e.preventDefault();
47
-
48
- var t = $(this),
49
- product_id = t.data( 'product_id' ),
50
- is_blocked = false;
51
-
52
- if ( typeof yith_qv.loader !== 'undefined' ) {
53
- is_blocked = true;
54
- t.block({
55
- message: null,
56
- overlayCSS : {
57
- background: '#fff url(' + yith_qv.loader + ') no-repeat center',
58
- opacity : 0.5,
59
- cursor : 'none'
60
- }
61
- });
62
-
63
- if( ! qv_modal.hasClass( 'loading' ) ) {
64
- qv_modal.addClass('loading');
65
- }
66
-
67
- // stop loader
68
- $(document).trigger( 'qv_loading' );
69
- }
70
- ajax_call( t, product_id, is_blocked );
71
- });
72
- };
73
-
74
- /*================
75
- * MAIN AJAX CALL
76
- ================*/
77
-
78
- var ajax_call = function( t, product_id, is_blocked ) {
79
-
80
- $.ajax({
81
- url: yith_qv.ajaxurl,
82
- data: {
83
- action: 'yith_load_product_quick_view',
84
- product_id: product_id,
85
- lang: yith_qv.lang
86
- },
87
- dataType: 'html',
88
- type: 'POST',
89
- success: function (data) {
90
-
91
- qv_content.html(data);
92
-
93
- // quantity fields for WC 2.2
94
- if (yith_qv.is2_2) {
95
- qv_content.find('div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)').addClass('buttons_added').append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');
96
- }
97
-
98
- // Variation Form
99
- var form_variation = qv_content.find('.variations_form');
100
- form_variation.each( function() {
101
- $( this ).wc_variation_form();
102
- // add Color and Label Integration
103
- if( typeof $.fn.yith_wccl !== 'undefined' ) {
104
- $(this).yith_wccl();
105
- }
106
- });
107
- form_variation.trigger( 'check_variations' );
108
- form_variation.trigger( 'reset_image' );
109
-
110
- // Init prettyPhoto
111
- if (typeof $.fn.prettyPhoto !== 'undefined') {
112
- qv_content.find("a[data-rel^='prettyPhoto'], a.zoom").prettyPhoto({
113
- hook: 'data-rel',
114
- social_tools: false,
115
- theme: 'pp_woocommerce',
116
- horizontal_padding: 20,
117
- opacity: 0.8,
118
- deeplinking: false
119
- });
120
- }
121
-
122
- if( typeof $.fn.wc_product_gallery !== 'undefined' ) {
123
- qv_content.find('.woocommerce-product-gallery').each(function () {
124
- $(this).wc_product_gallery();
125
- });
126
- }
127
-
128
- if (!qv_modal.hasClass('open')) {
129
- qv_modal.removeClass('loading').addClass('open');
130
- if (is_blocked)
131
- t.unblock();
132
- }
133
-
134
- // stop loader
135
- $(document).trigger('qv_loader_stop');
136
-
137
- }
138
- });
139
- };
140
-
141
- /*===================
142
- * CLOSE QUICK VIEW
143
- ===================*/
144
-
145
- var close_modal_qv = function() {
146
-
147
- // Close box by click overlay
148
- qv_overlay.on( 'click', function(e){
149
- close_qv();
150
- });
151
- // Close box with esc key
152
- $(document).keyup(function(e){
153
- if( e.keyCode === 27 )
154
- close_qv();
155
- });
156
- // Close box by click close button
157
- qv_close.on( 'click', function(e) {
158
- e.preventDefault();
159
- close_qv();
160
- });
161
-
162
- var close_qv = function() {
163
- qv_modal.removeClass('open').removeClass('loading');
164
-
165
- setTimeout(function () {
166
- qv_content.html('');
167
- }, 1000);
168
- }
169
- };
170
-
171
- close_modal_qv();
172
-
173
-
174
- center_modal();
175
- $( window ).on( 'resize', center_modal );
176
-
177
- // START
178
- $.fn.yith_quick_view();
179
-
180
- $( document ).on( 'yith_infs_adding_elem yith-wcan-ajax-filtered', function(){
181
- // RESTART
182
- $.fn.yith_quick_view();
183
- });
184
-
185
});
1
+ /**
2
+ * frontend.js
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Quick View
6
+ * @version 1.0.0
7
+ */
8
+
9
+ jQuery(document).ready(function($){
10
+ "use strict";
11
+
12
+ if( typeof yith_qv === 'undefined' ) {
13
+ return;
14
+ }
15
+
16
+ var qv_modal = $(document).find( '#yith-quick-view-modal' ),
17
+ qv_overlay = qv_modal.find( '.yith-quick-view-overlay'),
18
+ qv_content = qv_modal.find( '#yith-quick-view-content' ),
19
+ qv_close = qv_modal.find( '#yith-quick-view-close' ),
20
+ qv_wrapper = qv_modal.find( '.yith-wcqv-wrapper'),
21
+ qv_wrapper_w = qv_wrapper.width(),
22
+ qv_wrapper_h = qv_wrapper.height(),
23
+ center_modal = function() {
24
+
25
+ var window_w = $(window).width(),
26
+ window_h = $(window).height(),
27
+ width = ( ( window_w - 60 ) > qv_wrapper_w ) ? qv_wrapper_w : ( window_w - 60 ),
28
+ height = ( ( window_h - 120 ) > qv_wrapper_h ) ? qv_wrapper_h : ( window_h - 120 );
29
+
30
+ qv_wrapper.css({
31
+ 'left' : (( window_w/2 ) - ( width/2 )),
32
+ 'top' : (( window_h/2 ) - ( height/2 )),
33
+ 'width' : width + 'px',
34
+ 'height' : height + 'px'
35
+ });
36
+ };
37
+
38
+
39
+ /*==================
40
+ *MAIN BUTTON OPEN
41
+ ==================*/
42
+
43
+ $.fn.yith_quick_view = function() {
44
+
45
+ $(document).off( 'click', '.yith-wcqv-button' ).on( 'click', '.yith-wcqv-button', function(e){
46
+ e.preventDefault();
47
+
48
+ var t = $(this),
49
+ product_id = t.data( 'product_id' ),
50
+ is_blocked = false;
51
+
52
+ if ( typeof yith_qv.loader !== 'undefined' ) {
53
+ is_blocked = true;
54
+ t.block({
55
+ message: null,
56
+ overlayCSS : {
57
+ background: '#fff url(' + yith_qv.loader + ') no-repeat center',
58
+ opacity : 0.5,
59
+ cursor : 'none'
60
+ }
61
+ });
62
+
63
+ if( ! qv_modal.hasClass( 'loading' ) ) {
64
+ qv_modal.addClass('loading');
65
+ }
66
+
67
+ // stop loader
68
+ $(document).trigger( 'qv_loading' );
69
+ }
70
+ ajax_call( t, product_id, is_blocked );
71
+ });
72
+ };
73
+
74
+ /*================
75
+ * MAIN AJAX CALL
76
+ ================*/
77
+
78
+ var ajax_call = function( t, product_id, is_blocked ) {
79
+
80
+ $.ajax({
81
+ url: yith_qv.ajaxurl,
82
+ data: {
83
+ action: 'yith_load_product_quick_view',
84
+ product_id: product_id,
85
+ lang: yith_qv.lang
86
+ },
87
+ dataType: 'html',
88
+ type: 'POST',
89
+ success: function (data) {
90
+
91
+ qv_content.html(data);
92
+
93
+ // quantity fields for WC 2.2
94
+ if (yith_qv.is2_2) {
95
+ qv_content.find('div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)').addClass('buttons_added').append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');
96
+ }
97
+
98
+ // Variation Form
99
+ var form_variation = qv_content.find('.variations_form');
100
+ form_variation.each( function() {
101
+ $( this ).wc_variation_form();
102
+ // add Color and Label Integration
103
+ if( typeof $.fn.yith_wccl !== 'undefined' ) {
104
+ $(this).yith_wccl();
105
+ }
106
+ });
107
+ form_variation.trigger( 'check_variations' );
108
+ form_variation.trigger( 'reset_image' );
109
+
110
+ // Init prettyPhoto
111
+ if (typeof $.fn.prettyPhoto !== 'undefined') {
112
+ qv_content.find("a[data-rel^='prettyPhoto'], a.zoom").prettyPhoto({
113
+ hook: 'data-rel',
114
+ social_tools: false,
115
+ theme: 'pp_woocommerce',
116
+ horizontal_padding: 20,
117
+ opacity: 0.8,
118
+ deeplinking: false
119
+ });
120
+ }
121
+
122
+ if( typeof $.fn.wc_product_gallery !== 'undefined' ) {
123
+ qv_content.find('.woocommerce-product-gallery').each(function () {
124
+ $(this).wc_product_gallery();
125
+ });
126
+ }
127
+
128
+ if (!qv_modal.hasClass('open')) {
129
+ qv_modal.removeClass('loading').addClass('open');
130
+ if (is_blocked)
131
+ t.unblock();
132
+ }
133
+
134
+ // stop loader
135
+ $(document).trigger('qv_loader_stop');
136
+
137
+ }
138
+ });
139
+ };
140
+
141
+ /*===================
142
+ * CLOSE QUICK VIEW
143
+ ===================*/
144
+
145
+ var close_modal_qv = function() {
146
+
147
+ // Close box by click overlay
148
+ qv_overlay.on( 'click', function(e){
149
+ close_qv();
150
+ });
151
+ // Close box with esc key
152
+ $(document).keyup(function(e){
153
+ if( e.keyCode === 27 )
154
+ close_qv();
155
+ });
156
+ // Close box by click close button
157
+ qv_close.on( 'click', function(e) {
158
+ e.preventDefault();
159
+ close_qv();
160
+ });
161
+
162
+ var close_qv = function() {
163
+ qv_modal.removeClass('open').removeClass('loading');
164
+
165
+ setTimeout(function () {
166
+ qv_content.html('');
167
+ }, 1000);
168
+ }
169
+ };
170
+
171
+ close_modal_qv();
172
+
173
+
174
+ center_modal();
175
+ $( window ).on( 'resize', center_modal );
176
+
177
+ // START
178
+ $.fn.yith_quick_view();
179
+
180
+ $( document ).on( 'yith_infs_adding_elem yith-wcan-ajax-filtered', function(){
181
+ // RESTART
182
+ $.fn.yith_quick_view();
183
+ });
184
+
185
});
assets/js/frontend.min.js CHANGED
@@ -1,8 +1,8 @@
1
- /**
2
- * frontend.js
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Quick View
6
- * @version 1.0.0
7
- */
8
jQuery(document).ready(function(e){"use strict";if("undefined"!=typeof yith_qv){var a=e(document).find("#yith-quick-view-modal"),t=a.find(".yith-quick-view-overlay"),c=a.find("#yith-quick-view-content"),n=a.find("#yith-quick-view-close"),d=a.find(".yith-wcqv-wrapper"),u=d.width(),r=d.height(),i=function(){var t=e(window).width(),i=e(window).height(),n=u<t-60?u:t-60,o=r<i-120?r:i-120;d.css({left:t/2-n/2,top:i/2-o/2,width:n+"px",height:o+"px"})};e.fn.yith_quick_view=function(){e(document).off("click",".yith-wcqv-button").on("click",".yith-wcqv-button",function(t){t.preventDefault();var i=e(this),n=i.data("product_id"),o=!1;void 0!==yith_qv.loader&&(o=!0,i.block({message:null,overlayCSS:{background:"#fff url("+yith_qv.loader+") no-repeat center",opacity:.5,cursor:"none"}}),a.hasClass("loading")||a.addClass("loading"),e(document).trigger("qv_loading")),l(i,n,o)})};var l=function(n,t,o){e.ajax({url:yith_qv.ajaxurl,data:{action:"yith_load_product_quick_view",product_id:t,lang:yith_qv.lang},dataType:"html",type:"POST",success:function(t){c.html(t),yith_qv.is2_2&&c.find("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');var i=c.find(".variations_form");i.each(function(){e(this).wc_variation_form(),void 0!==e.fn.yith_wccl&&e(this).yith_wccl()}),i.trigger("check_variations"),i.trigger("reset_image"),void 0!==e.fn.prettyPhoto&&c.find("a[data-rel^='prettyPhoto'], a.zoom").prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1}),void 0!==e.fn.wc_product_gallery&&c.find(".woocommerce-product-gallery").each(function(){e(this).wc_product_gallery()}),a.hasClass("open")||(a.removeClass("loading").addClass("open"),o&&n.unblock()),e(document).trigger("qv_loader_stop")}})};!function(){t.on("click",function(t){i()}),e(document).keyup(function(t){27===t.keyCode&&i()}),n.on("click",function(t){t.preventDefault(),i()});var i=function(){a.removeClass("open").removeClass("loading"),setTimeout(function(){c.html("")},1e3)}}(),i(),e(window).on("resize",i),e.fn.yith_quick_view(),e(document).on("yith_infs_adding_elem yith-wcan-ajax-filtered",function(){e.fn.yith_quick_view()})}});
1
+ /**
2
+ * frontend.js
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Quick View
6
+ * @version 1.0.0
7
+ */
8
jQuery(document).ready(function(e){"use strict";if("undefined"!=typeof yith_qv){var a=e(document).find("#yith-quick-view-modal"),t=a.find(".yith-quick-view-overlay"),c=a.find("#yith-quick-view-content"),n=a.find("#yith-quick-view-close"),d=a.find(".yith-wcqv-wrapper"),u=d.width(),r=d.height(),i=function(){var t=e(window).width(),i=e(window).height(),n=u<t-60?u:t-60,o=r<i-120?r:i-120;d.css({left:t/2-n/2,top:i/2-o/2,width:n+"px",height:o+"px"})};e.fn.yith_quick_view=function(){e(document).off("click",".yith-wcqv-button").on("click",".yith-wcqv-button",function(t){t.preventDefault();var i=e(this),n=i.data("product_id"),o=!1;void 0!==yith_qv.loader&&(o=!0,i.block({message:null,overlayCSS:{background:"#fff url("+yith_qv.loader+") no-repeat center",opacity:.5,cursor:"none"}}),a.hasClass("loading")||a.addClass("loading"),e(document).trigger("qv_loading")),l(i,n,o)})};var l=function(n,t,o){e.ajax({url:yith_qv.ajaxurl,data:{action:"yith_load_product_quick_view",product_id:t,lang:yith_qv.lang},dataType:"html",type:"POST",success:function(t){c.html(t),yith_qv.is2_2&&c.find("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');var i=c.find(".variations_form");i.each(function(){e(this).wc_variation_form(),void 0!==e.fn.yith_wccl&&e(this).yith_wccl()}),i.trigger("check_variations"),i.trigger("reset_image"),void 0!==e.fn.prettyPhoto&&c.find("a[data-rel^='prettyPhoto'], a.zoom").prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1}),void 0!==e.fn.wc_product_gallery&&c.find(".woocommerce-product-gallery").each(function(){e(this).wc_product_gallery()}),a.hasClass("open")||(a.removeClass("loading").addClass("open"),o&&n.unblock()),e(document).trigger("qv_loader_stop")}})};!function(){t.on("click",function(t){i()}),e(document).keyup(function(t){27===t.keyCode&&i()}),n.on("click",function(t){t.preventDefault(),i()});var i=function(){a.removeClass("open").removeClass("loading"),setTimeout(function(){c.html("")},1e3)}}(),i(),e(window).on("resize",i),e.fn.yith_quick_view(),e(document).on("yith_infs_adding_elem yith-wcan-ajax-filtered",function(){e.fn.yith_quick_view()})}});
includes/class.yith-wcqv-admin.php CHANGED
@@ -1,231 +1,231 @@
1
- <?php
2
- /**
3
- * Admin class
4
- *
5
- * @author YITH
6
- * @package YITH WooCommerce Quick View
7
- * @version 1.1.1
8
- */
9
-
10
- if ( ! defined( 'YITH_WCQV' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCQV_Admin' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the admin behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCQV_Admin {
22
-
23
- /**
24
- * Single instance of the class
25
- *
26
- * @var \YITH_WCQV_Admin
27
- * @since 1.0.0
28
- */
29
- protected static $instance;
30
-
31
- /**
32
- * Plugin options
33
- *
34
- * @var array
35
- * @access public
36
- * @since 1.0.0
37
- */
38
- public $options = array();
39
-
40
- /**
41
- * Plugin version
42
- *
43
- * @var string
44
- * @since 1.0.0
45
- */
46
- public $version = YITH_WCQV_VERSION;
47
-
48
- /**
49
- * @var $_panel Panel Object
50
- */
51
- protected $_panel;
52
-
53
- /**
54
- * @var $_premium string Premium tab template file name
55
- */
56
- protected $_premium = 'premium.php';
57
-
58
- /**
59
- * @var string Premium version landing link
60
- */
61
- protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-quick-view/';
62
-
63
- /**
64
- * @var string Quick View panel page
65
- */
66
- protected $_panel_page = 'yith_wcqv_panel';
67
-
68
- /**
69
- * Returns single instance of the class
70
- *
71
- * @return \YITH_WCQV_Admin
72
- * @since 1.0.0
73
- */
74
- public static function get_instance(){
75
- if( is_null( self::$instance ) ){
76
- self::$instance = new self();
77
- }
78
-
79
- return self::$instance;
80
- }
81
-
82
- /**
83
- * Constructor
84
- *
85
- * @access public
86
- * @since 1.0.0
87
- */
88
- public function __construct() {
89
-
90
- // Add panel options
91
- add_action( 'admin_menu', array( $this, 'register_panel' ), 5) ;
92
-
93
- //Add action links
94
- add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCQV_DIR . '/' . basename( YITH_WCQV_FILE ) ), array( $this, 'action_links') );
95
- add_filter( 'yith_show_plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 5 );
96
-
97
- add_action( 'yith_quick_view_premium', array( $this, 'premium_tab' ) );
98
-
99
- // YITH WCQV Loaded
100
- do_action( 'yith_wcqv_loaded' );
101
-
102
- }
103
-
104
-
105
- /**
106
- * Action Links
107
- *
108
- * add the action links to plugin admin page
109
- *
110
- * @param $links | links plugin array
111
- *
112
- * @return mixed Array
113
- * @since 1.0
114
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
115
- * @return mixed
116
- * @use plugin_action_links_{$plugin_file_name}
117
- */
118
- public function action_links( $links ) {
119
- $links = yith_add_action_links( $links, $this->_panel_page, false );
120
- return $links;
121
- }
122
-
123
- /**
124
- * Add a panel under YITH Plugins tab
125
- *
126
- * @return void
127
- * @since 1.0
128
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
129
- * @use /Yit_Plugin_Panel class
130
- * @see plugin-fw/lib/yit-plugin-panel.php
131
- */
132
- public function register_panel() {
133
-
134
- if ( ! empty( $this->_panel ) ) {
135
- return;
136
- }
137
-
138
- $admin_tabs = array(
139
- 'settings' => __( 'Settings', 'yith-woocommerce-quick-view' ),
140
- 'premium' => __( 'Premium Version', 'yith-woocommerce-quick-view' ),
141
- );
142
-
143
- $args = array(
144
- 'create_menu_page' => true,
145
- 'parent_slug' => '',
146
- 'page_title' => _x( 'YITH WooCommerce Quick View', 'options page title', 'yith-woocommerce-quick-view' ),
147
- 'menu_title' => _x( 'Quick View', 'plugin menu title', 'yith-woocommerce-quick-view' ),
148
- 'capability' => 'manage_options',
149
- 'parent' => '',
150
- 'parent_page' => 'yith_plugin_panel',
151
- 'page' => $this->_panel_page,
152
- 'admin-tabs' => $admin_tabs,
153
- 'options-path' => YITH_WCQV_DIR . '/plugin-options',
154
- 'class' => yith_set_wrapper_class()
155
- );
156
-
157
-
158
- /* === Fixed: not updated theme === */
159
- if( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
160
- require_once( 'plugin-fw/lib/yit-plugin-panel-wc.php' );
161
- }
162
-
163
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
164
- }
165
-
166
- /**
167
- * Premium Tab Template
168
- *
169
- * Load the premium tab template on admin page
170
- *
171
- * @return void
172
- * @since 1.0
173
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
174
- * @return void
175
- */
176
- public function premium_tab() {
177
- $premium_tab_template = YITH_WCQV_TEMPLATE_PATH . '/admin/' . $this->_premium;
178
- if( file_exists( $premium_tab_template ) ) {
179
- include_once($premium_tab_template);
180
- }
181
-
182
- }
183
-
184
- /**
185
- * plugin_row_meta
186
- *
187
- * add the action links to plugin admin page
188
- *
189
- * @param $plugin_meta
190
- * @param $plugin_file
191
- * @param $plugin_data
192
- * @param $status
193
- *
194
- * @return Array
195
- * @since 1.0
196
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
197
- * @use plugin_row_meta
198
- */
199
- public function plugin_row_meta( $new_row_meta_args, $plugin_meta, $plugin_file, $plugin_data, $status ) {
200
- if ( defined( 'YITH_WCQV_INIT' ) && YITH_WCQV_INIT == $plugin_file ) {
201
- $new_row_meta_args['slug'] = YITH_WCQV_SLUG;
202
-
203
- if( defined( 'YITH_WCQV_PREMIUM' ) ){
204
- $new_row_meta_args['is_premium'] = true;
205
- }
206
- }
207
- return $new_row_meta_args;
208
- }
209
-
210
- /**
211
- * Get the premium landing uri
212
- *
213
- * @since 1.0.0
214
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
215
- * @return string The premium landing link
216
- */
217
- public function get_premium_landing_uri(){
218
- return $this->_premium_landing;
219
- }
220
-
221
- }
222
- }
223
- /**
224
- * Unique access to instance of YITH_WCQV_Admin class
225
- *
226
- * @return \YITH_WCQV_Admin
227
- * @since 1.0.0
228
- */
229
- function YITH_WCQV_Admin(){
230
- return YITH_WCQV_Admin::get_instance();
231
}
1
+ <?php
2
+ /**
3
+ * Admin class
4
+ *
5
+ * @author YITH
6
+ * @package YITH WooCommerce Quick View
7
+ * @version 1.1.1
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCQV' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCQV_Admin' ) ) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the admin behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCQV_Admin {
22
+
23
+ /**
24
+ * Single instance of the class
25
+ *
26
+ * @var \YITH_WCQV_Admin
27
+ * @since 1.0.0
28
+ */
29
+ protected static $instance;
30
+
31
+ /**
32
+ * Plugin options
33
+ *
34
+ * @var array
35
+ * @access public
36
+ * @since 1.0.0
37
+ */
38
+ public $options = array();
39
+
40
+ /**
41
+ * Plugin version
42
+ *
43
+ * @var string
44
+ * @since 1.0.0
45
+ */
46
+ public $version = YITH_WCQV_VERSION;
47
+
48
+ /**
49
+ * @var $_panel Panel Object
50
+ */
51
+ protected $_panel;
52
+
53
+ /**
54
+ * @var $_premium string Premium tab template file name
55
+ */
56
+ protected $_premium = 'premium.php';
57
+
58
+ /**
59
+ * @var string Premium version landing link
60
+ */
61
+ protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-quick-view/';
62
+
63
+ /**
64
+ * @var string Quick View panel page
65
+ */
66
+ protected $_panel_page = 'yith_wcqv_panel';
67
+
68
+ /**
69
+ * Returns single instance of the class
70
+ *
71
+ * @return \YITH_WCQV_Admin
72
+ * @since 1.0.0
73
+ */
74
+ public static function get_instance(){
75
+ if( is_null( self::$instance ) ){
76
+ self::$instance = new self();
77
+ }
78
+
79
+ return self::$instance;
80
+ }
81
+
82
+ /**
83
+ * Constructor
84
+ *
85
+ * @access public
86
+ * @since 1.0.0
87
+ */
88
+ public function __construct() {
89
+
90
+ // Add panel options
91
+ add_action( 'admin_menu', array( $this, 'register_panel' ), 5) ;
92
+
93
+ //Add action links
94
+ add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCQV_DIR . '/' . basename( YITH_WCQV_FILE ) ), array( $this, 'action_links') );
95
+ add_filter( 'yith_show_plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 5 );
96
+
97
+ add_action( 'yith_quick_view_premium', array( $this, 'premium_tab' ) );
98
+
99
+ // YITH WCQV Loaded
100
+ do_action( 'yith_wcqv_loaded' );
101
+
102
+ }
103
+
104
+
105
+ /**
106
+ * Action Links
107
+ *
108
+ * add the action links to plugin admin page
109
+ *
110
+ * @param $links | links plugin array
111
+ *
112
+ * @return mixed Array
113
+ * @since 1.0
114
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
115
+ * @return mixed
116
+ * @use plugin_action_links_{$plugin_file_name}
117
+ */
118
+ public function action_links( $links ) {
119
+ $links = yith_add_action_links( $links, $this->_panel_page, false );
120
+ return $links;
121
+ }
122
+
123
+ /**
124
+ * Add a panel under YITH Plugins tab
125
+ *
126
+ * @return void
127
+ * @since 1.0
128
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
129
+ * @use /Yit_Plugin_Panel class
130
+ * @see plugin-fw/lib/yit-plugin-panel.php
131
+ */
132
+ public function register_panel() {
133
+
134
+ if ( ! empty( $this->_panel ) ) {
135
+ return;
136
+ }
137
+
138
+ $admin_tabs = array(
139
+ 'settings' => __( 'Settings', 'yith-woocommerce-quick-view' ),
140
+ 'premium' => __( 'Premium Version', 'yith-woocommerce-quick-view' ),
141
+ );
142
+
143
+ $args = array(
144
+ 'create_menu_page' => true,
145
+ 'parent_slug' => '',
146
+ 'page_title' => _x( 'YITH WooCommerce Quick View', 'options page title', 'yith-woocommerce-quick-view' ),
147
+ 'menu_title' => _x( 'Quick View', 'plugin menu title', 'yith-woocommerce-quick-view' ),
148
+ 'capability' => 'manage_options',
149
+ 'parent' => '',
150
+ 'parent_page' => 'yith_plugin_panel',
151
+ 'page' => $this->_panel_page,
152
+ 'admin-tabs' => $admin_tabs,
153
+ 'options-path' => YITH_WCQV_DIR . '/plugin-options',
154
+ 'class' => yith_set_wrapper_class()
155
+ );
156
+
157
+
158
+ /* === Fixed: not updated theme === */
159
+ if( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
160
+ require_once( 'plugin-fw/lib/yit-plugin-panel-wc.php' );
161
+ }
162
+
163
+ $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
164
+ }
165
+
166
+ /**
167
+ * Premium Tab Template
168
+ *
169
+ * Load the premium tab template on admin page
170
+ *
171
+ * @return void
172
+ * @since 1.0
173
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
174
+ * @return void
175
+ */
176
+ public function premium_tab() {
177
+ $premium_tab_template = YITH_WCQV_TEMPLATE_PATH . '/admin/' . $this->_premium;
178
+ if( file_exists( $premium_tab_template ) ) {
179
+ include_once($premium_tab_template);
180
+ }
181
+
182
+ }
183
+
184
+ /**
185
+ * plugin_row_meta
186
+ *
187
+ * add the action links to plugin admin page
188
+ *
189
+ * @param $plugin_meta
190
+ * @param $plugin_file
191
+ * @param $plugin_data
192
+ * @param $status
193
+ *
194
+ * @return Array
195
+ * @since 1.0
196
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
197
+ * @use plugin_row_meta
198
+ */
199
+ public function plugin_row_meta( $new_row_meta_args, $plugin_meta, $plugin_file, $plugin_data, $status ) {
200
+ if ( defined( 'YITH_WCQV_INIT' ) && YITH_WCQV_INIT == $plugin_file ) {
201
+ $new_row_meta_args['slug'] = YITH_WCQV_SLUG;
202
+
203
+ if( defined( 'YITH_WCQV_PREMIUM' ) ){
204
+ $new_row_meta_args['is_premium'] = true;
205
+ }
206
+ }
207
+ return $new_row_meta_args;
208
+ }
209
+
210
+ /**
211
+ * Get the premium landing uri
212
+ *
213
+ * @since 1.0.0
214
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
215
+ * @return string The premium landing link
216
+ */
217
+ public function get_premium_landing_uri(){
218
+ return $this->_premium_landing;
219
+ }
220
+
221
+ }
222
+ }
223
+ /**
224
+ * Unique access to instance of YITH_WCQV_Admin class
225
+ *
226
+ * @return \YITH_WCQV_Admin
227
+ * @since 1.0.0
228
+ */
229
+ function YITH_WCQV_Admin(){
230
+ return YITH_WCQV_Admin::get_instance();
231
}
includes/class.yith-wcqv-frontend.php CHANGED
@@ -1,393 +1,393 @@
1
- <?php
2
- /**
3
- * Frontend class
4
- *
5
- * @author YITH
6
- * @package YITH WooCommerce Quick View
7
- * @version 1.1.1
8
- */
9
-
10
- if ( ! defined( 'YITH_WCQV' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if( ! class_exists( 'YITH_WCQV_Frontend' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the Frontend behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCQV_Frontend {
22
-
23
- /**
24
- * Single instance of the class
25
- *
26
- * @var \YITH_WCQV_Frontend
27
- * @since 1.0.0
28
- */
29
- protected static $instance;
30
-
31
- /**
32
- * Plugin version
33
- *
34
- * @var string
35
- * @since 1.0.0
36
- */
37
- public $version = YITH_WCQV_VERSION;
38
-
39
- /**
40
- * Returns single instance of the class
41
- *
42
- * @return \YITH_WCQV_Frontend
43
- * @since 1.0.0
44
- */
45
- public static function get_instance(){
46
- if( is_null( self::$instance ) ){
47
- self::$instance = new self();
48
- }
49
-
50
- return self::$instance;
51
- }
52
-
53
- /**
54
- * Constructor
55
- *
56
- * @access public
57
- * @since 1.0.0
58
- */
59
- public function __construct() {
60
-
61
- // custom styles and javascripts
62
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
63
-
64
- // enqueue gift card script
65
- if( defined('YITH_YWGC_FILE') ){
66
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_gift_card_script' ) );
67
- }
68
-
69
- // quick view ajax
70
- add_action( 'wp_ajax_yith_load_product_quick_view', array( $this, 'yith_load_product_quick_view_ajax' ) );
71
- add_action( 'wp_ajax_nopriv_yith_load_product_quick_view', array( $this, 'yith_load_product_quick_view_ajax' ) );
72
-
73
- // add button
74
- add_action( 'woocommerce_after_shop_loop_item', array( $this, 'yith_add_quick_view_button' ), 15 );
75
- add_action( 'yith_wcwl_table_after_product_name', array( $this, 'yith_add_quick_view_button' ), 15, 0 );
76
-
77
- // load modal template
78
- add_action( 'wp_footer', array( $this, 'yith_quick_view' ) );
79
-
80
- // load action for product template
81
- $this->yith_quick_view_action_template();
82
-
83
- add_shortcode( 'yith_quick_view', array( $this, 'quick_view_shortcode' ) );
84
- add_filter( 'woocommerce_add_to_cart_form_action', array( $this, 'avoid_redirect_to_single_page'), 10, 1 );
85
- }
86
-
87
- /**
88
- * Enqueue styles and scripts
89
- *
90
- * @access public
91
- * @return void
92
- * @since 1.0.0
93
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
94
- */
95
- public function enqueue_styles_scripts() {
96
-
97
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
98
-
99
- wp_register_script( 'yith-wcqv-frontend', YITH_WCQV_ASSETS_URL . '/js/frontend'.$suffix.'.js', array('jquery'), $this->version, true);
100
- wp_enqueue_script( 'yith-wcqv-frontend' );
101
- wp_enqueue_style( 'yith-quick-view', YITH_WCQV_ASSETS_URL . '/css/yith-quick-view.css' );
102
-
103
- $background_modal = get_option( 'yith-wcqv-background-modal' );
104
- $close_color = get_option( 'yith-wcqv-close-color' );
105
- $close_color_hover = get_option( 'yith-wcqv-close-color-hover' );
106
-
107
- $inline_style = "
108
- #yith-quick-view-modal .yith-wcqv-main{background:{$background_modal};}
109
- #yith-quick-view-close{color:{$close_color};}
110
- #yith-quick-view-close:hover{color:{$close_color_hover};}";
111
-
112
- wp_add_inline_style( 'yith-quick-view', $inline_style );
113
- }
114
-
115
-
116
- /**
117
- * Enqueue scripts for YITH WooCommerce Gift Cards
118
- *
119
- * @access public
120
- * @return void
121
- * @since 1.0.0
122
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
123
- */
124
- public function enqueue_gift_card_script(){
125
-
126
- if( !wp_script_is('ywgc-frontend') && !is_checkout() ){
127
- wp_register_script( "ywgc-frontend",
128
- YITH_YWGC_URL . 'assets/js/' . yit_load_js_file( 'ywgc-frontend.js' ),
129
- array(
130
- 'jquery',
131
- 'woocommerce',
132
- ),
133
- YITH_YWGC_VERSION,
134
- true );
135
-
136
- wp_enqueue_script( "ywgc-frontend" );
137
- }
138
- }
139
-
140
- /**
141
- * Add quick view button in wc product loop
142
- *
143
- * @access public
144
- * @param integer|string $product_id The product id
145
- * @param string $label The button label
146
- * @param boolean $return
147
- * @return string|void
148
- * @since 1.0.0
149
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
150
- */
151
- public function yith_add_quick_view_button( $product_id = 0, $label = '', $return = false ) {
152
-
153
- global $product;
154
-
155
- if( ! $product_id ){
156
- $product instanceof WC_Product && $product_id = yit_get_prop( $product, 'id', true );
157
- }
158
-
159
- $show_quick_view_button = apply_filters( 'yith_wcqv_show_quick_view_button', true, $product_id );
160
-
161
- if( !$show_quick_view_button ) return;
162
-
163
- $button = '';
164
- if( $product_id ) {
165
- // get label
166
- ! $label && $label = $this->get_button_label();
167
-
168
- $button = '<a href="#" class="button yith-wcqv-button" data-product_id="' . $product_id . '">' . $label . '</a>';
169
- $button = apply_filters('yith_add_quick_view_button_html', $button, $label, $product);
170
- }
171
-
172
- if( $return ) {
173
- return $button;
174
- }
175
-
176
- echo $button;
177
- }
178
-
179
- /**
180
- * Enqueue scripts and pass variable to js used in quick view
181
- *
182
- * @access public
183
- * @return bool
184
- * @since 1.0.0
185
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
186
- */
187
- public function yith_woocommerce_quick_view() {
188
-
189
- wp_enqueue_script( 'wc-add-to-cart-variation' );
190
- if( version_compare( WC()->version, '3.0.0', '>=' ) ) {
191
- if( current_theme_supports('wc-product-gallery-zoom') ) {
192
- wp_enqueue_script('zoom');
193
- }
194
- if( current_theme_supports('wc-product-gallery-lightbox') ) {
195
- wp_enqueue_script('photoswipe-ui-default');
196
- wp_enqueue_style('photoswipe-default-skin');
197
- if( has_action('wp_footer', 'woocommerce_photoswipe') === FALSE ) {
198
- add_action('wp_footer', 'woocommerce_photoswipe', 15);
199
- }
200
- }
201
- wp_enqueue_script('wc-single-product');
202
- }
203
-
204
- // enqueue wc color e label variation style
205
- wp_enqueue_script( 'yith_wccl_frontend' );
206
- wp_enqueue_style( 'yith_wccl_frontend' );
207
-
208
- $lightbox_en = get_option( 'yith-wcqv-enable-lightbox' ) == 'yes' ? true : false;
209
-
210
- // if enabled load prettyPhoto css
211
- if( $lightbox_en ) {
212
-
213
- $assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';
214
-
215
- wp_enqueue_script( 'prettyPhoto', $assets_path . 'js/prettyPhoto/jquery.prettyPhoto.min.js', array( 'jquery' ), '3.1.5', true );
216
- wp_enqueue_style( 'woocommerce_prettyPhoto_css', $assets_path . 'css/prettyPhoto.css' );
217
- }
218
-
219
- $version = version_compare( preg_replace( '/-beta-([0-9]+)/', '', WC()->version ), '2.3.0', '<' );
220
-
221
- // loader gif
222
- $loader = apply_filters( 'yith_quick_view_loader_gif', YITH_WCQV_ASSETS_URL . '/image/qv-loader.gif' );
223
-
224
- // Allow user to load custom style and scripts
225
- do_action( 'yith_quick_view_custom_style_scripts' );
226
-
227
- wp_localize_script( 'yith-wcqv-frontend', 'yith_qv', array (
228
- 'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
229
- 'loader' => $loader,
230
- 'is2_2' => $version,
231
- 'lang' => defined( 'ICL_LANGUAGE_CODE' ) ? ICL_LANGUAGE_CODE : ''
232
- )
233
- );
234
-
235
- return true;
236
- }
237
-
238
- /**
239
- * Ajax action to load product in quick view
240
- *
241
- * @access public
242
- * @return void
243
- * @since 1.0.0
244
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
245
- */
246
- public function yith_load_product_quick_view_ajax() {
247
-
248
- if ( ! isset( $_REQUEST['product_id'] ) ) {
249
- die();
250
- }
251
-
252
- global $sitepress;
253
-
254
- $product_id = intval( $_REQUEST['product_id'] );
255
-
256
- /**
257
- * WPML Suppot: Localize Ajax Call
258
- */
259
- $lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : '';
260
- if( defined( 'ICL_LANGUAGE_CODE' ) && $lang && isset( $sitepress ) ) {
261
- $sitepress->switch_lang( $lang, true );
262
- }
263
-
264
- // set the main wp query for the product
265
- wp( 'p=' . $product_id . '&post_type=product' );
266
-
267
- // remove product thumbnails gallery
268
- remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
269
-
270
- // change template for variable products
271
- if ( isset( $GLOBALS['yith_wccl'] ) ) {
272
- $GLOBALS['yith_wccl']->obj = new YITH_WCCL_Frontend( YITH_WCCL_VERSION );
273
- $GLOBALS['yith_wccl']->obj->override();
274
- }
275
-
276
- ob_start();
277
-
278
- // load content template
279
- wc_get_template( 'yith-quick-view-content.php', array(), '', YITH_WCQV_DIR . 'templates/' );
280
-
281
- echo ob_get_clean();
282
-
283
- die();
284
- }
285
-
286
- /**
287
- * Load quick view template
288
- *
289
- * @access public
290
- * @return void
291
- * @since 1.0.0
292
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
293
- */
294
- public function yith_quick_view() {
295
- $this->yith_woocommerce_quick_view();
296
- wc_get_template( 'yith-quick-view.php', array(), '', YITH_WCQV_DIR . 'templates/' );
297
- }
298
-
299
- /**
300
- * Load wc action for quick view product template
301
- *
302
- * @access public
303
- * @return void
304
- * @since 1.0.0
305
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
306
- */
307
- public function yith_quick_view_action_template() {
308
-
309
- // Image
310
- add_action( 'yith_wcqv_product_image', 'woocommerce_show_product_sale_flash', 10 );
311
- add_action( 'yith_wcqv_product_image', 'woocommerce_show_product_images', 20 );
312
-
313
- // Summary
314
- add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_title', 5 );
315
- add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_rating', 10 );
316
- add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_price', 15 );
317
- add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_excerpt', 20 );
318
- add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_add_to_cart', 25 );
319
- add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_meta', 30 );
320
- }
321
-
322
- /**
323
- * Get Quick View button label
324
- *
325
- * @author Francesco Licandro
326
- * @since 1.2.0
327
- * @return string
328
- */
329
- public function get_button_label(){
330
- $label = get_option( 'yith-wcqv-button-label' );
331
- $label = call_user_func( '__' , $label, 'yith-woocommerce-quick-view' );
332
-
333
- return apply_filters( 'yith_wcqv_button_label', esc_html( $label ) );
334
- }
335
-
336
- /**
337
- * Quick View shortcode button
338
- *
339
- * @access public
340
- * @since 1.0.7
341
- * @param array $atts
342
- * @return string
343
- * @author Francesco Licandro
344
- */
345
- public function quick_view_shortcode( $atts ) {
346
-
347
- $atts = shortcode_atts(array(
348
- 'product_id' => 0,
349
- 'label' => ''
350
- ), $atts );
351
-
352
- extract( $atts );
353
-
354
- return $this->yith_add_quick_view_button( intval( $product_id ), $label, true );
355
- }
356
-
357
- /**
358
- * Check if is quick view
359
- *
360
- * @access public
361
- * @return bool
362
- * @since 1.3.1
363
- * @author Francesco Licandro <francesco.licandro@yithemes.com>
364
- */
365
- public function yith_is_quick_view() {
366
- return ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yith_load_product_quick_view' ) ? true : false;
367
- }
368
-
369
- /**
370
- * Avoid redirect to single product page on add to cart action in quick view
371
- *
372
- * @since 1.3.1
373
- * @author Francesco Licandro
374
- * @param string $value
375
- * @return string
376
- */
377
- public function avoid_redirect_to_single_page( $value ){
378
- if( $this->yith_is_quick_view() ) {
379
- return '';
380
- }
381
- return $value;
382
- }
383
- }
384
- }
385
- /**
386
- * Unique access to instance of YITH_WCQV_Frontend class
387
- *
388
- * @return \YITH_WCQV_Frontend
389
- * @since 1.0.0
390
- */
391
- function YITH_WCQV_Frontend(){
392
- return YITH_WCQV_Frontend::get_instance();
393
- }
1
+ <?php
2
+ /**
3
+ * Frontend class
4
+ *
5
+ * @author YITH
6
+ * @package YITH WooCommerce Quick View
7
+ * @version 1.1.1
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCQV' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if( ! class_exists( 'YITH_WCQV_Frontend' ) ) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the Frontend behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCQV_Frontend {
22
+
23
+ /**
24
+ * Single instance of the class
25
+ *
26
+ * @var \YITH_WCQV_Frontend
27
+ * @since 1.0.0
28
+ */
29
+ protected static $instance;
30
+
31
+ /**
32
+ * Plugin version
33
+ *
34
+ * @var string
35
+ * @since 1.0.0
36
+ */
37
+ public $version = YITH_WCQV_VERSION;
38
+
39
+ /**
40
+ * Returns single instance of the class
41
+ *
42
+ * @return \YITH_WCQV_Frontend
43
+ * @since 1.0.0
44
+ */
45
+ public static function get_instance(){
46
+ if( is_null( self::$instance ) ){
47
+ self::$instance = new self();
48
+ }
49
+
50
+ return self::$instance;
51
+ }
52
+
53
+ /**
54
+ * Constructor
55
+ *
56
+ * @access public
57
+ * @since 1.0.0
58
+ */
59
+ public function __construct() {
60
+
61
+ // custom styles and javascripts
62
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
63
+
64
+ // enqueue gift card script
65
+ if( defined('YITH_YWGC_FILE') ){
66
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_gift_card_script' ) );
67
+ }
68
+
69
+ // quick view ajax
70
+ add_action( 'wp_ajax_yith_load_product_quick_view', array( $this, 'yith_load_product_quick_view_ajax' ) );
71
+ add_action( 'wp_ajax_nopriv_yith_load_product_quick_view', array( $this, 'yith_load_product_quick_view_ajax' ) );
72
+
73
+ // add button
74
+ add_action( 'woocommerce_after_shop_loop_item', array( $this, 'yith_add_quick_view_button' ), 15 );
75
+ add_action( 'yith_wcwl_table_after_product_name', array( $this, 'yith_add_quick_view_button' ), 15, 0 );
76
+
77
+ // load modal template
78
+ add_action( 'wp_footer', array( $this, 'yith_quick_view' ) );
79
+
80
+ // load action for product template
81
+ $this->yith_quick_view_action_template();
82
+
83
+ add_shortcode( 'yith_quick_view', array( $this, 'quick_view_shortcode' ) );
84
+ add_filter( 'woocommerce_add_to_cart_form_action', array( $this, 'avoid_redirect_to_single_page'), 10, 1 );
85
+ }
86
+
87
+ /**
88
+ * Enqueue styles and scripts
89
+ *
90
+ * @access public
91
+ * @return void
92
+ * @since 1.0.0
93
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
94
+ */
95
+ public function enqueue_styles_scripts() {
96
+
97
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
98
+
99
+ wp_register_script( 'yith-wcqv-frontend', YITH_WCQV_ASSETS_URL . '/js/frontend'.$suffix.'.js', array('jquery'), $this->version, true);
100
+ wp_enqueue_script( 'yith-wcqv-frontend' );
101
+ wp_enqueue_style( 'yith-quick-view', YITH_WCQV_ASSETS_URL . '/css/yith-quick-view.css' );
102
+
103
+ $background_modal = get_option( 'yith-wcqv-background-modal' );
104
+ $close_color = get_option( 'yith-wcqv-close-color' );
105
+ $close_color_hover = get_option( 'yith-wcqv-close-color-hover' );
106
+
107
+ $inline_style = "
108
+ #yith-quick-view-modal .yith-wcqv-main{background:{$background_modal};}
109
+ #yith-quick-view-close{color:{$close_color};}
110
+ #yith-quick-view-close:hover{color:{$close_color_hover};}";
111
+
112
+ wp_add_inline_style( 'yith-quick-view', $inline_style );
113
+ }
114
+
115
+
116
+ /**
117
+ * Enqueue scripts for YITH WooCommerce Gift Cards
118
+ *
119
+ * @access public
120
+ * @return void
121
+ * @since 1.0.0
122
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
123
+ */
124
+ public function enqueue_gift_card_script(){
125
+
126
+ if( !wp_script_is('ywgc-frontend') && !is_checkout() ){
127
+ wp_register_script( "ywgc-frontend",
128
+ YITH_YWGC_URL . 'assets/js/' . yit_load_js_file( 'ywgc-frontend.js' ),
129
+ array(
130
+ 'jquery',
131
+ 'woocommerce',
132
+ ),
133
+ YITH_YWGC_VERSION,
134
+ true );
135
+
136
+ wp_enqueue_script( "ywgc-frontend" );
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Add quick view button in wc product loop
142
+ *
143
+ * @access public
144
+ * @param integer|string $product_id The product id
145
+ * @param string $label The button label
146
+ * @param boolean $return
147
+ * @return string|void
148
+ * @since 1.0.0
149
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
150
+ */
151
+ public function yith_add_quick_view_button( $product_id = 0, $label = '', $return = false ) {
152
+
153
+ global $product;
154
+
155
+ if( ! $product_id ){
156
+ $product instanceof WC_Product && $product_id = yit_get_prop( $product, 'id', true );
157
+ }
158
+
159
+ $show_quick_view_button = apply_filters( 'yith_wcqv_show_quick_view_button', true, $product_id );
160
+
161
+ if( !$show_quick_view_button ) return;
162
+
163
+ $button = '';
164
+ if( $product_id ) {
165
+ // get label
166
+ ! $label && $label = $this->get_button_label();
167
+
168
+ $button = '<a href="#" class="button yith-wcqv-button" data-product_id="' . $product_id . '">' . $label . '</a>';
169
+ $button = apply_filters('yith_add_quick_view_button_html', $button, $label, $product);
170
+ }
171
+
172
+ if( $return ) {
173
+ return $button;
174
+ }
175
+
176
+ echo $button;
177
+ }
178
+
179
+ /**
180
+ * Enqueue scripts and pass variable to js used in quick view
181
+ *
182
+ * @access public
183
+ * @return bool
184
+ * @since 1.0.0
185
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
186
+ */
187
+ public function yith_woocommerce_quick_view() {
188
+
189
+ wp_enqueue_script( 'wc-add-to-cart-variation' );
190
+ if( version_compare( WC()->version, '3.0.0', '>=' ) ) {
191
+ if( current_theme_supports('wc-product-gallery-zoom') ) {
192
+ wp_enqueue_script('zoom');
193
+ }
194
+ if( current_theme_supports('wc-product-gallery-lightbox') ) {
195
+ wp_enqueue_script('photoswipe-ui-default');
196
+ wp_enqueue_style('photoswipe-default-skin');
197
+ if( has_action('wp_footer', 'woocommerce_photoswipe') === FALSE ) {
198
+ add_action('wp_footer', 'woocommerce_photoswipe', 15);
199
+ }
200
+ }
201
+ wp_enqueue_script('wc-single-product');
202
+ }
203
+
204
+ // enqueue wc color e label variation style
205
+ wp_enqueue_script( 'yith_wccl_frontend' );
206
+ wp_enqueue_style( 'yith_wccl_frontend' );
207
+
208
+ $lightbox_en = get_option( 'yith-wcqv-enable-lightbox' ) == 'yes' ? true : false;
209
+
210
+ // if enabled load prettyPhoto css
211
+ if( $lightbox_en ) {
212
+
213
+ $assets_path = str_replace( array( 'http:', 'https:' ), '', WC()->plugin_url() ) . '/assets/';
214
+
215
+ wp_enqueue_script( 'prettyPhoto', $assets_path . 'js/prettyPhoto/jquery.prettyPhoto.min.js', array( 'jquery' ), '3.1.5', true );
216
+ wp_enqueue_style( 'woocommerce_prettyPhoto_css', $assets_path . 'css/prettyPhoto.css' );
217
+ }
218
+
219
+ $version = version_compare( preg_replace( '/-beta-([0-9]+)/', '', WC()->version ), '2.3.0', '<' );
220
+
221
+ // loader gif
222
+ $loader = apply_filters( 'yith_quick_view_loader_gif', YITH_WCQV_ASSETS_URL . '/image/qv-loader.gif' );
223
+
224
+ // Allow user to load custom style and scripts
225
+ do_action( 'yith_quick_view_custom_style_scripts' );
226
+
227
+ wp_localize_script( 'yith-wcqv-frontend', 'yith_qv', array (
228
+ 'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
229
+ 'loader' => $loader,
230
+ 'is2_2' => $version,
231
+ 'lang' => defined( 'ICL_LANGUAGE_CODE' ) ? ICL_LANGUAGE_CODE : ''
232
+ )
233
+ );
234
+
235
+ return true;
236
+ }
237
+
238
+ /**
239
+ * Ajax action to load product in quick view
240
+ *
241
+ * @access public
242
+ * @return void
243
+ * @since 1.0.0
244
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
245
+ */
246
+ public function yith_load_product_quick_view_ajax() {
247
+
248
+ if ( ! isset( $_REQUEST['product_id'] ) ) {
249
+ die();
250
+ }
251
+
252
+ global $sitepress;
253
+
254
+ $product_id = intval( $_REQUEST['product_id'] );
255
+
256
+ /**
257
+ * WPML Suppot: Localize Ajax Call
258
+ */
259
+ $lang = isset( $_REQUEST['lang'] ) ? $_REQUEST['lang'] : '';
260
+ if( defined( 'ICL_LANGUAGE_CODE' ) && $lang && isset( $sitepress ) ) {
261
+ $sitepress->switch_lang( $lang, true );
262
+ }
263
+
264
+ // set the main wp query for the product
265
+ wp( 'p=' . $product_id . '&post_type=product' );
266
+
267
+ // remove product thumbnails gallery
268
+ remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
269
+
270
+ // change template for variable products
271
+ if ( isset( $GLOBALS['yith_wccl'] ) ) {
272
+ $GLOBALS['yith_wccl']->obj = new YITH_WCCL_Frontend( YITH_WCCL_VERSION );
273
+ $GLOBALS['yith_wccl']->obj->override();
274
+ }
275
+
276
+ ob_start();
277
+
278
+ // load content template
279
+ wc_get_template( 'yith-quick-view-content.php', array(), '', YITH_WCQV_DIR . 'templates/' );
280
+
281
+ echo ob_get_clean();
282
+
283
+ die();
284
+ }
285
+
286
+ /**
287
+ * Load quick view template
288
+ *
289
+ * @access public
290
+ * @return void
291
+ * @since 1.0.0
292
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
293
+ */
294
+ public function yith_quick_view() {
295
+ $this->yith_woocommerce_quick_view();
296
+ wc_get_template( 'yith-quick-view.php', array(), '', YITH_WCQV_DIR . 'templates/' );
297
+ }
298
+
299
+ /**
300
+ * Load wc action for quick view product template
301
+ *
302
+ * @access public
303
+ * @return void
304
+ * @since 1.0.0
305
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
306
+ */
307
+ public function yith_quick_view_action_template() {
308
+
309
+ // Image
310
+ add_action( 'yith_wcqv_product_image', 'woocommerce_show_product_sale_flash', 10 );
311
+ add_action( 'yith_wcqv_product_image', 'woocommerce_show_product_images', 20 );
312
+
313
+ // Summary
314
+ add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_title', 5 );
315
+ add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_rating', 10 );
316
+ add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_price', 15 );
317
+ add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_excerpt', 20 );
318
+ add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_add_to_cart', 25 );
319
+ add_action( 'yith_wcqv_product_summary', 'woocommerce_template_single_meta', 30 );
320
+ }
321
+
322
+ /**
323
+ * Get Quick View button label
324
+ *
325
+ * @author Francesco Licandro
326
+ * @since 1.2.0
327
+ * @return string
328
+ */
329
+ public function get_button_label(){
330
+ $label = get_option( 'yith-wcqv-button-label' );
331
+ $label = call_user_func( '__' , $label, 'yith-woocommerce-quick-view' );
332
+
333
+ return apply_filters( 'yith_wcqv_button_label', esc_html( $label ) );
334
+ }
335
+
336
+ /**
337
+ * Quick View shortcode button
338
+ *
339
+ * @access public
340
+ * @since 1.0.7
341
+ * @param array $atts
342
+ * @return string
343
+ * @author Francesco Licandro
344
+ */
345
+ public function quick_view_shortcode( $atts ) {
346
+
347
+ $atts = shortcode_atts(array(
348
+ 'product_id' => 0,
349
+ 'label' => ''
350
+ ), $atts );
351
+
352
+ extract( $atts );
353
+
354
+ return $this->yith_add_quick_view_button( intval( $product_id ), $label, true );
355
+ }
356
+
357
+ /**
358
+ * Check if is quick view
359
+ *
360
+ * @access public
361
+ * @return bool
362
+ * @since 1.3.1
363
+ * @author Francesco Licandro <francesco.licandro@yithemes.com>
364
+ */
365
+ public function yith_is_quick_view() {
366
+ return ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'yith_load_product_quick_view' ) ? true : false;
367
+ }
368
+
369
+ /**
370
+ * Avoid redirect to single product page on add to cart action in quick view
371
+ *
372
+ * @since 1.3.1
373
+ * @author Francesco Licandro
374
+ * @param string $value
375
+ * @return string
376
+ */
377
+ public function avoid_redirect_to_single_page( $value ){
378
+ if( $this->yith_is_quick_view() ) {
379
+ return '';
380
+ }
381
+ return $value;
382
+ }
383
+ }
384
+ }
385
+ /**
386
+ * Unique access to instance of YITH_WCQV_Frontend class
387
+ *
388
+ * @return \YITH_WCQV_Frontend
389
+ * @since 1.0.0
390
+ */
391
+ function YITH_WCQV_Frontend(){
392
+ return YITH_WCQV_Frontend::get_instance();
393
+ }
includes/class.yith-wcqv.php CHANGED
@@ -1,157 +1,157 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author YITH
6
- * @package YITH WooCommerce Quick View
7
- * @version 1.0.0
8
- */
9
-
10
-
11
- if ( ! defined( 'YITH_WCQV' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( ! class_exists( 'YITH_WCQV' ) ) {
16
- /**
17
- * YITH WooCommerce Quick View
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCQV {
22
-
23
- /**
24
- * Single instance of the class
25
- *
26
- * @var \YITH_WCQV
27
- * @since 1.0.0
28
- */
29
- protected static $instance;
30
-
31
- /**
32
- * Plugin version
33
- *
34
- * @var string
35
- * @since 1.0.0
36
- */
37
- public $version = YITH_WCQV_VERSION;
38
-
39
- /**
40
- * Plugin object
41
- *
42
- * @var string
43
- * @since 1.0.0
44
- */
45
- public $obj = null;
46
-
47
- /**
48
- * Returns single instance of the class
49
- *
50
- * @return \YITH_WCQV
51
- * @since 1.0.0
52
- */
53
- public static function get_instance(){
54
- if( is_null( self::$instance ) ){
55
- self::$instance = new self();
56
- }
57
-
58
- return self::$instance;
59
- }
60
-
61
- /**
62
- * Constructor
63
- *
64
- * @return mixed| YITH_WCQV_Admin | YITH_WCQV_Frontend
65
- * @since 1.0.0
66
- */
67
- public function __construct() {
68
-
69
- // Load Plugin Framework
70
- add_action( 'after_setup_theme', array( $this, 'plugin_fw_loader' ), 1 );
71
-
72
- $action = array(
73
- 'woocommerce_get_refreshed_fragments',
74
- 'woocommerce_apply_coupon',
75
- 'woocommerce_remove_coupon',
76
- 'woocommerce_update_shipping_method',
77
- 'woocommerce_update_order_review',
78
- 'woocommerce_add_to_cart',
79
- 'woocommerce_checkout'
80
- );
81
-
82
- // Exit if is woocommerce ajax
83
- if( defined( 'DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $action ) ) {
84
- return;
85
- }
86
-
87
- if ( $this->is_admin() ) {
88
- // load admin classes
89
- require_once( 'class.yith-wcqv-admin.php' );
90
- YITH_WCQV_Admin();
91
- }
92
-
93
- if( $this->load_frontend() ) {
94
- // load frontend classes
95
- require_once( 'class.yith-wcqv-frontend.php' );
96
- YITH_WCQV_Frontend();
97
- }
98
- }
99
-
100
- /**
101
- * Check if context is admin
102
- *
103
- * @author Francesco Licandro
104
- * @since 1.2.0
105
- * @return boolean
106
- */
107
- public function is_admin(){
108
- $is_ajax = ( defined( 'DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'frontend' );
109
- return apply_filters( 'yith_wcqv_is_admin', is_admin() && ! $is_ajax );
110
- }
111
-
112
- /**
113
- * Check if load or not frontend
114
- *
115
- * @author Francesco Licandro
116
- * @since 1.2.0
117
- * @return boolean
118
- */
119
- public function load_frontend(){
120
- // Class frontend
121
- $enable = get_option( 'yith-wcqv-enable', 'yes' ) == 'yes';
122
- $enable_on_mobile = get_option( 'yith-wcqv-enable-mobile', 'yes' ) == 'yes';
123
- $is_mobile = wp_is_mobile();
124
-
125
- return apply_filters( 'yith_wcqv_load_frontend', ( ! $is_mobile && $enable ) || ( $is_mobile && $enable_on_mobile ) );
126
- }
127
-
128
-
129
- /**
130
- * Load Plugin Framework
131
- *
132
- * @since 1.0
133
- * @access public
134
- * @return void
135
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
136
- */
137
- public function plugin_fw_loader() {
138
- if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
139
- global $plugin_fw_data;
140
- if( ! empty( $plugin_fw_data ) ){
141
- $plugin_fw_file = array_shift( $plugin_fw_data );
142
- require_once( $plugin_fw_file );
143
- }
144
- }
145
- }
146
- }
147
- }
148
-
149
- /**
150
- * Unique access to instance of YITH_WCQV class
151
- *
152
- * @return \YITH_WCQV
153
- * @since 1.0.0
154
- */
155
- function YITH_WCQV(){
156
- return YITH_WCQV::get_instance();
157
}
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author YITH
6
+ * @package YITH WooCommerce Quick View
7
+ * @version 1.0.0
8
+ */
9
+
10
+
11
+ if ( ! defined( 'YITH_WCQV' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( ! class_exists( 'YITH_WCQV' ) ) {
16
+ /**
17
+ * YITH WooCommerce Quick View
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCQV {
22
+
23
+ /**
24
+ * Single instance of the class
25
+ *
26
+ * @var \YITH_WCQV
27
+ * @since 1.0.0
28
+ */
29
+ protected static $instance;
30
+
31
+ /**
32
+ * Plugin version
33
+ *
34
+ * @var string
35
+ * @since 1.0.0
36
+ */
37
+ public $version = YITH_WCQV_VERSION;
38
+
39
+ /**
40
+ * Plugin object
41
+ *
42
+ * @var string
43
+ * @since 1.0.0
44
+ */
45
+ public $obj = null;
46
+
47
+ /**
48
+ * Returns single instance of the class
49
+ *
50
+ * @return \YITH_WCQV
51
+ * @since 1.0.0
52
+ */
53
+ public static function get_instance(){
54
+ if( is_null( self::$instance ) ){
55
+ self::$instance = new self();
56
+ }
57
+
58
+ return self::$instance;
59
+ }
60
+
61
+ /**
62
+ * Constructor
63
+ *
64
+ * @return mixed| YITH_WCQV_Admin | YITH_WCQV_Frontend
65
+ * @since 1.0.0
66
+ */
67
+ public function __construct() {
68
+
69
+ // Load Plugin Framework
70
+ add_action( 'after_setup_theme', array( $this, 'plugin_fw_loader' ), 1 );
71
+
72
+ $action = array(
73
+ 'woocommerce_get_refreshed_fragments',
74
+ 'woocommerce_apply_coupon',
75
+ 'woocommerce_remove_coupon',
76
+ 'woocommerce_update_shipping_method',
77
+ 'woocommerce_update_order_review',
78
+ 'woocommerce_add_to_cart',
79
+ 'woocommerce_checkout'
80
+ );
81
+
82
+ // Exit if is woocommerce ajax
83
+ if( defined( 'DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], $action ) ) {
84
+ return;
85
+ }
86
+
87
+ if ( $this->is_admin() ) {
88
+ // load admin classes
89
+ require_once( 'class.yith-wcqv-admin.php' );
90
+ YITH_WCQV_Admin();
91
+ }
92
+
93
+ if( $this->load_frontend() ) {
94
+ // load frontend classes
95
+ require_once( 'class.yith-wcqv-frontend.php' );
96
+ YITH_WCQV_Frontend();
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Check if context is admin
102
+ *
103
+ * @author Francesco Licandro
104
+ * @since 1.2.0
105
+ * @return boolean
106
+ */
107
+ public function is_admin(){
108
+ $is_ajax = ( defined( 'DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'frontend' );
109
+ return apply_filters( 'yith_wcqv_is_admin', is_admin() && ! $is_ajax );
110
+ }
111
+
112
+ /**
113
+ * Check if load or not frontend
114
+ *
115
+ * @author Francesco Licandro
116
+ * @since 1.2.0
117
+ * @return boolean
118
+ */
119
+ public function load_frontend(){
120
+ // Class frontend
121
+ $enable = get_option( 'yith-wcqv-enable', 'yes' ) == 'yes';
122
+ $enable_on_mobile = get_option( 'yith-wcqv-enable-mobile', 'yes' ) == 'yes';
123
+ $is_mobile = wp_is_mobile();
124
+
125
+ return apply_filters( 'yith_wcqv_load_frontend', ( ! $is_mobile && $enable ) || ( $is_mobile && $enable_on_mobile ) );
126
+ }
127
+
128
+
129
+ /**
130
+ * Load Plugin Framework
131
+ *
132
+ * @since 1.0
133
+ * @access public
134
+ * @return void
135
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
136
+ */
137
+ public function plugin_fw_loader() {
138
+ if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
139
+ global $plugin_fw_data;
140
+ if( ! empty( $plugin_fw_data ) ){
141
+ $plugin_fw_file = array_shift( $plugin_fw_data );
142
+ require_once( $plugin_fw_file );
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Unique access to instance of YITH_WCQV class
151
+ *
152
+ * @return \YITH_WCQV
153
+ * @since 1.0.0
154
+ */
155
+ function YITH_WCQV(){
156
+ return YITH_WCQV::get_instance();
157
}
init.php CHANGED
@@ -1,135 +1,135 @@
1
- <?php
2
- /**
3
- * Plugin Name: YITH WooCommerce Quick View
4
- * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-quick-view
5
- * Description: The <code><strong>YITH WooCommerce Quick View</strong></code> plugin allows your customers to have a quick look about products. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
- * Version: 1.3.12
7
- * Author: YITH
8
- * Author URI: https://yithemes.com/
9
- * Text Domain: yith-woocommerce-quick-view
10
- * Domain Path: /languages/
11
- * WC requires at least: 2.5.0
12
- * WC tested up to: 3.7
13
- *
14
- * @author YITH
15
- * @package YITH WooCommerce Quick View
16
- * @version 1.3.12
17
- */
18
- /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
19
-
20
- This program is free software; you can redistribute it and/or modify
21
- it under the terms of the GNU General Public License, version 2, as
22
- published by the Free Software Foundation.
23
-
24
- This program is distributed in the hope that it will be useful,
25
- but WITHOUT ANY WARRANTY; without even the implied warranty of
26
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
- GNU General Public License for more details.
28
-
29
- You should have received a copy of the GNU General Public License
30
- along with this program; if not, write to the Free Software
31
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32
- */
33
-
34
- if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
35
-
36
- if ( ! function_exists( 'is_plugin_active' ) ) {
37
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
38
- }
39
-
40
- function yith_wcqv_install_woocommerce_admin_notice() {
41
- ?>
42
- <div class="error">
43
- <p><?php _e( 'YITH WooCommerce Quick View is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-quick-view' ); ?></p>
44
- </div>
45
- <?php
46
- }
47
-
48
-
49
- function yith_wcqv_install_free_admin_notice() {
50
- ?>
51
- <div class="error">
52
- <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Quick View while you are using the premium one.', 'yith-woocommerce-quick-view' ); ?></p>
53
- </div>
54
- <?php
55
- }
56
-
57
- if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
58
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
59
- }
60
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
61
-
62
-
63
- if ( ! defined( 'YITH_WCQV_VERSION' ) ){
64
- define( 'YITH_WCQV_VERSION', '1.3.12' );
65
- }
66
-
67
- if ( ! defined( 'YITH_WCQV_FREE_INIT' ) ) {
68
- define( 'YITH_WCQV_FREE_INIT', plugin_basename( __FILE__ ) );
69
- }
70
-
71
- if ( ! defined( 'YITH_WCQV_INIT' ) ) {
72
- define( 'YITH_WCQV_INIT', plugin_basename( __FILE__ ) );
73
- }
74
-
75
- if ( ! defined( 'YITH_WCQV' ) ) {
76
- define( 'YITH_WCQV', true );
77
- }
78
-
79
- if ( ! defined( 'YITH_WCQV_FILE' ) ) {
80
- define( 'YITH_WCQV_FILE', __FILE__ );
81
- }
82
-
83
- if ( ! defined( 'YITH_WCQV_URL' ) ) {
84
- define( 'YITH_WCQV_URL', plugin_dir_url( __FILE__ ) );
85
- }
86
-
87
- if ( ! defined( 'YITH_WCQV_DIR' ) ) {
88
- define( 'YITH_WCQV_DIR', plugin_dir_path( __FILE__ ) );
89
- }
90
-
91
- if ( ! defined( 'YITH_WCQV_TEMPLATE_PATH' ) ) {
92
- define( 'YITH_WCQV_TEMPLATE_PATH', YITH_WCQV_DIR . 'templates' );
93
- }
94
-
95
- if ( ! defined( 'YITH_WCQV_ASSETS_URL' ) ) {
96
- define( 'YITH_WCQV_ASSETS_URL', YITH_WCQV_URL . 'assets' );
97
- }
98
-
99
- if ( ! defined( 'YITH_WCQV_SLUG' ) ) {
100
- define( 'YITH_WCQV_SLUG', 'yith-woocommerce-quick-view' );
101
- }
102
-
103
- /* Plugin Framework Version Check */
104
- if( ! function_exists( 'yit_maybe_plugin_fw_loader' ) && file_exists( YITH_WCQV_DIR . 'plugin-fw/init.php' ) ) {
105
- require_once( YITH_WCQV_DIR . 'plugin-fw/init.php' );
106
- }
107
- yit_maybe_plugin_fw_loader( YITH_WCQV_DIR );
108
-
109
- function yith_wcqv_init() {
110
-
111
- load_plugin_textdomain( 'yith-woocommerce-quick-view', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
112
-
113
- // Load required classes and functions
114
- require_once('includes/class.yith-wcqv.php');
115
-
116
- // Let's start the game!
117
- YITH_WCQV();
118
- }
119
- add_action( 'yith_wcqv_init', 'yith_wcqv_init' );
120
-
121
-
122
- function yith_wcqv_install() {
123
-
124
- if ( ! function_exists( 'WC' ) ) {
125
- add_action( 'admin_notices', 'yith_wcqv_install_woocommerce_admin_notice' );
126
- }
127
- elseif ( defined( 'YITH_WCQV_PREMIUM' ) ) {
128
- add_action( 'admin_notices', 'yith_wcqv_install_free_admin_notice' );
129
- deactivate_plugins( plugin_basename( __FILE__ ) );
130
- }
131
- else {
132
- do_action( 'yith_wcqv_init' );
133
- }
134
- }
135
add_action( 'plugins_loaded', 'yith_wcqv_install', 11 );
1
+ <?php
2
+ /**
3
+ * Plugin Name: YITH WooCommerce Quick View
4
+ * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-quick-view
5
+ * Description: The <code><strong>YITH WooCommerce Quick View</strong></code> plugin allows your customers to have a quick look about products. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
6
+ * Version: 1.3.14
7
+ * Author: YITH
8
+ * Author URI: https://yithemes.com/
9
+ * Text Domain: yith-woocommerce-quick-view
10
+ * Domain Path: /languages/
11
+ * WC requires at least: 3.6
12
+ * WC tested up to: 3.8
13
+ *
14
+ * @author YITH
15
+ * @package YITH WooCommerce Quick View
16
+ * @version 1.3.13
17
+ */
18
+ /* Copyright 2015 YITH (email : plugins@yithemes.com)
19
+
20
+ This program is free software; you can redistribute it and/or modify
21
+ it under the terms of the GNU General Public License, version 2, as
22
+ published by the Free Software Foundation.
23
+
24
+ This program is distributed in the hope that it will be useful,
25
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
+ GNU General Public License for more details.
28
+
29
+ You should have received a copy of the GNU General Public License
30
+ along with this program; if not, write to the Free Software
31
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32
+ */
33
+
34
+ if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
35