YITH Essential Kit for WooCommerce #1 - Version 1.1.15

Version Description

  • Updated: YITH WooCommerce Multi Vendor
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH Essential Kit for WooCommerce #1
Version 1.1.15
Comparing to
See all releases

Code changes from version 1.1.14 to 1.1.15

Files changed (98) hide show
  1. README.txt +8 -4
  2. init.php +1 -1
  3. modules/yith-woocommerce-ajax-navigation/assets/css/admin.css +209 -205
  4. modules/yith-woocommerce-ajax-navigation/assets/css/frontend.css +279 -269
  5. modules/yith-woocommerce-ajax-navigation/assets/images/06.png +0 -0
  6. modules/yith-woocommerce-ajax-navigation/assets/images/07.png +0 -0
  7. modules/yith-woocommerce-ajax-navigation/assets/images/08-bg.png +0 -0
  8. modules/yith-woocommerce-ajax-navigation/assets/images/08-icon.png +0 -0
  9. modules/yith-woocommerce-ajax-navigation/assets/images/08.png +0 -0
  10. modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-admin.js +117 -117
  11. modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.js +321 -312
  12. modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.min.js +11 -11
  13. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-admin.php +275 -275
  14. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-frontend.php +138 -138
  15. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-helper.php +65 -65
  16. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan.php +173 -173
  17. modules/yith-woocommerce-ajax-navigation/includes/functions.yith-wcan.php +502 -502
  18. modules/yith-woocommerce-ajax-navigation/init.php +2 -3
  19. modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-it_IT.mo +0 -0
  20. modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-it_IT.po +2 -2
  21. modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-tr_TR.mo +0 -0
  22. modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-tr_TR.po +2 -2
  23. modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation.pot +1 -1
  24. modules/yith-woocommerce-ajax-navigation/settings/custom-style-options.php +39 -39
  25. modules/yith-woocommerce-ajax-navigation/settings/frontend-options.php +60 -60
  26. modules/yith-woocommerce-ajax-navigation/templates/admin/premium.php +17 -1
  27. modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php +947 -912
  28. modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-reset-navigation-widget.php +111 -111
  29. modules/yith-woocommerce-ajax-search/init.php +2 -2
  30. modules/yith-woocommerce-badges-management/assets/css/admin.css +235 -233
  31. modules/yith-woocommerce-badges-management/assets/css/jquery-ui.css +1225 -0
  32. modules/yith-woocommerce-badges-management/class.yith-wcbm-admin.php +2 -2
  33. modules/yith-woocommerce-badges-management/class.yith-wcbm-frontend.php +10 -6
  34. modules/yith-woocommerce-badges-management/init.php +4 -4
  35. modules/yith-woocommerce-badges-management/languages/yith-wcbm.pot +170 -111
  36. modules/yith-woocommerce-badges-management/plugin-options/settings-options.php +38 -22
  37. modules/yith-woocommerce-catalog-mode/assets/css/yith-catalog-mode.css +2 -2
  38. modules/yith-woocommerce-catalog-mode/class.yith-woocommerce-catalog-mode.php +791 -735
  39. modules/yith-woocommerce-catalog-mode/init.php +123 -123
  40. modules/yith-woocommerce-catalog-mode/languages/yith-woocommerce-catalog-mode-nl_NL.po +294 -294
  41. modules/yith-woocommerce-catalog-mode/plugin-options/premium-landing-options.php +22 -22
  42. modules/yith-woocommerce-catalog-mode/plugin-options/settings-options.php +103 -103
  43. modules/yith-woocommerce-catalog-mode/templates/admin/premium.php +360 -360
  44. modules/yith-woocommerce-mailchimp/assets/css/admin/yith-wcmc.css +261 -252
  45. modules/yith-woocommerce-mailchimp/assets/js/admin/unminified/yith-wcmc.js +269 -269
  46. modules/yith-woocommerce-mailchimp/assets/js/admin/yith-wcmc.min.js +10 -10
  47. modules/yith-woocommerce-mailchimp/includes/class.yith-wcmc-admin.php +270 -262
  48. modules/yith-woocommerce-mailchimp/includes/class.yith-wcmc.php +496 -478
  49. modules/yith-woocommerce-mailchimp/includes/functions.yith-wcmc.php +37 -0
  50. modules/yith-woocommerce-mailchimp/init.php +130 -123
  51. modules/yith-woocommerce-mailchimp/languages/yith-wcmc.pot +79 -14
  52. modules/yith-woocommerce-mailchimp/plugin-options/checkout-options.php +149 -149
  53. modules/yith-woocommerce-mailchimp/plugin-options/integration-options.php +64 -64
  54. modules/yith-woocommerce-mailchimp/plugin-options/premium-options.php +20 -20
  55. modules/yith-woocommerce-mailchimp/templates/admin/mailchimp-panel-premium.php +373 -373
  56. modules/yith-woocommerce-mailchimp/templates/admin/types/integration-status.php +45 -45
  57. modules/yith-woocommerce-mailchimp/templates/mailchimp-subscription-checkbox.php +18 -18
  58. modules/yith-woocommerce-mailchimp/uninstall.php +12 -12
  59. modules/yith-woocommerce-mailchimp/wpml-config.xml +4 -4
  60. modules/yith-woocommerce-order-tracking/class.yith-woocommerce-order-tracking.php +1 -1
  61. modules/yith-woocommerce-product-vendors/includes/class.yith-orders.php +4 -1
  62. modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-admin.php +49 -6
  63. modules/yith-woocommerce-product-vendors/includes/functions.yith-update.php +25 -8
  64. modules/yith-woocommerce-product-vendors/init.php +2 -2
  65. modules/yith-woocommerce-request-a-quote/yith-woocommerce-request-a-quote.php +136 -136
  66. modules/yith-woocommerce-review-reminder/class.yith-woocommerce-review-reminder.php +624 -620
  67. modules/yith-woocommerce-review-reminder/includes/admin/class-yith-custom-table.php +245 -245
  68. modules/yith-woocommerce-review-reminder/includes/class-ywrr-blocklist.php +135 -135
  69. modules/yith-woocommerce-review-reminder/includes/class-ywrr-emails.php +159 -159
  70. modules/yith-woocommerce-review-reminder/includes/class-ywrr-form-handler.php +115 -115
  71. modules/yith-woocommerce-review-reminder/includes/class-ywrr-schedule.php +194 -194
  72. modules/yith-woocommerce-review-reminder/includes/emails/class-ywrr-request-email.php +235 -235
  73. modules/yith-woocommerce-review-reminder/includes/emails/class-ywrr-unsubscribe-email.php +127 -127
  74. modules/yith-woocommerce-review-reminder/init.php +182 -182
  75. modules/yith-woocommerce-review-reminder/plugin-options/blocklist-options.php +21 -21
  76. modules/yith-woocommerce-review-reminder/plugin-options/mail-options.php +176 -176
  77. modules/yith-woocommerce-review-reminder/plugin-options/premium-landing-options.php +22 -22
  78. modules/yith-woocommerce-review-reminder/templates/admin/blocklist-table.php +255 -255
  79. modules/yith-woocommerce-review-reminder/templates/admin/custom-textarea.php +64 -64
  80. modules/yith-woocommerce-review-reminder/templates/admin/premium.php +340 -340
  81. modules/yith-woocommerce-review-reminder/templates/emails/email-items-list.php +23 -23
  82. modules/yith-woocommerce-review-reminder/templates/unsubscribe.php +44 -44
  83. modules/yith-woocommerce-stripe/includes/class-yith-stripe-gateway.php +29 -17
  84. modules/yith-woocommerce-stripe/includes/class-yith-stripe.php +7 -3
  85. modules/yith-woocommerce-stripe/init.php +3 -3
  86. modules/yith-woocommerce-tab-manager/includes/class.yith-woocommerce-tab-manager.php +39 -39
  87. modules/yith-woocommerce-tab-manager/includes/metabox/tab-metabox.php +7 -7
  88. modules/yith-woocommerce-tab-manager/init.php +6 -6
  89. modules/yith-woocommerce-tab-manager/languages/yith-woocommerce-tab-manager.pot +321 -0
  90. modules/yith-woocommerce-tab-manager/plugin-options/settings-options.php +9 -9
  91. modules/yith-woocommerce-tab-manager/templates/admin/premium.php +37 -29
  92. modules/yith-woocommerce-wishlist/assets/css/admin.css +62 -62
  93. modules/yith-woocommerce-wishlist/assets/css/style.css +587 -587
  94. modules/yith-woocommerce-wishlist/assets/js/admin/yith-wcwl.js +4 -4
  95. modules/yith-woocommerce-wishlist/assets/js/jquery.yith-wcwl.js +19 -19
  96. modules/yith-woocommerce-wishlist/assets/js/unminified/admin/yith-wcwl.js +72 -72
  97. modules/yith-woocommerce-wishlist/assets/js/unminified/jquery.yith-wcwl.js +603 -603
  98. modules/yith-woocommerce-wishlist/includes/class.yith-wcwl-admin-init.php +80 -1511
README.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: yithemes
4
  Tags: woocommerce,jetpack,woocommerce jetpack, essential, kit, plugins, plugin, product, e-commerce, ecommerce, commerce, shop, yith, yit, yithemes,yith woocommerce colors and labels variations, colors and labels variations,colors and labels variations jetpack,yith woocommerce zoom magnifier,zoom magnifier,zoom magnifier jetpack,yith woocommerce wishlist,wishlist,wishlist jetpack,yith woocommerce compare,compare,compare jetpack,yith woocommerce ajax product filter,ajax product filter,ajax product filter jetpack,yith woocommerce ajax search,ajax search,ajax search jetpack,yith woocommerce catalog mode,catalog mode,catalog mode jetpack,yith woocommerce order tracking,order tracking,order tracking jetpack, yith woocommerce advanced reviews,advanced reviews,advanced reviews jetpack,yith woocommerce badges management,badges management,badges management jetpack,yith woocommerce cart messages,cart messages,cart messages jetpack,yith woocommerce review reminder,review reminder,review reminder jetpack,yith woocommerce quick view,quick view,quick view jetpack,yith live chat,live chat,live chat jetpack,yith woocommerce eu vat,eu vat,eu vat jetpack,yith woocommerce mailchimp,mailchimp,mailchimp jetpack,yith woocommerce stripe,stripe, stripe jetpack,yith infinite scrolling,infinite scrolling,infinite scrolling jetpack,yith woocommerce request a quote,request a quote,request a quote jetpack,yith woocommerce waiting list,waiting list,waiting list jetpack,yith woocommerce tab manager,tab manager,tab manager jetpack,yith woocommerce multi vendor,multi vendor,multi vendor jetpack,product vendor,products vendor,products vendor jetpack, booster for woocommerce
5
  Requires at least: 3.5.1
6
- Tested up to: 4.2.4
7
- Stable tag: 1.1.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -151,13 +151,17 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
151
 
152
  == Changelog ==
153
 
 
 
 
 
154
  = 1.1.14 =
155
 
156
  * Fixed: Minor Bugs
157
 
158
  = 1.1.13 =
159
 
160
- * Update: YITH WooCommerce Multi Vendor
161
 
162
  = 1.1.12 =
163
 
@@ -261,4 +265,4 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
261
 
262
  == Upgrade Notice ==
263
 
264
- Last Stable Tag 1.1.4
3
  Contributors: yithemes
4
  Tags: woocommerce,jetpack,woocommerce jetpack, essential, kit, plugins, plugin, product, e-commerce, ecommerce, commerce, shop, yith, yit, yithemes,yith woocommerce colors and labels variations, colors and labels variations,colors and labels variations jetpack,yith woocommerce zoom magnifier,zoom magnifier,zoom magnifier jetpack,yith woocommerce wishlist,wishlist,wishlist jetpack,yith woocommerce compare,compare,compare jetpack,yith woocommerce ajax product filter,ajax product filter,ajax product filter jetpack,yith woocommerce ajax search,ajax search,ajax search jetpack,yith woocommerce catalog mode,catalog mode,catalog mode jetpack,yith woocommerce order tracking,order tracking,order tracking jetpack, yith woocommerce advanced reviews,advanced reviews,advanced reviews jetpack,yith woocommerce badges management,badges management,badges management jetpack,yith woocommerce cart messages,cart messages,cart messages jetpack,yith woocommerce review reminder,review reminder,review reminder jetpack,yith woocommerce quick view,quick view,quick view jetpack,yith live chat,live chat,live chat jetpack,yith woocommerce eu vat,eu vat,eu vat jetpack,yith woocommerce mailchimp,mailchimp,mailchimp jetpack,yith woocommerce stripe,stripe, stripe jetpack,yith infinite scrolling,infinite scrolling,infinite scrolling jetpack,yith woocommerce request a quote,request a quote,request a quote jetpack,yith woocommerce waiting list,waiting list,waiting list jetpack,yith woocommerce tab manager,tab manager,tab manager jetpack,yith woocommerce multi vendor,multi vendor,multi vendor jetpack,product vendor,products vendor,products vendor jetpack, booster for woocommerce
5
  Requires at least: 3.5.1
6
+ Tested up to: 4.4
7
+ Stable tag: 1.1.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
151
 
152
  == Changelog ==
153
 
154
+ = 1.1.15 =
155
+
156
+ * Updated: YITH WooCommerce Multi Vendor
157
+
158
  = 1.1.14 =
159
 
160
  * Fixed: Minor Bugs
161
 
162
  = 1.1.13 =
163
 
164
+ * Updated: YITH WooCommerce Multi Vendor
165
 
166
  = 1.1.12 =
167
 
265
 
266
  == Upgrade Notice ==
267
 
268
+ Last Stable Tag 1.1.15
init.php CHANGED
@@ -7,7 +7,7 @@ Text Domain: yith-essential-kit-for-woocommerce-1
7
  Domain Path: /languages/
8
  Author: YIThemes
9
  Author URI: http://yithemes.com/
10
- Version: 1.1.14
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
7
  Domain Path: /languages/
8
  Author: YIThemes
9
  Author URI: http://yithemes.com/
10
+ Version: 1.1.15
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
modules/yith-woocommerce-ajax-navigation/assets/css/admin.css CHANGED
@@ -1,206 +1,210 @@
1
- /* widget area */
2
- .yith_wcan_placeholder + .spinner {
3
- background-position: center;
4
- float: left;
5
- margin: 10px 0;
6
- width: 100%;
7
- }
8
-
9
- .yith_wcan_placeholder table {
10
- width: 100%;
11
- }
12
-
13
- .yith_wcan_placeholder th {
14
- text-align: left;
15
- }
16
-
17
- .yith_wcan_placeholder td {
18
- vertical-align: middle;
19
- }
20
-
21
- p.yit-wcan-display-label,
22
- p.yit-wcan-display-color,
23
- p#yit-wcan-style,
24
- p#yit-wcan-show-count,
25
- p.yit-wcan-display-tags,
26
- div.yit-wcan-widget-tag-list {
27
- display: none;
28
- }
29
-
30
- div.yit-wcan-widget-tag-list.tags{
31
- display: block;
32
- }
33
-
34
- p#yit-wcan-style.yit-wcan-style-color,
35
- p#yit-wcan-style.yit-wcan-style-multicolor,
36
- p#yit-wcan-show-count.yit-wcan-show-count-list,
37
- p#yit-wcan-show-count.yit-wcan-show-count-brands,
38
- p#yit-wcan-show-count.yit-wcan-show-count-tags{
39
- display: block;
40
- }
41
-
42
- label.yith-wcan-reset-table{
43
- width: 50%;
44
- display: inline-block;
45
- vertical-align: top;
46
- }
47
-
48
- /* Options Panel Customizzation */
49
-
50
- .plugin-option .form-table tr {
51
- background-color: #ffffff;
52
- border: none;
53
- }
54
-
55
- .plugin-option .form-table tr th {
56
- padding: 20px 10px 20px 20px;
57
- }
58
-
59
- .yith_wcan_placeholder .wp-picker-holder {
60
- position: absolute;
61
- z-index: 999;
62
- }
63
-
64
- .yith-wcan-multicolor .wp-picker-container .wp-picker-clear {
65
- display: none;
66
- }
67
-
68
- /* == Panel Customization === */
69
-
70
- .yit-plugins_page_yith_wcan_panel .plugin-option{
71
- margin-right: 15px;
72
- }
73
-
74
- .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options .option {
75
- width: 270px;
76
- }
77
-
78
- .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options.on_off_container .option {
79
- width: 100px;
80
- }
81
-
82
- .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options.on_off_container .description {
83
- line-height: 38px;
84
- }
85
-
86
- .yit-plugins_page_yith_wcan_panel .plugin-option .form-table tr th {
87
- width: 240px;
88
- }
89
-
90
- div#yit_wcan_options_yith_wcan_dropdown_style-container .select_wrapper,
91
- div#yit_wcan_options_yith_wcan_tag_query_option-container .select_wrapper {
92
- width: 220px;
93
- }
94
-
95
- input.yith-wcan-price-filter-input.widefat {
96
- width: 30%;
97
- display: inline-block;
98
- margin-bottom: 10px;
99
- margin-right: 15px;
100
- }
101
-
102
- .yith-wcan-price-filter label {
103
- display: block;
104
- margin-bottom: 15px;
105
- }
106
-
107
- .yith-add-new-range-button {
108
- margin-bottom: 15px;
109
- }
110
-
111
- .plugin-option .form-table td .yith_wcan_select_tag tbody td,
112
- .plugin-option .form-table td .yith_wcan_select_tag thead td{
113
- padding: 5px 5px 5px 0;
114
- line-height: 0;
115
- }
116
-
117
- .plugin-option .form-table td .yith_wcan_select_tag tbody td.term_count{
118
- text-align: center;
119
- }
120
-
121
- .plugin-option .form-table td .yith_wcan_select_tag thead {
122
- margin-bottom: 15px;
123
- }
124
-
125
- .plugin-option .form-table td .yith_wcan_select_tag thead td{
126
- font-weight: bold;
127
- text-transform: uppercase;
128
- padding-bottom: 25px;
129
- }
130
-
131
- .yith_wcan_select_tag_wrapper {
132
- max-height: 150px;
133
- overflow-y: scroll;
134
- overflow-x: hidden;
135
- }
136
-
137
- .yith_wcan_select_tag_wrapper .term_count{
138
- text-align: center;
139
- }
140
-
141
- .yith_wcan_tags_query_type{
142
- margin-bottom: 15px;
143
- }
144
-
145
- .yith-wcan-select-option .select-all {
146
- margin-right: 15px;
147
- }
148
- .yith-wcan-select-option .select-all,
149
- .yith-wcan-select-option .unselect-all {
150
- text-decoration: none;
151
- font-size: 12px;
152
- font-weight: bold;
153
- text-transform: uppercase;
154
- margin-bottom: 5px;
155
- display: inline-block;
156
- }
157
-
158
- .yith-wcan-select-option a.select-all:focus,
159
- .yith-wcan-select-option a.unselect-all:focus{
160
- -webkit-box-shadow: none;
161
- box-shadow: none;
162
- }
163
-
164
- .yith-wcan-admin-note {
165
- display: block;
166
- font-style: italic;
167
- }
168
-
169
- .yith-wcan-admin-note-star {
170
- font-size: 8px;
171
- }
172
-
173
- #yith-wcan-tag-list-messages {
174
- display: none;
175
- background-color: #FAFAFA ;
176
- border: 1px solid #e5e5e5;
177
- -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
178
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
179
- padding: 5px;
180
- border-radius: 5px;
181
- font-size: 12px;
182
- }
183
-
184
- input#yit_wcan_options_yith_wcan_ajax_shop_pagination,
185
- input#yit_wcan_options_yith_wcan_ajax_shop_container,
186
- input#yit_wcan_options_yith_wcan_ajax_shop_result_container,
187
- input#yit_wcan_options_yith_wcan_ajax_widget_title_class,
188
- input#yit_wcan_options_yith_wcan_ajax_widget_title_tag {
189
- width: 230px;
190
- }
191
-
192
- div#yit_wcan_options_yith_wcan_custom_style-container .option {
193
- width: 85%;
194
- }
195
-
196
- textarea#yit_wcan_options_yith_wcan_custom_style {
197
- min-height: 300px;
198
- padding: 8px;
199
- resize: none;
200
- }
201
-
202
- div#yit_wcan_options_yith_wcan_seo_value-container .option,
203
- div#yit_wcan_options_yith_wcan_seo_value-container .option .select_wrapper,
204
- #yit_wcan_options_yith_wcan_seo_option-container .select_wrapper {
205
- width: auto;
 
 
 
 
206
  }
1
+ /* widget area */
2
+ .yith_wcan_placeholder + .spinner {
3
+ background-position: center;
4
+ float: left;
5
+ margin: 10px 0;
6
+ width: 100%;
7
+ }
8
+
9
+ .yith_wcan_placeholder table {
10
+ width: 100%;
11
+ }
12
+
13
+ .yith_wcan_placeholder th {
14
+ text-align: left;
15
+ }
16
+
17
+ .yith_wcan_placeholder td {
18
+ vertical-align: middle;
19
+ }
20
+
21
+ p.yit-wcan-display-label,
22
+ p.yit-wcan-display-color,
23
+ p#yit-wcan-style,
24
+ p#yit-wcan-show-count,
25
+ p.yit-wcan-display-tags,
26
+ div.yit-wcan-widget-tag-list {
27
+ display: none;
28
+ }
29
+
30
+ div.yit-wcan-widget-tag-list.tags{
31
+ display: block;
32
+ }
33
+
34
+ p#yit-wcan-style.yit-wcan-style-color,
35
+ p#yit-wcan-style.yit-wcan-style-multicolor,
36
+ p#yit-wcan-show-count.yit-wcan-show-count-list,
37
+ p#yit-wcan-show-count.yit-wcan-show-count-brands,
38
+ p#yit-wcan-show-count.yit-wcan-show-count-tags{
39
+ display: block;
40
+ }
41
+
42
+ label.yith-wcan-reset-table{
43
+ width: 50%;
44
+ display: inline-block;
45
+ vertical-align: top;
46
+ }
47
+
48
+ /* Options Panel Customizzation */
49
+
50
+ .plugin-option .form-table tr {
51
+ background-color: #ffffff;
52
+ border: none;
53
+ }
54
+
55
+ .plugin-option .form-table tr th {
56
+ padding: 20px 10px 20px 20px;
57
+ }
58
+
59
+ .yith_wcan_placeholder .wp-picker-holder {
60
+ position: absolute;
61
+ z-index: 999;
62
+ }
63
+
64
+ .yith-wcan-multicolor .wp-picker-container .wp-picker-clear {
65
+ display: none;
66
+ }
67
+
68
+ /* == Panel Customization === */
69
+
70
+ .yit-plugins_page_yith_wcan_panel .plugin-option{
71
+ margin-right: 15px;
72
+ }
73
+
74
+ .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options .option {
75
+ width: 270px;
76
+ }
77
+
78
+ .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options .option.yit-upload {
79
+ width: 350px;
80
+ }
81
+
82
+ .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options.on_off_container .option {
83
+ width: 100px;
84
+ }
85
+
86
+ .yit-plugins_page_yith_wcan_panel .plugin-option .yit-options .option, .plugin-option .yit_options.on_off_container .description {
87
+ line-height: 38px;
88
+ }
89
+
90
+ .yit-plugins_page_yith_wcan_panel .plugin-option .form-table tr th {
91
+ width: 240px;
92
+ }
93
+
94
+ div#yit_wcan_options_yith_wcan_dropdown_style-container .select_wrapper,
95
+ div#yit_wcan_options_yith_wcan_tag_query_option-container .select_wrapper {
96
+ width: 220px;
97
+ }
98
+
99
+ input.yith-wcan-price-filter-input.widefat {
100
+ width: 30%;
101
+ display: inline-block;
102
+ margin-bottom: 10px;
103
+ margin-right: 15px;
104
+ }
105
+
106
+ .yith-wcan-price-filter label {
107
+ display: block;
108
+ margin-bottom: 15px;
109
+ }
110
+
111
+ .yith-add-new-range-button {
112
+ margin-bottom: 15px;
113
+ }
114
+
115
+ .plugin-option .form-table td .yith_wcan_select_tag tbody td,
116
+ .plugin-option .form-table td .yith_wcan_select_tag thead td{
117
+ padding: 5px 5px 5px 0;
118
+ line-height: 0;
119
+ }
120
+
121
+ .plugin-option .form-table td .yith_wcan_select_tag tbody td.term_count{
122
+ text-align: center;
123
+ }
124
+
125
+ .plugin-option .form-table td .yith_wcan_select_tag thead {
126
+ margin-bottom: 15px;
127
+ }
128
+
129
+ .plugin-option .form-table td .yith_wcan_select_tag thead td{
130
+ font-weight: bold;
131
+ text-transform: uppercase;
132
+ padding-bottom: 25px;
133
+ }
134
+
135
+ .yith_wcan_select_tag_wrapper {
136
+ max-height: 150px;
137
+ overflow-y: scroll;
138
+ overflow-x: hidden;
139
+ }
140
+
141
+ .yith_wcan_select_tag_wrapper .term_count{
142
+ text-align: center;
143
+ }
144
+
145
+ .yith_wcan_tags_query_type{
146
+ margin-bottom: 15px;
147
+ }
148
+
149
+ .yith-wcan-select-option .select-all {
150
+ margin-right: 15px;
151
+ }
152
+ .yith-wcan-select-option .select-all,
153
+ .yith-wcan-select-option .unselect-all {
154
+ text-decoration: none;
155
+ font-size: 12px;
156
+ font-weight: bold;
157
+ text-transform: uppercase;
158
+ margin-bottom: 5px;
159
+ display: inline-block;
160
+ }
161
+
162
+ .yith-wcan-select-option a.select-all:focus,
163
+ .yith-wcan-select-option a.unselect-all:focus{
164
+ -webkit-box-shadow: none;
165
+ box-shadow: none;
166
+ }
167
+
168
+ .yith-wcan-admin-note {
169
+ display: block;
170
+ font-style: italic;
171
+ }
172
+
173
+ .yith-wcan-admin-note-star {
174
+ font-size: 8px;
175
+ }
176
+
177
+ #yith-wcan-tag-list-messages {
178
+ display: none;
179
+ background-color: #FAFAFA ;
180
+ border: 1px solid #e5e5e5;
181
+ -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
182
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
183
+ padding: 5px;
184
+ border-radius: 5px;
185
+ font-size: 12px;
186
+ }
187
+
188
+ input#yit_wcan_options_yith_wcan_ajax_shop_pagination,
189
+ input#yit_wcan_options_yith_wcan_ajax_shop_container,
190
+ input#yit_wcan_options_yith_wcan_ajax_shop_result_container,
191
+ input#yit_wcan_options_yith_wcan_ajax_widget_title_class,
192
+ input#yit_wcan_options_yith_wcan_ajax_widget_title_tag {
193
+ width: 230px;
194
+ }
195
+
196
+ div#yit_wcan_options_yith_wcan_custom_style-container .option {
197
+ width: 85%;
198
+ }
199
+
200
+ textarea#yit_wcan_options_yith_wcan_custom_style {
201
+ min-height: 300px;
202
+ padding: 8px;
203
+ resize: none;
204
+ }
205
+
206
+ div#yit_wcan_options_yith_wcan_seo_value-container .option,
207
+ div#yit_wcan_options_yith_wcan_seo_value-container .option .select_wrapper,
208
+ #yit_wcan_options_yith_wcan_seo_option-container .select_wrapper {
209
+ width: auto;
210
  }
modules/yith-woocommerce-ajax-navigation/assets/css/frontend.css CHANGED
@@ -1,269 +1,279 @@
1
- .yith-wcan-group:after {
2
- content: "";
3
- display: table;
4
- clear: both;
5
- }
6
-
7
- .yith-wcan-loading {
8
- background: url('../images/ajax-loader.gif') no-repeat center;
9
- height: 100px;
10
- }
11
-
12
- .woocommerce .widget_layered_nav ul.yith-wcan li span,
13
- .woocommerce-page .widget_layered_nav ul.yith-wcan li span {
14
- cursor: not-allowed;
15
- }
16
-
17
- /* Colors Type */
18
- .yith-wcan-color li {
19
- float: left;
20
- }
21
-
22
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a,
23
- .woocommerce-page .widget_layered_nav ul.yith-wcan-color li a,
24
- .woocommerce .widget_layered_nav ul.yith-wcan-color li span,
25
- .woocommerce-page .widget_layered_nav ul.yith-wcan-color li span {
26
- border: 1px solid #ddd;
27
- display: block;
28
- height: 20px;
29
- margin: 5px 5px 5px 0;
30
- padding: 0;
31
- width: 20px;
32
- overflow: hidden;
33
- text-indent: 100%;
34
- white-space: nowrap;
35
- box-sizing: content-box;
36
- }
37
-
38
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a:hover,
39
- .woocommerce-page .widget_layered_nav ul.yith-wcan-color li a:hover,
40
- .woocommerce .widget_layered_nav ul.yith-wcan-color li.chosen a,
41
- .woocommerce-page .widget_layered_nav ul.yith-wcan-color li.chosen a,
42
- .woocommerce .widget_layered_nav ul.yith-wcan-color li span:hover,
43
- .woocommerce-page .widget_layered_nav ul.yith-wcan-color li span:hover,
44
- .woocommerce .widget_layered_nav ul.yith-wcan-color li.chosen span,
45
- .woocommerce-page .widget_layered_nav ul.yith-wcan-color li.chosen span {
46
- border: 1px solid #444;
47
- background-image: none;
48
- -webkit-border-radius: 0;
49
- -moz-border-radius: 0;
50
- border-radius: 0;
51
- }
52
-
53
- /* Labels Type */
54
- .yith-wcan-label li {
55
- float: left;
56
- }
57
-
58
- .woocommerce .widget_layered_nav ul.yith-wcan-label li a,
59
- .woocommerce-page .widget_layered_nav ul.yith-wcan-label li a,
60
- .woocommerce .widget_layered_nav ul.yith-wcan-label li span,
61
- .woocommerce-page .widget_layered_nav ul.yith-wcan-label li span {
62
- background: #efefef;
63
- border: 1px solid #ddd;
64
- display: block;
65
- margin: 5px 5px 5px 0;
66
- padding: 2px;
67
- overflow: hidden;
68
- text-decoration: none;
69
- }
70
-
71
- .woocommerce .widget_layered_nav ul.yith-wcan-label li a:hover,
72
- .woocommerce-page .widget_layered_nav ul.yith-wcan-label li a:hover,
73
- .woocommerce .widget_layered_nav ul.yith-wcan-label li.chosen a,
74
- .woocommerce-page .widget_layered_nav ul.yith-wcan-label li.chosen a {
75
- border: 1px solid #444;
76
- background-image: none;
77
- background-color: #ad74a2;
78
- color: #fff;
79
-
80
- -webkit-border-radius: 0;
81
- -moz-border-radius: 0;
82
- border-radius: 0;
83
- }
84
-
85
- /* DROPDOWN STYLE */
86
-
87
- .yit-wcan-select-open {
88
- background: transparent url(../images/select-arrow.png) top 15px right no-repeat;
89
- border: 1px solid #cecece;
90
- color: #838383;
91
- display: block;
92
- line-height: 16px;
93
- margin-bottom: 15px;
94
- margin-top: 15px;
95
- overflow: hidden;
96
- padding: 10px 30px 10px 10px;
97
- }
98
-
99
- .yit-wcan-select-open.active {
100
- background: transparent url(../images/select-arrow.png) bottom 15px right no-repeat;
101
- }
102
-
103
- .yith-wcan-select-wrapper {
104
- background: #ffffff;
105
- margin: 0 4px 4px 0;
106
- max-height: 240px;
107
- padding-bottom: 30px;
108
- position: absolute;
109
- overflow-x: hidden;
110
- overflow-y: auto;
111
- max-width: 268px;
112
- width: 100%;
113
- z-index: -1;
114
- border: 1px solid #cecece;
115
- padding: 10px 0px;
116
- margin-top: -16px;
117
- }
118
-
119
- .widget-area .yith-wcan-select-wrapper {
120
- max-width: 260px;
121
- }
122
-
123
- .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li {
124
- padding: 5px 8px;
125
- border-bottom: 1px solid transparent;
126
- border-top: 1px solid transparent;
127
- }
128
-
129
- .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li:hover,
130
- .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen {
131
- -webkit-box-shadow: 0px 3px 0px #F2F2F2 inset, 0px -3px 0px #F2F2F2 inset;
132
- -moz-box-shadow: 0px 3px 0px #f2f2f2 inset, 0px -3px 0px #f2f2f2 inset;
133
- box-shadow: 0px 3px 0px #F2F2F2 inset, 0px -3px 0px #F2F2F2 inset;
134
- border-bottom: 1px solid #cecece;
135
- border-top: 1px solid #cecece;
136
- }
137
-
138
- .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a, .widget .yit-wcan-select-open {
139
- width: 100%;
140
- color: #838383;
141
- box-sizing: border-box;
142
- -moz-box-sizing: border-box; /* Firefox */
143
- }
144
-
145
- .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a, .widget .yit-wcan-select-open {
146
- width: auto;
147
- }
148
-
149
- .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a:hover, .widget .yit-wcan-select-open:hover {
150
- text-decoration: none;
151
- color: #838383;
152
- }
153
-
154
- .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen a, .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen a {
155
- background: transparent url(../images/cross.png) bottom 6px left no-repeat;
156
- border: none;
157
- }
158
-
159
- /* WooCommerce 2.1.X Fix */
160
- .woocommerce .widget_layered_nav ul.yith-wcan-select li.chosen a:before,
161
- .woocommerce-page .widget_layered_nav ul.yith-wcan-select li.chosen a:before {
162
- content: "";
163
- }
164
-
165
- /* Hierarchical Order */
166
- .widget.widget_layered_nav li.yit-wcan-child-terms {
167
- padding-left: 30px;
168
- }
169
-
170
- .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li.yit-wcan-child-terms {
171
- padding-left: 30px;
172
- }
173
-
174
- /* widget dropdown */
175
- .widget h1.with-dropdown,
176
- .widget h2.with-dropdown,
177
- .widget h3.with-dropdown,
178
- .widget h4.with-dropdown,
179
- .widget h5.with-dropdown,
180
- .widget h6.with-dropdown {
181
- position: relative;
182
- cursor: pointer;
183
- }
184
-
185
- .widget h1.with-dropdown .widget-dropdown,
186
- .widget h2.with-dropdown .widget-dropdown,
187
- .widget h3.with-dropdown .widget-dropdown,
188
- .widget h4.with-dropdown .widget-dropdown,
189
- .widget h5.with-dropdown .widget-dropdown,
190
- .widget h6.with-dropdown .widget-dropdown {
191
- border-width: 0;
192
- width: 22px;
193
- height: 22px;
194
- background: url(../images/select-arrow.png) top 0px right no-repeat;
195
- background-size: 95% !important;
196
- position: absolute;
197
- top: 0;
198
- right: 0;
199
- }
200
-
201
- .widget h1.with-dropdown.open .widget-dropdown,
202
- .widget h2.with-dropdown.open .widget-dropdown,
203
- .widget h3.with-dropdown.open .widget-dropdown,
204
- .widget h4.with-dropdown.open .widget-dropdown,
205
- .widget h5.with-dropdown.open .widget-dropdown,
206
- .widget h6.with-dropdown.open .widget-dropdown {
207
- background-position: bottom 15px right;
208
- }
209
-
210
- /* === Sort By === */
211
-
212
- .yith-wcan-sort-by ul.orderby {
213
- list-style: none;
214
- padding: 0;
215
- }
216
-
217
- .yith-wcan-sort-by ul.orderby li.orderby-wrapper {
218
- margin-bottom: 5px;
219
- }
220
-
221
- .yith-wcan-sort-by ul.orderby li.orderby-wrapper a.active:before,
222
- a.yith-wcan-onsale-button.active:before,
223
- a.yith-wcan-instock-button.active:before,
224
- a.yith-wcan-price-link.active:before {
225
- font-family: WooCommerce;
226
- speak: none;
227
- font-variant: normal;
228
- text-transform: none;
229
- -webkit-font-smoothing: antialiased;
230
- text-decoration: none;
231
- font-weight: 400;
232
- line-height: 1;
233
- content:"";
234
- color: #a00;
235
- margin-right: .618em;
236
- }
237
-
238
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a.multicolor {
239
- position: relative;
240
- }
241
-
242
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a span.multicolor {
243
- width: 0;
244
- height: 0;
245
- border-style: solid;
246
- position: absolute;
247
- top: 0;
248
- left: 0;
249
- margin: 0;
250
- cursor: pointer;
251
- }
252
-
253
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a span.multicolor.color-1{
254
- border-width: 20px 20px 0 0;
255
- }
256
-
257
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a span.multicolor.color-2{
258
- border-width: 0 0 20px 20px;
259
- }
260
-
261
- .woocommerce .widget_layered_nav ul.yith-wcan-color li a.multicolor.round {
262
- border-radius: 50%;
263
- }
264
- .woocommerce .widget_price_filter .price_slider_amount #min_price.yith_wcan_no_slider,
265
- .woocommerce .widget_price_filter .price_slider_amount #max_price.yith_wcan_no_slider {
266
- margin-bottom: 10px;
267
- }
268
-
269
-
 
 
 
 
 
 
 
 
 
 
1
+ .yith-wcan-group:after {
2
+ content: "";
3
+ display: table;
4
+ clear: both;
5
+ }
6
+
7
+ .yith-wcan-loading {
8
+ background: url('../images/ajax-loader.gif') no-repeat center;
9
+ height: 100px;
10
+ }
11
+
12
+ .woocommerce .widget_layered_nav ul.yith-wcan li span,
13
+ .woocommerce-page .widget_layered_nav ul.yith-wcan li span {
14
+ cursor: not-allowed;
15
+ }
16
+
17
+ /* Colors Type */
18
+ .yith-wcan-color li {
19
+ float: left;
20
+ }
21
+
22
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a,
23
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-color li a,
24
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li span,
25
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-color li span {
26
+ border: 1px solid #ddd;
27
+ display: block;
28
+ height: 20px;
29
+ margin: 5px 5px 5px 0;
30
+ padding: 0;
31
+ width: 20px;
32
+ overflow: hidden;
33
+ text-indent: 100%;
34
+ white-space: nowrap;
35
+ box-sizing: content-box;
36
+ }
37
+
38
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a:hover,
39
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-color li a:hover,
40
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li.chosen a,
41
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-color li.chosen a,
42
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li span:hover,
43
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-color li span:hover,
44
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li.chosen span,
45
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-color li.chosen span {
46
+ border: 1px solid #444;
47
+ background-image: none;
48
+ -webkit-border-radius: 0;
49
+ -moz-border-radius: 0;
50
+ border-radius: 0;
51
+ }
52
+
53
+ /* Labels Type */
54
+ .yith-wcan-label li {
55
+ float: left;
56
+ }
57
+
58
+ .woocommerce .widget_layered_nav ul.yith-wcan-label li a,
59
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-label li a,
60
+ .woocommerce .widget_layered_nav ul.yith-wcan-label li span,
61
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-label li span {
62
+ background: #efefef;
63
+ border: 1px solid #ddd;
64
+ display: block;
65
+ margin: 5px 5px 5px 0;
66
+ padding: 2px;
67
+ overflow: hidden;
68
+ text-decoration: none;
69
+ }
70
+
71
+ .woocommerce .widget_layered_nav ul.yith-wcan-label li a:hover,
72
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-label li a:hover,
73
+ .woocommerce .widget_layered_nav ul.yith-wcan-label li.chosen a,
74
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-label li.chosen a {
75
+ border: 1px solid #444;
76
+ background-image: none;
77
+ background-color: #ad74a2;
78
+ color: #fff;
79
+
80
+ -webkit-border-radius: 0;
81
+ -moz-border-radius: 0;
82
+ border-radius: 0;
83
+ }
84
+
85
+ /* DROPDOWN STYLE */
86
+
87
+ .yit-wcan-select-open {
88
+ background: transparent url(../images/select-arrow.png) top 15px right no-repeat;
89
+ border: 1px solid #cecece;
90
+ color: #838383;
91
+ display: block;
92
+ line-height: 16px;
93
+ margin-bottom: 15px;
94
+ margin-top: 15px;
95
+ overflow: hidden;
96
+ padding: 10px 30px 10px 10px;
97
+ }
98
+
99
+ .yit-wcan-select-open.active {
100
+ background: transparent url(../images/select-arrow.png) bottom 15px right no-repeat;
101
+ }
102
+
103
+ .yith-wcan-select-wrapper {
104
+ background: #ffffff;
105
+ margin: 0 4px 4px 0;
106
+ max-height: 240px;
107
+ padding-bottom: 30px;
108
+ position: absolute;
109
+ overflow-x: hidden;
110
+ overflow-y: auto;
111
+ max-width: 268px;
112
+ width: 100%;
113
+ z-index: -1;
114
+ border: 1px solid #cecece;
115
+ padding: 10px 0px;
116
+ margin-top: -16px;
117
+ }
118
+
119
+ .widget-area .yith-wcan-select-wrapper {
120
+ max-width: 260px;
121
+ }
122
+
123
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li {
124
+ padding: 5px 8px;
125
+ border-bottom: 1px solid transparent;
126
+ border-top: 1px solid transparent;
127
+ }
128
+
129
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li:hover,
130
+ .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen {
131
+ -webkit-box-shadow: 0px 3px 0px #F2F2F2 inset, 0px -3px 0px #F2F2F2 inset;
132
+ -moz-box-shadow: 0px 3px 0px #f2f2f2 inset, 0px -3px 0px #f2f2f2 inset;
133
+ box-shadow: 0px 3px 0px #F2F2F2 inset, 0px -3px 0px #F2F2F2 inset;
134
+ border-bottom: 1px solid #cecece;
135
+ border-top: 1px solid #cecece;
136
+ }
137
+
138
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a, .widget .yit-wcan-select-open {
139
+ width: 100%;
140
+ color: #838383;
141
+ box-sizing: border-box;
142
+ -moz-box-sizing: border-box; /* Firefox */
143
+ }
144
+
145
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a, .widget .yit-wcan-select-open {
146
+ width: auto;
147
+ display: block;
148
+ }
149
+
150
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li.chosen a{
151
+ padding: 0;
152
+ }
153
+
154
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a:hover, .widget .yit-wcan-select-open:hover {
155
+ text-decoration: none;
156
+ color: #838383;
157
+ }
158
+
159
+ .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen a, .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen a {
160
+ background: transparent url(../images/cross.png) bottom 6px left no-repeat;
161
+ border: none;
162
+ }
163
+
164
+ /* WooCommerce 2.1.X Fix */
165
+ .woocommerce .widget_layered_nav ul.yith-wcan-select li.chosen a:before,
166
+ .woocommerce-page .widget_layered_nav ul.yith-wcan-select li.chosen a:before {
167
+ content: "";
168
+ }
169
+
170
+ /* Hierarchical Order */
171
+ .widget.widget_layered_nav li.yit-wcan-child-terms {
172
+ padding-left: 30px;
173
+ }
174
+
175
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li.yit-wcan-child-terms {
176
+ padding-left: 30px;
177
+ }
178
+
179
+ /* widget dropdown */
180
+ .widget h1.with-dropdown,
181
+ .widget h2.with-dropdown,
182
+ .widget h3.with-dropdown,
183
+ .widget h4.with-dropdown,
184
+ .widget h5.with-dropdown,
185
+ .widget h6.with-dropdown {
186
+ position: relative;
187
+ cursor: pointer;
188
+ }
189
+
190
+ .widget h1.with-dropdown .widget-dropdown,
191
+ .widget h2.with-dropdown .widget-dropdown,
192
+ .widget h3.with-dropdown .widget-dropdown,
193
+ .widget h4.with-dropdown .widget-dropdown,
194
+ .widget h5.with-dropdown .widget-dropdown,
195
+ .widget h6.with-dropdown .widget-dropdown {
196
+ border-width: 0;
197
+ width: 22px;
198
+ height: 22px;
199
+ background: url(../images/select-arrow.png) top 0px right no-repeat;
200
+ background-size: 95% !important;
201
+ position: absolute;
202
+ top: 0;
203
+ right: 0;
204
+ }
205
+
206
+ .widget h1.with-dropdown.open .widget-dropdown,
207
+ .widget h2.with-dropdown.open .widget-dropdown,
208
+ .widget h3.with-dropdown.open .widget-dropdown,
209
+ .widget h4.with-dropdown.open .widget-dropdown,
210
+ .widget h5.with-dropdown.open .widget-dropdown,
211
+ .widget h6.with-dropdown.open .widget-dropdown {
212
+ background-position: bottom 15px right;
213
+ }
214
+
215
+ /* === Sort By === */
216
+
217
+ .yith-wcan-sort-by ul.orderby {
218
+ list-style: none;
219
+ padding: 0;
220
+ }
221
+
222
+ .yith-wcan-sort-by ul.orderby li.orderby-wrapper {
223
+ margin-bottom: 5px;
224
+ }
225
+
226
+ .yith-wcan-sort-by ul.orderby li.orderby-wrapper a.active:before,
227
+ a.yith-wcan-onsale-button.active:before,
228
+ a.yith-wcan-instock-button.active:before,
229
+ a.yith-wcan-price-link.active:before {
230
+ font-family: WooCommerce;
231
+ speak: none;
232
+ font-variant: normal;
233
+ text-transform: none;
234
+ -webkit-font-smoothing: antialiased;
235
+ text-decoration: none;
236
+ font-weight: 400;
237
+ line-height: 1;
238
+ content:"";
239
+ color: #a00;
240
+ margin-right: .618em;
241
+ }
242
+
243
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a.multicolor {
244
+ position: relative;
245
+ }
246
+
247
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a span.multicolor {
248
+ width: 0;
249
+ height: 0;
250
+ border-style: solid;
251
+ position: absolute;
252
+ top: 0;
253
+ left: 0;
254
+ margin: 0;
255
+ cursor: pointer;
256
+ }
257
+
258
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a span.multicolor.color-1{
259
+ border-width: 20px 20px 0 0;
260
+ }
261
+
262
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a span.multicolor.color-2{
263
+ border-width: 0 0 20px 20px;
264
+ }
265
+
266
+ .woocommerce .widget_layered_nav ul.yith-wcan-color li a.multicolor.round {
267
+ border-radius: 50%;
268
+ }
269
+
270
+ .woocommerce .widget_price_filter .price_slider_amount button {
271
+ display: none;
272
+ }
273
+
274
+ .woocommerce .widget_price_filter .price_slider_amount #min_price.yith_wcan_no_slider,
275
+ .woocommerce .widget_price_filter .price_slider_amount #max_price.yith_wcan_no_slider {
276
+ margin-bottom: 10px;
277
+ }
278
+
279
+
modules/yith-woocommerce-ajax-navigation/assets/images/06.png CHANGED
Binary file
modules/yith-woocommerce-ajax-navigation/assets/images/07.png CHANGED
Binary file
modules/yith-woocommerce-ajax-navigation/assets/images/08-bg.png ADDED
Binary file
modules/yith-woocommerce-ajax-navigation/assets/images/08-icon.png ADDED
Binary file
modules/yith-woocommerce-ajax-navigation/assets/images/08.png ADDED
Binary file
modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-admin.js CHANGED
@@ -1,118 +1,118 @@
1
- /**
2
- * Admin
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Ajax Navigation
6
- * @version 1.3.2
7
- */
8
- jQuery(function ($) {
9
- $.add_new_range = function () {
10
- var range_filter = $('#widgets-right').find('.range-filter'),
11
- input_field = range_filter.find('input:last-child'),
12
- field_name = range_filter.data('field_name'),
13
- position = parseInt(input_field.data('position')) + 1,
14
- html = '<input type="text" placeholder="min" name="' + field_name + '[' + position + '][min]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>' +
15
- '<input type="text" placeholder="max" name="' + field_name + '[' + position + '][max]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>';
16
-
17
- range_filter.append(html);
18
- };
19
-
20
- $.select_dropdown = function( elem ) { console.log( elem );
21
- var t = elem,
22
- select = t.parents('p').next('p');
23
-
24
- t.is(':checked') ? select.fadeIn('slow') : select.fadeOut('slow');
25
- }
26
-
27
- $(document).on('change', '.yith_wcan_type, .yith_wcan_attributes', function (e) {
28
- var t = this,
29
- container = $(this).parents('.widget-content').find('.yith_wcan_placeholder').html(''),
30
- spinner = container.next('.spinner').show(),
31
- display = $(this).parents('.widget-content').find('#yit-wcan-display'),
32
- style = $(this).parents('.widget-content').find('#yit-wcan-style'),
33
- show_count = $(this).parents('.widget-content').find('#yit-wcan-show-count'),
34
- attributes = $(this).parents('.widget-content').find('.yith-wcan-attribute-list'),
35
- tag_list = $(this).parents('.widget-content').find('.yit-wcan-widget-tag-list');
36
-
37
- var data = {
38
- action : 'yith_wcan_select_type',
39
- id : $('input[name=widget_id]', $(t).parents('.widget-content')).val(),
40
- name : $('input[name=widget_name]', $(t).parents('.widget-content')).val(),
41
- attribute: $('.yith_wcan_attributes', $(t).parents('.widget-content')).val(),
42
- value : $('.yith_wcan_type', $(t).parents('.widget-content')).val()
43
- };
44
-
45
- /* Hierarchical hide/show */
46
- if (data.value == 'list' || data.value == 'select' || data.value == 'brands' || data.value == 'tags' ) {
47
- display.show();
48
- style.hide();
49
- } else if (data.value == 'label' || data.value == 'color' || data.value == 'multicolor' ) {
50
- display.hide();
51
- }
52
-
53
- if( data.value == 'color' || data.value == 'multicolor' ){
54
- style.show();
55
- } else {
56
- style.hide();
57
- }
58
-
59
- if( data.value == 'list' || data.value == 'tags' || data.value == 'brands' ){
60
- show_count.show();
61
- } else {
62
- show_count.hide();
63
- }
64
-
65
- if( data.value == 'tags' || data.value == 'brands' ){
66
- attributes.hide();
67
- } else {
68
- attributes.show();
69
- }
70
-
71
- if( data.value == 'tags' ){
72
- tag_list.show();
73
- } else {
74
- tag_list.hide();
75
- }
76
-
77
- $.post(ajaxurl, data, function (response) {
78
- spinner.hide();
79
- container.html(response.content);
80
- $(document).trigger('yith_colorpicker');
81
- }, 'json');
82
- });
83
-
84
- //color-picker
85
- $(document).on('yith_colorpicker',function () {
86
- $('.yith-colorpicker').each(function () {
87
- $(this).wpColorPicker();
88
- });
89
- }).trigger('yith_colorpicker');
90
-
91
- $(document).on('change', '.yith-wcan-enable-custom-style', function(){
92
- var t = $(this),
93
- enable_custom_style = t.parents('.widget-content').find('.yith-wcan-reset-custom-style'),
94
- checked = t.find('.yith-wcan-enable-custom-style-check').is(':checked');
95
-
96
- checked ? enable_custom_style.fadeIn('slow') : enable_custom_style.fadeOut('slow');
97
- });
98
-
99
- $(document).on('change', '.yith-wcan-dropdown-check', function(){
100
- $.select_dropdown( $(this) );
101
- });
102
-
103
- //Filter By Tag tab
104
- var select_all = $('.yith-wcan-select-option .select-all'),
105
- unselect_all = $('.yith-wcan-select-option .unselect-all'),
106
- checklist = $('.yith_wcan_select_tag'),
107
- widget_select = $('#yith-wcan-tag-widget-select');
108
-
109
- select_all.on('click', function(e){
110
- e.preventDefault();
111
- $(this).parents( '.yith-wcan-select-option').next('.yith_wcan_select_tag').find('.yith_wcan_tag_list_checkbox').attr( 'checked', true );
112
- });
113
-
114
- unselect_all.on('click', function(e){
115
- e.preventDefault();
116
- $(this).parents( '.yith-wcan-select-option').next('.yith_wcan_select_tag').find('.yith_wcan_tag_list_checkbox').attr( 'checked', false );
117
- });
118
  });
1
+ /**
2
+ * Admin
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.3.2
7
+ */
8
+ jQuery(function ($) {
9
+ $.add_new_range = function () {
10
+ var range_filter = $('#widgets-right').find('.range-filter'),
11
+ input_field = range_filter.find('input:last-child'),
12
+ field_name = range_filter.data('field_name'),
13
+ position = parseInt(input_field.data('position')) + 1,
14
+ html = '<input type="text" placeholder="min" name="' + field_name + '[' + position + '][min]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>' +
15
+ '<input type="text" placeholder="max" name="' + field_name + '[' + position + '][max]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>';
16
+
17
+ range_filter.append(html);
18
+ };
19
+
20
+ $.select_dropdown = function( elem ) { console.log( elem );
21
+ var t = elem,
22
+ select = t.parents('p').next('p');
23
+
24
+ t.is(':checked') ? select.fadeIn('slow') : select.fadeOut('slow');
25
+ }
26
+
27
+ $(document).on('change', '.yith_wcan_type, .yith_wcan_attributes', function (e) {
28
+ var t = this,
29
+ container = $(this).parents('.widget-content').find('.yith_wcan_placeholder').html(''),
30
+ spinner = container.next('.spinner').show(),
31
+ display = $(this).parents('.widget-content').find('#yit-wcan-display'),
32
+ style = $(this).parents('.widget-content').find('#yit-wcan-style'),
33
+ show_count = $(this).parents('.widget-content').find('#yit-wcan-show-count'),
34
+ attributes = $(this).parents('.widget-content').find('.yith-wcan-attribute-list'),
35
+ tag_list = $(this).parents('.widget-content').find('.yit-wcan-widget-tag-list');
36
+
37
+ var data = {
38
+ action : 'yith_wcan_select_type',
39
+ id : $('input[name=widget_id]', $(t).parents('.widget-content')).val(),
40
+ name : $('input[name=widget_name]', $(t).parents('.widget-content')).val(),
41
+ attribute: $('.yith_wcan_attributes', $(t).parents('.widget-content')).val(),
42
+ value : $('.yith_wcan_type', $(t).parents('.widget-content')).val()
43
+ };
44
+
45
+ /* Hierarchical hide/show */
46
+ if (data.value == 'list' || data.value == 'select' || data.value == 'brands' || data.value == 'tags' ) {
47
+ display.show();
48
+ style.hide();
49
+ } else if (data.value == 'label' || data.value == 'color' || data.value == 'multicolor' ) {
50
+ display.hide();
51
+ }
52
+
53
+ if( data.value == 'color' || data.value == 'multicolor' ){
54
+ style.show();
55
+ } else {
56
+ style.hide();
57
+ }
58
+
59
+ if( data.value == 'list' || data.value == 'tags' || data.value == 'brands' ){
60
+ show_count.show();
61
+ } else {
62
+ show_count.hide();
63
+ }
64
+
65
+ if( data.value == 'tags' || data.value == 'brands' || data.value == 'categories' ){
66
+ attributes.hide();
67
+ } else {
68
+ attributes.show();
69
+ }
70
+
71
+ if( data.value == 'tags' ){
72
+ tag_list.show();
73
+ } else {
74
+ tag_list.hide();
75
+ }
76
+
77
+ $.post(ajaxurl, data, function (response) {
78
+ spinner.hide();
79
+ container.html(response.content);
80
+ $(document).trigger('yith_colorpicker');
81
+ }, 'json');
82
+ });
83
+
84
+ //color-picker
85
+ $(document).on('yith_colorpicker',function () {
86
+ $('.yith-colorpicker').each(function () {
87
+ $(this).wpColorPicker();
88
+ });
89
+ }).trigger('yith_colorpicker');
90
+
91
+ $(document).on('change', '.yith-wcan-enable-custom-style', function(){
92
+ var t = $(this),
93
+ enable_custom_style = t.parents('.widget-content').find('.yith-wcan-reset-custom-style'),
94
+ checked = t.find('.yith-wcan-enable-custom-style-check').is(':checked');
95
+
96
+ checked ? enable_custom_style.fadeIn('slow') : enable_custom_style.fadeOut('slow');
97
+ });
98
+
99
+ $(document).on('change', '.yith-wcan-dropdown-check', function(){
100
+ $.select_dropdown( $(this) );
101
+ });
102
+
103
+ //Filter By Tag tab
104
+ var select_all = $('.yith-wcan-select-option .select-all'),
105
+ unselect_all = $('.yith-wcan-select-option .unselect-all'),
106
+ checklist = $('.yith_wcan_select_tag'),
107
+ widget_select = $('#yith-wcan-tag-widget-select');
108
+
109
+ select_all.on('click', function(e){
110
+ e.preventDefault();
111
+ $(this).parents( '.yith-wcan-select-option').next('.yith_wcan_select_tag').find('.yith_wcan_tag_list_checkbox').attr( 'checked', true );
112
+ });
113
+
114
+ unselect_all.on('click', function(e){
115
+ e.preventDefault();
116
+ $(this).parents( '.yith-wcan-select-option').next('.yith_wcan_select_tag').find('.yith_wcan_tag_list_checkbox').attr( 'checked', false );
117
+ });
118
  });
modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.js CHANGED
@@ -1,312 +1,321 @@
1
- /**
2
- * Frontend
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Ajax Navigation
6
- * @version 1.3.2
7
- */
8
- jQuery(function ($) {
9
- /**
10
- Copyright (c) 2010, All Right Reserved, Wong Shek Hei @ shekhei@gmail.com
11
- License: GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html)
12
- **/
13
- var expr = /[.#\w].([\S]*)/g, classexpr = /(?!(\[))(\.)[^.#[]*/g, idexpr = /(#)[^.#[]*/, tagexpr = /^[\w]+/, varexpr = /(\w+?)=(['"])([^\2$]*?)\2/, simpleselector = /^[\w]+$/, parseSelector = function (d) {
14
- for (var c = {sel: [], val: []}, a = [], j = !1, h = "", e = [], f = 0, m = d.length; f < m; f++) {
15
- var g = d.charAt(f);
16
- if (j)if ("\\" === g && f + 1 < d.length)e.push(d.charAt(++f)); else if (h === g)h = "", e.push(g); else if (("'" === g || '"' === g) && "" === h)h = g, e.push(g); else if ("]" === g && "" === h)c.val.push(e.join("")), e = [], j = !1; else {
17
- if ("]" !== g || "" !== h)"" === h && "," === g ? (c.val.push(e.join("")),
18
- e = []) : e.push(g)
19
- } else"\\" === g && f + 1 < d.length ? j && e.push(d.charAt(++f)) : "[" === g && "" === h ? j = !0 : " " === g || "+" === g ? (c.sel = c.sel.join(""), a.push(c), "+" === g && a.push({sel: "+", val: ""}), c = {sel: [], val: []}) : " " !== g && "]" !== g && c.sel.push(g)
20
- }
21
- if (0 != c.sel.length || 0 != c.val.length)c.sel = c.sel.join(""), a.push(c);
22
- for (f = 0; f < a.length; f++) {
23
- c = a[f].sel;
24
- if ("+" === c)b.tag = c; else {
25
- var b = [];
26
- b.tag = tagexpr.exec(c);
27
- b.id = idexpr.exec(c);
28
- b.id && $.isArray(b.id) && (b.id = b.id[0].substr(1));
29
- b.tag || (b.tag = "div");
30
- b.vars = [];
31
- for (d = 0; d < a[f].val.length; d++)h =
32
- a[f].val[d].indexOf("="), j = a[f].val[d].substr(0, h), h = a[f].val[d].substr(h + 1), h = h.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g, ""), "text" === j ? b.text = h : b.vars.push([j, h]);
33
- c = c.match(classexpr);
34
- j = [];
35
- if (c) {
36
- for (d = 0; d < c.length; d++)j.push(c[d].substr(1));
37
- b.className = j.join(" ")
38
- }
39
- }
40
- a[f] = b
41
- }
42
- return a
43
- }, rmFromParent = function (d) {
44
- var c = d.parentNode, a = d.nextSibling;
45
- c.removeChild(d);
46
- return a ? function () {
47
- c.insertBefore(d, a)
48
- } : function () {
49
- c.appendChild(d)
50
- }
51
- }, nonArrVer = function (d, c) {
52
- var a = [], a = simpleselector.test(d) ? [
53
- {tag: d}
54
- ] : parseSelector(d),
55
- j = [];
56
- "undefined" === typeof c && (c = 1);
57
- for (var h = [], e = [], f = [], m = document.createElement("div"), g = 0, b = 0; b < a.length; b++) {
58
- if ("+" == a[b].tag)e = f.slice(), --g; else {
59
- for (var l = 0; l < c; l++)if ("input" == a[b].tag) {
60
- var k = [];
61
- k.push("<" + a[b].tag);
62
- a[b].id && k.push("id='" + a[b].id + "'");
63
- a[b].className && (k.push("class='" + a[b].className), b + 1 === a.length && k.push(lastClass), k.push("'"));
64
- if (a[b].vars)for (var n = 0; n < a[b].vars.length; n++)k.push(a[b].vars[n][0] + "='" + a[b].vars[n][1] + "'");
65
- a[b].text && k.push("value='" + a[b].text + "'");
66
- k.push("/>");
67
- f[l] = e[l];
68
- e[l] ? (e[l].innerHTML += k.join(" "), e[l] = e[l].lastChild) : (m.innerHTML = k.join(" "), e[l] = m.removeChild(m.firstChild))
69
- } else {
70
- k = document.createElement(a[b].tag);
71
- if (a[b].vars)for (n = 0; n < a[b].vars.length; n++)console.log(a[b].tag, a[b].vars[n]), k.setAttribute(a[b].vars[n][0], a[b].vars[n][1]);
72
- a[b].id && (k.id = a[b].id);
73
- a[b].className && (k.className = a[b].className);
74
- a[b].text && k.appendChild(document.createTextNode(a[b].text));
75
- f[l] = e[l];
76
- e[l] = e[l] ? e[l].appendChild(k) : k
77
- }
78
- g++ || Array.prototype.push.apply(h, e)
79
- }
80
- j =
81
- $.merge(j, e)
82
- }
83
- return $(h)
84
- }, arrVer = function (d, c, a) {
85
- for (var j = d.match(/%[^%]*%/g) || [], h = [], e = 0; e < c.length; e++) {
86
- for (var f = d, m = 0; m < j.length; m++)var g = j[m].substr(1, j[m].length - 2), f = f.replace(j[m], c[e][g]);
87
- h = $.merge(h, nonArrVer(f, a))
88
- }
89
- return $(h)
90
- };
91
- $.jseldom = function (d) {
92
- if (2 == arguments.length && $.isPlainObject(arguments[1]))return arrVer.apply(this, [arguments[0], [arguments[1]]]);
93
- if (1 == arguments.length || 2 == arguments.length && !$.isArray(arguments[1]))return nonArrVer.apply(this, arguments);
94
- if (2 == arguments.length)return arrVer.apply(this, arguments)
95
- };
96
-
97
- $.fn.yith_wcan_ajax_filters = function (e, obj) {
98
- e.preventDefault();
99
- var href = obj.href,
100
- t = $(obj);
101
-
102
- if (typeof href == 'undefined' && t.parents().hasClass('price_slider_wrapper')) {
103
- var form = t.parents('form'),
104
- l = window.location,
105
- shop_uri = l.origin + l.pathname,
106
- is_filtered = shop_uri != l.href,
107
- search = l.search,
108
- min_price = $('.price_slider_amount #min_price').val(),
109
- max_price = $('.price_slider_amount #max_price').val(),
110
- regex_min = new RegExp('^min_price', 'i'),
111
- regex_max = new RegExp('^max_price', 'i');
112
-
113
- href = l.href;
114
-
115
- if (is_filtered == true) {
116
- href = RemoveParameterFromUrl(href, 'min_price');
117
- href = RemoveParameterFromUrl(href, 'max_price');
118
- }
119
-
120
- var concat = shop_uri == href ? '?' : '&';
121
-
122
- href = href + concat + $.param(
123
- {
124
- min_price: min_price,
125
- max_price: max_price
126
- }
127
- );
128
- }
129
-
130
- if (t.data('type') == 'select') {
131
-
132
- t.parents('div.yith-woo-ajax-navigation').find('a.yit-wcan-select-open').removeClass('active');
133
-
134
- t.parent().find('div.yith-wcan-select-wrapper').animate({
135
-
136
- visibility: "hidden",
137
- opacity : 0
138
-
139
- }, 300);
140
- }
141
-
142
- //loading
143
- $(yith_wcan.container).html('').addClass('yith-wcan-loading');
144
- $(document).trigger("yith-wcan-ajax-loading");
145
-
146
- if (typeof yith_wcan_frontend != 'undefined') {
147
- $(yith_wcan.container).css('backgroundImage', 'url(' + yith_wcan_frontend.loader_url + ')');
148
- }
149
-
150
- $(yith_wcan.pagination).hide();
151
- $(yith_wcan.result_count).hide();
152
-
153
- $.ajax({
154
- url : href,
155
- success: function (response) {
156
- $(yith_wcan.container).removeClass('yith-wcan-loading');
157
-
158
- //container
159
- if ($(response).find(yith_wcan.container).length > 0) {
160
- $('.yit-wcan-container').html($(response).find(yith_wcan.container));
161
- } else {
162
- $('.yit-wcan-container').html($(response).find('.woocommerce-info'));
163
- }
164
-
165
- //pagination
166
- if ($(response).find(yith_wcan.pagination).length > 0) {
167
- //se non esiste lo creo
168
- if ($(yith_wcan.pagination).length == 0) {
169
- $.jseldom(yith_wcan.pagination).insertAfter($(yith_wcan.container));
170
- }
171
-
172
- $(yith_wcan.pagination)
173
- .html($(response).find(yith_wcan.pagination).html())
174
- .show();
175
- }
176
-
177
- else {
178
- $(yith_wcan.pagination).empty();
179
- }
180
-
181
- //result count
182
- if ($(response).find(yith_wcan.result_count).length > 0) {
183
- $(yith_wcan.result_count).html($(response).find(yith_wcan.result_count).html()).show();
184
- }
185
-
186
-
187
- var widget_reload = function (t) {
188
- var id = t.attr('id');
189
- t.html($(response).find('#' + id).html());
190
-
191
- if (t.text() == '') {
192
- t.hide();
193
- } else {
194
- t.show();
195
- }
196
- };
197
-
198
- //load new widgets
199
- $('.yith-woo-ajax-navigation').add('.yith-wcan-sort-by').add('.yith-wcan-stock-on-sale').add('.yith-wcan-list-price-filter').each(function () {
200
- var t = $(this);
201
- widget_reload(t)
202
- });
203
-
204
- //update browser history (IE doesn't support it)
205
- if (!navigator.userAgent.match(/msie/i)) {
206
- window.history.pushState({"pageTitle": response.pageTitle}, "", href);
207
- }
208
-
209
- //trigger ready event
210
- $(document).trigger("ready");
211
- $(document).trigger("yith-wcan-ajax-filtered");
212
- }
213
- });
214
- };
215
-
216
- //wrap the container
217
- $(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');
218
- $('.woocommerce-info').wrap('<div class="yit-wcan-container"></div>');
219
-
220
- $(document).on('click', '.yith-wcan a', function (e) {
221
- $(this).yith_wcan_ajax_filters(e, this);
222
- });
223
-
224
-
225
- /*AJAX NAVIGATION DROPDOWN STYLE*/
226
-
227
- function yit_open_select_dropdown(element) {
228
-
229
- $(element).parent().find('div.yith-wcan-select-wrapper').css("z-index", "1").animate({
230
-
231
- visibility: "visible",
232
- opacity : 1
233
-
234
-
235
- }, 300);
236
-
237
- $(element).parent().find('a.yit-wcan-select-open').addClass('active');
238
- }
239
-
240
- function yit_close_select_dropdown(element) {
241
-
242
- $(element).parent().find('div.yith-wcan-select-wrapper').css("z-index", "-1").animate({
243
-
244
- visibility: "hidden",
245
- opacity : 0
246
-
247
- }, 300);
248
-
249
- $(element).parent().find('a.yit-wcan-select-open').removeClass('active');
250
- }
251
-
252
- var yit_hidden_filters_wrapper = function () {
253
-
254
- $('div.yith-wcan-select-wrapper').animate({
255
-
256
- visibility: "hidden",
257
- opacity : 0
258
-
259
- }, 0);
260
-
261
- $('a.yit-wcan-select-open').removeClass('active');
262
- }
263
-
264
- var yit_active_filter = function () {
265
-
266
- var filter_number = $('div.yith-wcan-select-wrapper ul.yith-wcan-select li.chosen').length;
267
-
268
- yit_hidden_filters_wrapper();
269
-
270
- $('div.yith-wcan-select-wrapper').each(function () {
271
-
272
- var filter_name = "";
273
- var chosen = $(this).find('ul.yith-wcan-select li.chosen').each(function () {
274
- filter_name += $(this).text() + ', ';
275
- });
276
-
277
- filter_name = filter_name.substring(0, filter_name.length - 2);
278
-
279
- if (filter_name != "") {
280
- $(this).parent().find('a.yit-wcan-select-open').text(filter_name);
281
- }
282
- })
283
- }
284
-
285
- $(document).on('click', 'a.yit-wcan-select-open.active', function (e) {
286
- e.preventDefault();
287
- yit_close_select_dropdown(this);
288
- });
289
-
290
- $(document).on('click', 'a.yit-wcan-select-open:not(.active)', function (e) {
291
- e.preventDefault();
292
- yit_open_select_dropdown(this);
293
- });
294
-
295
- $(document).on('ready yith-wcan-ajax-filtered', yit_active_filter);
296
-
297
- $(document).on('ready', yit_hidden_filters_wrapper);
298
-
299
- $('body').on('click', function (e) {
300
-
301
- if (!$(e.target).hasClass('yit-wcan-select-open')) {
302
- yit_hidden_filters_wrapper();
303
- }
304
-
305
- });
306
-
307
- function RemoveParameterFromUrl(url, parameter) {
308
- return url
309
- .replace(new RegExp('[?&]' + parameter + '=[^&#]*(#.*)?$'), '$1')
310
- .replace(new RegExp('([?&])' + parameter + '=[^&]*&'), '$1');
311
- }
312
- });
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Frontend
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.3.2
7
+ */
8
+ jQuery(function ($) {
9
+ /**
10
+ Copyright (c) 2010, All Right Reserved, Wong Shek Hei @ shekhei@gmail.com
11
+ License: GNU Lesser General Public License (http://www.gnu.org/licenses/lgpl.html)
12
+ **/
13
+ var expr = /[.#\w].([\S]*)/g, classexpr = /(?!(\[))(\.)[^.#[]*/g, idexpr = /(#)[^.#[]*/, tagexpr = /^[\w]+/, varexpr = /(\w+?)=(['"])([^\2$]*?)\2/, simpleselector = /^[\w]+$/, parseSelector = function (d) {
14
+ for (var c = {sel: [], val: []}, a = [], j = !1, h = "", e = [], f = 0, m = d.length; f < m; f++) {
15
+ var g = d.charAt(f);
16
+ if (j)if ("\\" === g && f + 1 < d.length)e.push(d.charAt(++f)); else if (h === g)h = "", e.push(g); else if (("'" === g || '"' === g) && "" === h)h = g, e.push(g); else if ("]" === g && "" === h)c.val.push(e.join("")), e = [], j = !1; else {
17
+ if ("]" !== g || "" !== h)"" === h && "," === g ? (c.val.push(e.join("")),
18
+ e = []) : e.push(g)
19
+ } else"\\" === g && f + 1 < d.length ? j && e.push(d.charAt(++f)) : "[" === g && "" === h ? j = !0 : " " === g || "+" === g ? (c.sel = c.sel.join(""), a.push(c), "+" === g && a.push({sel: "+", val: ""}), c = {sel: [], val: []}) : " " !== g && "]" !== g && c.sel.push(g)
20
+ }
21
+ if (0 != c.sel.length || 0 != c.val.length)c.sel = c.sel.join(""), a.push(c);
22
+ for (f = 0; f < a.length; f++) {
23
+ c = a[f].sel;
24
+ if ("+" === c)b.tag = c; else {
25
+ var b = [];
26
+ b.tag = tagexpr.exec(c);
27
+ b.id = idexpr.exec(c);
28
+ b.id && $.isArray(b.id) && (b.id = b.id[0].substr(1));
29
+ b.tag || (b.tag = "div");
30
+ b.vars = [];
31
+ for (d = 0; d < a[f].val.length; d++)h =
32
+ a[f].val[d].indexOf("="), j = a[f].val[d].substr(0, h), h = a[f].val[d].substr(h + 1), h = h.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g, ""), "text" === j ? b.text = h : b.vars.push([j, h]);
33
+ c = c.match(classexpr);
34
+ j = [];
35
+ if (c) {
36
+ for (d = 0; d < c.length; d++)j.push(c[d].substr(1));
37
+ b.className = j.join(" ")
38
+ }
39
+ }
40
+ a[f] = b
41
+ }
42
+ return a
43
+ }, rmFromParent = function (d) {
44
+ var c = d.parentNode, a = d.nextSibling;
45
+ c.removeChild(d);
46
+ return a ? function () {
47
+ c.insertBefore(d, a)
48
+ } : function () {
49
+ c.appendChild(d)
50
+ }
51
+ }, nonArrVer = function (d, c) {
52
+ var a = [], a = simpleselector.test(d) ? [
53
+ {tag: d}
54
+ ] : parseSelector(d),
55
+ j = [];
56
+ "undefined" === typeof c && (c = 1);
57
+ for (var h = [], e = [], f = [], m = document.createElement("div"), g = 0, b = 0; b < a.length; b++) {
58
+ if ("+" == a[b].tag)e = f.slice(), --g; else {
59
+ for (var l = 0; l < c; l++)if ("input" == a[b].tag) {
60
+ var k = [];
61
+ k.push("<" + a[b].tag);
62
+ a[b].id && k.push("id='" + a[b].id + "'");
63
+ a[b].className && (k.push("class='" + a[b].className), b + 1 === a.length && k.push(lastClass), k.push("'"));
64
+ if (a[b].vars)for (var n = 0; n < a[b].vars.length; n++)k.push(a[b].vars[n][0] + "='" + a[b].vars[n][1] + "'");
65
+ a[b].text && k.push("value='" + a[b].text + "'");
66
+ k.push("/>");
67
+ f[l] = e[l];
68
+ e[l] ? (e[l].innerHTML += k.join(" "), e[l] = e[l].lastChild) : (m.innerHTML = k.join(" "), e[l] = m.removeChild(m.firstChild))
69
+ } else {
70
+ k = document.createElement(a[b].tag);
71
+ if (a[b].vars)for (n = 0; n < a[b].vars.length; n++)console.log(a[b].tag, a[b].vars[n]), k.setAttribute(a[b].vars[n][0], a[b].vars[n][1]);
72
+ a[b].id && (k.id = a[b].id);
73
+ a[b].className && (k.className = a[b].className);
74
+ a[b].text && k.appendChild(document.createTextNode(a[b].text));
75
+ f[l] = e[l];
76
+ e[l] = e[l] ? e[l].appendChild(k) : k
77
+ }
78
+ g++ || Array.prototype.push.apply(h, e)
79
+ }
80
+ j =
81
+ $.merge(j, e)
82
+ }
83
+ return $(h)
84
+ }, arrVer = function (d, c, a) {
85
+ for (var j = d.match(/%[^%]*%/g) || [], h = [], e = 0; e < c.length; e++) {
86
+ for (var f = d, m = 0; m < j.length; m++)var g = j[m].substr(1, j[m].length - 2), f = f.replace(j[m], c[e][g]);
87
+ h = $.merge(h, nonArrVer(f, a))
88
+ }
89
+ return $(h)
90
+ };
91
+ $.jseldom = function (d) {
92
+ if (2 == arguments.length && $.isPlainObject(arguments[1]))return arrVer.apply(this, [arguments[0], [arguments[1]]]);
93
+ if (1 == arguments.length || 2 == arguments.length && !$.isArray(arguments[1]))return nonArrVer.apply(this, arguments);
94
+ if (2 == arguments.length)return arrVer.apply(this, arguments)
95
+ };
96
+
97
+ var ajax_call = false;
98
+
99
+ $.fn.yith_wcan_ajax_filters = function (e, obj) {
100
+ e.preventDefault();
101
+ var href = obj.href,
102
+ t = $(obj);
103
+
104
+ if (typeof href == 'undefined' && t.parents().hasClass('price_slider_wrapper')) {
105
+ var form = t.parents('form'),
106
+ l = window.location,
107
+ shop_uri = l.origin + l.pathname,
108
+ is_filtered = shop_uri != l.href,
109
+ search = l.search,
110
+ min_price = $('.price_slider_amount #min_price').val(),
111
+ max_price = $('.price_slider_amount #max_price').val(),
112
+ regex_min = new RegExp('^min_price', 'i'),
113
+ regex_max = new RegExp('^max_price', 'i');
114
+
115
+ href = l.href;
116
+
117
+ if (is_filtered == true) {
118
+ href = RemoveParameterFromUrl(href, 'min_price');
119
+ href = RemoveParameterFromUrl(href, 'max_price');
120
+ }
121
+
122
+ var concat = shop_uri == href ? '?' : '&';
123
+
124
+ href = href + concat + $.param(
125
+ {
126
+ min_price: min_price,
127
+ max_price: max_price
128
+ }
129
+ );
130
+ }
131
+
132
+ if (t.data('type') == 'select') {
133
+
134
+ t.parents('div.yith-woo-ajax-navigation').find('a.yit-wcan-select-open').removeClass('active');
135
+
136
+ t.parent().find('div.yith-wcan-select-wrapper').animate({
137
+
138
+ visibility: "hidden",
139
+ opacity : 0
140
+
141
+ }, 300);
142
+ }
143
+
144
+ //loading
145
+ $(yith_wcan.container).html('').addClass('yith-wcan-loading');
146
+ $(document).trigger("yith-wcan-ajax-loading");
147
+
148
+ if (typeof yith_wcan_frontend != 'undefined') {
149
+ $(yith_wcan.container).css('backgroundImage', 'url(' + yith_wcan_frontend.loader_url + ')');
150
+ }
151
+
152
+ $(yith_wcan.pagination).hide();
153
+ $(yith_wcan.result_count).hide();
154
+
155
+ if( ajax_call != false ){
156
+ ajax_call.abort();
157
+ ajax_call = false;
158
+ console.log( 'here' );
159
+ }
160
+
161
+ ajax_call = $.ajax({
162
+ url : href,
163
+ success: function (response) {
164
+ ajax_call = false;
165
+ $(yith_wcan.container).removeClass('yith-wcan-loading');
166
+
167
+ //container
168
+ if ($(response).find(yith_wcan.container).length > 0) {
169
+ $('.yit-wcan-container').html($(response).find(yith_wcan.container));
170
+ } else {
171
+ $('.yit-wcan-container').html($(response).find('.woocommerce-info'));
172
+ }
173
+
174
+ //pagination
175
+ if ($(response).find(yith_wcan.pagination).length > 0) {
176
+ //se non esiste lo creo
177
+ if ($(yith_wcan.pagination).length == 0) {
178
+ $.jseldom(yith_wcan.pagination).insertAfter($(yith_wcan.container));
179
+ }
180
+
181
+ $(yith_wcan.pagination)
182
+ .html($(response).find(yith_wcan.pagination).html())
183
+ .show();
184
+ }
185
+
186
+ else {
187
+ $(yith_wcan.pagination).empty();
188
+ }
189
+
190
+ //result count
191
+ if ($(response).find(yith_wcan.result_count).length > 0) {
192
+ $(yith_wcan.result_count).html($(response).find(yith_wcan.result_count).html()).show();
193
+ }
194
+
195
+
196
+ var widget_reload = function (t) {
197
+ var id = t.attr('id');
198
+ t.html($(response).find('#' + id).html());
199
+
200
+ if (t.text() == '') {
201
+ t.hide();
202
+ } else {
203
+ t.show();
204
+ }
205
+ };
206
+
207
+ //load new widgets
208
+ $('.yith-woo-ajax-navigation').add('.yith-wcan-sort-by').add('.yith-wcan-stock-on-sale').add('.yith-wcan-list-price-filter').each(function () {
209
+ var t = $(this);
210
+ widget_reload(t)
211
+ });
212
+
213
+ //update browser history (IE doesn't support it)
214
+ if (!navigator.userAgent.match(/msie/i)) {
215
+ window.history.pushState({"pageTitle": response.pageTitle}, "", href);
216
+ }
217
+
218
+ //trigger ready event
219
+ $(document).trigger("ready");
220
+ $(document).trigger("yith-wcan-ajax-filtered");
221
+ }
222
+ });
223
+ };
224
+
225
+ //wrap the container
226
+ $(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');
227
+ $('.woocommerce-info').wrap('<div class="yit-wcan-container"></div>');
228
+
229
+ $(document).on('click', '.yith-wcan a', function (e) {
230
+ $(this).yith_wcan_ajax_filters(e, this);
231
+ });
232
+
233
+
234
+ /*AJAX NAVIGATION DROPDOWN STYLE*/
235
+
236
+ function yit_open_select_dropdown(element) {
237
+
238
+ $(element).parent().find('div.yith-wcan-select-wrapper').css("z-index", "1").animate({
239
+
240
+ visibility: "visible",
241
+ opacity : 1
242
+
243
+
244
+ }, 300);
245
+
246
+ $(element).parent().find('a.yit-wcan-select-open').addClass('active');
247
+ }
248
+
249
+ function yit_close_select_dropdown(element) {
250
+
251
+ $(element).parent().find('div.yith-wcan-select-wrapper').css("z-index", "-1").animate({
252
+
253
+ visibility: "hidden",
254
+ opacity : 0
255
+
256
+ }, 300);
257
+
258
+ $(element).parent().find('a.yit-wcan-select-open').removeClass('active');
259
+ }
260
+
261
+ var yit_hidden_filters_wrapper = function () {
262
+
263
+ $('div.yith-wcan-select-wrapper').animate({
264
+
265
+ visibility: "hidden",
266
+ opacity : 0
267
+
268
+ }, 0);
269
+
270
+ $('a.yit-wcan-select-open').removeClass('active');
271
+ }
272
+
273
+ var yit_active_filter = function () {
274
+
275
+ var filter_number = $('div.yith-wcan-select-wrapper ul.yith-wcan-select li.chosen').length;
276
+
277
+ yit_hidden_filters_wrapper();
278
+
279
+ $('div.yith-wcan-select-wrapper').each(function () {
280
+
281
+ var filter_name = "";
282
+ var chosen = $(this).find('ul.yith-wcan-select li.chosen').each(function () {
283
+ filter_name += $(this).text() + ', ';
284
+ });
285
+
286
+ filter_name = filter_name.substring(0, filter_name.length - 2);
287
+
288
+ if (filter_name != "") {
289
+ $(this).parent().find('a.yit-wcan-select-open').text(filter_name);
290
+ }
291
+ })
292
+ }
293
+
294
+ $(document).on('click', 'a.yit-wcan-select-open.active', function (e) {
295
+ e.preventDefault();
296
+ yit_close_select_dropdown(this);
297
+ });
298
+
299
+ $(document).on('click', 'a.yit-wcan-select-open:not(.active)', function (e) {
300
+ e.preventDefault();
301
+ yit_open_select_dropdown(this);
302
+ });
303
+
304
+ $(document).on('ready yith-wcan-ajax-filtered', yit_active_filter);
305
+
306
+ $(document).on('ready', yit_hidden_filters_wrapper);
307
+
308
+ $('body').on('click', function (e) {
309
+
310
+ if (!$(e.target).hasClass('yit-wcan-select-open')) {
311
+ yit_hidden_filters_wrapper();
312
+ }
313
+
314
+ });
315
+
316
+ function RemoveParameterFromUrl(url, parameter) {
317
+ return url
318
+ .replace(new RegExp('[?&]' + parameter + '=[^&#]*(#.*)?$'), '$1')
319
+ .replace(new RegExp('([?&])' + parameter + '=[^&]*&'), '$1');
320
+ }
321
+ });
modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.min.js CHANGED
@@ -1,13 +1,13 @@
1
- jQuery(function(b){function t(b,p){return b.replace(new RegExp("[?&]"+p+"=[^&#]*(#.*)?$"),"$1").replace(new RegExp("([?&])"+p+"=[^&]*&"),"$1")}var w=/(?!(\[))(\.)[^.#[]*/g,x=/(#)[^.#[]*/,y=/^[\w]+/,z=/^[\w]+$/,u=function(h,p){var a=[];if(z.test(h))a=[{tag:h}];else{for(var a=h,d={sel:[],val:[]},f=[],k=!1,g="",l=[],c=0,m=a.length;c<m;c++){var e=a.charAt(c);if(k)if("\\"===e&&c+1<a.length)l.push(a.charAt(++c));else if(g===e)g="",l.push(e);else if(("'"===e||'"'===e)&&""===g)g=e,l.push(e);else if("]"===
2
- e&&""===g)d.val.push(l.join("")),l=[],k=!1;else{if("]"!==e||""!==g)""===g&&","===e?(d.val.push(l.join("")),l=[]):l.push(e)}else"\\"===e&&c+1<a.length?k&&l.push(a.charAt(++c)):"["===e&&""===g?k=!0:" "===e||"+"===e?(d.sel=d.sel.join(""),f.push(d),"+"===e&&f.push({sel:"+",val:""}),d={sel:[],val:[]}):" "!==e&&"]"!==e&&d.sel.push(e)}if(0!=d.sel.length||0!=d.val.length)d.sel=d.sel.join(""),f.push(d);for(c=0;c<f.length;c++){d=f[c].sel;if("+"===d)n.tag=d;else{var n=[];n.tag=y.exec(d);n.id=x.exec(d);n.id&&
3
- b.isArray(n.id)&&(n.id=n.id[0].substr(1));n.tag||(n.tag="div");n.vars=[];for(a=0;a<f[c].val.length;a++)g=f[c].val[a].indexOf("="),k=f[c].val[a].substr(0,g),g=f[c].val[a].substr(g+1),g=g.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g,""),"text"===k?n.text=g:n.vars.push([k,g]);d=d.match(w);k=[];if(d){for(a=0;a<d.length;a++)k.push(d[a].substr(1));n.className=k.join(" ")}}f[c]=n}a=f}n=[];"undefined"===typeof p&&(p=1);d=[];f=[];k=[];g=document.createElement("div");for(c=l=0;c<a.length;c++){if("+"==a[c].tag)f=
4
  k.slice(),--l;else{for(m=0;m<p;m++)if("input"==a[c].tag){e=[];e.push("<"+a[c].tag);a[c].id&&e.push("id='"+a[c].id+"'");a[c].className&&(e.push("class='"+a[c].className),c+1===a.length&&e.push(lastClass),e.push("'"));if(a[c].vars)for(var q=0;q<a[c].vars.length;q++)e.push(a[c].vars[q][0]+"='"+a[c].vars[q][1]+"'");a[c].text&&e.push("value='"+a[c].text+"'");e.push("/>");k[m]=f[m];f[m]?(f[m].innerHTML+=e.join(" "),f[m]=f[m].lastChild):(g.innerHTML=e.join(" "),f[m]=g.removeChild(g.firstChild))}else{e=document.createElement(a[c].tag);
5
- if(a[c].vars)for(q=0;q<a[c].vars.length;q++)console.log(a[c].tag,a[c].vars[q]),e.setAttribute(a[c].vars[q][0],a[c].vars[q][1]);a[c].id&&(e.id=a[c].id);a[c].className&&(e.className=a[c].className);a[c].text&&e.appendChild(document.createTextNode(a[c].text));k[m]=f[m];f[m]=f[m]?f[m].appendChild(e):e}l++||Array.prototype.push.apply(d,f)}n=b.merge(n,f)}return b(d)},v=function(h,p,a){for(var d=h.match(/%[^%]*%/g)||[],f=[],k=0;k<p.length;k++){for(var g=h,l=0;l<d.length;l++)var c=d[l].substr(1,d[l].length-
6
- 2),g=g.replace(d[l],p[k][c]);f=b.merge(f,u(g,a))}return b(f)};b.jseldom=function(h){if(2==arguments.length&&b.isPlainObject(arguments[1]))return v.apply(this,[arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!b.isArray(arguments[1]))return u.apply(this,arguments);if(2==arguments.length)return v.apply(this,arguments)};b.fn.yith_wcan_ajax_filters=function(h,p){h.preventDefault();var a=p.href,d=b(p);if("undefined"==typeof a&&d.parents().hasClass("price_slider_wrapper")){d.parents("form");
7
- var f=window.location,k=f.origin+f.pathname,g=k!=f.href,l=b(".price_slider_amount #min_price").val(),c=b(".price_slider_amount #max_price").val(),a=f.href;1==g&&(a=t(a,"min_price"),a=t(a,"max_price"));a=a+(k==a?"?":"&")+b.param({min_price:l,max_price:c})}"select"==d.data("type")&&(d.parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),d.parent().find("div.yith-wcan-select-wrapper").animate({visibility:"hidden",opacity:0},300));b(yith_wcan.container).html("").addClass("yith-wcan-loading");
8
- b(document).trigger("yith-wcan-ajax-loading");"undefined"!=typeof yith_wcan_frontend&&b(yith_wcan.container).css("backgroundImage","url("+yith_wcan_frontend.loader_url+")");b(yith_wcan.pagination).hide();b(yith_wcan.result_count).hide();b.ajax({url:a,success:function(c){b(yith_wcan.container).removeClass("yith-wcan-loading");0<b(c).find(yith_wcan.container).length?b(".yit-wcan-container").html(b(c).find(yith_wcan.container)):b(".yit-wcan-container").html(b(c).find(".woocommerce-info"));0<b(c).find(yith_wcan.pagination).length?
9
- (0==b(yith_wcan.pagination).length&&b.jseldom(yith_wcan.pagination).insertAfter(b(yith_wcan.container)),b(yith_wcan.pagination).html(b(c).find(yith_wcan.pagination).html()).show()):b(yith_wcan.pagination).empty();0<b(c).find(yith_wcan.result_count).length&&b(yith_wcan.result_count).html(b(c).find(yith_wcan.result_count).html()).show();b(".yith-woo-ajax-navigation").add(".yith-wcan-sort-by").add(".yith-wcan-stock-on-sale").add(".yith-wcan-list-price-filter").each(function(){var a=b(this),d=a.attr("id");
10
- a.html(b(c).find("#"+d).html());""==a.text()?a.hide():a.show()});navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:c.pageTitle},"",a);b(document).trigger("ready");b(document).trigger("yith-wcan-ajax-filtered")}})};b(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');b(".woocommerce-info").wrap('<div class="yit-wcan-container"></div>');b(document).on("click",".yith-wcan a",function(h){b(this).yith_wcan_ajax_filters(h,this)});var r=function(){b("div.yith-wcan-select-wrapper").animate({visibility:"hidden",
11
  opacity:0},0);b("a.yit-wcan-select-open").removeClass("active")};b(document).on("click","a.yit-wcan-select-open.active",function(h){h.preventDefault();b(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);b(this).parent().find("a.yit-wcan-select-open").removeClass("active")});b(document).on("click","a.yit-wcan-select-open:not(.active)",function(h){h.preventDefault();b(this).parent().find("div.yith-wcan-select-wrapper").css("z-index",
12
- "1").animate({visibility:"visible",opacity:1},300);b(this).parent().find("a.yit-wcan-select-open").addClass("active")});b(document).on("ready yith-wcan-ajax-filtered",function(){b("div.yith-wcan-select-wrapper ul.yith-wcan-select li.chosen");r();b("div.yith-wcan-select-wrapper").each(function(){var h="";b(this).find("ul.yith-wcan-select li.chosen").each(function(){h+=b(this).text()+", "});h=h.substring(0,h.length-2);""!=h&&b(this).parent().find("a.yit-wcan-select-open").text(h)})});b(document).on("ready",
13
- r);b("body").on("click",function(h){b(h.target).hasClass("yit-wcan-select-open")||r()})});
1
+ jQuery(function(b){function u(b,p){return b.replace(new RegExp("[?&]"+p+"=[^&#]*(#.*)?$"),"$1").replace(new RegExp("([?&])"+p+"=[^&]*&"),"$1")}var x=/(?!(\[))(\.)[^.#[]*/g,y=/(#)[^.#[]*/,z=/^[\w]+/,A=/^[\w]+$/,v=function(h,p){var a=[];if(A.test(h))a=[{tag:h}];else{for(var a=h,d={sel:[],val:[]},f=[],k=!1,g="",l=[],c=0,m=a.length;c<m;c++){var e=a.charAt(c);if(k)if("\\"===e&&c+1<a.length)l.push(a.charAt(++c));else if(g===e)g="",l.push(e);else if(("'"===e||'"'===e)&&""===g)g=e,l.push(e);else if("]"===
2
+ e&&""===g)d.val.push(l.join("")),l=[],k=!1;else{if("]"!==e||""!==g)""===g&&","===e?(d.val.push(l.join("")),l=[]):l.push(e)}else"\\"===e&&c+1<a.length?k&&l.push(a.charAt(++c)):"["===e&&""===g?k=!0:" "===e||"+"===e?(d.sel=d.sel.join(""),f.push(d),"+"===e&&f.push({sel:"+",val:""}),d={sel:[],val:[]}):" "!==e&&"]"!==e&&d.sel.push(e)}if(0!=d.sel.length||0!=d.val.length)d.sel=d.sel.join(""),f.push(d);for(c=0;c<f.length;c++){d=f[c].sel;if("+"===d)n.tag=d;else{var n=[];n.tag=z.exec(d);n.id=y.exec(d);n.id&&
3
+ b.isArray(n.id)&&(n.id=n.id[0].substr(1));n.tag||(n.tag="div");n.vars=[];for(a=0;a<f[c].val.length;a++)g=f[c].val[a].indexOf("="),k=f[c].val[a].substr(0,g),g=f[c].val[a].substr(g+1),g=g.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g,""),"text"===k?n.text=g:n.vars.push([k,g]);d=d.match(x);k=[];if(d){for(a=0;a<d.length;a++)k.push(d[a].substr(1));n.className=k.join(" ")}}f[c]=n}a=f}n=[];"undefined"===typeof p&&(p=1);d=[];f=[];k=[];g=document.createElement("div");for(c=l=0;c<a.length;c++){if("+"==a[c].tag)f=
4
  k.slice(),--l;else{for(m=0;m<p;m++)if("input"==a[c].tag){e=[];e.push("<"+a[c].tag);a[c].id&&e.push("id='"+a[c].id+"'");a[c].className&&(e.push("class='"+a[c].className),c+1===a.length&&e.push(lastClass),e.push("'"));if(a[c].vars)for(var q=0;q<a[c].vars.length;q++)e.push(a[c].vars[q][0]+"='"+a[c].vars[q][1]+"'");a[c].text&&e.push("value='"+a[c].text+"'");e.push("/>");k[m]=f[m];f[m]?(f[m].innerHTML+=e.join(" "),f[m]=f[m].lastChild):(g.innerHTML=e.join(" "),f[m]=g.removeChild(g.firstChild))}else{e=document.createElement(a[c].tag);
5
+ if(a[c].vars)for(q=0;q<a[c].vars.length;q++)console.log(a[c].tag,a[c].vars[q]),e.setAttribute(a[c].vars[q][0],a[c].vars[q][1]);a[c].id&&(e.id=a[c].id);a[c].className&&(e.className=a[c].className);a[c].text&&e.appendChild(document.createTextNode(a[c].text));k[m]=f[m];f[m]=f[m]?f[m].appendChild(e):e}l++||Array.prototype.push.apply(d,f)}n=b.merge(n,f)}return b(d)},w=function(h,p,a){for(var d=h.match(/%[^%]*%/g)||[],f=[],k=0;k<p.length;k++){for(var g=h,l=0;l<d.length;l++)var c=d[l].substr(1,d[l].length-
6
+ 2),g=g.replace(d[l],p[k][c]);f=b.merge(f,v(g,a))}return b(f)};b.jseldom=function(h){if(2==arguments.length&&b.isPlainObject(arguments[1]))return w.apply(this,[arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!b.isArray(arguments[1]))return v.apply(this,arguments);if(2==arguments.length)return w.apply(this,arguments)};var r=!1;b.fn.yith_wcan_ajax_filters=function(h,p){h.preventDefault();var a=p.href,d=b(p);if("undefined"==typeof a&&d.parents().hasClass("price_slider_wrapper")){d.parents("form");
7
+ var f=window.location,k=f.origin+f.pathname,g=k!=f.href,l=b(".price_slider_amount #min_price").val(),c=b(".price_slider_amount #max_price").val(),a=f.href;1==g&&(a=u(a,"min_price"),a=u(a,"max_price"));a=a+(k==a?"?":"&")+b.param({min_price:l,max_price:c})}"select"==d.data("type")&&(d.parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),d.parent().find("div.yith-wcan-select-wrapper").animate({visibility:"hidden",opacity:0},300));b(yith_wcan.container).html("").addClass("yith-wcan-loading");
8
+ b(document).trigger("yith-wcan-ajax-loading");"undefined"!=typeof yith_wcan_frontend&&b(yith_wcan.container).css("backgroundImage","url("+yith_wcan_frontend.loader_url+")");b(yith_wcan.pagination).hide();b(yith_wcan.result_count).hide();0!=r&&(r.abort(),r=!1,console.log("here"));r=b.ajax({url:a,success:function(c){r=!1;b(yith_wcan.container).removeClass("yith-wcan-loading");0<b(c).find(yith_wcan.container).length?b(".yit-wcan-container").html(b(c).find(yith_wcan.container)):b(".yit-wcan-container").html(b(c).find(".woocommerce-info"));
9
+ 0<b(c).find(yith_wcan.pagination).length?(0==b(yith_wcan.pagination).length&&b.jseldom(yith_wcan.pagination).insertAfter(b(yith_wcan.container)),b(yith_wcan.pagination).html(b(c).find(yith_wcan.pagination).html()).show()):b(yith_wcan.pagination).empty();0<b(c).find(yith_wcan.result_count).length&&b(yith_wcan.result_count).html(b(c).find(yith_wcan.result_count).html()).show();b(".yith-woo-ajax-navigation").add(".yith-wcan-sort-by").add(".yith-wcan-stock-on-sale").add(".yith-wcan-list-price-filter").each(function(){var a=
10
+ b(this),d=a.attr("id");a.html(b(c).find("#"+d).html());""==a.text()?a.hide():a.show()});navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:c.pageTitle},"",a);b(document).trigger("ready");b(document).trigger("yith-wcan-ajax-filtered")}})};b(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');b(".woocommerce-info").wrap('<div class="yit-wcan-container"></div>');b(document).on("click",".yith-wcan a",function(h){b(this).yith_wcan_ajax_filters(h,this)});var t=function(){b("div.yith-wcan-select-wrapper").animate({visibility:"hidden",
11
  opacity:0},0);b("a.yit-wcan-select-open").removeClass("active")};b(document).on("click","a.yit-wcan-select-open.active",function(h){h.preventDefault();b(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);b(this).parent().find("a.yit-wcan-select-open").removeClass("active")});b(document).on("click","a.yit-wcan-select-open:not(.active)",function(h){h.preventDefault();b(this).parent().find("div.yith-wcan-select-wrapper").css("z-index",
12
+ "1").animate({visibility:"visible",opacity:1},300);b(this).parent().find("a.yit-wcan-select-open").addClass("active")});b(document).on("ready yith-wcan-ajax-filtered",function(){b("div.yith-wcan-select-wrapper ul.yith-wcan-select li.chosen");t();b("div.yith-wcan-select-wrapper").each(function(){var h="";b(this).find("ul.yith-wcan-select li.chosen").each(function(){h+=b(this).text()+", "});h=h.substring(0,h.length-2);""!=h&&b(this).parent().find("a.yit-wcan-select-open").text(h)})});b(document).on("ready",
13
+ t);b("body").on("click",function(h){b(h.target).hasClass("yit-wcan-select-open")||t()})});
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-admin.php CHANGED
@@ -1,275 +1,275 @@
1
- <?php
2
- /**
3
- * Admin class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the admin behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCAN_Admin {
22
- /**
23
- * Plugin version
24
- *
25
- * @var string
26
- * @since 1.0.0
27
- */
28
- public $version;
29
-
30
- /* @var YIT_Plugin_Panel_WooCommerce */
31
- protected $_panel;
32
-
33
- /**
34
- * @var string Main Panel Option
35
- */
36
- protected $_main_panel_option;
37
-
38
- /**
39
- * @var string The panel page
40
- */
41
- protected $_panel_page = 'yith_wcan_panel';
42
-
43
- /**
44
- * @var string Official plugin documentation
45
- */
46
- protected $_official_documentation = 'https://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter';
47
-
48
- /**
49
- * @var string Official plugin landing page
50
- */
51
- protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-ajax-product-filter';
52
-
53
- /**
54
- * @var string Official plugin landing page
55
- */
56
- protected $_premium_live = 'http://plugins.yithemes.com/yith-woocommerce-ajax-product-filter/shop/';
57
-
58
- /**
59
- * Constructor
60
- *
61
- * @access public
62
- * @since 1.0.0
63
- */
64
- public function __construct( $version ) {
65
- $this->version = $version;
66
-
67
- //Actions
68
- add_action( 'init', array( $this, 'init' ) );
69
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
70
-
71
- /* Plugin Option Panel */
72
- add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
73
- add_action( 'yit_panel_wcan_description', array( $this, 'frontend_description_option' ), 10, 3 );
74
- add_action( 'yith_wcan_premium_tab', array( $this, 'premium_tab' ) );
75
- add_action( 'yith_wcan_custom_style_tab', array( $this, 'custom_style_tab' ) );
76
-
77
- /* Plugin Informations */
78
- add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCAN_DIR . '/' . basename( YITH_WCAN_FILE ) ), array( $this, 'action_links' ) );
79
- add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
80
-
81
- // YITH WCAN Loaded
82
- do_action( 'yith_wcan_loaded' );
83
- }
84
-
85
-
86
- /**
87
- * Init method:
88
- * - default options
89
- *
90
- * @access public
91
- * @since 1.0.0
92
- */
93
- public function init() {
94
- }
95
-
96
-
97
- /**
98
- * Enqueue admin styles and scripts
99
- *
100
- * @access public
101
- * @return void
102
- * @since 1.0.0
103
- */
104
- public function enqueue_styles_scripts() {
105
- global $pagenow;
106
-
107
- if ( 'widgets.php' == $pagenow || 'admin.php' == $pagenow ) {
108
- wp_enqueue_style( 'wp-color-picker' );
109
- wp_enqueue_style( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/css/admin.css', array( 'yit-plugin-style' ), $this->version );
110
-
111
- wp_enqueue_script( 'wp-color-picker' );
112
- wp_enqueue_script( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/js/yith-wcan-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
113
- }
114
-
115
- if( 'admin.php' == $pagenow && isset( $_GET['page'] ) && 'yith_wcan_panel' == $_GET['page'] && isset( $_GET['tab'] ) && 'custom-style' == $_GET['tab'] ){
116
- wp_enqueue_style( 'codemirror-style', YITH_WCAN_URL . 'assets/3rd-party/codemirror/lib/codemirror.css', array( 'yit-plugin-style' ) );
117
- wp_enqueue_script( 'codemirror-script', YITH_WCAN_URL . 'assets/3rd-party/codemirror/lib/codemirror.js', array( 'jquery' ), false, true );
118
- wp_enqueue_script( 'codemirror-script-css', YITH_WCAN_URL . 'assets/3rd-party/codemirror/mode/css/css.js', array( 'codemirror-script' ), false, true );
119
- wp_enqueue_script( 'yith-wcan-codemirror-init', YITH_WCAN_URL . 'assets/js/yith-wcan-editor.js', array( 'jquery' ), $this->version, true );
120
- }
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
- 'frontend' => __( 'Front end', 'yith-woocommerce-ajax-navigation' ),
140
- 'custom-style' => __( 'Custom Style', 'yith-woocommerce-ajax-navigation' ),
141
- 'premium' => __( 'Premium Version', 'yith-woocommerce-ajax-navigation' )
142
- );
143
-
144
- $args = array(
145
- 'create_menu_page' => true,
146
- 'parent_slug' => '',
147
- 'page_title' => __( 'Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ),
148
- 'menu_title' => __( 'Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ),
149
- 'capability' => 'manage_options',
150
- 'parent' => 'wcan',
151
- 'parent_page' => 'yit_plugin_panel',
152
- 'page' => $this->_panel_page,
153
- 'admin-tabs' => apply_filters( 'yith_wcan_settings_tabs', $admin_tabs ),
154
- 'options-path' => YITH_WCAN_DIR . '/settings',
155
- 'plugin-url' => YITH_WCAN_URL
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( $args );
164
- $this->_main_panel_option = "yit_{$args['parent']}_options";
165
-
166
- $this->save_default_options();
167
-
168
- do_action( 'yith_wcan_after_option_panel', $args );
169
- }
170
-
171
- /**
172
- * Add default option to panel
173
- *
174
- * @return void
175
- * @since 1.0
176
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
177
- * @use /Yit_Plugin_Panel class
178
- * @see plugin-fw/lib/yit-plugin-panel.php
179
- */
180
- public function save_default_options(){
181
- $options = get_option( $this->_main_panel_option );
182
- if( $options === false ){
183
- add_option( $this->_main_panel_option, $this->_panel->get_default_options());
184
- }
185
- }
186
-
187
-
188
- /**
189
- * Premium Tab
190
- */
191
- public function premium_tab() {
192
- require_once( YITH_WCAN_DIR . 'templates/admin/premium.php' );
193
- }
194
-
195
- /**
196
- * Action Links
197
- *
198
- * add the action links to plugin admin page
199
- *
200
- * @param $links | links plugin array
201
- *
202
- * @return mixed Array
203
- * @since 1.0
204
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
205
- * @return mixed
206
- * @use plugin_action_links_{$plugin_file_name}
207
- */
208
- public function action_links( $links ) {
209
- $premium_live_text = defined( 'YITH_WCAN_FREE_INIT' ) ? __( 'Premium live demo', 'yith-woocommerce-ajax-navigation' ) : __( 'Live demo', 'yith-woocommerce-ajax-navigation' );
210
- $links[] = '<a href="' . $this->_premium_live . '" target="_blank">' . $premium_live_text . '</a>';
211
-
212
- if ( defined( 'YITH_WCAN_FREE_INIT' ) ) {
213
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-ajax-navigation' ) . '</a>';
214
- }
215
-
216
- return $links;
217
- }
218
-
219
- /**
220
- * plugin_row_meta
221
- *
222
- * add the action links to plugin admin page
223
- *
224
- * @param $plugin_meta
225
- * @param $plugin_file
226
- * @param $plugin_data
227
- * @param $status
228
- *
229
- * @return Array
230
- * @since 1.0
231
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
232
- * @use plugin_row_meta
233
- */
234
- public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
235
-
236
- if ( ( defined( 'YITH_WCAN_INIT' ) && YITH_WCAN_INIT == $plugin_file ) || ( defined( 'YITH_WCAN_FREE_INIT' ) && YITH_WCAN_FREE_INIT == $plugin_file ) ) {
237
- $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-ajax-navigation' ) . '</a>';
238
- }
239
- return $plugin_meta;
240
- }
241
-
242
- /**
243
- * Get the premium landing uri
244
- *
245
- * @since 1.0.0
246
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
247
- * @return string The premium landing link
248
- */
249
- public function get_premium_landing_uri() {
250
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
251
- }
252
-
253
- /**
254
- * Add the frontend tab description
255
- *
256
- * @param $option
257
- * @param $db_value
258
- * @param $custom_attributes
259
- *
260
- * @return string The description text
261
- * @since 2.0.0
262
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
263
- */
264
- public function frontend_description_option( $option, $db_value, $custom_attributes ){
265
- echo "<p>{$option['desc']}</p>";
266
- }
267
-
268
- /**
269
- * Custom Style tab
270
- */
271
- public function custom_style_tab(){
272
- require_once( YITH_WCAN_DIR . 'templates/admin/editor.php' );
273
- }
274
- }
275
- }
1
+ <?php
2
+ /**
3
+ * Admin class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the admin behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCAN_Admin {
22
+ /**
23
+ * Plugin version
24
+ *
25
+ * @var string
26
+ * @since 1.0.0
27
+ */
28
+ public $version;
29
+
30
+ /* @var YIT_Plugin_Panel_WooCommerce */
31
+ protected $_panel;
32
+
33
+ /**
34
+ * @var string Main Panel Option
35
+ */
36
+ protected $_main_panel_option;
37
+
38
+ /**
39
+ * @var string The panel page
40
+ */
41
+ protected $_panel_page = 'yith_wcan_panel';
42
+
43
+ /**
44
+ * @var string Official plugin documentation
45
+ */
46
+ protected $_official_documentation = 'https://yithemes.com/docs-plugins/yith-woocommerce-ajax-product-filter';
47
+
48
+ /**
49
+ * @var string Official plugin landing page
50
+ */
51
+ protected $_premium_landing = 'https://yithemes.com/themes/plugins/yith-woocommerce-ajax-product-filter';
52
+
53
+ /**
54
+ * @var string Official plugin landing page
55
+ */
56
+ protected $_premium_live = 'http://plugins.yithemes.com/yith-woocommerce-ajax-product-filter/shop/';
57
+
58
+ /**
59
+ * Constructor
60
+ *
61
+ * @access public
62
+ * @since 1.0.0
63
+ */
64
+ public function __construct( $version ) {
65
+ $this->version = $version;
66
+
67
+ //Actions
68
+ add_action( 'init', array( $this, 'init' ) );
69
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
70
+
71
+ /* Plugin Option Panel */
72
+ add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
73
+ add_action( 'yit_panel_wcan_description', array( $this, 'frontend_description_option' ), 10, 3 );
74
+ add_action( 'yith_wcan_premium_tab', array( $this, 'premium_tab' ) );
75
+ add_action( 'yith_wcan_custom_style_tab', array( $this, 'custom_style_tab' ) );
76
+
77
+ /* Plugin Informations */
78
+ add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCAN_DIR . '/' . basename( YITH_WCAN_FILE ) ), array( $this, 'action_links' ) );
79
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
80
+
81
+ // YITH WCAN Loaded
82
+ do_action( 'yith_wcan_loaded' );
83
+ }
84
+
85
+
86
+ /**
87
+ * Init method:
88
+ * - default options
89
+ *
90
+ * @access public
91
+ * @since 1.0.0
92
+ */
93
+ public function init() {
94
+ }
95
+
96
+
97
+ /**
98
+ * Enqueue admin styles and scripts
99
+ *
100
+ * @access public
101
+ * @return void
102
+ * @since 1.0.0
103
+ */
104
+ public function enqueue_styles_scripts() {
105
+ global $pagenow;
106
+
107
+ if ( 'widgets.php' == $pagenow || 'admin.php' == $pagenow ) {
108
+ wp_enqueue_style( 'wp-color-picker' );
109
+ wp_enqueue_style( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/css/admin.css', array( 'yit-plugin-style' ), $this->version );
110
+
111
+ wp_enqueue_script( 'wp-color-picker' );
112
+ wp_enqueue_script( 'yith_wcan_admin', YITH_WCAN_URL . 'assets/js/yith-wcan-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
113
+ }
114
+
115
+ if( 'admin.php' == $pagenow && isset( $_GET['page'] ) && 'yith_wcan_panel' == $_GET['page'] && isset( $_GET['tab'] ) && 'custom-style' == $_GET['tab'] ){
116
+ wp_enqueue_style( 'codemirror-style', YITH_WCAN_URL . 'assets/3rd-party/codemirror/lib/codemirror.css', array( 'yit-plugin-style' ) );
117
+ wp_enqueue_script( 'codemirror-script', YITH_WCAN_URL . 'assets/3rd-party/codemirror/lib/codemirror.js', array( 'jquery' ), false, true );
118
+ wp_enqueue_script( 'codemirror-script-css', YITH_WCAN_URL . 'assets/3rd-party/codemirror/mode/css/css.js', array( 'codemirror-script' ), false, true );
119
+ wp_enqueue_script( 'yith-wcan-codemirror-init', YITH_WCAN_URL . 'assets/js/yith-wcan-editor.js', array( 'jquery' ), $this->version, true );
120
+ }
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
+ 'frontend' => __( 'Front end', 'yith-woocommerce-ajax-navigation' ),
140
+ 'custom-style' => __( 'Custom Style', 'yith-woocommerce-ajax-navigation' ),
141
+ 'premium' => __( 'Premium Version', 'yith-woocommerce-ajax-navigation' )
142
+ );
143
+
144
+ $args = array(
145
+ 'create_menu_page' => true,
146
+ 'parent_slug' => '',
147
+ 'page_title' => __( 'Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ),
148
+ 'menu_title' => __( 'Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ),
149
+ 'capability' => 'manage_options',
150
+ 'parent' => 'wcan',
151
+ 'parent_page' => 'yit_plugin_panel',
152
+ 'page' => $this->_panel_page,
153
+ 'admin-tabs' => apply_filters( 'yith_wcan_settings_tabs', $admin_tabs ),
154
+ 'options-path' => YITH_WCAN_DIR . '/settings',
155
+ 'plugin-url' => YITH_WCAN_URL
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( $args );
164
+ $this->_main_panel_option = "yit_{$args['parent']}_options";
165
+
166
+ $this->save_default_options();
167
+
168
+ do_action( 'yith_wcan_after_option_panel', $args );
169
+ }
170
+
171
+ /**
172
+ * Add default option to panel
173
+ *
174
+ * @return void
175
+ * @since 1.0
176
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
177
+ * @use /Yit_Plugin_Panel class
178
+ * @see plugin-fw/lib/yit-plugin-panel.php
179
+ */
180
+ public function save_default_options(){
181
+ $options = get_option( $this->_main_panel_option );
182
+ if( $options === false ){
183
+ add_option( $this->_main_panel_option, $this->_panel->get_default_options());
184
+ }
185
+ }
186
+
187
+
188
+ /**
189
+ * Premium Tab
190
+ */
191
+ public function premium_tab() {
192
+ require_once( YITH_WCAN_DIR . 'templates/admin/premium.php' );
193
+ }
194
+
195
+ /**
196
+ * Action Links
197
+ *
198
+ * add the action links to plugin admin page
199
+ *
200
+ * @param $links | links plugin array
201
+ *
202
+ * @return mixed Array
203
+ * @since 1.0
204
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
205
+ * @return mixed
206
+ * @use plugin_action_links_{$plugin_file_name}
207
+ */
208
+ public function action_links( $links ) {
209
+ $premium_live_text = defined( 'YITH_WCAN_FREE_INIT' ) ? __( 'Premium live demo', 'yith-woocommerce-ajax-navigation' ) : __( 'Live demo', 'yith-woocommerce-ajax-navigation' );
210
+ $links[] = '<a href="' . $this->_premium_live . '" target="_blank">' . $premium_live_text . '</a>';
211
+
212
+ if ( defined( 'YITH_WCAN_FREE_INIT' ) ) {
213
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-ajax-navigation' ) . '</a>';
214
+ }
215
+
216
+ return $links;
217
+ }
218
+
219
+ /**
220
+ * plugin_row_meta
221
+ *
222
+ * add the action links to plugin admin page
223
+ *
224
+ * @param $plugin_meta
225
+ * @param $plugin_file
226
+ * @param $plugin_data
227
+ * @param $status
228
+ *
229
+ * @return Array
230
+ * @since 1.0
231
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
232
+ * @use plugin_row_meta
233
+ */
234
+ public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
235
+
236
+ if ( ( defined( 'YITH_WCAN_INIT' ) && YITH_WCAN_INIT == $plugin_file ) || ( defined( 'YITH_WCAN_FREE_INIT' ) && YITH_WCAN_FREE_INIT == $plugin_file ) ) {
237
+ $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-ajax-navigation' ) . '</a>';
238
+ }
239
+ return $plugin_meta;
240
+ }
241
+
242
+ /**
243
+ * Get the premium landing uri
244
+ *
245
+ * @since 1.0.0
246
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
247
+ * @return string The premium landing link
248
+ */
249
+ public function get_premium_landing_uri() {
250
+ return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
251
+ }
252
+
253
+ /**
254
+ * Add the frontend tab description
255
+ *
256
+ * @param $option
257
+ * @param $db_value
258
+ * @param $custom_attributes
259
+ *
260
+ * @return string The description text
261
+ * @since 2.0.0
262
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
263
+ */
264
+ public function frontend_description_option( $option, $db_value, $custom_attributes ){
265
+ echo "<p>{$option['desc']}</p>";
266
+ }
267
+
268
+ /**
269
+ * Custom Style tab
270
+ */
271
+ public function custom_style_tab(){
272
+ require_once( YITH_WCAN_DIR . 'templates/admin/editor.php' );
273
+ }
274
+ }
275
+ }
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-frontend.php CHANGED
@@ -1,138 +1,138 @@
1
- <?php
2
- /**
3
- * Frontend class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
15
- /**
16
- * Frontend class.
17
- * The class manage all the frontend behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCAN_Frontend {
22
- /**
23
- * Plugin version
24
- *
25
- * @var string
26
- * @since 1.0.0
27
- */
28
- public $version;
29
-
30
- /**
31
- * Constructor
32
- *
33
- * @access public
34
- * @since 1.0.0
35
- */
36
- public function __construct( $version ) {
37
- $this->version = $version;
38
-
39
- //Actions
40
- add_action( 'init', array( $this, 'woocommerce_layered_nav_init' ), 99 );
41
-
42
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
43
-
44
- // YITH WCAN Loaded
45
- do_action( 'yith_wcan_loaded' );
46
- }
47
-
48
- /**
49
- * Enqueue frontend styles and scripts
50
- *
51
- * @access public
52
- * @return void
53
- * @since 1.0.0
54
- */
55
- public function enqueue_styles_scripts() {
56
- if ( yith_wcan_can_be_displayed() ) {
57
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
58
-
59
- wp_enqueue_style( 'yith-wcan-frontend', YITH_WCAN_URL . 'assets/css/frontend.css', false, $this->version );
60
- wp_enqueue_script( 'yith-wcan-script', YITH_WCAN_URL . 'assets/js/yith-wcan-frontend' . $suffix . '.js', array( 'jquery' ), $this->version, true );
61
-
62
- $custom_style = yith_wcan_get_option( 'yith_wcan_custom_style', '' );
63
-
64
- ! empty( $custom_style ) && wp_add_inline_style( 'yith-wcan-frontend', sanitize_text_field( $custom_style ) );
65
-
66
- $args = apply_filters( 'yith_wcan_ajax_frontend_classes', array(
67
- 'container' => yith_wcan_get_option( 'yith_wcan_ajax_shop_container', '.products' ),
68
- 'pagination' => yith_wcan_get_option( 'yith_wcan_ajax_shop_pagination', 'nav.woocommerce-pagination' ),
69
- 'result_count' => yith_wcan_get_option( 'yith_wcan_ajax_shop_result_container', '.woocommerce-result-count' ),
70
- )
71
- );
72
-
73
- wp_localize_script( 'yith-wcan-script', 'yith_wcan', apply_filters( 'yith-wcan-frontend-args', $args ) );
74
- }
75
- }
76
-
77
-
78
- /**
79
- * Layered Nav Init
80
- *
81
- * @package WooCommerce/Widgets
82
- * @access public
83
- * @return void
84
- */
85
- public function woocommerce_layered_nav_init() {
86
-
87
- if ( is_active_widget( false, false, 'yith-woo-ajax-navigation', true ) && ! is_admin() ) {
88
-
89
- global $_chosen_attributes, $woocommerce;
90
-
91
- $_chosen_attributes = array();
92
-
93
- /* FIX TO WOOCOMMERCE 2.1 */
94
- $attibute_taxonomies = function_exists( 'wc_get_attribute_taxonomies' ) ? $attribute_taxonomies = wc_get_attribute_taxonomies() : $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
95
-
96
- if ( $attribute_taxonomies ) {
97
- foreach ( $attribute_taxonomies as $tax ) {
98
-
99
- $attribute = wc_sanitize_taxonomy_name( $tax->attribute_name );
100
-
101
- /* FIX TO WOOCOMMERCE 2.1 */
102
- if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
103
- $taxonomy = wc_attribute_taxonomy_name( $attribute );
104
- }
105
- else {
106
- $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute );
107
- }
108
-
109
- $name = 'filter_' . $attribute;
110
- $query_type_name = 'query_type_' . $attribute;
111
-
112
- if ( ! empty( $_GET[$name] ) && taxonomy_exists( $taxonomy ) ) {
113
-
114
- $_chosen_attributes[ $taxonomy ]['terms'] = explode( ',', $_GET[ $name ] );
115
-
116
- if ( empty( $_GET[ $query_type_name ] ) || ! in_array( strtolower( $_GET[ $query_type_name ] ), array( 'and', 'or' ) ) )
117
- $_chosen_attributes[ $taxonomy ]['query_type'] = apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' );
118
- else
119
- $_chosen_attributes[ $taxonomy ]['query_type'] = strtolower( $_GET[ $query_type_name ] );
120
-
121
- }
122
- }
123
- }
124
-
125
- if ( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.1', '<' ) ) {
126
- add_filter( 'loop_shop_post_in', 'woocommerce_layered_nav_query' );
127
- }
128
- else {
129
- add_filter( 'loop_shop_post_in', array( WC()->query, 'layered_nav_query' ) );
130
- }
131
-
132
-
133
- }
134
- }
135
-
136
-
137
- }
138
- }
1
+ <?php
2
+ /**
3
+ * Frontend class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
15
+ /**
16
+ * Frontend class.
17
+ * The class manage all the frontend behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCAN_Frontend {
22
+ /**
23
+ * Plugin version
24
+ *
25
+ * @var string
26
+ * @since 1.0.0
27
+ */
28
+ public $version;
29
+
30
+ /**
31
+ * Constructor
32
+ *
33
+ * @access public
34
+ * @since 1.0.0
35
+ */
36
+ public function __construct( $version ) {
37
+ $this->version = $version;
38
+
39
+ //Actions
40
+ add_action( 'init', array( $this, 'woocommerce_layered_nav_init' ), 99 );
41
+
42
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
43
+
44
+ // YITH WCAN Loaded
45
+ do_action( 'yith_wcan_loaded' );
46
+ }
47
+
48
+ /**
49
+ * Enqueue frontend styles and scripts
50
+ *
51
+ * @access public
52
+ * @return void
53
+ * @since 1.0.0
54
+ */
55
+ public function enqueue_styles_scripts() {
56
+ if ( yith_wcan_can_be_displayed() ) {
57
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
58
+
59
+ wp_enqueue_style( 'yith-wcan-frontend', YITH_WCAN_URL . 'assets/css/frontend.css', false, $this->version );
60
+ wp_enqueue_script( 'yith-wcan-script', YITH_WCAN_URL . 'assets/js/yith-wcan-frontend' . $suffix . '.js', array( 'jquery' ), $this->version, true );
61
+
62
+ $custom_style = yith_wcan_get_option( 'yith_wcan_custom_style', '' );
63
+
64
+ ! empty( $custom_style ) && wp_add_inline_style( 'yith-wcan-frontend', sanitize_text_field( $custom_style ) );
65
+
66
+ $args = apply_filters( 'yith_wcan_ajax_frontend_classes', array(
67
+ 'container' => yith_wcan_get_option( 'yith_wcan_ajax_shop_container', '.products' ),
68
+ 'pagination' => yith_wcan_get_option( 'yith_wcan_ajax_shop_pagination', 'nav.woocommerce-pagination' ),
69
+ 'result_count' => yith_wcan_get_option( 'yith_wcan_ajax_shop_result_container', '.woocommerce-result-count' ),
70
+ )
71
+ );
72
+
73
+ wp_localize_script( 'yith-wcan-script', 'yith_wcan', apply_filters( 'yith-wcan-frontend-args', $args ) );
74
+ }
75
+ }
76
+
77
+
78
+ /**
79
+ * Layered Nav Init
80
+ *
81
+ * @package WooCommerce/Widgets
82
+ * @access public
83
+ * @return void
84
+ */
85
+ public function woocommerce_layered_nav_init() {
86
+
87
+ if ( is_active_widget( false, false, 'yith-woo-ajax-navigation', true ) && ! is_admin() ) {
88
+
89
+ global $_chosen_attributes, $woocommerce;
90
+
91
+ $_chosen_attributes = array();
92
+
93
+ /* FIX TO WOOCOMMERCE 2.1 */
94
+ $attibute_taxonomies = function_exists( 'wc_get_attribute_taxonomies' ) ? $attribute_taxonomies = wc_get_attribute_taxonomies() : $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
95
+
96
+ if ( $attribute_taxonomies ) {
97
+ foreach ( $attribute_taxonomies as $tax ) {
98
+
99
+ $attribute = wc_sanitize_taxonomy_name( $tax->attribute_name );
100
+
101
+ /* FIX TO WOOCOMMERCE 2.1 */
102
+ if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
103
+ $taxonomy = wc_attribute_taxonomy_name( $attribute );
104
+ }
105
+ else {
106
+ $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute );
107
+ }
108
+
109
+ $name = 'filter_' . $attribute;
110
+ $query_type_name = 'query_type_' . $attribute;
111
+
112
+ if ( ! empty( $_GET[$name] ) && taxonomy_exists( $taxonomy ) ) {
113
+
114
+ $_chosen_attributes[ $taxonomy ]['terms'] = explode( ',', $_GET[ $name ] );
115
+
116
+ if ( empty( $_GET[ $query_type_name ] ) || ! in_array( strtolower( $_GET[ $query_type_name ] ), array( 'and', 'or' ) ) )
117
+ $_chosen_attributes[ $taxonomy ]['query_type'] = apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' );
118
+ else
119
+ $_chosen_attributes[ $taxonomy ]['query_type'] = strtolower( $_GET[ $query_type_name ] );
120
+
121
+ }
122
+ }
123
+ }
124
+
125
+ if ( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.1', '<' ) ) {
126
+ add_filter( 'loop_shop_post_in', 'woocommerce_layered_nav_query' );
127
+ }
128
+ else {
129
+ add_filter( 'loop_shop_post_in', array( WC()->query, 'layered_nav_query' ) );
130
+ }
131
+
132
+
133
+ }
134
+ }
135
+
136
+
137
+ }
138
+ }
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-helper.php CHANGED
@@ -1,66 +1,66 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCAN_Helper' ) ) {
15
- /**
16
- * YITH WooCommerce Ajax Navigation Helper
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCAN_Helper {
21
-
22
- /*
23
- * Get Woocommerce Attribute Taxonomies
24
- *
25
- * @since 1.0.0
26
- * @access public
27
- */
28
- public static function attribute_taxonomies() {
29
- global $woocommerce;
30
-
31
- if ( ! isset( $woocommerce ) ) {
32
- return array();
33
- }
34
-
35
- $attributes = array();
36
- if ( function_exists( 'wc_get_attribute_taxonomies' ) ) {
37
- $attribute_taxonomies = wc_get_attribute_taxonomies();
38
- }
39
- else {
40
- $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
41
- }
42
-
43
- if ( empty( $attribute_taxonomies ) ) {
44
- return array();
45
- }
46
- foreach ( $attribute_taxonomies as $attribute ) {
47
-
48
- /* FIX TO WOOCOMMERCE 2.1 */
49
- if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
50
- $taxonomy = wc_attribute_taxonomy_name( $attribute->attribute_name );
51
- }
52
- else {
53
- $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute->attribute_name );
54
- }
55
-
56
-
57
- if ( taxonomy_exists( $taxonomy ) ) {
58
- $attributes[] = $attribute->attribute_name;
59
- }
60
- }
61
-
62
- return $attributes;
63
- }
64
-
65
- }
66
  }
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCAN_Helper' ) ) {
15
+ /**
16
+ * YITH WooCommerce Ajax Navigation Helper
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCAN_Helper {
21
+
22
+ /*
23
+ * Get Woocommerce Attribute Taxonomies
24
+ *
25
+ * @since 1.0.0
26
+ * @access public
27
+ */
28
+ public static function attribute_taxonomies() {
29
+ global $woocommerce;
30
+
31
+ if ( ! isset( $woocommerce ) ) {
32
+ return array();
33
+ }
34
+
35
+ $attributes = array();
36
+ if ( function_exists( 'wc_get_attribute_taxonomies' ) ) {
37
+ $attribute_taxonomies = wc_get_attribute_taxonomies();
38
+ }
39
+ else {
40
+ $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
41
+ }
42
+
43
+ if ( empty( $attribute_taxonomies ) ) {
44
+ return array();
45
+ }
46
+ foreach ( $attribute_taxonomies as $attribute ) {
47
+
48
+ /* FIX TO WOOCOMMERCE 2.1 */
49
+ if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
50
+ $taxonomy = wc_attribute_taxonomy_name( $attribute->attribute_name );
51
+ }
52
+ else {
53
+ $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute->attribute_name );
54
+ }
55
+
56
+
57
+ if ( taxonomy_exists( $taxonomy ) ) {
58
+ $attributes[] = $attribute->attribute_name;
59
+ }
60
+ }
61
+
62
+ return $attributes;
63
+ }
64
+
65
+ }
66
  }
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan.php CHANGED
@@ -1,174 +1,174 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCAN' ) ) {
15
- /**
16
- * YITH WooCommerce Ajax Navigation
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCAN {
21
- /**
22
- * Plugin version
23
- *
24
- * @var string
25
- * @since 1.0.0
26
- */
27
- public $version;
28
-
29
- /**
30
- * Frontend object
31
- *
32
- * @var string
33
- * @since 1.0.0
34
- */
35
- public $frontend = null;
36
-
37
-
38
- /**
39
- * Admin object
40
- *
41
- * @var string
42
- * @since 1.0.0
43
- */
44
- public $admin = null;
45
-
46
-
47
- /**
48
- * Main instance
49
- *
50
- * @var string
51
- * @since 1.4.0
52
- */
53
- protected static $_instance = null;
54
-
55
- /**
56
- * Constructor
57
- *
58
- * @return mixed|YITH_WCAN_Admin|YITH_WCAN_Frontend
59
- * @since 1.0.0
60
- */
61
- public function __construct() {
62
-
63
- $this->version = YITH_WCAN_VERSION;
64
-
65
- /* Load Plugin Framework */
66
- add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ) );
67
-
68
- /* Register Widget */
69
- add_action( 'widgets_init', array( $this, 'registerWidgets' ) );
70
-
71
- $this->required();
72
-
73
- $this->init();
74
- }
75
-
76
- /**
77
- * Load and register widgets
78
- *
79
- * @access public
80
- * @since 1.0.0
81
- */
82
- public function registerWidgets() {
83
- $widgets = apply_filters( 'yith_wcan_widgets', array(
84
- 'YITH_WCAN_Navigation_Widget',
85
- 'YITH_WCAN_Reset_Navigation_Widget',
86
- )
87
- );
88
-
89
- foreach( $widgets as $widget ){
90
- register_widget( $widget );
91
- }
92
- }
93
-
94
- /**
95
- * Load plugin framework
96
- *
97
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
98
- * @since 1.0
99
- * @return void
100
- */
101
- public function plugin_fw_loader() {
102
- if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
103
- global $plugin_fw_data;
104
- if( ! empty( $plugin_fw_data ) ){
105
- $plugin_fw_file = array_shift( $plugin_fw_data );
106
- require_once( $plugin_fw_file );
107
- }
108
- }
109
- }
110
-
111
- /**
112
- * Main plugin Instance
113
- *
114
- * @return YITH_Vendors Main instance
115
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
116
- */
117
- public static function instance() {
118
-
119
- if( class_exists( 'YITH_WCAN_Premium' ) ){
120
- //Premium Class
121
- if( is_null( YITH_WCAN_Premium::$_instance ) ){
122
- YITH_WCAN_Premium::$_instance = new YITH_WCAN_Premium();
123
- }
124
-
125
- return YITH_WCAN_Premium::$_instance;
126
- }
127
-
128
- // Base Class
129
- else {
130
- //Premium Class
131
- if( is_null( YITH_WCAN::$_instance ) ){
132
- YITH_WCAN::$_instance = new YITH_WCAN();
133
- }
134
-
135
- return YITH_WCAN::$_instance;
136
- }
137
- }
138
-
139
-
140
-
141
- /**
142
- * Load required files
143
- *
144
- * @since 1.4
145
- * @return void
146
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
147
- */
148
- public function required(){
149
- $required = apply_filters( 'yith_wcan_required_files', array(
150
- 'includes/functions.yith-wcan.php',
151
- 'includes/class.yith-wcan-admin.php',
152
- 'includes/class.yith-wcan-frontend.php',
153
- 'includes/class.yith-wcan-helper.php',
154
- 'widgets/class.yith-wcan-navigation-widget.php',
155
- 'widgets/class.yith-wcan-reset-navigation-widget.php',
156
- )
157
- );
158
-
159
- foreach( $required as $file ){
160
- file_exists( YITH_WCAN_DIR . $file ) && require_once( YITH_WCAN_DIR . $file );
161
- }
162
- }
163
-
164
- public function init() {
165
- if ( is_admin() ) {
166
- $this->admin = new YITH_WCAN_Admin( $this->version );
167
- }
168
- else {
169
- $this->frontend = new YITH_WCAN_Frontend( $this->version );
170
- }
171
- }
172
-
173
- }
174
  }
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCAN' ) ) {
15
+ /**
16
+ * YITH WooCommerce Ajax Navigation
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCAN {
21
+ /**
22
+ * Plugin version
23
+ *
24
+ * @var string
25
+ * @since 1.0.0
26
+ */
27
+ public $version;
28
+
29
+ /**
30
+ * Frontend object
31
+ *
32
+ * @var string
33
+ * @since 1.0.0
34
+ */
35
+ public $frontend = null;
36
+
37
+
38
+ /**
39
+ * Admin object
40
+ *
41
+ * @var string
42
+ * @since 1.0.0
43
+ */
44
+ public $admin = null;
45
+
46
+
47
+ /**
48
+ * Main instance
49
+ *
50
+ * @var string
51
+ * @since 1.4.0
52
+ */
53
+ protected static $_instance = null;
54
+
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @return mixed|YITH_WCAN_Admin|YITH_WCAN_Frontend
59
+ * @since 1.0.0
60
+ */
61
+ public function __construct() {
62
+
63
+ $this->version = YITH_WCAN_VERSION;
64
+
65
+ /* Load Plugin Framework */
66
+ add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ) );
67
+
68
+ /* Register Widget */
69
+ add_action( 'widgets_init', array( $this, 'registerWidgets' ) );
70
+
71
+ $this->required();
72
+
73
+ $this->init();
74
+ }
75
+
76
+ /**
77
+ * Load and register widgets
78
+ *
79
+ * @access public
80
+ * @since 1.0.0
81
+ */
82
+ public function registerWidgets() {
83
+ $widgets = apply_filters( 'yith_wcan_widgets', array(
84
+ 'YITH_WCAN_Navigation_Widget',
85
+ 'YITH_WCAN_Reset_Navigation_Widget',
86
+ )
87
+ );
88
+
89
+ foreach( $widgets as $widget ){
90
+ register_widget( $widget );
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Load plugin framework
96
+ *
97
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
98
+ * @since 1.0
99
+ * @return void
100
+ */
101
+ public function plugin_fw_loader() {
102
+ if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
103
+ global $plugin_fw_data;
104
+ if( ! empty( $plugin_fw_data ) ){
105
+ $plugin_fw_file = array_shift( $plugin_fw_data );
106
+ require_once( $plugin_fw_file );
107
+ }
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Main plugin Instance
113
+ *
114
+ * @return YITH_Vendors Main instance
115
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
116
+ */
117
+ public static function instance() {
118
+
119
+ if( class_exists( 'YITH_WCAN_Premium' ) ){
120
+ //Premium Class
121
+ if( is_null( YITH_WCAN_Premium::$_instance ) ){
122
+ YITH_WCAN_Premium::$_instance = new YITH_WCAN_Premium();
123
+ }
124
+
125
+ return YITH_WCAN_Premium::$_instance;
126
+ }
127
+
128
+ // Base Class
129
+ else {
130
+ //Premium Class
131
+ if( is_null( YITH_WCAN::$_instance ) ){
132
+ YITH_WCAN::$_instance = new YITH_WCAN();
133
+ }
134
+
135
+ return YITH_WCAN::$_instance;
136
+ }
137
+ }
138
+
139
+
140
+
141
+ /**
142
+ * Load required files
143
+ *
144
+ * @since 1.4
145
+ * @return void
146
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
147
+ */
148
+ public function required(){
149
+ $required = apply_filters( 'yith_wcan_required_files', array(
150
+ 'includes/functions.yith-wcan.php',
151
+ 'includes/class.yith-wcan-admin.php',
152
+ 'includes/class.yith-wcan-frontend.php',
153
+ 'includes/class.yith-wcan-helper.php',
154
+ 'widgets/class.yith-wcan-navigation-widget.php',
155
+ 'widgets/class.yith-wcan-reset-navigation-widget.php',
156
+ )
157
+ );
158
+
159
+ foreach( $required as $file ){
160
+ file_exists( YITH_WCAN_DIR . $file ) && require_once( YITH_WCAN_DIR . $file );
161
+ }
162
+ }
163
+
164
+ public function init() {
165
+ if ( is_admin() ) {
166
+ $this->admin = new YITH_WCAN_Admin( $this->version );
167
+ }
168
+ else {
169
+ $this->frontend = new YITH_WCAN_Frontend( $this->version );
170
+ }
171
+ }
172
+
173
+ }
174
  }
modules/yith-woocommerce-ajax-navigation/includes/functions.yith-wcan.php CHANGED
@@ -1,503 +1,503 @@
1
- <?php
2
- /**
3
- * Functions
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
-
15
- /**
16
- * Return a dropdown with Woocommerce attributes
17
- */
18
- function yith_wcan_dropdown_attributes( $selected, $echo = true ) {
19
- $attributes = YITH_WCAN_Helper::attribute_taxonomies();
20
- $options = "";
21
-
22
- foreach ( $attributes as $attribute ) {
23
- $options .= "<option name='{$attribute}'" . selected( $attribute, $selected, false ) . ">{$attribute}</option>";
24
- }
25
-
26
- if ( $echo ) {
27
- echo $options;
28
- }
29
- else {
30
- return $options;
31
- }
32
- }
33
-
34
-
35
- /**
36
- * Print the widgets options already filled
37
- *
38
- * @param $type string list|colors|label
39
- * @param $attribute woocommerce taxonomy
40
- * @param $id id used in the <input />
41
- * @param $name base name used in the <input />
42
- * @param $values array of values (could be empty if this is an ajax call)
43
- *
44
- * @return string
45
- */
46
- function yith_wcan_attributes_table( $type, $attribute, $id, $name, $values = array(), $echo = true ) {
47
- $return = '';
48
-
49
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
50
-
51
- if ( 'list' == $type ) {
52
- $return = '<input type="hidden" name="' . $name . '[colors]" value="" /><input type="hidden" name="' . $name . '[labels]" value="" />';
53
- }
54
-
55
- elseif ( 'color' == $type ) {
56
- if ( ! empty( $terms ) ) {
57
- $return = sprintf( '<table><tr><th>%s</th><th>%s</th></tr>', __( 'Term', 'yith-woocommerce-ajax-navigation' ), __( 'Color', 'yith-woocommerce-ajax-navigation' ) );
58
-
59
- foreach ( $terms as $term ) {
60
- $return .= "<tr><td><label for='{$id}{$term->term_id}'>{$term->name}</label></td><td><input type='text' id='{$id}{$term->term_id}' name='{$name}[colors][{$term->term_id}]' value='" . ( isset( $values[$term->term_id] ) ? $values[$term->term_id] : '' ) . "' size='3' class='yith-colorpicker' /></td></tr>";
61
- }
62
-
63
- $return .= '</table>';
64
- }
65
-
66
- $return .= '<input type="hidden" name="' . $name . '[labels]" value="" />';
67
- }
68
-
69
- elseif ( 'multicolor' == $type ) {
70
- if ( ! empty( $terms ) ) {
71
- $return = sprintf( '<table class="yith-wcan-multicolor"><tr><th>%s</th><th>%s</th><th>%s</th></tr>', __( 'Term', 'yith-woocommerce-ajax-navigation' ), _x( 'Color 1', 'For multicolor: I.E. white and red T-Shirt', 'yith-woocommerce-ajax-navigation' ), _x( 'Color 2', 'For multicolor: I.E. white and red T-Shirt', 'yith-woocommerce-ajax-navigation' ) );
72
-
73
- foreach ( $terms as $term ) {
74
-
75
- $return .= "<tr>";
76
-
77
- $return .= "<td><label for='{$id}{$term->term_id}'>{$term->name}</label></td>";
78
-
79
- $return .= "<td><input type='text' id='{$id}{$term->term_id}_1' name='{$name}[multicolor][{$term->term_id}][]' value='" . ( isset( $values[$term->term_id][0] ) ? $values[$term->term_id][0] : '' ) . "' size='3' class='yith-colorpicker multicolor' /></td>";
80
- $return .= "<td><input type='text' id='{$id}{$term->term_id}_2' name='{$name}[multicolor][{$term->term_id}][]' value='" . ( isset( $values[$term->term_id][1] ) ? $values[$term->term_id][1] : '' ) . "' size='3' class='yith-colorpicker multicolor' /></td>";
81
-
82
- $return .= '</tr>';
83
- }
84
-
85
- $return .= '</table>';
86
- }
87
-
88
- $return .= '<input type="hidden" name="' . $name . '[labels]" value="" />';
89
- }
90
-
91
- elseif ( 'label' == $type ) {
92
- if ( ! empty( $terms ) ) {
93
- $return = sprintf( '<table><tr><th>%s</th><th>%s</th></tr>', __( 'Term', 'yith-woocommerce-ajax-navigation' ), __( 'Labels', 'yith-woocommerce-ajax-navigation' ) );
94
-
95
- foreach ( $terms as $term ) {
96
- $return .= "<tr><td><label for='{$id}{$term->term_id}'>{$term->name}</label></td><td><input type='text' id='{$id}{$term->term_id}' name='{$name}[labels][{$term->term_id}]' value='" . ( isset( $values[$term->term_id] ) ? $values[$term->term_id] : '' ) . "' size='3' /></td></tr>";
97
- }
98
-
99
- $return .= '</table>';
100
- }
101
-
102
- $return .= '<input type="hidden" name="' . $name . '[colors]" value="" />';
103
- }
104
-
105
- if ( $echo ) {
106
- echo $return;
107
- }
108
-
109
- return $return;
110
- }
111
-
112
-
113
- /**
114
- * Can the widget be displayed?
115
- *
116
- * @return bool
117
- */
118
- function yith_wcan_can_be_displayed() {
119
- global $woocommerce, $_attributes_array;
120
-
121
- if (
122
- is_active_widget( false, false, 'yith-woo-ajax-navigation', true ) ||
123
- is_active_widget( false, false, 'yith-woo-ajax-navigation-sort-by', true ) ||
124
- is_active_widget( false, false, 'yith-woo-ajax-navigation-stock-on-sale', true ) ||
125
- is_active_widget( false, false, 'yith-woo-ajax-navigation-list-price-filter', true )
126
- ) {
127
- return true;
128
- }
129
- else {
130
- return false;
131
- }
132
- }
133
-
134
-
135
- if ( ! function_exists( 'yit_curPageURL' ) ) {
136
- /**
137
- * Retrieve the current complete url
138
- *
139
- * @since 1.0
140
- */
141
- function yit_curPageURL() {
142
- $pageURL = 'http';
143
- if ( isset( $_SERVER["HTTPS"] ) AND $_SERVER["HTTPS"] == "on" ) {
144
- $pageURL .= "s";
145
- }
146
-
147
- $pageURL .= "://";
148
-
149
- if ( isset( $_SERVER["SERVER_PORT"] ) AND $_SERVER["SERVER_PORT"] != "80" ) {
150
- $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
151
- }
152
- else {
153
- $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
154
- }
155
-
156
- return $pageURL;
157
- }
158
- }
159
-
160
- if ( ! function_exists( 'yit_reorder_terms_by_parent' ) ) {
161
- /**
162
- * Sort the array of terms associating the child to the parent terms
163
- *
164
- * @param $terms mixed|array
165
- *
166
- * @return mixed!array
167
- * @since 1.3.1
168
- */
169
- function yit_reorder_terms_by_parent( $terms ) {
170
-
171
- /* Extract Child Terms */
172
- $child_terms = array();
173
- $terms_count = 0;
174
- $parent_terms = array();
175
-
176
- foreach ( $terms as $array_key => $term ) {
177
-
178
- if ( $term->parent != 0 ) {
179
-
180
- if ( isset( $child_terms[$term->parent] ) && $child_terms[$term->parent] != null ) {
181
- $child_terms[$term->parent] = array_merge( $child_terms[$term->parent], array( $term ) );
182
- }
183
- else {
184
- $child_terms[$term->parent] = array( $term );
185
- }
186
-
187
- }
188
- else {
189
- $parent_terms[$terms_count] = $term;
190
- }
191
- $terms_count ++;
192
- }
193
-
194
- /* Reorder Therms */
195
- $terms_count = 0;
196
- $terms = array();
197
-
198
- foreach ( $parent_terms as $term ) {
199
-
200
- $terms[$terms_count] = $term;
201
-
202
- /* The term as child */
203
- if ( array_key_exists( $term->term_id, $child_terms ) ) {
204
-
205
- foreach ( $child_terms[$term->term_id] as $child_term ) {
206
- $terms_count ++;
207
- $terms[$terms_count] = $child_term;
208
- }
209
- }
210
- $terms_count ++;
211
- }
212
-
213
- return $terms;
214
- }
215
- }
216
-
217
- if ( ! function_exists( 'yit_get_terms' ) ) {
218
- /**
219
- * Get the array of objects terms
220
- *
221
- * @param $type A type of term to display
222
- *
223
- * @return $terms mixed|array
224
- *
225
- * @since 1.3.1
226
- */
227
- function yit_get_terms( $case, $taxonomy, $instance = false ) {
228
-
229
- $exclude = apply_filters( 'yith_wcan_exclude_terms', array(), $instance );
230
- $include = apply_filters( 'yith_wcan_include_terms', array(), $instance );
231
-
232
- switch ( $case ) {
233
-
234
- case 'all':
235
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) );
236
- break;
237
-
238
- case 'hierarchical':
239
- $terms = yit_reorder_terms_by_parent( get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) ) );
240
- break;
241
-
242
- case 'parent' :
243
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'parent' => false, 'exclude' => $exclude ) );
244
- break;
245
-
246
- default:
247
- $args = array( 'hide_empty' => true, 'exclude' => $exclude, 'include' => $include );
248
- if ( 'parent' == $instance['display'] ) {
249
- $args['parent'] = false;
250
- }
251
-
252
- $terms = get_terms( $taxonomy, $args );
253
-
254
- if ( 'hierarchical' == $instance['display'] ) {
255
- $terms = yit_reorder_terms_by_parent( $terms );
256
- }
257
- break;
258
- }
259
-
260
- return $terms;
261
- }
262
- }
263
-
264
- if ( ! function_exists( 'yit_term_is_child' ) ) {
265
- /**
266
- * Return true if the term is a child, false otherwise
267
- *
268
- * @param $term The term object
269
- *
270
- * @return bool
271
- *
272
- * @since 1.3.1
273
- */
274
- function yit_term_is_child( $term ) {
275
-
276
- return ( isset( $term->parent ) && $term->parent != 0 ) ? true : false;
277
- }
278
- }
279
-
280
- if ( ! function_exists( 'yit_term_is_parent' ) ) {
281
- /**
282
- * Return true if the term is a parent, false otherwise
283
- *
284
- * @param $term The term object
285
- *
286
- * @return bool
287
- *
288
- * @since 1.3.1
289
- */
290
- function yit_term_is_parent( $term ) {
291
-
292
- return ( isset( $term->parent ) && $term->parent == 0 ) ? true : false;
293
- }
294
- }
295
-
296
- if ( ! function_exists( 'yit_term_has_child' ) ) {
297
- /**
298
- * Return true if the term has a child, false otherwise
299
- *
300
- * @param $term The term object
301
- * @param $taxonomy the taxonomy to search
302
- *
303
- * @return bool
304
- *
305
- * @since 1.3.1
306
- */
307
- function yit_term_has_child( $term, $taxonomy ) {
308
- global $woocommerce;
309
-
310
- $count = 0;
311
- $child_terms = get_terms( $taxonomy, array( 'child_of' => $term->term_id ) );
312
- foreach ( $child_terms as $term ) {
313
- $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
314
- $count += sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
315
- }
316
-
317
- return empty( $count ) ? false : true;
318
- }
319
- }
320
-
321
- if ( ! function_exists( 'yith_wcan_get_option' ) ) {
322
- /**
323
- * Retreive the plugin option
324
- *
325
- * @param mixed|bool $option_name The option name. If false return alla options array
326
- *
327
- *
328
- * @return mixed|array|string The option(s)
329
- *
330
- * @since 1.3.1
331
- */
332
- function yith_wcan_get_option( $option_name = false, $default = false ) {
333
- $options = get_option( 'yit_wcan_options' );
334
-
335
- if ( ! $option_name ) {
336
- return $options;
337
- }
338
-
339
- return isset( $options[$option_name] ) ? $options[$option_name] : $default;
340
- }
341
- }
342
-
343
- if ( ! function_exists( 'yit_get_filter_args' ) ) {
344
- /**
345
- * Retreive the filter query args option
346
- *
347
- * @return array The option(s)
348
- *
349
- * @since 1.4
350
- */
351
- function yit_get_filter_args( $check_price_filter = true ) {
352
- $filter_value = array();
353
- $regexs = array( '/^filter_[a-zA-Z0-9]/', '/^query_type_[a-zA-Z0-9]/', '/product_tag/' );
354
-
355
- /* Support to YITH WooCommerce Brands */
356
- if ( defined( 'YITH_WCBR_PREMIUM_INIT' ) && YITH_WCBR_PREMIUM_INIT ) {
357
- $brands_taxonomy = YITH_WCBR::$brands_taxonomy;
358
- $regexs[] = "/{$brands_taxonomy}/";
359
- }
360
-
361
- if ( ! empty( $_GET ) ) {
362
- foreach ( $regexs as $regex ) {
363
- foreach ( $_GET as $query_var => $value ) {
364
- if ( preg_match( $regex, $query_var ) ) {
365
- $filter_value[$query_var] = $value;
366
- }
367
- }
368
- }
369
- }
370
-
371
- if ( $check_price_filter ) {
372
- // WooCommerce Price Filter
373
- if ( isset( $_GET['min_price'] ) ) {
374
- $link = $filter_value['min_price'] = $_GET['min_price'];
375
- }
376
-
377
- if ( isset( $_GET['max_price'] ) ) {
378
- $link = $filter_value['max_price'] = $_GET['max_price'];
379
- }
380
- }
381
-
382
- // WooCommerce In Stock/On Sale filters
383
- if ( isset( $_GET['instock_filter'] ) ) {
384
- $link = $filter_value['instock_filter'] = $_GET['instock_filter'];
385
- }
386
-
387
- if ( isset( $_GET['onsale_filter'] ) ) {
388
- $link = $filter_value['onsale_filter'] = $_GET['onsale_filter'];
389
- }
390
-
391
- if ( isset( $_GET['orderby'] ) ) {
392
- $link = $filter_value['orderby'] = $_GET['orderby'];
393
- }
394
-
395
- if ( isset( $_GET['product_tag'] ) ) {
396
- $link = $filter_value['product_tag'] = urlencode( $_GET['product_tag'] );
397
- }
398
-
399
- return $filter_value;
400
- }
401
- }
402
-
403
- if ( ! function_exists( 'yit_check_active_price_filter' ) ) {
404
- /**
405
- * Check if there is an active price filter
406
- *
407
- * @return bool True if the the filter is active, false otherwise
408
- *
409
- * @since 1.4
410
- */
411
- function yit_check_active_price_filter( $min_price, $max_price ) {
412
- return isset( $_GET['min_price'] ) && $_GET['min_price'] == $min_price && isset( $_GET['max_price'] ) && $_GET['max_price'] == $max_price;
413
- }
414
- }
415
-
416
- if ( ! function_exists( 'yit_remove_price_filter_query_args' ) ) {
417
- /**
418
- * Remove min_price and max_price query args from filters array value
419
- *
420
- * @return array The array params
421
- *
422
- * @since 1.4
423
- */
424
- function yit_remove_price_filter_query_args( $filter_value ) {
425
- foreach ( array( 'min_price', 'max_price' ) as $remove ) {
426
- unset( $filter_value[$remove] );
427
- }
428
-
429
- return $filter_value;
430
- }
431
- }
432
-
433
- if ( ! function_exists( 'yit_get_woocommerce_layered_nav_link' ) ) {
434
- /**
435
- * Get current layered link
436
- *
437
- * @return string The new link
438
- *
439
- * @since 1.4
440
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
441
- */
442
- function yit_get_woocommerce_layered_nav_link() {
443
-
444
- if ( defined( 'SHOP_IS_ON_FRONT' ) || ( is_shop() && ! is_product_category() && ! is_product_taxonomy() ) ) {
445
- $return = get_post_type_archive_link( 'product' );
446
- return apply_filters( 'yith_wcan_untrailingslashit', true ) ? untrailingslashit( $return ) : $return;
447
- }
448
-
449
- elseif ( is_product_category() ) {
450
- $return = get_term_link( get_queried_object()->slug, 'product_cat' );
451
- return apply_filters( 'yith_wcan_untrailingslashit', true ) ? untrailingslashit( $return ) : $return;
452
- }
453
-
454
- else {
455
- $return = get_term_link( get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
456
- return apply_filters( 'yith_wcan_untrailingslashit', true ) ? untrailingslashit( $return ) : $return;
457
- }
458
-
459
- return false;
460
- }
461
- }
462
-
463
- if ( ! function_exists( 'yit_wcan_localize_terms' ) ) {
464
- /**
465
- * Get current layered link
466
- *
467
- * @param $term_id The term id
468
- * @param $taxonomy The taxonomy name
469
- *
470
- * @return string The new term_id
471
- *
472
- * @since 1.4
473
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
474
- */
475
-
476
- function yit_wcan_localize_terms( $term_id, $taxonomy ) {
477
- /* === WPML Support === */
478
- global $sitepress;
479
- if ( ! empty( $sitepress ) && function_exists( 'wpml_object_id_filter' ) ) {
480
- $term_id = wpml_object_id_filter( $term_id, $taxonomy, true, $sitepress->get_default_language() );
481
- }
482
-
483
- return $term_id;
484
- }
485
-
486
- }
487
-
488
- if ( ! function_exists( 'yit_wcan_get_product_taxonomy' ) ) {
489
- /**
490
- * Get the product taxonomy array
491
- * @return array product taxonomy array
492
- *
493
- * @since 2.2
494
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
495
- */
496
-
497
- function yit_wcan_get_product_taxonomy() {
498
- global $_attributes_array;
499
- $product_taxonomies = ! empty( $_attributes_array ) ? $_attributes_array : get_object_taxonomies( 'product' );
500
- return array_merge( $product_taxonomies, apply_filters( 'yith_wcan_product_taxonomy_type', array() ) );
501
- }
502
-
503
  }
1
+ <?php
2
+ /**
3
+ * Functions
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+
15
+ /**
16
+ * Return a dropdown with Woocommerce attributes
17
+ */
18
+ function yith_wcan_dropdown_attributes( $selected, $echo = true ) {
19
+ $attributes = YITH_WCAN_Helper::attribute_taxonomies();
20
+ $options = "";
21
+
22
+ foreach ( $attributes as $attribute ) {
23
+ $options .= "<option name='{$attribute}'" . selected( $attribute, $selected, false ) . ">{$attribute}</option>";
24
+ }
25
+
26
+ if ( $echo ) {
27
+ echo $options;
28
+ }
29
+ else {
30
+ return $options;
31
+ }
32
+ }
33
+
34
+
35
+ /**
36
+ * Print the widgets options already filled
37
+ *
38
+ * @param $type string list|colors|label
39
+ * @param $attribute woocommerce taxonomy
40
+ * @param $id id used in the <input />
41
+ * @param $name base name used in the <input />
42
+ * @param $values array of values (could be empty if this is an ajax call)
43
+ *
44
+ * @return string
45
+ */
46
+ function yith_wcan_attributes_table( $type, $attribute, $id, $name, $values = array(), $echo = true ) {
47
+ $return = '';
48
+
49
+ $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
50
+
51
+ if ( 'list' == $type ) {
52
+ $return = '<input type="hidden" name="' . $name . '[colors]" value="" /><input type="hidden" name="' . $name . '[labels]" value="" />';
53
+ }
54
+
55
+ elseif ( 'color' == $type ) {
56
+ if ( ! empty( $terms ) ) {
57
+ $return = sprintf( '<table><tr><th>%s</th><th>%s</th></tr>', __( 'Term', 'yith-woocommerce-ajax-navigation' ), __( 'Color', 'yith-woocommerce-ajax-navigation' ) );
58
+
59
+ foreach ( $terms as $term ) {
60
+ $return .= "<tr><td><label for='{$id}{$term->term_id}'>{$term->name}</label></td><td><input type='text' id='{$id}{$term->term_id}' name='{$name}[colors][{$term->term_id}]' value='" . ( isset( $values[$term->term_id] ) ? $values[$term->term_id] : '' ) . "' size='3' class='yith-colorpicker' /></td></tr>";
61
+ }
62
+
63
+ $return .= '</table>';
64
+ }
65
+
66
+ $return .= '<input type="hidden" name="' . $name . '[labels]" value="" />';
67
+ }
68
+
69
+ elseif ( 'multicolor' == $type ) {
70
+ if ( ! empty( $terms ) ) {
71
+ $return = sprintf( '<table class="yith-wcan-multicolor"><tr><th>%s</th><th>%s</th><th>%s</th></tr>', __( 'Term', 'yith-woocommerce-ajax-navigation' ), _x( 'Color 1', 'For multicolor: I.E. white and red T-Shirt', 'yith-woocommerce-ajax-navigation' ), _x( 'Color 2', 'For multicolor: I.E. white and red T-Shirt', 'yith-woocommerce-ajax-navigation' ) );
72
+
73
+ foreach ( $terms as $term ) {
74
+
75
+ $return .= "<tr>";
76
+
77
+ $return .= "<td><label for='{$id}{$term->term_id}'>{$term->name}</label></td>";
78
+
79
+ $return .= "<td><input type='text' id='{$id}{$term->term_id}_1' name='{$name}[multicolor][{$term->term_id}][]' value='" . ( isset( $values[$term->term_id][0] ) ? $values[$term->term_id][0] : '' ) . "' size='3' class='yith-colorpicker multicolor' /></td>";
80
+ $return .= "<td><input type='text' id='{$id}{$term->term_id}_2' name='{$name}[multicolor][{$term->term_id}][]' value='" . ( isset( $values[$term->term_id][1] ) ? $values[$term->term_id][1] : '' ) . "' size='3' class='yith-colorpicker multicolor' /></td>";
81
+
82
+ $return .= '</tr>';
83
+ }
84
+
85
+ $return .= '</table>';
86
+ }
87
+
88
+ $return .= '<input type="hidden" name="' . $name . '[labels]" value="" />';
89
+ }
90
+
91
+ elseif ( 'label' == $type ) {
92
+ if ( ! empty( $terms ) ) {
93
+ $return = sprintf( '<table><tr><th>%s</th><th>%s</th></tr>', __( 'Term', 'yith-woocommerce-ajax-navigation' ), __( 'Labels', 'yith-woocommerce-ajax-navigation' ) );
94
+
95
+ foreach ( $terms as $term ) {
96
+ $return .= "<tr><td><label for='{$id}{$term->term_id}'>{$term->name}</label></td><td><input type='text' id='{$id}{$term->term_id}' name='{$name}[labels][{$term->term_id}]' value='" . ( isset( $values[$term->term_id] ) ? $values[$term->term_id] : '' ) . "' size='3' /></td></tr>";
97
+ }
98
+
99
+ $return .= '</table>';
100
+ }
101
+
102
+ $return .= '<input type="hidden" name="' . $name . '[colors]" value="" />';
103
+ }
104
+
105
+ if ( $echo ) {
106
+ echo $return;
107
+ }
108
+
109
+ return $return;
110
+ }
111
+
112
+
113
+ /**
114
+ * Can the widget be displayed?
115
+ *
116
+ * @return bool
117
+ */
118
+ function yith_wcan_can_be_displayed() {
119
+ global $woocommerce, $_attributes_array;
120
+
121
+ if (
122
+ is_active_widget( false, false, 'yith-woo-ajax-navigation', true ) ||
123
+ is_active_widget( false, false, 'yith-woo-ajax-navigation-sort-by', true ) ||
124
+ is_active_widget( false, false, 'yith-woo-ajax-navigation-stock-on-sale', true ) ||
125
+ is_active_widget( false, false, 'yith-woo-ajax-navigation-list-price-filter', true )
126
+ ) {
127
+ return true;
128
+ }
129
+ else {
130
+ return false;
131
+ }
132
+ }
133
+
134
+
135
+ if ( ! function_exists( 'yit_curPageURL' ) ) {
136
+ /**
137
+ * Retrieve the current complete url
138
+ *
139
+ * @since 1.0
140
+ */
141
+ function yit_curPageURL() {
142
+ $pageURL = 'http';
143
+ if ( isset( $_SERVER["HTTPS"] ) AND $_SERVER["HTTPS"] == "on" ) {
144
+ $pageURL .= "s";
145
+ }
146
+
147
+ $pageURL .= "://";
148
+
149
+ if ( isset( $_SERVER["SERVER_PORT"] ) AND $_SERVER["SERVER_PORT"] != "80" ) {
150
+ $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
151
+ }
152
+ else {
153
+ $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
154
+ }
155
+
156
+ return $pageURL;
157
+ }
158
+ }
159
+
160
+ if ( ! function_exists( 'yit_reorder_terms_by_parent' ) ) {
161
+ /**
162
+ * Sort the array of terms associating the child to the parent terms
163
+ *
164
+ * @param $terms mixed|array
165
+ *
166
+ * @return mixed!array
167
+ * @since 1.3.1
168
+ */
169
+ function yit_reorder_terms_by_parent( $terms ) {
170
+
171
+ /* Extract Child Terms */
172
+ $child_terms = array();
173
+ $terms_count = 0;
174
+ $parent_terms = array();
175
+
176
+ foreach ( $terms as $array_key => $term ) {
177
+
178
+ if ( $term->parent != 0 ) {
179
+
180
+ if ( isset( $child_terms[$term->parent] ) && $child_terms[$term->parent] != null ) {
181
+ $child_terms[$term->parent] = array_merge( $child_terms[$term->parent], array( $term ) );
182
+ }
183
+ else {
184
+ $child_terms[$term->parent] = array( $term );
185
+ }
186
+
187
+ }
188
+ else {
189
+ $parent_terms[$terms_count] = $term;
190
+ }
191
+ $terms_count ++;
192
+ }
193
+
194
+ /* Reorder Therms */
195
+ $terms_count = 0;
196
+ $terms = array();
197
+
198
+ foreach ( $parent_terms as $term ) {
199
+
200
+ $terms[$terms_count] = $term;
201
+
202
+ /* The term as child */
203
+ if ( array_key_exists( $term->term_id, $child_terms ) ) {
204
+
205
+ foreach ( $child_terms[$term->term_id] as $child_term ) {
206
+ $terms_count ++;
207
+ $terms[$terms_count] = $child_term;
208
+ }
209
+ }
210
+ $terms_count ++;
211
+ }
212
+
213
+ return $terms;
214
+ }
215
+ }
216
+
217
+ if ( ! function_exists( 'yit_get_terms' ) ) {
218
+ /**
219
+ * Get the array of objects terms
220
+ *
221
+ * @param $type A type of term to display
222
+ *
223
+ * @return $terms mixed|array
224
+ *
225
+ * @since 1.3.1
226
+ */
227
+ function yit_get_terms( $case, $taxonomy, $instance = false ) {
228
+
229
+ $exclude = apply_filters( 'yith_wcan_exclude_terms', array(), $instance );
230
+ $include = apply_filters( 'yith_wcan_include_terms', array(), $instance );
231
+
232
+ switch ( $case ) {
233
+
234
+ case 'all':
235
+ $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) );
236
+ break;
237
+
238
+ case 'hierarchical':
239
+ $terms = yit_reorder_terms_by_parent( get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) ) );
240
+ break;
241
+
242
+ case 'parent' :
243
+ $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'parent' => false, 'exclude' => $exclude ) );
244
+ break;
245
+
246
+ default:
247
+ $args = array( 'hide_empty' => true, 'exclude' => $exclude, 'include' => $include );
248
+ if ( 'parent' == $instance['display'] ) {
249
+ $args['parent'] = false;
250
+ }
251
+
252
+ $terms = get_terms( $taxonomy, $args );
253
+
254
+ if ( 'hierarchical' == $instance['display'] ) {
255
+ $terms = yit_reorder_terms_by_parent( $terms );
256
+ }
257
+ break;
258
+ }
259
+
260
+ return $terms;
261
+ }
262
+ }
263
+
264
+ if ( ! function_exists( 'yit_term_is_child' ) ) {
265
+ /**
266
+ * Return true if the term is a child, false otherwise
267
+ *
268
+ * @param $term The term object
269
+ *
270
+ * @return bool
271
+ *
272
+ * @since 1.3.1
273
+ */
274
+ function yit_term_is_child( $term ) {
275
+
276
+ return ( isset( $term->parent ) && $term->parent != 0 ) ? true : false;
277
+ }
278
+ }
279
+
280
+ if ( ! function_exists( 'yit_term_is_parent' ) ) {
281
+ /**
282
+ * Return true if the term is a parent, false otherwise
283
+ *
284
+ * @param $term The term object
285
+ *
286
+ * @return bool
287
+ *
288
+ * @since 1.3.1
289
+ */
290
+ function yit_term_is_parent( $term ) {
291
+
292
+ return ( isset( $term->parent ) && $term->parent == 0 ) ? true : false;
293
+ }
294
+ }
295
+
296
+ if ( ! function_exists( 'yit_term_has_child' ) ) {
297
+ /**
298
+ * Return true if the term has a child, false otherwise
299
+ *
300
+ * @param $term The term object
301
+ * @param $taxonomy the taxonomy to search
302
+ *
303
+ * @return bool
304
+ *
305
+ * @since 1.3.1
306
+ */
307
+ function yit_term_has_child( $term, $taxonomy ) {
308
+ global $woocommerce;
309
+
310
+ $count = 0;
311
+ $child_terms = get_terms( $taxonomy, array( 'child_of' => $term->term_id ) );
312
+ foreach ( $child_terms as $term ) {
313
+ $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
314
+ $count += sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
315
+ }
316
+
317
+ return empty( $count ) ? false : true;
318
+ }
319
+ }
320
+
321
+ if ( ! function_exists( 'yith_wcan_get_option' ) ) {
322
+ /**
323
+ * Retreive the plugin option
324
+ *
325
+ * @param mixed|bool $option_name The option name. If false return alla options array
326
+ *
327
+ *
328
+ * @return mixed|array|string The option(s)
329
+ *
330
+ * @since 1.3.1
331
+ */
332
+ function yith_wcan_get_option( $option_name = false, $default = false ) {
333
+ $options = get_option( 'yit_wcan_options' );
334
+
335
+ if ( ! $option_name ) {
336
+ return $options;
337
+ }
338
+
339
+ return isset( $options[$option_name] ) ? $options[$option_name] : $default;
340
+ }
341
+ }
342
+
343
+ if ( ! function_exists( 'yit_get_filter_args' ) ) {
344
+ /**
345
+ * Retreive the filter query args option
346
+ *
347
+ * @return array The option(s)
348
+ *
349
+ * @since 1.4
350
+ */
351
+ function yit_get_filter_args( $check_price_filter = true ) {
352
+ $filter_value = array();
353
+ $regexs = array( '/^filter_[a-zA-Z0-9]/', '/^query_type_[a-zA-Z0-9]/', '/product_tag/' );
354
+
355
+ /* Support to YITH WooCommerce Brands */
356
+ if ( defined( 'YITH_WCBR_PREMIUM_INIT' ) && YITH_WCBR_PREMIUM_INIT ) {
357
+ $brands_taxonomy = YITH_WCBR::$brands_taxonomy;
358
+ $regexs[] = "/{$brands_taxonomy}/";
359
+ }
360
+
361
+ if ( ! empty( $_GET ) ) {
362
+ foreach ( $regexs as $regex ) {
363
+ foreach ( $_GET as $query_var => $value ) {
364
+ if ( preg_match( $regex, $query_var ) ) {
365
+ $filter_value[$query_var] = $value;
366
+ }
367
+ }
368
+ }
369
+ }
370
+
371
+ if ( $check_price_filter ) {
372
+ // WooCommerce Price Filter
373
+ if ( isset( $_GET['min_price'] ) ) {
374
+ $link = $filter_value['min_price'] = $_GET['min_price'];
375
+ }
376
+
377
+ if ( isset( $_GET['max_price'] ) ) {
378
+ $link = $filter_value['max_price'] = $_GET['max_price'];
379
+ }
380
+ }
381
+
382
+ // WooCommerce In Stock/On Sale filters
383
+ if ( isset( $_GET['instock_filter'] ) ) {
384
+ $link = $filter_value['instock_filter'] = $_GET['instock_filter'];
385
+ }
386
+
387
+ if ( isset( $_GET['onsale_filter'] ) ) {
388
+ $link = $filter_value['onsale_filter'] = $_GET['onsale_filter'];
389
+ }
390
+
391
+ if ( isset( $_GET['orderby'] ) ) {
392
+ $link = $filter_value['orderby'] = $_GET['orderby'];
393
+ }
394
+
395
+ if ( isset( $_GET['product_tag'] ) ) {
396
+ $link = $filter_value['product_tag'] = urlencode( $_GET['product_tag'] );
397
+ }
398
+
399
+ return $filter_value;
400
+ }
401
+ }
402
+
403
+ if ( ! function_exists( 'yit_check_active_price_filter' ) ) {
404
+ /**
405
+ * Check if there is an active price filter
406
+ *
407
+ * @return bool True if the the filter is active, false otherwise
408
+ *
409
+ * @since 1.4
410
+ */
411
+ function yit_check_active_price_filter( $min_price, $max_price ) {
412
+ return isset( $_GET['min_price'] ) && $_GET['min_price'] == $min_price && isset( $_GET['max_price'] ) && $_GET['max_price'] == $max_price;
413
+ }
414
+ }
415
+
416
+ if ( ! function_exists( 'yit_remove_price_filter_query_args' ) ) {
417
+ /**
418
+ * Remove min_price and max_price query args from filters array value
419
+ *
420
+ * @return array The array params
421
+ *
422
+ * @since 1.4
423
+ */
424
+ function yit_remove_price_filter_query_args( $filter_value ) {
425
+ foreach ( array( 'min_price', 'max_price' ) as $remove ) {
426
+ unset( $filter_value[$remove] );
427
+ }
428
+
429
+ return $filter_value;
430
+ }
431
+ }
432
+
433
+ if ( ! function_exists( 'yit_get_woocommerce_layered_nav_link' ) ) {
434
+ /**
435
+ * Get current layered link
436
+ *
437
+ * @return string The new link
438
+ *
439
+ * @since 1.4
440
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
441
+ */
442
+ function yit_get_woocommerce_layered_nav_link() {
443
+
444
+ if ( defined( 'SHOP_IS_ON_FRONT' ) || ( is_shop() && ! is_product_category() ) || is_product_taxonomy() ) {
445
+ $return = get_post_type_archive_link( 'product' );
446
+ return apply_filters( 'yith_wcan_untrailingslashit', true ) ? untrailingslashit( $return ) : $return;
447
+ }
448
+
449
+ elseif ( is_product_category() ) {
450
+ $return = get_term_link( get_queried_object()->slug, 'product_cat' );
451
+ return apply_filters( 'yith_wcan_untrailingslashit', true ) ? untrailingslashit( $return ) : $return;
452
+ }
453
+
454
+ else {
455
+ $return = get_term_link( get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
456
+ return apply_filters( 'yith_wcan_untrailingslashit', true ) ? untrailingslashit( $return ) : $return;
457
+ }
458
+
459
+ return false;
460
+ }
461
+ }
462
+
463
+ if ( ! function_exists( 'yit_wcan_localize_terms' ) ) {
464
+ /**
465
+ * Get current layered link
466
+ *
467
+ * @param $term_id The term id
468
+ * @param $taxonomy The taxonomy name
469
+ *
470
+ * @return string The new term_id
471
+ *
472
+ * @since 1.4
473
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
474
+ */
475
+
476
+ function yit_wcan_localize_terms( $term_id, $taxonomy ) {
477
+ /* === WPML Support === */
478
+ global $sitepress;
479
+ if ( ! empty( $sitepress ) && function_exists( 'wpml_object_id_filter' ) ) {
480
+ $term_id = wpml_object_id_filter( $term_id, $taxonomy, true, $sitepress->get_default_language() );
481
+ }
482
+
483
+ return $term_id;
484
+ }
485
+
486
+ }
487
+
488
+ if ( ! function_exists( 'yit_wcan_get_product_taxonomy' ) ) {
489
+ /**
490
+ * Get the product taxonomy array
491
+ * @return array product taxonomy array
492
+ *
493
+ * @since 2.2
494
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
495
+ */
496
+
497
+ function yit_wcan_get_product_taxonomy() {
498
+ global $_attributes_array;
499
+ $product_taxonomies = ! empty( $_attributes_array ) ? $_attributes_array : get_object_taxonomies( 'product' );
500
+ return array_merge( $product_taxonomies, apply_filters( 'yith_wcan_product_taxonomy_type', array() ) );
501
+ }
502
+
503
  }
modules/yith-woocommerce-ajax-navigation/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 2.6.0
7
  * Author: yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_ajxnav
@@ -65,11 +65,10 @@ if ( defined( 'YITH_WCAN_VERSION' ) ) {
65
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
66
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
67
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
68
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '2.6.0' );
69
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
70
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
71
 
72
-
73
  /**
74
  * Init default plugin settings
75
  */
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 2.7.0
7
  * Author: yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_ajxnav
65
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
66
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
67
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
68
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '2.7.0' );
69
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
70
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
71
 
 
72
  /**
73
  * Init default plugin settings
74
  */
modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-it_IT.mo CHANGED
Binary file
modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-it_IT.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-11-02 15:07+0100\n"
6
- "PO-Revision-Date: 2015-11-02 15:07+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: it_IT\n"
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-11-10 12:29+0100\n"
6
+ "PO-Revision-Date: 2015-11-10 12:29+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: it_IT\n"
modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-tr_TR.mo CHANGED
Binary file
modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation-tr_TR.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-11-02 15:07+0100\n"
6
- "PO-Revision-Date: 2015-11-02 15:07+0100\n"
7
  "Last-Translator: Caner Öncel <caneroncel@gmail.com>\n"
8
  "Language-Team: Caner Öncel <caneroncel@gmail.com>\n"
9
  "Language: tr\n"
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-11-10 12:29+0100\n"
6
+ "PO-Revision-Date: 2015-11-10 12:29+0100\n"
7
  "Last-Translator: Caner Öncel <caneroncel@gmail.com>\n"
8
  "Language-Team: Caner Öncel <caneroncel@gmail.com>\n"
9
  "Language: tr\n"
modules/yith-woocommerce-ajax-navigation/languages/yith-woocommerce-ajax-navigation.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2015-11-02 15:07+0100\n"
7
  "PO-Revision-Date: 2015-06-19 13:59+0100\n"
8
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
9
  "Language-Team: \n"
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2015-11-10 12:29+0100\n"
7
  "PO-Revision-Date: 2015-06-19 13:59+0100\n"
8
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
9
  "Language-Team: \n"
modules/yith-woocommerce-ajax-navigation/settings/custom-style-options.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
-
3
- $custom_style = array(
4
-
5
- 'custom-style' => array(
6
-
7
- 'header' => array(
8
-
9
- array( 'type' => 'open' ),
10
-
11
- array(
12
- 'name' => __( 'Custom Style', 'yith-woocommerce-ajax-navigation' ),
13
- 'type' => 'title'
14
- ),
15
-
16
- array( 'type' => 'close' )
17
- ),
18
-
19
- 'settings' => array(
20
-
21
- array( 'type' => 'open' ),
22
-
23
- array(
24
- 'name' => __( 'Put here your custom CSS rules:', 'yith-woocommerce-ajax-navigation' ),
25
- 'desc' => '',
26
- 'id' => 'yith_wcan_custom_style',
27
- 'type' => 'textarea',
28
- 'std' => '',
29
- 'custom_attributes' => array(
30
- 'rows' => 15,
31
- 'cols' => 75
32
- )
33
- ),
34
-
35
- array( 'type' => 'close' ),
36
- ),
37
- )
38
- );
39
-
40
  return apply_filters( 'yith_wcan_panel_custom_style_options', $custom_style );
1
+ <?php
2
+
3
+ $custom_style = array(
4
+
5
+ 'custom-style' => array(
6
+
7
+ 'header' => array(
8
+
9
+ array( 'type' => 'open' ),
10
+
11
+ array(
12
+ 'name' => __( 'Custom Style', 'yith-woocommerce-ajax-navigation' ),
13
+ 'type' => 'title'
14
+ ),
15
+
16
+ array( 'type' => 'close' )
17
+ ),
18
+
19
+ 'settings' => array(
20
+
21
+ array( 'type' => 'open' ),
22
+
23
+ array(
24
+ 'name' => __( 'Put here your custom CSS rules:', 'yith-woocommerce-ajax-navigation' ),
25
+ 'desc' => '',
26
+ 'id' => 'yith_wcan_custom_style',
27
+ 'type' => 'textarea',
28
+ 'std' => '',
29
+ 'custom_attributes' => array(
30
+ 'rows' => 15,
31
+ 'cols' => 75
32
+ )
33
+ ),
34
+
35
+ array( 'type' => 'close' ),
36
+ ),
37
+ )
38
+ );
39
+
40
  return apply_filters( 'yith_wcan_panel_custom_style_options', $custom_style );
modules/yith-woocommerce-ajax-navigation/settings/frontend-options.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
-
3
- $frontend = array(
4
-
5
- 'frontend' => array(
6
-
7
- 'header' => array(
8
-
9
- array( 'type' => 'open' ),
10
-
11
- array(
12
- 'name' => __( 'General Settings', 'yith-woocommerce-ajax-navigation' ),
13
- 'type' => 'title'
14
- ),
15
-
16
- array( 'type' => 'close' )
17
- ),
18
-
19
- 'settings' => array(
20
-
21
- array( 'type' => 'open' ),
22
-
23
- array(
24
- 'id' => 'yith_wcan_frontend_description',
25
- 'name' => _x( 'How To:', 'Admin panel: option description', 'yith-woocommerce-ajax-navigation' ),
26
- 'type' => 'wcan_description',
27
- 'desc' => _x( "If your theme use the WooCommerce standard templates, you don't need to change the following values.
28
- Otherwise, add the classes used in the template of your theme.
29
- If you don't know them, please contact the developer of your theme to receive the correct classes.", 'Admin: Panel section description', 'yith-woocommerce-ajax-navigation' ),
30
- ),
31
-
32
- array(
33
- 'name' => __( 'Product Container', 'yith-woocommerce-ajax-navigation' ),
34
- 'desc' => __( 'Put here the CSS class or id for the product container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: <strong>.products</strong>)',
35
- 'id' => 'yith_wcan_ajax_shop_container',
36
- 'type' => 'text',
37
- 'std' => '.products'
38
- ),
39
-
40
- array(
41
- 'name' => __( 'Shop Pagination Container', 'yith-woocommerce-ajax-navigation' ),
42
- 'desc' => __( 'Put here the CSS class or id for the shop pagination container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: <strong>nav.woocommerce-pagination</strong>)',
43
- 'id' => 'yith_wcan_ajax_shop_pagination',
44
- 'type' => 'text',
45
- 'std' => 'nav.woocommerce-pagination'
46
- ),
47
-
48
- array(
49
- 'name' => __( 'Result Count Container', 'yith-woocommerce-ajax-navigation' ),
50
- 'desc' => __( 'Put here the CSS class or id for the result count container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: <strong>.woocommerce-result-count</strong>)',
51
- 'id' => 'yith_wcan_ajax_shop_result_container',
52
- 'type' => 'text',
53
- 'std' => '.woocommerce-result-count'
54
- ),
55
-
56
- array( 'type' => 'close' ),
57
- ),
58
- )
59
- );
60
-
61
  return apply_filters( 'yith_wcan_panel_frontend_options', $frontend );
1
+ <?php
2
+
3
+ $frontend = array(
4
+
5
+ 'frontend' => array(
6
+
7
+ 'header' => array(
8
+
9
+ array( 'type' => 'open' ),
10
+
11
+ array(
12
+ 'name' => __( 'General Settings', 'yith-woocommerce-ajax-navigation' ),
13
+ 'type' => 'title'
14
+ ),
15
+
16
+ array( 'type' => 'close' )
17
+ ),
18
+
19
+ 'settings' => array(
20
+
21
+ array( 'type' => 'open' ),
22
+
23
+ array(
24
+ 'id' => 'yith_wcan_frontend_description',
25
+ 'name' => _x( 'How To:', 'Admin panel: option description', 'yith-woocommerce-ajax-navigation' ),
26
+ 'type' => 'wcan_description',
27
+ 'desc' => _x( "If your theme use the WooCommerce standard templates, you don't need to change the following values.
28
+ Otherwise, add the classes used in the template of your theme.
29
+ If you don't know them, please contact the developer of your theme to receive the correct classes.", 'Admin: Panel section description', 'yith-woocommerce-ajax-navigation' ),
30
+ ),
31
+
32
+ array(
33
+ 'name' => __( 'Product Container', 'yith-woocommerce-ajax-navigation' ),
34
+ 'desc' => __( 'Put here the CSS class or id for the product container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: <strong>.products</strong>)',
35
+ 'id' => 'yith_wcan_ajax_shop_container',
36
+ 'type' => 'text',
37
+ 'std' => '.products'
38
+ ),
39
+
40
+ array(
41
+ 'name' => __( 'Shop Pagination Container', 'yith-woocommerce-ajax-navigation' ),
42
+ 'desc' => __( 'Put here the CSS class or id for the shop pagination container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: <strong>nav.woocommerce-pagination</strong>)',
43
+ 'id' => 'yith_wcan_ajax_shop_pagination',
44
+ 'type' => 'text',
45
+ 'std' => 'nav.woocommerce-pagination'
46
+ ),
47
+
48
+ array(
49
+ 'name' => __( 'Result Count Container', 'yith-woocommerce-ajax-navigation' ),
50
+ 'desc' => __( 'Put here the CSS class or id for the result count container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: <strong>.woocommerce-result-count</strong>)',
51
+ 'id' => 'yith_wcan_ajax_shop_result_container',
52
+ 'type' => 'text',
53
+ 'std' => '.woocommerce-result-count'
54
+ ),
55
+
56
+ array( 'type' => 'close' ),
57
+ ),
58
+ )
59
+ );
60
+
61
  return apply_filters( 'yith_wcan_panel_frontend_options', $frontend );
modules/yith-woocommerce-ajax-navigation/templates/admin/premium.php CHANGED
@@ -298,7 +298,7 @@
298
  <h2><?php _e('WooCommerce Price Filter','yith-woocommerce-ajax-navigation');?></h2>
299
  </div>
300
  <p>
301
- <?php echo _e('With the premium version of the plugin, you will also be able to customize WooCommerce Price Filter widget, changing the settings you can find in the plugin option panel.', 'yith-woocommerce-ajax-navigation');?>
302
  </p>
303
  </div>
304
  <div class="col-1">
@@ -322,6 +322,22 @@
322
  </div>
323
  </div>
324
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  <div class="section section-cta section-odd">
326
  <div class="landing-container">
327
  <div class="premium-cta">
298
  <h2><?php _e('WooCommerce Price Filter','yith-woocommerce-ajax-navigation');?></h2>
299
  </div>
300
  <p>
301
+ <?php echo _e('Take advantage of the premium version of the plugin to edit the default behavior of WooCommerce Price Filter. Change the %1$slayout of the filter%2$s and activate the %1$sAjax mode%2$s to apply the filter immediately, without reloading the page.', 'yith-woocommerce-ajax-navigation');?>
302
  </p>
303
  </div>
304
  <div class="col-1">
322
  </div>
323
  </div>
324
  </div>
325
+ <div class="section section-odd clear" style="background: url(<?php echo YITH_WCAN_URL ?>assets/images/08-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
326
+ <div class="landing-container">
327
+ <div class="col-2">
328
+ <div class="section-title">
329
+ <img src="<?php echo YITH_WCAN_URL ?>assets/images/08-icon.png" alt="icon 08" />
330
+ <h2><?php _e(' Filter by category','yith-woocommerce-ajax-navigation');?></h2>
331
+ </div>
332
+ <p>
333
+ <?php echo _e('Configure the widget to let your users filter product by a %1$sselected category%2$s. Your users will be even happier to browse your shop.', 'yith-woocommerce-ajax-navigation');?>
334
+ </p>
335
+ </div>
336
+ <div class="col-1">
337
+ <img src="<?php echo YITH_WCAN_URL ?>assets/images/08.png" alt="woocommerce price filter" />
338
+ </div>
339
+ </div>
340
+ </div>
341
  <div class="section section-cta section-odd">
342
  <div class="landing-container">
343
  <div class="premium-cta">
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -1,913 +1,948 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
15
- /**
16
- * YITH WooCommerce Ajax Navigation Widget
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCAN_Navigation_Widget extends WP_Widget {
21
-
22
- function __construct() {
23
- $widget_ops = array( 'classname' => 'yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Filter the product list without reloading the page', 'yith-woocommerce-ajax-navigation' ) );
24
- $control_ops = array( 'width' => 400, 'height' => 350 );
25
- add_action('wp_ajax_yith_wcan_select_type', array( $this, 'ajax_print_terms') );
26
- parent::__construct( 'yith-woo-ajax-navigation', _x( 'YITH WooCommerce Ajax Product Filter', 'Admin: Widget Title', 'yith-woocommerce-ajax-navigation' ), $widget_ops, $control_ops );
27
- }
28
-
29
-
30
- function widget( $args, $instance ) {
31
- global $_chosen_attributes, $woocommerce;
32
-
33
- extract( $args );
34
- $_attributes_array = yit_wcan_get_product_taxonomy();
35
-
36
- if( apply_filters( 'yith_wcan_is_search', is_search() ) ){
37
- return;
38
- }
39
-
40
- if ( apply_filters( 'yith_wcan_show_widget', ! is_post_type_archive( 'product' ) && ! is_tax( $_attributes_array ) ) ) {
41
- return;
42
- }
43
-
44
- $current_term = $_attributes_array && is_tax( $_attributes_array ) ? get_queried_object()->term_id : '';
45
- $current_tax = $_attributes_array && is_tax( $_attributes_array ) ? get_queried_object()->taxonomy : '';
46
- $title = apply_filters( 'yith_widget_title_ajax_navigation', ( isset( $instance['title'] ) ? $instance['title'] : '' ), $instance, $this->id_base );
47
- $query_type = isset( $instance['query_type'] ) ? $instance['query_type'] : 'and';
48
- $display_type = isset( $instance['type'] ) ? $instance['type'] : 'list';
49
- $is_child_class = 'yit-wcan-child-terms';
50
- $is_chosen_class = 'chosen';
51
- $terms_type_list = ( isset( $instance['display'] ) && ( $display_type == 'list' || $display_type == 'select' ) ) ? $instance['display'] : 'all';
52
-
53
- $instance['attribute'] = empty( $instance['attribute'] ) ? '' : $instance['attribute'];
54
-
55
- /* FIX TO WOOCOMMERCE 2.1 */
56
- if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
57
- $taxonomy = wc_attribute_taxonomy_name( $instance['attribute'] );
58
- }
59
- else {
60
- $taxonomy = $woocommerce->attribute_taxonomy_name( $instance['attribute'] );
61
- }
62
-
63
- if ( ! taxonomy_exists( $taxonomy ) ) {
64
- return;
65
- }
66
-
67
- $taxonomy = apply_filters( 'yith_wcan_get_terms_params', $taxonomy, $instance, 'taxonomy_name' );
68
- $terms_type_list = apply_filters( 'yith_wcan_get_terms_params', $terms_type_list, $instance, 'terms_type' );
69
-
70
- $terms = yit_get_terms( $terms_type_list, $taxonomy, $instance );
71
-
72
- if ( count( $terms ) > 0 ) {
73
-
74
- ob_start();
75
-
76
- $found = false;
77
-
78
- echo $before_widget;
79
-
80
- $title = html_entity_decode( apply_filters( 'widget_title', $title ) );
81
-
82
- if ( ! empty( $title ) ) {
83
- echo $before_title . $title . $after_title;
84
- }
85
-
86
- // Force found when option is selected - do not force found on taxonomy attributes
87
- if ( ! $_attributes_array || ! is_tax( $_attributes_array ) ) {
88
- if ( is_array( $_chosen_attributes ) && array_key_exists( $taxonomy, $_chosen_attributes ) ) {
89
- $found = true;
90
- }
91
- }
92
-
93
- if ( in_array( $display_type, apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
94
- // List display
95
- echo "<ul class='yith-wcan-list yith-wcan'>";
96
-
97
- foreach ( $terms as $term ) {
98
-
99
- // Get count based on current view - uses transients
100
- $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
101
-
102
- //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
103
-
104
- $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
105
-
106
- set_transient( $transient_name, $_products_in_term );
107
- //}
108
-
109
- $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
110
-
111
- $term_param = apply_filters( 'yith_wcan_term_param_uri', $term->term_id, $display_type, $term );
112
-
113
- // If this is an AND query, only show options with count > 0
114
- if ( $query_type == 'and' ) {
115
-
116
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
117
-
118
- // skip the term for the current archive
119
- if ( $current_term == $term_param ) {
120
- continue;
121
- }
122
-
123
- if ( $count > 0 && $current_term !== $term_param ) {
124
- $found = true;
125
- }
126
-
127
- if ( ( ( $terms_type_list == 'hierarchical' || ( $terms_type_list == 'tags' && $instance['display'] == 'hierarchical' ) ) || ! yit_term_has_child( $term, $taxonomy ) ) && $count == 0 && ! $option_is_set ) {
128
- continue;
129
- }
130
-
131
- // If this is an OR query, show all options so search can be expanded
132
- }
133
- else {
134
-
135
- // skip the term for the current archive
136
- if ( $current_term == $term_param ) {
137
- continue;
138
- }
139
-
140
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
141
-
142
- if ( $count > 0 ) {
143
- $found = true;
144
- }
145
-
146
- }
147
-
148
- $arg = apply_filters( 'yith_wcan_list_type_query_arg', 'filter_' . sanitize_title( $instance['attribute'] ), $display_type, $term );
149
-
150
- $current_filter = ( isset( $_GET[$arg] ) ) ? explode(apply_filters( 'yith_wcan_list_filter_operator', ',', $display_type ), apply_filters( "yith_wcan_list_filter_query_{$arg}", $_GET[$arg] ) ) : array();
151
-
152
- if ( ! is_array( $current_filter ) ) {
153
- $current_filter = array();
154
- }
155
-
156
- $current_filter = array_map( 'esc_attr', $current_filter );
157
-
158
- if ( ! in_array( $term_param, $current_filter ) ) {
159
- $current_filter[] = $term_param;
160
- }
161
-
162
- $link = yit_get_woocommerce_layered_nav_link();
163
-
164
- // All current filters
165
- if ( $_chosen_attributes ) {
166
- foreach ( $_chosen_attributes as $name => $data ) {
167
- if ( $name !== $taxonomy ) {
168
-
169
- // Exclude query arg for current term archive term
170
- while ( in_array( $current_term, $data['terms'] ) ) {
171
- $key = array_search( $current_term, $data );
172
- unset( $data['terms'][$key] );
173
- }
174
-
175
- // Remove pa_ and sanitize
176
- $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
177
-
178
- if ( ! empty( $data['terms'] ) ) {
179
- $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
180
- }
181
-
182
- if ( $data['query_type'] == 'or' ) {
183
- $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
184
- }
185
- }
186
- }
187
- }
188
-
189
- // Min/Max
190
- if ( isset( $_GET['min_price'] ) ) {
191
- $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
192
- }
193
-
194
- if ( isset( $_GET['max_price'] ) ) {
195
- $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
196
- }
197
-
198
- if ( isset( $_GET['product_tag'] ) && $display_type != 'tags' ) {
199
- $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
200
- }
201
-
202
- $check_for_current_widget = isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] );
203
-
204
- // Current Filter = this widget
205
- if ( apply_filters( 'yith_wcan_list_type_current_widget_check', $check_for_current_widget, $current_filter, $display_type, $term_param ) ) {
206
- $class = ( ( $terms_type_list == 'hierarchical' || ( $terms_type_list == 'tags' && $instance['display'] == 'hierarchical' ) ) && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
207
-
208
- // Remove this term is $current_filter has more than 1 term filtered
209
- if ( sizeof( $current_filter ) > 1 ) {
210
- $current_filter_without_this = array_diff( $current_filter, array( $term_param ) );
211
- $link = add_query_arg( $arg, implode( apply_filters( 'yith_wcan_list_filter_operator', ',', $display_type ), $current_filter_without_this ), $link );
212
- }
213
- }
214
-
215
- else {
216
- $class = ( ( $terms_type_list == 'hierarchical' || ( $terms_type_list == 'tags' && $instance['display'] == 'hierarchical' ) ) && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
217
- $link = add_query_arg( $arg, implode( apply_filters( 'yith_wcan_list_filter_operator', ',', $display_type ), $current_filter ), $link );
218
- }
219
-
220
- // Search Arg
221
- if ( get_search_query() ) {
222
- $link = add_query_arg( 's', get_search_query(), $link );
223
- }
224
-
225
- // Post Type Arg
226
- if ( isset( $_GET['post_type'] ) ) {
227
- $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
228
- }
229
-
230
- $is_attribute = apply_filters( 'yith_wcan_is_attribute_check', true );
231
-
232
- // Query type Arg
233
- if ( $is_attribute && $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
234
- $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
235
- }
236
-
237
-
238
- echo '<li ' . $class . '>';
239
-
240
- echo ( $count > 0 || $option_is_set ) ? '<a href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
241
-
242
- echo $term->name;
243
-
244
- echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
245
-
246
- if ( $count != 0 && apply_filters( "{$args['widget_id']}-show_product_count", true, $instance ) ) {
247
- echo ' <small class="count">' . $count . '</small><div class="clear"></div></li>';
248
- }
249
- }
250
-
251
- echo "</ul>";
252
- }
253
- elseif ( $display_type == 'select' ) {
254
- $dropdown_label = __( 'Filters:', 'yith-woocommerce-ajax-navigation' );
255
- ?>
256
-
257
- <a class="yit-wcan-select-open" href="#"><?php echo apply_filters( 'yith_wcan_dropdown_default_label', $dropdown_label ) ?></a>
258
-
259
- <?php
260
- // Select display
261
- echo "<div class='yith-wcan-select-wrapper'>";
262
-
263
- echo "<ul class='yith-wcan-select yith-wcan'>";
264
-
265
- foreach ( $terms as $term ) {
266
-
267
- // Get count based on current view - uses transients
268
- $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
269
-
270
- //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
271
-
272
- $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
273
-
274
- set_transient( $transient_name, $_products_in_term );
275
- //}
276
-
277
- $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
278
-
279
- // If this is an AND query, only show options with count > 0
280
- if ( $query_type == 'and' ) {
281
-
282
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
283
-
284
- // skip the term for the current archive
285
- if ( $current_term == $term->term_id ) {
286
- continue;
287
- }
288
-
289
- if ( $count > 0 && $current_term !== $term->term_id ) {
290
- $found = true;
291
- }
292
-
293
- if ( ( $terms_type_list != 'hierarchical' || ! yit_term_has_child( $term, $taxonomy ) ) && $count == 0 && ! $option_is_set ) {
294
- continue;
295
- }
296
-
297
- // If this is an OR query, show all options so search can be expanded
298
- }
299
- else {
300
-
301
- // skip the term for the current archive
302
- if ( $current_term == $term->term_id ) {
303
- continue;
304
- }
305
-
306
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
307
-
308
- if ( $count > 0 ) {
309
- $found = true;
310
- }
311
-
312
- }
313
-
314
- $arg = 'filter_' . urldecode( sanitize_title( $instance['attribute'] ) );
315
-
316
- $current_filter = ( isset( $_GET[$arg] ) ) ? explode( ',', $_GET[$arg] ) : array();
317
-
318
- if ( ! is_array( $current_filter ) ) {
319
- $current_filter = array();
320
- }
321
-
322
- $current_filter = array_map( 'esc_attr', $current_filter );
323
-
324
- if ( ! in_array( $term->term_id, $current_filter ) ) {
325
- $current_filter[] = $term->term_id;
326
- }
327
-
328
- $link = yit_get_woocommerce_layered_nav_link();
329
-
330
- // All current filters
331
- if ( $_chosen_attributes ) {
332
- foreach ( $_chosen_attributes as $name => $data ) {
333
- if ( $name !== $taxonomy ) {
334
-
335
- // Exclude query arg for current term archive term
336
- while ( in_array( $current_term, $data['terms'] ) ) {
337
- $key = array_search( $current_term, $data );
338
- unset( $data['terms'][$key] );
339
- }
340
-
341
- // Remove pa_ and sanitize
342
- $filter_name = urldecode( sanitize_title( str_replace( 'pa_', '', $name ) ) );
343
-
344
- if ( ! empty( $data['terms'] ) ) {
345
- $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
346
- }
347
-
348
- if ( $data['query_type'] == 'or' ) {
349
- $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
350
- }
351
- }
352
- }
353
- }
354
-
355
- // Min/Max
356
- if ( isset( $_GET['min_price'] ) ) {
357
- $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
358
- }
359
-
360
- if ( isset( $_GET['max_price'] ) ) {
361
- $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
362
- }
363
-
364
- if ( isset( $_GET['product_tag'] ) ) {
365
- $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
366
- }
367
-
368
- // Current Filter = this widget
369
- if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) {
370
-
371
- $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
372
-
373
- // Remove this term is $current_filter has more than 1 term filtered
374
- if ( sizeof( $current_filter ) > 1 ) {
375
- $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
376
- $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
377
- }
378
-
379
- }
380
- else {
381
-
382
- $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
383
- $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
384
-
385
- }
386
-
387
- // Search Arg
388
- if ( get_search_query() ) {
389
- $link = add_query_arg( 's', get_search_query(), $link );
390
- }
391
-
392
- // Post Type Arg
393
- if ( isset( $_GET['post_type'] ) ) {
394
- $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
395
- }
396
-
397
- // Query type Arg
398
- if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
399
- $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
400
- }
401
-
402
- echo '<li ' . $class . '>';
403
-
404
- echo ( $count > 0 || $option_is_set ) ? '<a data-type="select" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
405
-
406
- echo $term->name;
407
-
408
- echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
409
-
410
- echo '</li>';
411
-
412
- }
413
-
414
- echo "</ul>";
415
-
416
- echo "</div>";
417
-
418
- }
419
- elseif ( $display_type == 'color' ) {
420
- // List display
421
- echo "<ul class='yith-wcan-color yith-wcan yith-wcan-group'>";
422
-
423
- foreach ( $terms as $term ) {
424
-
425
- // Get count based on current view - uses transients
426
- $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
427
-
428
- //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
429
-
430
- $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
431
-
432
- set_transient( $transient_name, $_products_in_term );
433
- //}
434
-
435
- $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
436
-
437
- // If this is an AND query, only show options with count > 0
438
- if ( $query_type == 'and' ) {
439
-
440
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
441
-
442
- // skip the term for the current archive
443
- if ( $current_term == $term->term_id ) {
444
- continue;
445
- }
446
-
447
- if ( $count > 0 && $current_term !== $term->term_id ) {
448
- $found = true;
449
- }
450
-
451
- if ( $count == 0 && ! $option_is_set ) {
452
- continue;
453
- }
454
-
455
- // If this is an OR query, show all options so search can be expanded
456
- }
457
- else {
458
-
459
- // skip the term for the current archive
460
- if ( $current_term == $term->term_id ) {
461
- continue;
462
- }
463
-
464
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
465
-
466
- if ( $count > 0 ) {
467
- $found = true;
468
- }
469
-
470
- }
471
-
472
- $arg = 'filter_' . sanitize_title( $instance['attribute'] );
473
-
474
- $current_filter = ( isset( $_GET[$arg] ) ) ? explode( ',', $_GET[$arg] ) : array();
475
-
476
- if ( ! is_array( $current_filter ) ) {
477
- $current_filter = array();
478
- }
479
-
480
- $current_filter = array_map( 'esc_attr', $current_filter );
481
-
482
- if ( ! in_array( $term->term_id, $current_filter ) ) {
483
- $current_filter[] = $term->term_id;
484
- }
485
-
486
- $link = yit_get_woocommerce_layered_nav_link();
487
-
488
- // All current filters
489
- if ( $_chosen_attributes ) {
490
- foreach ( $_chosen_attributes as $name => $data ) {
491
- if ( $name !== $taxonomy ) {
492
-
493
- // Exclude query arg for current term archive term
494
- while ( in_array( $current_term, $data['terms'] ) ) {
495
- $key = array_search( $current_term, $data );
496
- unset( $data['terms'][$key] );
497
- }
498
-
499
- // Remove pa_ and sanitize
500
- $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
501
-
502
- if ( ! empty( $data['terms'] ) ) {
503
- $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
504
- }
505
-
506
- if ( $data['query_type'] == 'or' ) {
507
- $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
508
- }
509
- }
510
- }
511
- }
512
-
513
- // Min/Max
514
- if ( isset( $_GET['min_price'] ) ) {
515
- $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
516
- }
517
-
518
- if ( isset( $_GET['max_price'] ) ) {
519
- $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
520
- }
521
-
522
- if ( isset( $_GET['product_tag'] ) ) {
523
- $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
524
- }
525
-
526
- // Current Filter = this widget
527
- if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) {
528
-
529
- $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
530
-
531
- // Remove this term is $current_filter has more than 1 term filtered
532
- if ( sizeof( $current_filter ) > 1 ) {
533
- $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
534
- $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
535
- }
536
- }
537
- else {
538
- $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
539
- $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
540
- }
541
-
542
- // Search Arg
543
- if ( get_search_query() ) {
544
- $link = add_query_arg( 's', get_search_query(), $link );
545
- }
546
-
547
- // Post Type Arg
548
- if ( isset( $_GET['post_type'] ) ) {
549
- $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
550
- }
551
-
552
- // Query type Arg
553
- if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
554
- $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
555
- }
556
-
557
- $term_id = yit_wcan_localize_terms( $term->term_id, $taxonomy );
558
-
559
- if ( ! empty( $instance['colors'][$term_id] ) ) {
560
- $li_style = apply_filters( "{$args['widget_id']}-li_style", 'background-color:' . $instance['colors'][$term_id] . ';', $instance );
561
-
562
- echo '<li ' . $class . '>';
563
-
564
- echo ( $count > 0 || $option_is_set ) ? '<a style="' . $li_style . '" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '" title="' . $term->name . '" >' : '<span style="background-color:' . $instance['colors'][$term_id] . ';" >';
565
-
566
- echo $term->name;
567
-
568
- echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
569
- }
570
- }
571
-
572
- echo "</ul>";
573
-
574
- }
575
- elseif ( $display_type == 'label' ) {
576
- // List display
577
- echo "<ul class='yith-wcan-label yith-wcan yith-wcan-group'>";
578
-
579
- foreach ( $terms as $term ) {
580
-
581
- // Get count based on current view - uses transients
582
- $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
583
-
584
- //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
585
-
586
- $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
587
-
588
- set_transient( $transient_name, $_products_in_term );
589
- //}
590
-
591
- $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
592
-
593
- // If this is an AND query, only show options with count > 0
594
- if ( $query_type == 'and' ) {
595
-
596
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
597
-
598
- // skip the term for the current archive
599
- if ( $current_term == $term->term_id ) {
600
- continue;
601
- }
602
-
603
- if ( $count > 0 && $current_term !== $term->term_id ) {
604
- $found = true;
605
- }
606
-
607
- if ( $count == 0 && ! $option_is_set ) {
608
- continue;
609
- }
610
-
611
- // If this is an OR query, show all options so search can be expanded
612
- }
613
- else {
614
-
615
- // skip the term for the current archive
616
- if ( $current_term == $term->term_id ) {
617
- continue;
618
- }
619
-
620
- $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
621
-
622
- if ( $count > 0 ) {
623
- $found = true;
624
- }
625
-
626
- }
627
-
628
- $arg = 'filter_' . sanitize_title( $instance['attribute'] );
629
-
630
- $current_filter = ( isset( $_GET[$arg] ) ) ? explode( ',', $_GET[$arg] ) : array();
631
-
632
- if ( ! is_array( $current_filter ) ) {
633
- $current_filter = array();
634
- }
635
-
636
- $current_filter = array_map( 'esc_attr', $current_filter );
637
-
638
- if ( ! in_array( $term->term_id, $current_filter ) ) {
639
- $current_filter[] = $term->term_id;
640
- }
641
-
642
- $link = yit_get_woocommerce_layered_nav_link();
643
-
644
- // All current filters
645
- if ( $_chosen_attributes ) {
646
- foreach ( $_chosen_attributes as $name => $data ) {
647
- if ( $name !== $taxonomy ) {
648
-
649
- // Exclude query arg for current term archive term
650
- while ( in_array( $current_term, $data['terms'] ) ) {
651
- $key = array_search( $current_term, $data );
652
- unset( $data['terms'][$key] );
653
- }
654
-
655
- // Remove pa_ and sanitize
656
- $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
657
-
658
- if ( ! empty( $data['terms'] ) ) {
659
- $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
660
- }
661
-
662
- if ( $data['query_type'] == 'or' ) {
663
- $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
664
- }
665
- }
666
- }
667
- }
668
-
669
- // Min/Max
670
- if ( isset( $_GET['min_price'] ) ) {
671
- $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
672
- }
673
-
674
- if ( isset( $_GET['max_price'] ) ) {
675
- $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
676
- }
677
-
678
- if ( isset( $_GET['product_tag'] ) ) {
679
- $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
680
- }
681
-
682
- // Current Filter = this widget
683
- if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) {
684
-
685
- $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
686
-
687
- // Remove this term is $current_filter has more than 1 term filtered
688
- if ( sizeof( $current_filter ) > 1 ) {
689
- $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
690
- $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
691
- }
692
-
693
- }
694
- else {
695
-
696
- $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
697
- $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
698
-
699
- }
700
-
701
- // Search Arg
702
- if ( get_search_query() ) {
703
- $link = add_query_arg( 's', get_search_query(), $link );
704
- }
705
-
706
- // Post Type Arg
707
- if ( isset( $_GET['post_type'] ) ) {
708
- $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
709
- }
710
-
711
- // Query type Arg
712
- if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
713
- $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
714
- }
715
-
716
- $term_id = yit_wcan_localize_terms( $term->term_id, $taxonomy );
717
-
718
- if ( ! empty( $instance['labels'][$term_id] ) ) {
719
-
720
- echo '<li ' . $class . '>';
721
-
722
- echo ( $count > 0 || $option_is_set ) ? '<a title="' . $term->name . '" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
723
-
724
- echo $instance['labels'][$term_id];
725
-
726
- echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
727
- }
728
- }
729
- echo "</ul>";
730
-
731
- }
732
- else {
733
- do_action( "yith_wcan_widget_display_{$display_type}", $args, $instance, $display_type, $terms, $taxonomy );
734
- }
735
- // End display type conditional
736
-
737
- echo $after_widget;
738
-
739
- if ( ! apply_filters( 'yith_wcan_found_taxonomy', $found ) ) {
740
- ob_end_clean();
741
- echo substr( $before_widget, 0, strlen( $before_widget ) - 1 ) . ' style="display:none">' . $after_widget;
742
- }
743
- else {
744
- echo ob_get_clean();
745
- }
746
- }
747
- }
748
-
749
- function form( $instance ) {
750
- global $woocommerce;
751
-
752
- $defaults = array(
753
- 'title' => '',
754
- 'attribute' => '',
755
- 'query_type' => 'and',
756
- 'type' => 'list',
757
- 'colors' => '',
758
- 'multicolor' => array(),
759
- 'labels' => '',
760
- 'display' => 'all'
761
- );
762
-
763
- $instance = wp_parse_args( (array) $instance, $defaults );
764
-
765
- $widget_types = apply_filters( 'yith_wcan_widget_types', array(
766
- 'list' => __( 'List', 'yith-woocommerce-ajax-navigation' ),
767
- 'color' => __( 'Color', 'yith-woocommerce-ajax-navigation' ),
768
- 'label' => __( 'Label', 'yith-woocommerce-ajax-navigation' ),
769
- 'select' => __( 'Dropdown', 'yith-woocommerce-ajax-navigation' )
770
- )
771
- );
772
- ?>
773
-
774
- <p>
775
- <label>
776
- <strong><?php _e( 'Title', 'yith-woocommerce-ajax-navigation' ) ?>:</strong><br />
777
- <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
778
- </label>
779
- </p>
780
-
781
- <p>
782
- <label for="<?php echo $this->get_field_id( 'type' ); ?>"><strong><?php _e( 'Type:', 'yith-woocommerce-ajax-navigation' ) ?></strong></label>
783
- <select class="yith_wcan_type widefat" id="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'type' ) ); ?>">
784
- <?php foreach ( $widget_types as $type => $label ) : ?>
785
- <option value="<?php echo $type ?>" <?php selected( $type, $instance['type'] ) ?>><?php echo $label ?></option>
786
- <?php endforeach; ?>
787
- </select>
788
- </p>
789
-
790
- <?php do_action( 'yith_wcan_after_widget_type' ); ?>
791
-
792
- <p>
793
- <label for="<?php echo $this->get_field_id( 'query_type' ); ?>"><?php _e( 'Query Type:', 'yith-woocommerce-ajax-navigation' ) ?></label>
794
- <select id="<?php echo esc_attr( $this->get_field_id( 'query_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'query_type' ) ); ?>">
795
- <option value="and" <?php selected( $instance['query_type'], 'and' ); ?>><?php _e( 'AND', 'yith-woocommerce-ajax-navigation' ); ?></option>
796
- <option value="or" <?php selected( $instance['query_type'], 'or' ); ?>><?php _e( 'OR', 'yith-woocommerce-ajax-navigation' ); ?></option>
797
- </select>
798
- </p>
799
-
800
- <p class="yith-wcan-attribute-list" style="display: <?php echo $instance['type'] == 'tags' || $instance['type'] == 'brands' || $instance['type'] == 'categories' ? 'none' : 'block' ?>;">
801
- <label for="<?php echo $this->get_field_id( 'attribute' ); ?>"><strong><?php _e( 'Attribute:', 'yith-woocommerce-ajax-navigation' ) ?></strong></label>
802
- <select class="yith_wcan_attributes widefat" id="<?php echo esc_attr( $this->get_field_id( 'attribute' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'attribute' ) ); ?>">
803
- <?php yith_wcan_dropdown_attributes( $instance['attribute'] ); ?>
804
- </select>
805
- </p>
806
-
807
- <p id="yit-wcan-display" class="yit-wcan-display-<?php echo $instance['type'] ?>">
808
- <label for="<?php echo $this->get_field_id( 'display' ); ?>"><strong><?php _e( 'Display (default All):', 'yith-woocommerce-ajax-navigation' ) ?></strong></label>
809
- <select class="yith_wcan_type widefat" id="<?php echo esc_attr( $this->get_field_id( 'display' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'display' ) ); ?>">
810
- <option value="all" <?php selected( 'all', $instance['display'] ) ?>> <?php _e( 'All (no hierarchical)', 'yith-woocommerce-ajax-navigation' ) ?></option>
811
- <option value="hierarchical" <?php selected( 'hierarchical', $instance['display'] ) ?>> <?php _e( 'All (hierarchical)', 'yith-woocommerce-ajax-navigation' ) ?> </option>
812
- <option value="parent" <?php selected( 'parent', $instance['display'] ) ?>> <?php _e( 'Only Parent', 'yith-woocommerce-ajax-navigation' ) ?> </option>
813
- </select>
814
- </p>
815
-
816
- <div class="yith_wcan_placeholder">
817
- <?php
818
- $values = array();
819
-
820
- if ( $instance['type'] == 'color' ) {
821
- $values = $instance['colors'];
822
- }
823
-
824
- if ( $instance['type'] == 'multicolor' ) {
825
- $values = $instance['multicolor'];
826
- }
827
-
828
- elseif ( $instance['type'] == 'label' ) {
829
- $values = $instance['labels'];
830
- }
831
-
832
- yith_wcan_attributes_table(
833
- $instance['type'],
834
- $instance['attribute'],
835
- 'widget-' . $this->id . '-',
836
- 'widget-' . $this->id_base . '[' . $this->number . ']',
837
- $values,
838
- $instance['display']
839
- );
840
- ?>
841
- </div>
842
- <span class="spinner" style="display: none;"></span>
843
-
844
- <input type="hidden" name="widget_id" value="widget-<?php echo $this->id ?>-" />
845
- <input type="hidden" name="widget_name" value="widget-<?php echo $this->id_base ?>[<?php echo $this->number ?>]" />
846
-
847
- <script>jQuery(document).trigger('yith_colorpicker');</script>
848
- <?php
849
- }
850
-
851
- function update( $new_instance, $old_instance ) {
852
- global $woocommerce;
853
-
854
- $instance = $old_instance;
855
- $instance['title'] = strip_tags( $new_instance['title'] );
856
- $instance['attribute'] = stripslashes( $new_instance['attribute'] );
857
- $instance['query_type'] = stripslashes( $new_instance['query_type'] );
858
- $instance['type'] = stripslashes( $new_instance['type'] );
859
- $instance['colors'] = ! empty( $new_instance['colors'] ) ? $new_instance['colors'] : array();
860
- $instance['multicolor'] = ! empty( $new_instance['multicolor'] ) ? $new_instance['multicolor'] : array();
861
- $instance['labels'] = ! empty( $new_instance['labels'] ) ? $new_instance['labels'] : array();
862
- $instance['display'] = $new_instance['display'];
863
-
864
- return $instance;
865
- }
866
-
867
- /**
868
- * Print terms for the element selected
869
- *
870
- * @access public
871
- * @return void
872
- * @since 1.0.0
873
- */
874
- public function ajax_print_terms() {
875
- $type = $_POST['value'];
876
- $attribute = $_POST['attribute'];
877
- $return = array( 'message' => '', 'content' => $_POST );
878
-
879
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
880
-
881
- $settings = $this->get_settings();
882
- $widget_settings = $settings[ $this->number ];
883
- $value = '';
884
-
885
- if( 'label' == $type ){
886
- $value = $widget_settings['labels'];
887
- }
888
-
889
- elseif( 'color' == $type ){
890
- $value = $widget_settings['colors'];
891
- }
892
-
893
- elseif( 'multicolor' == $type ) {
894
- $value = $widget_settings['multicolor'];
895
- }
896
-
897
- if ( $type ) {
898
- $return['content'] = yith_wcan_attributes_table(
899
- $type,
900
- $attribute,
901
- $_POST['id'],
902
- $_POST['name'],
903
- $value,
904
- false
905
- );
906
- }
907
-
908
-
909
- echo json_encode( $return );
910
- die();
911
- }
912
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
  }
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
15
+ /**
16
+ * YITH WooCommerce Ajax Navigation Widget
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCAN_Navigation_Widget extends WP_Widget {
21
+
22
+ public $brand_taxonomy = '';
23
+
24
+ function __construct() {
25
+ $widget_ops = array( 'classname' => 'yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Filter the product list without reloading the page', 'yith-woocommerce-ajax-navigation' ) );
26
+ $control_ops = array( 'width' => 400, 'height' => 350 );
27
+ add_action('wp_ajax_yith_wcan_select_type', array( $this, 'ajax_print_terms') );
28
+ parent::__construct( 'yith-woo-ajax-navigation', _x( 'YITH WooCommerce Ajax Product Filter', 'Admin: Widget Title', 'yith-woocommerce-ajax-navigation' ), $widget_ops, $control_ops );
29
+ }
30
+
31
+
32
+ function widget( $args, $instance ) {
33
+ global $_chosen_attributes, $woocommerce;
34
+
35
+ extract( $args );
36
+ $_attributes_array = yit_wcan_get_product_taxonomy();
37
+
38
+ if( apply_filters( 'yith_wcan_is_search', is_search() ) ){
39
+ return;
40
+ }
41
+
42
+ if ( apply_filters( 'yith_wcan_show_widget', ! is_post_type_archive( 'product' ) && ! is_tax( $_attributes_array ) ) ) {
43
+ return;
44
+ }
45
+
46
+ if( defined( 'YITH_WCBR_PREMIUM_INIT' ) && YITH_WCBR_PREMIUM_INIT ) {
47
+ $this->brand_taxonomy = YITH_WCBR::$brands_taxonomy;
48
+ }
49
+
50
+ $current_term = $_attributes_array && is_tax( $_attributes_array ) ? get_queried_object()->term_id : '';
51
+ $current_tax = $_attributes_array && is_tax( $_attributes_array ) ? get_queried_object()->taxonomy : '';
52
+ $title = apply_filters( 'yith_widget_title_ajax_navigation', ( isset( $instance['title'] ) ? $instance['title'] : '' ), $instance, $this->id_base );
53
+ $query_type = isset( $instance['query_type'] ) ? $instance['query_type'] : 'and';
54
+ $display_type = isset( $instance['type'] ) ? $instance['type'] : 'list';
55
+ $is_child_class = 'yit-wcan-child-terms';
56
+ $is_chosen_class = 'chosen';
57
+ $terms_type_list = ( isset( $instance['display'] ) && ( $display_type == 'list' || $display_type == 'select' ) ) ? $instance['display'] : 'all';
58
+
59
+ $instance['attribute'] = empty( $instance['attribute'] ) ? '' : $instance['attribute'];
60
+
61
+ /* FIX TO WOOCOMMERCE 2.1 */
62
+ if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
63
+ $taxonomy = wc_attribute_taxonomy_name( $instance['attribute'] );
64
+ }
65
+ else {
66
+ $taxonomy = $woocommerce->attribute_taxonomy_name( $instance['attribute'] );
67
+ }
68
+
69
+ if ( ! taxonomy_exists( $taxonomy ) ) {
70
+ return;
71
+ }
72
+
73
+ $taxonomy = apply_filters( 'yith_wcan_get_terms_params', $taxonomy, $instance, 'taxonomy_name' );
74
+ $terms_type_list = apply_filters( 'yith_wcan_get_terms_params', $terms_type_list, $instance, 'terms_type' );
75
+
76
+ $terms = yit_get_terms( $terms_type_list, $taxonomy, $instance );
77
+
78
+ if ( count( $terms ) > 0 ) {
79
+
80
+ ob_start();
81
+
82
+ $found = false;
83
+
84
+ echo $before_widget;
85
+
86
+ $title = html_entity_decode( apply_filters( 'widget_title', $title ) );
87
+
88
+ if ( ! empty( $title ) ) {
89
+ echo $before_title . $title . $after_title;
90
+ }
91
+
92
+ // Force found when option is selected - do not force found on taxonomy attributes
93
+ if ( ! $_attributes_array || ! is_tax( $_attributes_array ) ) {
94
+ if ( is_array( $_chosen_attributes ) && array_key_exists( $taxonomy, $_chosen_attributes ) ) {
95
+ $found = true;
96
+ }
97
+ }
98
+
99
+ if ( in_array( $display_type, apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
100
+ // List display
101
+ echo "<ul class='yith-wcan-list yith-wcan'>";
102
+
103
+ foreach ( $terms as $term ) {
104
+
105
+ // Get count based on current view - uses transients
106
+ $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
107
+
108
+ //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
109
+
110
+ $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
111
+
112
+ set_transient( $transient_name, $_products_in_term );
113
+ //}
114
+
115
+ $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
116
+
117
+ $term_param = apply_filters( 'yith_wcan_term_param_uri', $term->term_id, $display_type, $term );
118
+
119
+ // If this is an AND query, only show options with count > 0
120
+ if ( $query_type == 'and' ) {
121
+
122
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
123
+
124
+ // skip the term for the current archive
125
+ if ( $current_term == $term_param ) {
126
+ continue;
127
+ }
128
+
129
+ if ( $count > 0 && $current_term !== $term_param ) {
130
+ $found = true;
131
+ }
132
+
133
+ if ( ( ( $terms_type_list == 'hierarchical' || ( $terms_type_list == 'tags' && $instance['display'] == 'hierarchical' ) ) || ! yit_term_has_child( $term, $taxonomy ) ) && $count == 0 && ! $option_is_set ) {
134
+ continue;
135
+ }
136
+
137
+ // If this is an OR query, show all options so search can be expanded
138
+ }
139
+ else {
140
+
141
+ // skip the term for the current archive
142
+ if ( $current_term == $term_param ) {
143
+ continue;
144
+ }
145
+
146
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
147
+
148
+ if ( $count > 0 ) {
149
+ $found = true;
150
+ }
151
+
152
+ }
153
+
154
+ $arg = apply_filters( 'yith_wcan_list_type_query_arg', 'filter_' . sanitize_title( $instance['attribute'] ), $display_type, $term );
155
+
156
+ $current_filter = ( isset( $_GET[$arg] ) ) ? explode(apply_filters( 'yith_wcan_list_filter_operator', ',', $display_type ), apply_filters( "yith_wcan_list_filter_query_{$arg}", $_GET[$arg] ) ) : array();
157
+
158
+ if ( ! is_array( $current_filter ) ) {
159
+ $current_filter = array();
160
+ }
161
+
162
+ $current_filter = array_map( 'esc_attr', $current_filter );
163
+
164
+ if ( ! in_array( $term_param, $current_filter ) ) {
165
+ $current_filter[] = $term_param;
166
+ }
167
+
168
+ $link = yit_get_woocommerce_layered_nav_link();
169
+
170
+ // All current filters
171
+ if ( $_chosen_attributes ) {
172
+ foreach ( $_chosen_attributes as $name => $data ) {
173
+ if ( $name !== $taxonomy ) {
174
+
175
+ // Exclude query arg for current term archive term
176
+ while ( in_array( $current_term, $data['terms'] ) ) {
177
+ $key = array_search( $current_term, $data );
178
+ unset( $data['terms'][$key] );
179
+ }
180
+
181
+ // Remove pa_ and sanitize
182
+ $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
183
+
184
+ if ( ! empty( $data['terms'] ) ) {
185
+ $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
186
+ }
187
+
188
+ if ( $data['query_type'] == 'or' ) {
189
+ $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
190
+ }
191
+ }
192
+ }
193
+ }
194
+
195
+ // Min/Max
196
+ if ( isset( $_GET['min_price'] ) ) {
197
+ $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
198
+ }
199
+
200
+ if ( isset( $_GET['max_price'] ) ) {
201
+ $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
202
+ }
203
+
204
+ if ( isset( $_GET['product_tag'] ) && $display_type != 'tags' ) {
205
+ $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
206
+ }
207
+
208
+ if ( isset( $_GET[ $this->brand_taxonomy ] ) ) {
209
+ $brands = get_term_by( 'name', $_GET[ $this->brand_taxonomy ], $this->brand_taxonomy );
210
+ if( $brands->term_id != $term->term_id ){
211
+ $link = add_query_arg( $this->brand_taxonomy, urlencode( $brands->name ), $link );
212
+ }
213
+ }
214
+
215
+ $check_for_current_widget = isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] );
216
+
217
+ // Current Filter = this widget
218
+ if ( apply_filters( 'yith_wcan_list_type_current_widget_check', $check_for_current_widget, $current_filter, $display_type, $term_param ) ) {
219
+ $class = ( ( $terms_type_list == 'hierarchical' || ( $terms_type_list == 'tags' && $instance['display'] == 'hierarchical' ) ) && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
220
+
221
+ // Remove this term is $current_filter has more than 1 term filtered
222
+ if ( sizeof( $current_filter ) > 1 ) {
223
+ $current_filter_without_this = array_diff( $current_filter, array( $term_param ) );
224
+ $link = add_query_arg( $arg, implode( apply_filters( 'yith_wcan_list_filter_operator', ',', $display_type ), $current_filter_without_this ), $link );
225
+ }
226
+ }
227
+
228
+ else {
229
+ $class = ( ( $terms_type_list == 'hierarchical' || ( $terms_type_list == 'tags' && $instance['display'] == 'hierarchical' ) ) && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
230
+ $link = add_query_arg( $arg, implode( apply_filters( 'yith_wcan_list_filter_operator', ',', $display_type ), $current_filter ), $link );
231
+ }
232
+
233
+ // Search Arg
234
+ if ( get_search_query() ) {
235
+ $link = add_query_arg( 's', get_search_query(), $link );
236
+ }
237
+
238
+ // Post Type Arg
239
+ if ( isset( $_GET['post_type'] ) ) {
240
+ $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
241
+ }
242
+
243
+ $is_attribute = apply_filters( 'yith_wcan_is_attribute_check', true );
244
+
245
+ // Query type Arg
246
+ if ( $is_attribute && $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
247
+ $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
248
+ }
249
+
250
+
251
+ echo '<li ' . $class . '>';
252
+
253
+ echo ( $count > 0 || $option_is_set ) ? '<a href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
254
+
255
+ echo $term->name;
256
+
257
+ echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
258
+
259
+ if ( $count != 0 && apply_filters( "{$args['widget_id']}-show_product_count", true, $instance ) ) {
260
+ echo ' <small class="count">' . $count . '</small><div class="clear"></div></li>';
261
+ }
262
+ }
263
+
264
+ echo "</ul>";
265
+ }
266
+ elseif ( $display_type == 'select' ) {
267
+ $dropdown_label = __( 'Filters:', 'yith-woocommerce-ajax-navigation' );
268
+ ?>
269
+
270
+ <a class="yit-wcan-select-open" href="#"><?php echo apply_filters( 'yith_wcan_dropdown_default_label', $dropdown_label ) ?></a>
271
+
272
+ <?php
273
+ // Select display
274
+ echo "<div class='yith-wcan-select-wrapper'>";
275
+
276
+ echo "<ul class='yith-wcan-select yith-wcan'>";
277
+
278
+ foreach ( $terms as $term ) {
279
+
280
+ // Get count based on current view - uses transients
281
+ $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
282
+
283
+ //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
284
+
285
+ $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
286
+
287
+ set_transient( $transient_name, $_products_in_term );
288
+ //}
289
+
290
+ $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
291
+
292
+ // If this is an AND query, only show options with count > 0
293
+ if ( $query_type == 'and' ) {
294
+
295
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
296
+
297
+ // skip the term for the current archive
298
+ if ( $current_term == $term->term_id ) {
299
+ continue;
300
+ }
301
+
302
+ if ( $count > 0 && $current_term !== $term->term_id ) {
303
+ $found = true;
304
+ }
305
+
306
+ if ( ( $terms_type_list != 'hierarchical' || ! yit_term_has_child( $term, $taxonomy ) ) && $count == 0 && ! $option_is_set ) {
307
+ continue;
308
+ }
309
+
310
+ // If this is an OR query, show all options so search can be expanded
311
+ }
312
+ else {
313
+
314
+ // skip the term for the current archive
315
+ if ( $current_term == $term->term_id ) {
316
+ continue;
317
+ }
318
+
319
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
320
+
321
+ if ( $count > 0 ) {
322
+ $found = true;
323
+ }
324
+
325
+ }
326
+
327
+ $arg = 'filter_' . urldecode( sanitize_title( $instance['attribute'] ) );
328
+
329
+ $current_filter = ( isset( $_GET[$arg] ) ) ? explode( ',', $_GET[$arg] ) : array();
330
+
331
+ if ( ! is_array( $current_filter ) ) {
332
+ $current_filter = array();
333
+ }
334
+
335
+ $current_filter = array_map( 'esc_attr', $current_filter );
336
+
337
+ if ( ! in_array( $term->term_id, $current_filter ) ) {
338
+ $current_filter[] = $term->term_id;
339
+ }
340
+
341
+ $link = yit_get_woocommerce_layered_nav_link();
342
+
343
+ // All current filters
344
+ if ( $_chosen_attributes ) {
345
+ foreach ( $_chosen_attributes as $name => $data ) {
346
+ if ( $name !== $taxonomy ) {
347
+
348
+ // Exclude query arg for current term archive term
349
+ while ( in_array( $current_term, $data['terms'] ) ) {
350
+ $key = array_search( $current_term, $data );
351
+ unset( $data['terms'][$key] );
352
+ }
353
+
354
+ // Remove pa_ and sanitize
355
+ $filter_name = urldecode( sanitize_title( str_replace( 'pa_', '', $name ) ) );
356
+
357
+ if ( ! empty( $data['terms'] ) ) {
358
+ $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
359
+ }
360
+
361
+ if ( $data['query_type'] == 'or' ) {
362
+ $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
363
+ }
364
+ }
365
+ }
366
+ }
367
+
368
+ // Min/Max
369
+ if ( isset( $_GET['min_price'] ) ) {
370
+ $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
371
+ }
372
+
373
+ if ( isset( $_GET['max_price'] ) ) {
374
+ $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
375
+ }
376
+
377
+ if ( isset( $_GET['product_tag'] ) ) {
378
+ $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
379
+ }
380
+
381
+ if ( isset( $_GET[ $this->brand_taxonomy ] ) ) {
382
+ $brands = get_term_by( 'name', $_GET[ $this->brand_taxonomy ], $this->brand_taxonomy );
383
+ if( $brands->term_id != $term->term_id ){
384
+ $link = add_query_arg( $this->brand_taxonomy, urlencode( $brands->name ), $link );
385
+ }
386
+ }
387
+
388
+ // Current Filter = this widget
389
+ if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) {
390
+
391
+ $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
392
+
393
+ // Remove this term is $current_filter has more than 1 term filtered
394
+ if ( sizeof( $current_filter ) > 1 ) {
395
+ $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
396
+ $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
397
+ }
398
+
399
+ }
400
+ else {
401
+
402
+ $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
403
+ $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
404
+
405
+ }
406
+
407
+ // Search Arg
408
+ if ( get_search_query() ) {
409
+ $link = add_query_arg( 's', get_search_query(), $link );
410
+ }
411
+
412
+ // Post Type Arg
413
+ if ( isset( $_GET['post_type'] ) ) {
414
+ $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
415
+ }
416
+
417
+ // Query type Arg
418
+ if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
419
+ $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
420
+ }
421
+
422
+ echo '<li ' . $class . '>';
423
+
424
+ echo ( $count > 0 || $option_is_set ) ? '<a data-type="select" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
425
+
426
+ echo $term->name;
427
+
428
+ echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
429
+
430
+ echo '</li>';
431
+
432
+ }
433
+
434
+ echo "</ul>";
435
+
436
+ echo "</div>";
437
+
438
+ }
439
+ elseif ( $display_type == 'color' ) {
440
+ // List display
441
+ echo "<ul class='yith-wcan-color yith-wcan yith-wcan-group'>";
442
+
443
+ foreach ( $terms as $term ) {
444
+
445
+ // Get count based on current view - uses transients
446
+ $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
447
+
448
+ //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
449
+
450
+ $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
451
+
452
+ set_transient( $transient_name, $_products_in_term );
453
+ //}
454
+
455
+ $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
456
+
457
+ // If this is an AND query, only show options with count > 0
458
+ if ( $query_type == 'and' ) {
459
+
460
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
461
+
462
+ // skip the term for the current archive
463
+ if ( $current_term == $term->term_id ) {
464
+ continue;
465
+ }
466
+
467
+ if ( $count > 0 && $current_term !== $term->term_id ) {
468
+ $found = true;
469
+ }
470
+
471
+ if ( $count == 0 && ! $option_is_set ) {
472
+ continue;
473
+ }
474
+
475
+ // If this is an OR query, show all options so search can be expanded
476
+ }
477
+ else {
478
+
479
+ // skip the term for the current archive
480
+ if ( $current_term == $term->term_id ) {
481
+ continue;
482
+ }
483
+
484
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
485
+
486
+ if ( $count > 0 ) {
487
+ $found = true;
488
+ }
489
+
490
+ }
491
+
492
+ $arg = 'filter_' . sanitize_title( $instance['attribute'] );
493
+
494
+ $current_filter = ( isset( $_GET[$arg] ) ) ? explode( ',', $_GET[$arg] ) : array();
495
+
496
+ if ( ! is_array( $current_filter ) ) {
497
+ $current_filter = array();
498
+ }
499
+
500
+ $current_filter = array_map( 'esc_attr', $current_filter );
501
+
502
+ if ( ! in_array( $term->term_id, $current_filter ) ) {
503
+ $current_filter[] = $term->term_id;
504
+ }
505
+
506
+ $link = yit_get_woocommerce_layered_nav_link();
507
+
508
+ // All current filters
509
+ if ( $_chosen_attributes ) {
510
+ foreach ( $_chosen_attributes as $name => $data ) {
511
+ if ( $name !== $taxonomy ) {
512
+
513
+ // Exclude query arg for current term archive term
514
+ while ( in_array( $current_term, $data['terms'] ) ) {
515
+ $key = array_search( $current_term, $data );
516
+ unset( $data['terms'][$key] );
517
+ }
518
+
519
+ // Remove pa_ and sanitize
520
+ $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
521
+
522
+ if ( ! empty( $data['terms'] ) ) {
523
+ $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
524
+ }
525
+
526
+ if ( $data['query_type'] == 'or' ) {
527
+ $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
528
+ }
529
+ }
530
+ }
531
+ }
532
+
533
+ // Min/Max
534
+ if ( isset( $_GET['min_price'] ) ) {
535
+ $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
536
+ }
537
+
538
+ if ( isset( $_GET['max_price'] ) ) {
539
+ $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
540
+ }
541
+
542
+ if ( isset( $_GET['product_tag'] ) ) {
543
+ $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
544
+ }
545
+
546
+ if ( isset( $_GET[ $this->brand_taxonomy ] ) ) {
547
+ $brands = get_term_by( 'name', $_GET[ $this->brand_taxonomy ], $this->brand_taxonomy );
548
+ if( $brands->term_id != $term->term_id ){
549
+ $link = add_query_arg( $this->brand_taxonomy, urlencode( $brands->name ), $link );
550
+ }
551
+ }
552
+
553
+ // Current Filter = this widget
554
+ if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) {
555
+
556
+ $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
557
+
558
+ // Remove this term is $current_filter has more than 1 term filtered
559
+ if ( sizeof( $current_filter ) > 1 ) {
560
+ $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
561
+ $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
562
+ }
563
+ }
564
+ else {
565
+ $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
566
+ $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
567
+ }
568
+
569
+ // Search Arg
570
+ if ( get_search_query() ) {
571
+ $link = add_query_arg( 's', get_search_query(), $link );
572
+ }
573
+
574
+ // Post Type Arg
575
+ if ( isset( $_GET['post_type'] ) ) {
576
+ $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
577
+ }
578
+
579
+ // Query type Arg
580
+ if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
581
+ $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
582
+ }
583
+
584
+ $term_id = yit_wcan_localize_terms( $term->term_id, $taxonomy );
585
+
586
+ if ( ! empty( $instance['colors'][$term_id] ) ) {
587
+ $li_style = apply_filters( "{$args['widget_id']}-li_style", 'background-color:' . $instance['colors'][$term_id] . ';', $instance );
588
+
589
+ echo '<li ' . $class . '>';
590
+
591
+ echo ( $count > 0 || $option_is_set ) ? '<a style="' . $li_style . '" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '" title="' . $term->name . '" >' : '<span style="background-color:' . $instance['colors'][$term_id] . ';" >';
592
+
593
+ echo $term->name;
594
+
595
+ echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
596
+ }
597
+ }
598
+
599
+ echo "</ul>";
600
+
601
+ }
602
+ elseif ( $display_type == 'label' ) {
603
+ // List display
604
+ echo "<ul class='yith-wcan-label yith-wcan yith-wcan-group'>";
605
+
606
+ foreach ( $terms as $term ) {
607
+
608
+ // Get count based on current view - uses transients
609
+ $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
610
+
611
+ //if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
612
+
613
+ $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
614
+
615
+ set_transient( $transient_name, $_products_in_term );
616
+ //}
617
+
618
+ $option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) );
619
+
620
+ // If this is an AND query, only show options with count > 0
621
+ if ( $query_type == 'and' ) {
622
+
623
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
624
+
625
+ // skip the term for the current archive
626
+ if ( $current_term == $term->term_id ) {
627
+ continue;
628
+ }
629
+
630
+ if ( $count > 0 && $current_term !== $term->term_id ) {
631
+ $found = true;
632
+ }
633
+
634
+ if ( $count == 0 && ! $option_is_set ) {
635
+ continue;
636
+ }
637
+
638
+ // If this is an OR query, show all options so search can be expanded
639
+ }
640
+ else {
641
+
642
+ // skip the term for the current archive
643
+ if ( $current_term == $term->term_id ) {
644
+ continue;
645
+ }
646
+
647
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
648
+
649
+ if ( $count > 0 ) {
650
+ $found = true;
651
+ }
652
+
653
+ }
654
+
655
+ $arg = 'filter_' . sanitize_title( $instance['attribute'] );
656
+
657
+ $current_filter = ( isset( $_GET[$arg] ) ) ? explode( ',', $_GET[$arg] ) : array();
658
+
659
+ if ( ! is_array( $current_filter ) ) {
660
+ $current_filter = array();
661
+ }
662
+
663
+ $current_filter = array_map( 'esc_attr', $current_filter );
664
+
665
+ if ( ! in_array( $term->term_id, $current_filter ) ) {
666
+ $current_filter[] = $term->term_id;
667
+ }
668
+
669
+ $link = yit_get_woocommerce_layered_nav_link();
670
+
671
+ // All current filters
672
+ if ( $_chosen_attributes ) {
673
+ foreach ( $_chosen_attributes as $name => $data ) {
674
+ if ( $name !== $taxonomy ) {
675
+
676
+ // Exclude query arg for current term archive term
677
+ while ( in_array( $current_term, $data['terms'] ) ) {
678
+ $key = array_search( $current_term, $data );
679
+ unset( $data['terms'][$key] );
680
+ }
681
+
682
+ // Remove pa_ and sanitize
683
+ $filter_name = sanitize_title( str_replace( 'pa_', '', $name ) );
684
+
685
+ if ( ! empty( $data['terms'] ) ) {
686
+ $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
687
+ }
688
+
689
+ if ( $data['query_type'] == 'or' ) {
690
+ $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
691
+ }
692
+ }
693
+ }
694
+ }
695
+
696
+ // Min/Max
697
+ if ( isset( $_GET['min_price'] ) ) {
698
+ $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
699
+ }
700
+
701
+ if ( isset( $_GET['max_price'] ) ) {
702
+ $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
703
+ }
704
+
705
+ if ( isset( $_GET['product_tag'] ) ) {
706
+ $link = add_query_arg( 'product_tag', urlencode( $_GET['product_tag'] ), $link );
707
+ }
708
+
709
+ if ( isset( $_GET[ $this->brand_taxonomy ] ) ) {
710
+ $brands = get_term_by( 'name', $_GET[ $this->brand_taxonomy ], $this->brand_taxonomy );
711
+ if( $brands->term_id != $term->term_id ){
712
+ $link = add_query_arg( $this->brand_taxonomy, urlencode( $brands->name ), $link );
713
+ }
714
+ }
715
+
716
+ // Current Filter = this widget
717
+ if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) {
718
+
719
+ $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
720
+
721
+ // Remove this term is $current_filter has more than 1 term filtered
722
+ if ( sizeof( $current_filter ) > 1 ) {
723
+ $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
724
+ $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
725
+ }
726
+
727
+ }
728
+ else {
729
+
730
+ $class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_child_class}'" : '';
731
+ $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
732
+
733
+ }
734
+
735
+ // Search Arg
736
+ if ( get_search_query() ) {
737
+ $link = add_query_arg( 's', get_search_query(), $link );
738
+ }
739
+
740
+ // Post Type Arg
741
+ if ( isset( $_GET['post_type'] ) ) {
742
+ $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
743
+ }
744
+
745
+ // Query type Arg
746
+ if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
747
+ $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
748
+ }
749
+
750
+ $term_id = yit_wcan_localize_terms( $term->term_id, $taxonomy );
751
+
752
+ if ( ! empty( $instance['labels'][$term_id] ) ) {
753
+
754
+ echo '<li ' . $class . '>';
755
+
756
+ echo ( $count > 0 || $option_is_set ) ? '<a title="' . $term->name . '" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
757
+
758
+ echo $instance['labels'][$term_id];
759
+
760
+ echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
761
+ }
762
+ }
763
+ echo "</ul>";
764
+
765
+ }
766
+ else {
767
+ do_action( "yith_wcan_widget_display_{$display_type}", $args, $instance, $display_type, $terms, $taxonomy );
768
+ }
769
+ // End display type conditional
770
+
771
+ echo $after_widget;
772
+
773
+ if ( ! apply_filters( 'yith_wcan_found_taxonomy', $found ) ) {
774
+ ob_end_clean();
775
+ echo substr( $before_widget, 0, strlen( $before_widget ) - 1 ) . ' style="display:none">' . $after_widget;
776
+ }
777
+ else {
778
+ echo ob_get_clean();
779
+ }
780
+ }
781
+ }
782
+
783
+ function form( $instance ) {
784
+ global $woocommerce;
785
+
786
+ $defaults = array(
787
+ 'title' => '',
788
+ 'attribute' => '',
789
+ 'query_type' => 'and',
790
+ 'type' => 'list',
791
+ 'colors' => '',
792
+ 'multicolor' => array(),
793
+ 'labels' => '',
794
+ 'display' => 'all'
795
+ );
796
+
797
+ $instance = wp_parse_args( (array) $instance, $defaults );
798
+
799
+ $widget_types = apply_filters( 'yith_wcan_widget_types', array(
800
+ 'list' => __( 'List', 'yith-woocommerce-ajax-navigation' ),
801
+ 'color' => __( 'Color', 'yith-woocommerce-ajax-navigation' ),
802
+ 'label' => __( 'Label', 'yith-woocommerce-ajax-navigation' ),
803
+ 'select' => __( 'Dropdown', 'yith-woocommerce-ajax-navigation' )
804
+ )
805
+ );
806
+ ?>
807
+
808
+ <p>
809
+ <label>
810
+ <strong><?php _e( 'Title', 'yith-woocommerce-ajax-navigation' ) ?>:</strong><br />
811
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
812
+ </label>
813
+ </p>
814
+
815
+ <p>
816
+ <label for="<?php echo $this->get_field_id( 'type' ); ?>"><strong><?php _e( 'Type:', 'yith-woocommerce-ajax-navigation' ) ?></strong></label>
817
+ <select class="yith_wcan_type widefat" id="<?php echo esc_attr( $this->get_field_id( 'type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'type' ) ); ?>">
818
+ <?php foreach ( $widget_types as $type => $label ) : ?>
819
+ <option value="<?php echo $type ?>" <?php selected( $type, $instance['type'] ) ?>><?php echo $label ?></option>
820
+ <?php endforeach; ?>
821
+ </select>
822
+ </p>
823
+
824
+ <?php do_action( 'yith_wcan_after_widget_type' ); ?>
825
+
826
+ <p>
827
+ <label for="<?php echo $this->get_field_id( 'query_type' ); ?>"><?php _e( 'Query Type:', 'yith-woocommerce-ajax-navigation' ) ?></label>
828
+ <select id="<?php echo esc_attr( $this->get_field_id( 'query_type' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'query_type' ) ); ?>">
829
+ <option value="and" <?php selected( $instance['query_type'], 'and' ); ?>><?php _e( 'AND', 'yith-woocommerce-ajax-navigation' ); ?></option>
830
+ <option value="or" <?php selected( $instance['query_type'], 'or' ); ?>><?php _e( 'OR', 'yith-woocommerce-ajax-navigation' ); ?></option>
831
+ </select>
832
+ </p>
833
+
834
+ <p class="yith-wcan-attribute-list" style="display: <?php echo $instance['type'] == 'tags' || $instance['type'] == 'brands' || $instance['type'] == 'categories' ? 'none' : 'block' ?>;">
835
+
836
+ <label for="<?php echo $this->get_field_id( 'attribute' ); ?>"><strong><?php _e( 'Attribute:', 'yith-woocommerce-ajax-navigation' ) ?></strong></label>
837
+ <select class="yith_wcan_attributes widefat" id="<?php echo esc_attr( $this->get_field_id( 'attribute' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'attribute' ) ); ?>">
838
+ <?php yith_wcan_dropdown_attributes( $instance['attribute'] ); ?>
839
+ </select>
840
+ </p>
841
+
842
+ <p id="yit-wcan-display" class="yit-wcan-display-<?php echo $instance['type'] ?>">
843
+ <label for="<?php echo $this->get_field_id( 'display' ); ?>"><strong><?php _e( 'Display (default All):', 'yith-woocommerce-ajax-navigation' ) ?></strong></label>
844
+ <select class="yith_wcan_type widefat" id="<?php echo esc_attr( $this->get_field_id( 'display' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'display' ) ); ?>">
845
+ <option value="all" <?php selected( 'all', $instance['display'] ) ?>> <?php _e( 'All (no hierarchical)', 'yith-woocommerce-ajax-navigation' ) ?></option>
846
+ <option value="hierarchical" <?php selected( 'hierarchical', $instance['display'] ) ?>> <?php _e( 'All (hierarchical)', 'yith-woocommerce-ajax-navigation' ) ?> </option>
847
+ <option value="parent" <?php selected( 'parent', $instance['display'] ) ?>> <?php _e( 'Only Parent', 'yith-woocommerce-ajax-navigation' ) ?> </option>
848
+ </select>
849
+ </p>
850
+
851
+ <div class="yith_wcan_placeholder">
852
+ <?php
853
+ $values = array();
854
+
855
+ if ( $instance['type'] == 'color' ) {
856
+ $values = $instance['colors'];
857
+ }
858
+
859
+ if ( $instance['type'] == 'multicolor' ) {
860
+ $values = $instance['multicolor'];
861
+ }
862
+
863
+ elseif ( $instance['type'] == 'label' ) {
864
+ $values = $instance['labels'];
865
+ }
866
+
867
+ yith_wcan_attributes_table(
868
+ $instance['type'],
869
+ $instance['attribute'],
870
+ 'widget-' . $this->id . '-',
871
+ 'widget-' . $this->id_base . '[' . $this->number . ']',
872
+ $values,
873
+ $instance['display']
874
+ );
875
+ ?>
876
+ </div>
877
+ <span class="spinner" style="display: none;"></span>
878
+
879
+ <input type="hidden" name="widget_id" value="widget-<?php echo $this->id ?>-" />
880
+ <input type="hidden" name="widget_name" value="widget-<?php echo $this->id_base ?>[<?php echo $this->number ?>]" />
881
+
882
+ <script>jQuery(document).trigger('yith_colorpicker');</script>
883
+ <?php
884
+ }
885
+
886
+ function update( $new_instance, $old_instance ) {
887
+ global $woocommerce;
888
+
889
+ $instance = $old_instance;
890
+ $instance['title'] = strip_tags( $new_instance['title'] );
891
+ $instance['attribute'] = stripslashes( $new_instance['attribute'] );
892
+ $instance['query_type'] = stripslashes( $new_instance['query_type'] );
893
+ $instance['type'] = stripslashes( $new_instance['type'] );
894
+ $instance['colors'] = ! empty( $new_instance['colors'] ) ? $new_instance['colors'] : array();
895
+ $instance['multicolor'] = ! empty( $new_instance['multicolor'] ) ? $new_instance['multicolor'] : array();
896
+ $instance['labels'] = ! empty( $new_instance['labels'] ) ? $new_instance['labels'] : array();
897
+ $instance['display'] = $new_instance['display'];
898
+
899
+ return $instance;
900
+ }
901
+
902
+ /**
903
+ * Print terms for the element selected
904
+ *
905
+ * @access public
906
+ * @return void
907
+ * @since 1.0.0
908
+ */
909
+ public function ajax_print_terms() {
910
+ $type = $_POST['value'];
911
+ $attribute = $_POST['attribute'];
912
+ $return = array( 'message' => '', 'content' => $_POST );
913
+
914
+ $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
915
+
916
+ $settings = $this->get_settings();
917
+ $widget_settings = $settings[ $this->number ];
918
+ $value = '';
919
+
920
+ if( 'label' == $type ){
921
+ $value = $widget_settings['labels'];
922
+ }
923
+
924
+ elseif( 'color' == $type ){
925
+ $value = $widget_settings['colors'];
926
+ }
927
+
928
+ elseif( 'multicolor' == $type ) {
929
+ $value = $widget_settings['multicolor'];
930
+ }
931
+
932
+ if ( $type ) {
933
+ $return['content'] = yith_wcan_attributes_table(
934
+ $type,
935
+ $attribute,
936
+ $_POST['id'],
937
+ $_POST['name'],
938
+ $value,
939
+ false
940
+ );
941
+ }
942
+
943
+
944
+ echo json_encode( $return );
945
+ die();
946
+ }
947
+ }
948
  }
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-reset-navigation-widget.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.3.2
8
- */
9
-
10
- if ( ! defined( 'YITH_WCAN' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCAN_Reset_Navigation_Widget' ) ) {
15
- /**
16
- * YITH WooCommerce Ajax Navigation Widget
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCAN_Reset_Navigation_Widget extends WP_Widget {
21
-
22
- function __construct() {
23
- $widget_ops = array( 'classname' => 'yith-woo-ajax-reset-navigation yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Reset all filters set by YITH WooCommerce Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ) );
24
- $control_ops = array( 'width' => 400, 'height' => 350 );
25
- parent::__construct( 'yith-woo-ajax-reset-navigation', __( 'YITH WooCommerce Ajax Reset Filter', 'yith-woocommerce-ajax-navigation' ), $widget_ops, $control_ops );
26
- }
27
-
28
-
29
- function widget( $args, $instance ) {
30
- global $_chosen_attributes, $woocommerce;
31
-
32
- extract( $args );
33
-
34
- $_attributes_array = yit_wcan_get_product_taxonomy();
35
-
36
- if ( apply_filters( 'yith_wcan_show_widget', ! is_post_type_archive( 'product' ) && ! is_tax( $_attributes_array ) ) ) {
37
- return;
38
- }
39
-
40
- // Price
41
- $min_price = isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : 0;
42
- $max_price = isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : 0;
43
-
44
- ob_start();
45
-
46
- if ( count( $_chosen_attributes ) > 0 || $min_price > 0 || $max_price > 0 || apply_filters( 'yith_woocommerce_reset_filters_attributes', false ) ) {
47
- $title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) : '';
48
- $label = isset( $instance['label'] ) ? apply_filters( 'yith-wcan-reset-navigation-label', $instance['label'], $instance, $this->id_base ) : '';
49
-
50
- //clean the url
51
- $link = yit_curPageURL();
52
- foreach ( (array) $_chosen_attributes as $taxonomy => $data ) {
53
- $taxonomy_filter = str_replace( 'pa_', '', $taxonomy );
54
- $link = remove_query_arg( 'filter_' . $taxonomy_filter, $link );
55
- }
56
-
57
- $link = remove_query_arg( array( 'min_price', 'max_price', 'product_tag' ), $link );
58
-
59
- $link = apply_filters( 'yith_woocommerce_reset_filter_link', $link );
60
-
61
- echo $before_widget;
62
- if ( $title ) {
63
- echo $before_title . $title . $after_title;
64
- }
65
- $button_class = apply_filters( 'yith-wcan-reset-navigation-button-class', "yith-wcan-reset-navigation button" );
66
- echo "<div class='yith-wcan'><a class='{$button_class}' href='{$link}'>" . __( $label, 'yith-woocommerce-ajax-navigation' ) . "</a></div>";
67
- echo $after_widget;
68
- echo ob_get_clean();
69
- }
70
- else {
71
- ob_end_clean();
72
- echo substr( $before_widget, 0, strlen( $before_widget ) - 1 ) . ' style="display:none">' . $after_widget;
73
- }
74
- }
75
-
76
-
77
- function form( $instance ) {
78
- global $woocommerce;
79
-
80
- $defaults = array(
81
- 'title' => '',
82
- 'label' => __( 'Reset All Filters', 'yith-woocommerce-ajax-navigation' )
83
- );
84
-
85
- $instance = wp_parse_args( (array) $instance, $defaults ); ?>
86
-
87
- <p>
88
- <label>
89
- <strong><?php _e( 'Title', 'yith-woocommerce-ajax-navigation' ) ?>:</strong><br />
90
- <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
91
- </label>
92
- </p>
93
- <p>
94
- <label>
95
- <strong><?php _e( 'Button Label', 'yith-woocommerce-ajax-navigation' ) ?>:</strong><br />
96
- <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'label' ); ?>" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
97
- </label>
98
- </p>
99
-
100
- <?php
101
- }
102
-
103
- function update( $new_instance, $old_instance ) {
104
- $instance = $old_instance;
105
- $instance['title'] = strip_tags( $new_instance['title'] );
106
- $instance['label'] = strip_tags( $new_instance['label'] );
107
-
108
- return $instance;
109
- }
110
-
111
- }
112
  }
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.3.2
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCAN' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCAN_Reset_Navigation_Widget' ) ) {
15
+ /**
16
+ * YITH WooCommerce Ajax Navigation Widget
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCAN_Reset_Navigation_Widget extends WP_Widget {
21
+
22
+ function __construct() {
23
+ $widget_ops = array( 'classname' => 'yith-woo-ajax-reset-navigation yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Reset all filters set by YITH WooCommerce Ajax Product Filter', 'yith-woocommerce-ajax-navigation' ) );
24
+ $control_ops = array( 'width' => 400, 'height' => 350 );
25
+ parent::__construct( 'yith-woo-ajax-reset-navigation', __( 'YITH WooCommerce Ajax Reset Filter', 'yith-woocommerce-ajax-navigation' ), $widget_ops, $control_ops );
26
+ }
27
+
28
+
29
+ function widget( $args, $instance ) {
30
+ global $_chosen_attributes, $woocommerce;
31
+
32
+ extract( $args );
33
+
34
+ $_attributes_array = yit_wcan_get_product_taxonomy();
35
+
36
+ if ( apply_filters( 'yith_wcan_show_widget', ! is_post_type_archive( 'product' ) && ! is_tax( $_attributes_array ) ) ) {
37
+ return;
38
+ }
39
+
40
+ // Price
41
+ $min_price = isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : 0;
42
+ $max_price = isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : 0;
43
+
44
+ ob_start();
45
+
46
+ if ( count( $_chosen_attributes ) > 0 || $min_price > 0 || $max_price > 0 || apply_filters( 'yith_woocommerce_reset_filters_attributes', false ) ) {
47
+ $title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) : '';
48
+ $label = isset( $instance['label'] ) ? apply_filters( 'yith-wcan-reset-navigation-label', $instance['label'], $instance, $this->id_base ) : '';
49
+
50
+ //clean the url
51
+ $link = yit_curPageURL();
52
+ foreach ( (array) $_chosen_attributes as $taxonomy => $data ) {
53
+ $taxonomy_filter = str_replace( 'pa_', '', $taxonomy );
54
+ $link = remove_query_arg( 'filter_' . $taxonomy_filter, $link );
55
+ }
56
+
57
+ $link = remove_query_arg( array( 'min_price', 'max_price', 'product_tag' ), $link );
58
+
59
+ $link = apply_filters( 'yith_woocommerce_reset_filter_link', $link );
60
+
61
+ echo $before_widget;
62
+ if ( $title ) {
63
+ echo $before_title . $title . $after_title;
64
+ }
65
+ $button_class = apply_filters( 'yith-wcan-reset-navigation-button-class', "yith-wcan-reset-navigation button" );
66
+ echo "<div class='yith-wcan'><a class='{$button_class}' href='{$link}'>" . __( $label, 'yith-woocommerce-ajax-navigation' ) . "</a></div>";
67
+ echo $after_widget;
68
+ echo ob_get_clean();
69
+ }
70
+ else {
71
+ ob_end_clean();
72
+ echo substr( $before_widget, 0, strlen( $before_widget ) - 1 ) . ' style="display:none">' . $after_widget;
73
+ }
74
+ }
75
+
76
+
77
+ function form( $instance ) {
78
+ global $woocommerce;
79
+
80
+ $defaults = array(
81
+ 'title' => '',
82
+ 'label' => __( 'Reset All Filters', 'yith-woocommerce-ajax-navigation' )
83
+ );
84
+
85
+ $instance = wp_parse_args( (array) $instance, $defaults ); ?>
86
+
87
+ <p>
88
+ <label>
89
+ <strong><?php _e( 'Title', 'yith-woocommerce-ajax-navigation' ) ?>:</strong><br />
90
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
91
+ </label>
92
+ </p>
93
+ <p>
94
+ <label>
95
+ <strong><?php _e( 'Button Label', 'yith-woocommerce-ajax-navigation' ) ?>:</strong><br />
96
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'label' ); ?>" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
97
+ </label>
98
+ </p>
99
+
100
+ <?php
101
+ }
102
+
103
+ function update( $new_instance, $old_instance ) {
104
+ $instance = $old_instance;
105
+ $instance['title'] = strip_tags( $new_instance['title'] );
106
+ $instance['label'] = strip_tags( $new_instance['label'] );
107
+
108
+ return $instance;
109
+ }
110
+
111
+ }
112
  }
modules/yith-woocommerce-ajax-search/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Search allows your users to search products in real time.
6
- * Version: 1.3.8
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
@@ -61,7 +61,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
61
  if ( defined( 'YITH_WCAS_VERSION' ) ){
62
  return;
63
  }else{
64
- define( 'YITH_WCAS_VERSION', '1.3.8' );
65
  }
66
 
67
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
3
  * Plugin Name: YITH WooCommerce Ajax Search
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Search allows your users to search products in real time.
6
+ * Version: 1.3.9
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-search
61
  if ( defined( 'YITH_WCAS_VERSION' ) ){
62
  return;
63
  }else{
64
+ define( 'YITH_WCAS_VERSION', '1.3.9' );
65
  }
66
 
67
  if ( ! defined( 'YITH_WCAS_FREE_INIT' ) ) {
modules/yith-woocommerce-badges-management/assets/css/admin.css CHANGED
@@ -5,214 +5,216 @@
5
  * @version 1.0.0
6
  */
7
 
8
-
9
  #yith-wcbm-metabox .inside {
10
- overflow: auto;
11
- position: static !important;
12
  }
13
 
14
- .inside div.ui-corner-all{
15
-
16
  }
17
 
18
- .tab-container{
19
- overflow: auto;
20
- background: transparent !important;
21
- border:0 !important;
22
  }
23
 
24
- .tab-container li.ui-corner-top{
25
- border-radius: 0;
26
  }
27
 
28
- .tab-container .ui-state-default a, .tab-container .ui-state-default a:link, .tab-container .ui-state-default a:visited{
29
- color: #555;
30
  }
31
 
32
- .tab-container .ui-state-default:hover{
33
- background: #f1f1f1;
34
  }
35
 
36
- .tab-container li.ui-state-default{
37
- background: #e4e4e4;
38
  }
39
 
40
- .tab-container li.ui-state-active, .tab-container li.ui-tabs-active{
41
- background: #fff;
42
- color: #000;
43
  }
44
 
45
- .tab-container li.ui-state-active:hover, .tab-container li.ui-tabs-active:hover{
46
- background: #fff;
47
  }
48
 
49
- .tab-container div.ui-tabs, .tab-container div.ui-tabs-panel{
50
- padding: 0;
51
  }
52
 
53
  .half-left {
54
- width: 66%;
55
- float: left;
56
- margin-right: 1%;
57
- box-sizing: border-box;
58
  }
 
59
  .half-right {
60
- width: 33%;
61
- float: left;
62
- box-sizing: border-box;
63
  }
64
 
65
- .section-container{
66
- border: 1px solid #aaa;
67
- padding: 10px;
68
- margin-top: 20px;
69
- position: relative;
70
  }
71
 
72
- .section-container div.section-title{
73
- background: #fff;
74
- padding: 5px;
75
- color: #000;
76
- font-size: 14px;
77
- font-weight: 800;
78
- position: absolute;
79
- top:-15px;
80
- left: 10px;
81
  }
82
 
83
- .section-content-container{
84
- overflow: auto;
85
- width:100%;
86
- margin: 0;
87
- padding: 0;
88
  }
89
 
90
- table.section-table{
91
- width:100%;
92
  }
93
 
94
- table.section-table tr{
95
 
96
  }
97
 
98
- td.table-title{
99
- width:30%;
100
- vertical-align: top;
101
  }
102
 
103
- td.table-content{
104
- width:70%;
105
  }
106
 
107
- td.table-align-top{
108
- vertical-align: top;
109
  }
110
 
111
- div.table-description{
112
- width: 100%;
113
- font-size: 11px;
114
  }
115
 
116
- table.table-mini-title th{
117
- font-size: 10px;
118
- font-weight: 400;
119
- text-transform: uppercase;
120
  }
121
 
122
- h3#preview_title{
123
- text-align: center;
124
- margin-bottom: 2px;
 
125
  }
126
 
127
  #preview-bg {
128
- display:block;
129
- position:relative;
130
- width:150px;
131
- height:150px;
132
- background: #ddd;
133
- box-sizing: border-box;
134
- z-index:0;
135
- margin: 0 auto;
136
  }
 
137
  #preview-badge {
138
- position: absolute;
139
- box-sizing: border-box;
140
- text-align: center;
141
- z-index:10;
142
- line-height: 0;
143
  }
144
 
145
  /*** METABOX ***/
146
- .yith-wcbm-container-button{
147
- width:100%;
148
- overflow: auto;
149
  }
150
 
151
  h3.section-title {
152
- padding: 0 !important;
153
- margin-top: 15px !important;
154
- margin-bottom: 15px !important;
155
- }
156
-
157
- .minisection-container{
158
- margin-top: 10px;
159
- overflow: auto;
160
- }
161
-
162
- #yith-wcbm-custom-button, #yith-wcbm-image-button{
163
- float:left;
164
- padding-left: 15px;
165
- padding-right: 15px;
166
- height: 30px;
167
- margin-right: 10px;
168
- line-height: 30px;
169
- text-align: center;
170
- border-radius: 7px;
171
- border: 1px #c5c5c5 solid;
172
- text-transform: uppercase;
173
- cursor: pointer;
174
- }
175
-
176
- .yith-wcbm-button-selected{
177
- background: #f5f5f5;
178
- cursor: default !important;
179
- }
180
-
181
- #yith-wcbm-panel-image{
182
- width:100%;
183
- overflow: auto;
184
- padding-top: 15px;
185
- padding-right: 5px;
186
- }
187
-
188
- .yith-wcbm-select-image-btn{
189
- position:relative;
190
- float:left;
191
- width:17%;
192
- height:0;
193
- padding-bottom: 17%;
194
- margin: 1%;
195
- margin-right: 2%;
196
- border-radius: 5px;
197
- border: 1px #d5d5d5 solid;
198
- background-repeat:no-repeat;
199
- background-position:center center;
200
- cursor: pointer;
201
- box-sizing: border-box;
202
- }
203
-
204
- .yith-wcbm-select-image-btn-selected{
205
- border: 1px #4968ff solid;
206
- box-shadow:0px 0px 2px 0px #4968ff;
207
- -webkit-box-shadow: 0px 0px 2px 0px #4968ff;
208
- -moz-box-shadow: 0px 0px 2px 0px #4968ff;
209
- -o-box-shadow: 0px 0px 2px 0px #4968ff;
210
- -ms-box-shadow: 0px 0px 2px 0px #4968ff;
211
  }
212
 
213
  div.wp-picker-holder {
214
- z-index: 10;
215
- position: absolute;
216
  }
217
 
218
  /* === PREMIUM SECTION === */
@@ -222,108 +224,108 @@ div.wp-picker-holder {
222
  * @author Leanza Francesco
223
  * @version 1.0.0
224
  */
225
- table.table-four-colums{
226
- width:100%;
227
  }
228
 
229
  .table-four-colums th, .table-four-colums td {
230
- width: 24%;
231
- margin-right: 1%;
232
- text-align: center;
233
  }
234
 
235
  .table-four-colums td input {
236
- margin: 0 auto;
237
  }
238
 
239
- #preview_box{
240
- position:relative;
241
- overflow:hidden;
242
  }
243
 
244
- #preview-badge img{
245
- max-width: 200px;
246
- max-height: 200px;
247
  }
248
 
249
- .uploader_sect{
250
- width:100%;
251
- float:left;
252
- margin-top: 20px;
253
  }
254
 
255
  .delete_custom_image {
256
- display: none;
257
- position: absolute;
258
- top:-12px;
259
- right:-12px;
260
- z-index: 100;
261
- width:30px;
262
- height:30px;
263
- background: url("../images/x.png");
264
- background-repeat:no-repeat;
265
- background-position:center center;
266
  }
267
 
268
  .yith_wcbm_select_image_btn:hover > .delete_custom_image {
269
- display: block;
270
- }
271
-
272
- #yith-wcbm-opacity{
273
- float: left;
274
- }
275
-
276
- #output-opacity{
277
- background-color: #eee;
278
- border: 1px #ddd solid;
279
- border-radius: 50%;
280
- text-align: center;
281
- font-size: 10px;
282
- line-height: 25px;
283
- float: left;
284
- width: 25px;
285
- height: 25px;
286
- vertical-align: middle;
287
- }
288
-
289
- #yith-wcbm-metabox .ui-widget-header{
290
- border: 0;
291
- border-radius: 0;
292
- border-bottom: 1px solid #e4e4e4;
293
- background: transparent;
294
- }
295
-
296
- div#preview-desc{
297
- margin-bottom: 150px;
298
- font-size: 11px;
299
- font-weight: 400;
300
- padding-left: 10px;
301
- }
302
-
303
- #yith-wcbm-metabox a.ui-tabs-anchor:focus{
304
- outline:none;
305
- border:0;
306
- box-shadow: none;
307
- -webkit-box-shadow: none;
308
- -moz-box-shadow: none;
309
- -o-box-shadow: none;
310
- -ms-box-shadow: none;
311
- }
312
-
313
- #preview-bg{
314
- cursor: pointer;
315
- }
316
-
317
- #preview-loader{
318
- display: none;
319
- position: absolute;
320
- background: url('spinner.gif') no-repeat;
321
- border-radius: 5px;
322
- border-radius: 5px;
323
- opacity: 0.7;
324
- width: 20px;
325
- height: 20px;
326
- top: 65px;
327
- left: 65px;
328
- z-index: 999;
329
  }
5
  * @version 1.0.0
6
  */
7
 
 
8
  #yith-wcbm-metabox .inside {
9
+ overflow : auto;
10
+ position : static !important;
11
  }
12
 
13
+ .inside div.ui-corner-all {
14
+
15
  }
16
 
17
+ .tab-container {
18
+ overflow : auto;
19
+ background : transparent !important;
20
+ border : 0 !important;
21
  }
22
 
23
+ .tab-container li.ui-corner-top {
24
+ border-radius : 0;
25
  }
26
 
27
+ .tab-container .ui-state-default a, .tab-container .ui-state-default a:link, .tab-container .ui-state-default a:visited {
28
+ color : #555;
29
  }
30
 
31
+ .tab-container .ui-state-default:hover {
32
+ background : #f1f1f1;
33
  }
34
 
35
+ .tab-container li.ui-state-default {
36
+ background : #e4e4e4;
37
  }
38
 
39
+ .tab-container li.ui-state-active, .tab-container li.ui-tabs-active {
40
+ background : #fff;
41
+ color : #000;
42
  }
43
 
44
+ .tab-container li.ui-state-active:hover, .tab-container li.ui-tabs-active:hover {
45
+ background : #fff;
46
  }
47
 
48
+ .tab-container div.ui-tabs, .tab-container div.ui-tabs-panel {
49
+ padding : 0;
50
  }
51
 
52
  .half-left {
53
+ width : 66%;
54
+ float : left;
55
+ margin-right : 1%;
56
+ box-sizing : border-box;
57
  }
58
+
59
  .half-right {
60
+ width : 33%;
61
+ float : left;
62
+ box-sizing : border-box;
63
  }
64
 
65
+ .section-container {
66
+ border : 1px solid #aaa;
67
+ padding : 10px;
68
+ margin-top : 20px;
69
+ position : relative;
70
  }
71
 
72
+ .section-container div.section-title {
73
+ background : #fff;
74
+ padding : 5px;
75
+ color : #000;
76
+ font-size : 14px;
77
+ font-weight : 800;
78
+ position : absolute;
79
+ top : -15px;
80
+ left : 10px;
81
  }
82
 
83
+ .section-content-container {
84
+ overflow : auto;
85
+ width : 100%;
86
+ margin : 0;
87
+ padding : 0;
88
  }
89
 
90
+ table.section-table {
91
+ width : 100%;
92
  }
93
 
94
+ table.section-table tr {
95
 
96
  }
97
 
98
+ td.table-title {
99
+ width : 30%;
100
+ vertical-align : top;
101
  }
102
 
103
+ td.table-content {
104
+ width : 70%;
105
  }
106
 
107
+ td.table-align-top {
108
+ vertical-align : top;
109
  }
110
 
111
+ div.table-description {
112
+ width : 100%;
113
+ font-size : 11px;
114
  }
115
 
116
+ table.table-mini-title th {
117
+ font-size : 10px;
118
+ font-weight : 400;
119
+ text-transform : uppercase;
120
  }
121
 
122
+ h3#preview-title {
123
+ text-align : center;
124
+ margin-bottom: 20px;
125
+ font-size: 15px;
126
  }
127
 
128
  #preview-bg {
129
+ display : block;
130
+ position : relative;
131
+ width : 150px;
132
+ height : 150px;
133
+ background : #ddd;
134
+ box-sizing : border-box;
135
+ z-index : 0;
136
+ margin : 0 auto;
137
  }
138
+
139
  #preview-badge {
140
+ position : absolute;
141
+ box-sizing : border-box;
142
+ text-align : center;
143
+ z-index : 10;
144
+ line-height : 0;
145
  }
146
 
147
  /*** METABOX ***/
148
+ .yith-wcbm-container-button {
149
+ width : 100%;
150
+ overflow : auto;
151
  }
152
 
153
  h3.section-title {
154
+ padding : 0 !important;
155
+ margin-top : 15px !important;
156
+ margin-bottom : 15px !important;
157
+ }
158
+
159
+ .minisection-container {
160
+ margin-top : 10px;
161
+ overflow : auto;
162
+ }
163
+
164
+ #yith-wcbm-custom-button, #yith-wcbm-image-button {
165
+ float : left;
166
+ padding-left : 15px;
167
+ padding-right : 15px;
168
+ height : 30px;
169
+ margin-right : 10px;
170
+ line-height : 30px;
171
+ text-align : center;
172
+ border-radius : 7px;
173
+ border : 1px #c5c5c5 solid;
174
+ text-transform : uppercase;
175
+ cursor : pointer;
176
+ }
177
+
178
+ .yith-wcbm-button-selected {
179
+ background : #f5f5f5;
180
+ cursor : default !important;
181
+ }
182
+
183
+ #yith-wcbm-panel-image {
184
+ width : 100%;
185
+ overflow : auto;
186
+ padding-top : 15px;
187
+ padding-right : 5px;
188
+ }
189
+
190
+ .yith-wcbm-select-image-btn {
191
+ position : relative;
192
+ float : left;
193
+ width : 17%;
194
+ height : 0;
195
+ padding-bottom : 17%;
196
+ margin : 1%;
197
+ margin-right : 2%;
198
+ border-radius : 5px;
199
+ border : 1px #d5d5d5 solid;
200
+ background-repeat : no-repeat;
201
+ background-position : center center;
202
+ cursor : pointer;
203
+ box-sizing : border-box;
204
+ }
205
+
206
+ .yith-wcbm-select-image-btn-selected {
207
+ border : 1px #4968ff solid;
208
+ box-shadow : 0px 0px 2px 0px #4968ff;
209
+ -webkit-box-shadow : 0px 0px 2px 0px #4968ff;
210
+ -moz-box-shadow : 0px 0px 2px 0px #4968ff;
211
+ -o-box-shadow : 0px 0px 2px 0px #4968ff;
212
+ -ms-box-shadow : 0px 0px 2px 0px #4968ff;
213
  }
214
 
215
  div.wp-picker-holder {
216
+ z-index : 10;
217
+ position : absolute;
218
  }
219
 
220
  /* === PREMIUM SECTION === */
224
  * @author Leanza Francesco
225
  * @version 1.0.0
226
  */
227
+ table.table-four-colums {
228
+ width : 100%;
229
  }
230
 
231
  .table-four-colums th, .table-four-colums td {
232
+ width : 24%;
233
+ margin-right : 1%;
234
+ text-align : center;
235
  }
236
 
237
  .table-four-colums td input {
238
+ margin : 0 auto;
239
  }
240
 
241
+ #preview_box {
242
+ position : relative;
243
+ overflow : hidden;
244
  }
245
 
246
+ #preview-badge img {
247
+ max-width : 200px;
248
+ max-height : 200px;
249
  }
250
 
251
+ .uploader_sect {
252
+ width : 100%;
253
+ float : left;
254
+ margin-top : 20px;
255
  }
256
 
257
  .delete_custom_image {
258
+ display : none;
259
+ position : absolute;
260
+ top : -12px;
261
+ right : -12px;
262
+ z-index : 100;
263
+ width : 30px;
264
+ height : 30px;
265
+ background : url("../images/x.png");
266
+ background-repeat : no-repeat;
267
+ background-position : center center;
268
  }
269
 
270
  .yith_wcbm_select_image_btn:hover > .delete_custom_image {
271
+ display : block;
272
+ }
273
+
274
+ #yith-wcbm-opacity {
275
+ float : left;
276
+ }
277
+
278
+ #output-opacity {
279
+ background-color : #eee;
280
+ border : 1px #ddd solid;
281
+ border-radius : 50%;
282
+ text-align : center;
283
+ font-size : 10px;
284
+ line-height : 25px;
285
+ float : left;
286
+ width : 25px;
287
+ height : 25px;
288
+ vertical-align : middle;
289
+ }
290
+
291
+ #yith-wcbm-metabox .ui-widget-header {
292
+ border : 0;
293
+ border-radius : 0;
294
+ border-bottom : 1px solid #e4e4e4;
295
+ background : transparent;
296
+ }
297
+
298
+ div#preview-desc {
299
+ margin-bottom : 150px;
300
+ font-size : 11px;
301
+ font-weight : 400;
302
+ padding-left : 10px;
303
+ }
304
+
305
+ #yith-wcbm-metabox a.ui-tabs-anchor:focus {
306
+ outline : none;
307
+ border : 0;
308
+ box-shadow : none;
309
+ -webkit-box-shadow : none;
310
+ -moz-box-shadow : none;
311
+ -o-box-shadow : none;
312
+ -ms-box-shadow : none;
313
+ }
314
+
315
+ #preview-bg {
316
+ cursor : pointer;
317
+ }
318
+
319
+ #preview-loader {
320
+ display : none;
321
+ position : absolute;
322
+ background : url('spinner.gif') no-repeat;
323
+ border-radius : 5px;
324
+ border-radius : 5px;
325
+ opacity : 0.7;
326
+ width : 20px;
327
+ height : 20px;
328
+ top : 65px;
329
+ left : 65px;
330
+ z-index : 999;
331
  }
modules/yith-woocommerce-badges-management/assets/css/jquery-ui.css ADDED
@@ -0,0 +1,1225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.11.3 - 2015-02-12
2
+ * http://jqueryui.com
3
+ * Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden {
10
+ display: none;
11
+ }
12
+ .ui-helper-hidden-accessible {
13
+ border: 0;
14
+ clip: rect(0 0 0 0);
15
+ height: 1px;
16
+ margin: -1px;
17
+ overflow: hidden;
18
+ padding: 0;
19
+ position: absolute;
20
+ width: 1px;
21
+ }
22
+ .ui-helper-reset {
23
+ margin: 0;
24
+ padding: 0;
25
+ border: 0;
26
+ outline: 0;
27
+ line-height: 1.3;
28
+ text-decoration: none;
29
+ font-size: 100%;
30
+ list-style: none;
31
+ }
32
+ .ui-helper-clearfix:before,
33
+ .ui-helper-clearfix:after {
34
+ content: "";
35
+ display: table;
36
+ border-collapse: collapse;
37
+ }
38
+ .ui-helper-clearfix:after {
39
+ clear: both;
40
+ }
41
+ .ui-helper-clearfix {
42
+ min-height: 0; /* support: IE7 */
43
+ }
44
+ .ui-helper-zfix {
45
+ width: 100%;
46
+ height: 100%;
47
+ top: 0;
48
+ left: 0;
49
+ position: absolute;
50
+ opacity: 0;
51
+ filter:Alpha(Opacity=0); /* support: IE8 */
52
+ }
53
+
54
+ .ui-front {
55
+ z-index: 100;
56
+ }
57
+
58
+
59
+ /* Interaction Cues
60
+ ----------------------------------*/
61
+ .ui-state-disabled {
62
+ cursor: default !important;
63
+ }
64
+
65
+
66
+ /* Icons
67
+ ----------------------------------*/
68
+
69
+ /* states and images */
70
+ .ui-icon {
71
+ display: block;
72
+ text-indent: -99999px;
73
+ overflow: hidden;
74
+ background-repeat: no-repeat;
75
+ }
76
+
77
+
78
+ /* Misc visuals
79
+ ----------------------------------*/
80
+
81
+ /* Overlays */
82
+ .ui-widget-overlay {
83
+ position: fixed;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ }
89
+ .ui-accordion .ui-accordion-header {
90
+ display: block;
91
+ cursor: pointer;
92
+ position: relative;
93
+ margin: 2px 0 0 0;
94
+ padding: .5em .5em .5em .7em;
95
+ min-height: 0; /* support: IE7 */
96
+ font-size: 100%;
97
+ }
98
+ .ui-accordion .ui-accordion-icons {
99
+ padding-left: 2.2em;
100
+ }
101
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons {
102
+ padding-left: 2.2em;
103
+ }
104
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
105
+ position: absolute;
106
+ left: .5em;
107
+ top: 50%;
108
+ margin-top: -8px;
109
+ }
110
+ .ui-accordion .ui-accordion-content {
111
+ padding: 1em 2.2em;
112
+ border-top: 0;
113
+ overflow: auto;
114
+ }
115
+ .ui-autocomplete {
116
+ position: absolute;
117
+ top: 0;
118
+ left: 0;
119
+ cursor: default;
120
+ }
121
+ .ui-button {
122
+ display: inline-block;
123
+ position: relative;
124
+ padding: 0;
125
+ line-height: normal;
126
+ margin-right: .1em;
127
+ cursor: pointer;
128
+ vertical-align: middle;
129
+ text-align: center;
130
+ overflow: visible; /* removes extra width in IE */
131
+ }
132
+ .ui-button,
133
+ .ui-button:link,
134
+ .ui-button:visited,
135
+ .ui-button:hover,
136
+ .ui-button:active {
137
+ text-decoration: none;
138
+ }
139
+ /* to make room for the icon, a width needs to be set here */
140
+ .ui-button-icon-only {
141
+ width: 2.2em;
142
+ }
143
+ /* button elements seem to need a little more width */
144
+ button.ui-button-icon-only {
145
+ width: 2.4em;
146
+ }
147
+ .ui-button-icons-only {
148
+ width: 3.4em;
149
+ }
150
+ button.ui-button-icons-only {
151
+ width: 3.7em;
152
+ }
153
+
154
+ /* button text element */
155
+ .ui-button .ui-button-text {
156
+ display: block;
157
+ line-height: normal;
158
+ }
159
+ .ui-button-text-only .ui-button-text {
160
+ padding: .4em 1em;
161
+ }
162
+ .ui-button-icon-only .ui-button-text,
163
+ .ui-button-icons-only .ui-button-text {
164
+ padding: .4em;
165
+ text-indent: -9999999px;
166
+ }
167
+ .ui-button-text-icon-primary .ui-button-text,
168
+ .ui-button-text-icons .ui-button-text {
169
+ padding: .4em 1em .4em 2.1em;
170
+ }
171
+ .ui-button-text-icon-secondary .ui-button-text,
172
+ .ui-button-text-icons .ui-button-text {
173
+ padding: .4em 2.1em .4em 1em;
174
+ }
175
+ .ui-button-text-icons .ui-button-text {
176
+ padding-left: 2.1em;
177
+ padding-right: 2.1em;
178
+ }
179
+ /* no icon support for input elements, provide padding by default */
180
+ input.ui-button {
181
+ padding: .4em 1em;
182
+ }
183
+
184
+ /* button icon element(s) */
185
+ .ui-button-icon-only .ui-icon,
186
+ .ui-button-text-icon-primary .ui-icon,
187
+ .ui-button-text-icon-secondary .ui-icon,
188
+ .ui-button-text-icons .ui-icon,
189
+ .ui-button-icons-only .ui-icon {
190
+ position: absolute;
191
+ top: 50%;
192
+ margin-top: -8px;
193
+ }
194
+ .ui-button-icon-only .ui-icon {
195
+ left: 50%;
196
+ margin-left: -8px;
197
+ }
198
+ .ui-button-text-icon-primary .ui-button-icon-primary,
199
+ .ui-button-text-icons .ui-button-icon-primary,
200
+ .ui-button-icons-only .ui-button-icon-primary {
201
+ left: .5em;
202
+ }
203
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
204
+ .ui-button-text-icons .ui-button-icon-secondary,
205
+ .ui-button-icons-only .ui-button-icon-secondary {
206
+ right: .5em;
207
+ }
208
+
209
+ /* button sets */
210
+ .ui-buttonset {
211
+ margin-right: 7px;
212
+ }
213
+ .ui-buttonset .ui-button {
214
+ margin-left: 0;
215
+ margin-right: -.3em;
216
+ }
217
+
218
+ /* workarounds */
219
+ /* reset extra padding in Firefox, see h5bp.com/l */
220
+ input.ui-button::-moz-focus-inner,
221
+ button.ui-button::-moz-focus-inner {
222
+ border: 0;
223
+ padding: 0;
224
+ }
225
+ .ui-datepicker {
226
+ width: 17em;
227
+ padding: .2em .2em 0;
228
+ display: none;
229
+ }
230
+ .ui-datepicker .ui-datepicker-header {
231
+ position: relative;
232
+ padding: .2em 0;
233
+ }
234
+ .ui-datepicker .ui-datepicker-prev,
235
+ .ui-datepicker .ui-datepicker-next {
236
+ position: absolute;
237
+ top: 2px;
238
+ width: 1.8em;
239
+ height: 1.8em;
240
+ }
241
+ .ui-datepicker .ui-datepicker-prev-hover,
242
+ .ui-datepicker .ui-datepicker-next-hover {
243
+ top: 1px;
244
+ }
245
+ .ui-datepicker .ui-datepicker-prev {
246
+ left: 2px;
247
+ }
248
+ .ui-datepicker .ui-datepicker-next {
249
+ right: 2px;
250
+ }
251
+ .ui-datepicker .ui-datepicker-prev-hover {
252
+ left: 1px;
253
+ }
254
+ .ui-datepicker .ui-datepicker-next-hover {
255
+ right: 1px;
256
+ }
257
+ .ui-datepicker .ui-datepicker-prev span,
258
+ .ui-datepicker .ui-datepicker-next span {
259
+ display: block;
260
+ position: absolute;
261
+ left: 50%;
262
+ margin-left: -8px;
263
+ top: 50%;
264
+ margin-top: -8px;
265
+ }
266
+ .ui-datepicker .ui-datepicker-title {
267
+ margin: 0 2.3em;
268
+ line-height: 1.8em;
269
+ text-align: center;
270
+ }
271
+ .ui-datepicker .ui-datepicker-title select {
272
+ font-size: 1em;
273
+ margin: 1px 0;
274
+ }
275
+ .ui-datepicker select.ui-datepicker-month,
276
+ .ui-datepicker select.ui-datepicker-year {
277
+ width: 45%;
278
+ }
279
+ .ui-datepicker table {
280
+ width: 100%;
281
+ font-size: .9em;
282
+ border-collapse: collapse;
283
+ margin: 0 0 .4em;
284
+ }
285
+ .ui-datepicker th {
286
+ padding: .7em .3em;
287
+ text-align: center;
288
+ font-weight: bold;
289
+ border: 0;
290
+ }
291
+ .ui-datepicker td {
292
+ border: 0;
293
+ padding: 1px;
294
+ }
295
+ .ui-datepicker td span,
296
+ .ui-datepicker td a {
297
+ display: block;
298
+ padding: .2em;
299
+ text-align: right;
300
+ text-decoration: none;
301
+ }
302
+ .ui-datepicker .ui-datepicker-buttonpane {
303
+ background-image: none;
304
+ margin: .7em 0 0 0;
305
+ padding: 0 .2em;
306
+ border-left: 0;
307
+ border-right: 0;
308
+ border-bottom: 0;
309
+ }
310
+ .ui-datepicker .ui-datepicker-buttonpane button {
311
+ float: right;
312
+ margin: .5em .2em .4em;
313
+ cursor: pointer;
314
+ padding: .2em .6em .3em .6em;
315
+ width: auto;
316
+ overflow: visible;
317
+ }
318
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
319
+ float: left;
320
+ }
321
+
322
+ /* with multiple calendars */
323
+ .ui-datepicker.ui-datepicker-multi {
324
+ width: auto;
325
+ }
326
+ .ui-datepicker-multi .ui-datepicker-group {
327
+ float: left;
328
+ }
329
+ .ui-datepicker-multi .ui-datepicker-group table {
330
+ width: 95%;
331
+ margin: 0 auto .4em;
332
+ }
333
+ .ui-datepicker-multi-2 .ui-datepicker-group {
334
+ width: 50%;
335
+ }
336
+ .ui-datepicker-multi-3 .ui-datepicker-group {
337
+ width: 33.3%;
338
+ }
339
+ .ui-datepicker-multi-4 .ui-datepicker-group {
340
+ width: 25%;
341
+ }
342
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
343
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
344
+ border-left-width: 0;
345
+ }
346
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
347
+ clear: left;
348
+ }
349
+ .ui-datepicker-row-break {
350
+ clear: both;
351
+ width: 100%;
352
+ font-size: 0;
353
+ }
354
+
355
+ /* RTL support */
356
+ .ui-datepicker-rtl {
357
+ direction: rtl;
358
+ }
359
+ .ui-datepicker-rtl .ui-datepicker-prev {
360
+ right: 2px;
361
+ left: auto;
362
+ }
363
+ .ui-datepicker-rtl .ui-datepicker-next {
364
+ left: 2px;
365
+ right: auto;
366
+ }
367
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
368
+ right: 1px;
369
+ left: auto;
370
+ }
371
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
372
+ left: 1px;
373
+ right: auto;
374
+ }
375
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
376
+ clear: right;
377
+ }
378
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
379
+ float: left;
380
+ }
381
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
382
+ .ui-datepicker-rtl .ui-datepicker-group {
383
+ float: right;
384
+ }
385
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
386
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
387
+ border-right-width: 0;
388
+ border-left-width: 1px;
389
+ }
390
+ .ui-dialog {
391
+ overflow: hidden;
392
+ position: absolute;
393
+ top: 0;
394
+ left: 0;
395
+ padding: .2em;
396
+ outline: 0;
397
+ }
398
+ .ui-dialog .ui-dialog-titlebar {
399
+ padding: .4em 1em;
400
+ position: relative;
401
+ }
402
+ .ui-dialog .ui-dialog-title {
403
+ float: left;
404
+ margin: .1em 0;
405
+ white-space: nowrap;
406
+ width: 90%;
407
+ overflow: hidden;
408
+ text-overflow: ellipsis;
409
+ }
410
+ .ui-dialog .ui-dialog-titlebar-close {
411
+ position: absolute;
412
+ right: .3em;
413
+ top: 50%;
414
+ width: 20px;
415
+ margin: -10px 0 0 0;
416
+ padding: 1px;
417
+ height: 20px;
418
+ }
419
+ .ui-dialog .ui-dialog-content {
420
+ position: relative;
421
+ border: 0;
422
+ padding: .5em 1em;
423
+ background: none;
424
+ overflow: auto;
425
+ }
426
+ .ui-dialog .ui-dialog-buttonpane {
427
+ text-align: left;
428
+ border-width: 1px 0 0 0;
429
+ background-image: none;
430
+ margin-top: .5em;
431
+ padding: .3em 1em .5em .4em;
432
+ }
433
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
434
+ float: right;
435
+ }
436
+ .ui-dialog .ui-dialog-buttonpane button {
437
+ margin: .5em .4em .5em 0;
438
+ cursor: pointer;
439
+ }
440
+ .ui-dialog .ui-resizable-se {
441
+ width: 12px;
442
+ height: 12px;
443
+ right: -5px;
444
+ bottom: -5px;
445
+ background-position: 16px 16px;
446
+ }
447
+ .ui-draggable .ui-dialog-titlebar {
448
+ cursor: move;
449
+ }
450
+ .ui-draggable-handle {
451
+ -ms-touch-action: none;
452
+ touch-action: none;
453
+ }
454
+ .ui-menu {
455
+ list-style: none;
456
+ padding: 0;
457
+ margin: 0;
458
+ display: block;
459
+ outline: none;
460
+ }
461
+ .ui-menu .ui-menu {
462
+ position: absolute;
463
+ }
464
+ .ui-menu .ui-menu-item {
465
+ position: relative;
466
+ margin: 0;
467
+ padding: 3px 1em 3px .4em;
468
+ cursor: pointer;
469
+ min-height: 0; /* support: IE7 */
470
+ /* support: IE10, see #8844 */
471
+ list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
472
+ }
473
+ .ui-menu .ui-menu-divider {
474
+ margin: 5px 0;
475
+ height: 0;
476
+ font-size: 0;
477
+ line-height: 0;
478
+ border-width: 1px 0 0 0;
479
+ }
480
+ .ui-menu .ui-state-focus,
481
+ .ui-menu .ui-state-active {
482
+ margin: -1px;
483
+ }
484
+
485
+ /* icon support */
486
+ .ui-menu-icons {
487
+ position: relative;
488
+ }
489
+ .ui-menu-icons .ui-menu-item {
490
+ padding-left: 2em;
491
+ }
492
+
493
+ /* left-aligned */
494
+ .ui-menu .ui-icon {
495
+ position: absolute;
496
+ top: 0;
497
+ bottom: 0;
498
+ left: .2em;
499
+ margin: auto 0;
500
+ }
501
+
502
+ /* right-aligned */
503
+ .ui-menu .ui-menu-icon {
504
+ left: auto;
505
+ right: 0;
506
+ }
507
+ .ui-progressbar {
508
+ height: 2em;
509
+ text-align: left;
510
+ overflow: hidden;
511
+ }
512
+ .ui-progressbar .ui-progressbar-value {
513
+ margin: -1px;
514
+ height: 100%;
515
+ }
516
+ .ui-progressbar .ui-progressbar-overlay {
517
+ background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
518
+ height: 100%;
519
+ filter: alpha(opacity=25); /* support: IE8 */
520
+ opacity: 0.25;
521
+ }
522
+ .ui-progressbar-indeterminate .ui-progressbar-value {
523
+ background-image: none;
524
+ }
525
+ .ui-resizable {
526
+ position: relative;
527
+ }
528
+ .ui-resizable-handle {
529
+ position: absolute;
530
+ font-size: 0.1px;
531
+ display: block;
532
+ -ms-touch-action: none;
533
+ touch-action: none;
534
+ }
535
+ .ui-resizable-disabled .ui-resizable-handle,
536
+ .ui-resizable-autohide .ui-resizable-handle {
537
+ display: none;
538
+ }
539
+ .ui-resizable-n {
540
+ cursor: n-resize;
541
+ height: 7px;
542
+ width: 100%;
543
+ top: -5px;
544
+ left: 0;
545
+ }
546
+ .ui-resizable-s {
547
+ cursor: s-resize;
548
+ height: 7px;
549
+ width: 100%;
550
+ bottom: -5px;
551
+ left: 0;
552
+ }
553
+ .ui-resizable-e {
554
+ cursor: e-resize;
555
+ width: 7px;
556
+ right: -5px;
557
+ top: 0;
558
+ height: 100%;
559
+ }
560
+ .ui-resizable-w {
561
+ cursor: w-resize;
562
+ width: 7px;
563
+ left: -5px;
564
+ top: 0;
565
+ height: 100%;
566
+ }
567
+ .ui-resizable-se {
568
+ cursor: se-resize;
569
+ width: 12px;
570
+ height: 12px;
571
+ right: 1px;
572
+ bottom: 1px;
573
+ }
574
+ .ui-resizable-sw {
575
+ cursor: sw-resize;
576
+ width: 9px;
577
+ height: 9px;
578
+ left: -5px;
579
+ bottom: -5px;
580
+ }
581
+ .ui-resizable-nw {
582
+ cursor: nw-resize;
583
+ width: 9px;
584
+ height: 9px;
585
+ left: -5px;
586
+ top: -5px;
587
+ }
588
+ .ui-resizable-ne {
589
+ cursor: ne-resize;
590
+ width: 9px;
591
+ height: 9px;
592
+ right: -5px;
593
+ top: -5px;
594
+ }
595
+ .ui-selectable {
596
+ -ms-touch-action: none;
597
+ touch-action: none;
598
+ }
599
+ .ui-selectable-helper {
600
+ position: absolute;
601
+ z-index: 100;
602
+ border: 1px dotted black;
603
+ }
604
+ .ui-selectmenu-menu {
605
+ padding: 0;
606
+ margin: 0;
607
+ position: absolute;
608
+ top: 0;
609
+ left: 0;
610
+ display: none;
611
+ }
612
+ .ui-selectmenu-menu .ui-menu {
613
+ overflow: auto;
614
+ /* Support: IE7 */
615
+ overflow-x: hidden;
616
+ padding-bottom: 1px;
617
+ }
618
+ .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
619
+ font-size: 1em;
620
+ font-weight: bold;
621
+ line-height: 1.5;
622
+ padding: 2px 0.4em;
623
+ margin: 0.5em 0 0 0;
624
+ height: auto;
625
+ border: 0;
626
+ }
627
+ .ui-selectmenu-open {
628
+ display: block;
629
+ }
630
+ .ui-selectmenu-button {
631
+ display: inline-block;
632
+ overflow: hidden;
633
+ position: relative;
634
+ text-decoration: none;
635
+ cursor: pointer;
636
+ }
637
+ .ui-selectmenu-button span.ui-icon {
638
+ right: 0.5em;
639
+ left: auto;
640
+ margin-top: -8px;
641
+ position: absolute;
642
+ top: 50%;
643
+ }
644
+ .ui-selectmenu-button span.ui-selectmenu-text {
645
+ text-align: left;
646
+ padding: 0.4em 2.1em 0.4em 1em;
647
+ display: block;
648
+ line-height: 1.4;
649
+ overflow: hidden;
650
+ text-overflow: ellipsis;
651
+ white-space: nowrap;
652
+ }
653
+ .ui-slider {
654
+ position: relative;
655
+ text-align: left;
656
+ }
657
+ .ui-slider .ui-slider-handle {
658
+ position: absolute;
659
+ z-index: 2;
660
+ width: 1.2em;
661
+ height: 1.2em;
662
+ cursor: default;
663
+ -ms-touch-action: none;
664
+ touch-action: none;
665
+ }
666
+ .ui-slider .ui-slider-range {
667
+ position: absolute;
668
+ z-index: 1;
669
+ font-size: .7em;
670
+ display: block;
671
+ border: 0;
672
+ background-position: 0 0;
673
+ }
674
+
675
+ /* support: IE8 - See #6727 */
676
+ .ui-slider.ui-state-disabled .ui-slider-handle,
677
+ .ui-slider.ui-state-disabled .ui-slider-range {
678
+ filter: inherit;
679
+ }
680
+
681
+ .ui-slider-horizontal {
682
+ height: .8em;
683
+ }
684
+ .ui-slider-horizontal .ui-slider-handle {
685
+ top: -.3em;
686
+ margin-left: -.6em;
687
+ }
688
+ .ui-slider-horizontal .ui-slider-range {
689
+ top: 0;
690
+ height: 100%;
691
+ }
692
+ .ui-slider-horizontal .ui-slider-range-min {
693
+ left: 0;
694
+ }
695
+ .ui-slider-horizontal .ui-slider-range-max {
696
+ right: 0;
697
+ }
698
+
699
+ .ui-slider-vertical {
700
+ width: .8em;
701
+ height: 100px;
702
+ }
703
+ .ui-slider-vertical .ui-slider-handle {
704
+ left: -.3em;
705
+ margin-left: 0;
706
+ margin-bottom: -.6em;
707
+ }
708
+ .ui-slider-vertical .ui-slider-range {
709
+ left: 0;
710
+ width: 100%;
711
+ }
712
+ .ui-slider-vertical .ui-slider-range-min {
713
+ bottom: 0;
714
+ }
715
+ .ui-slider-vertical .ui-slider-range-max {
716
+ top: 0;
717
+ }
718
+ .ui-sortable-handle {
719
+ -ms-touch-action: none;
720
+ touch-action: none;
721
+ }
722
+ .ui-spinner {
723
+ position: relative;
724
+ display: inline-block;
725
+ overflow: hidden;
726
+ padding: 0;
727
+ vertical-align: middle;
728
+ }
729
+ .ui-spinner-input {
730
+ border: none;
731
+ background: none;
732
+ color: inherit;
733
+ padding: 0;
734
+ margin: .2em 0;
735
+ vertical-align: middle;
736
+ margin-left: .4em;
737
+ margin-right: 22px;
738
+ }
739
+ .ui-spinner-button {
740
+ width: 16px;
741
+ height: 50%;
742
+ font-size: .5em;
743
+ padding: 0;
744
+ margin: 0;
745
+ text-align: center;
746
+ position: absolute;
747
+ cursor: default;
748
+ display: block;
749
+ overflow: hidden;
750
+ right: 0;
751
+ }
752
+ /* more specificity required here to override default borders */
753
+ .ui-spinner a.ui-spinner-button {
754
+ border-top: none;
755
+ border-bottom: none;
756
+ border-right: none;
757
+ }
758
+ /* vertically center icon */
759
+ .ui-spinner .ui-icon {
760
+ position: absolute;
761
+ margin-top: -8px;
762
+ top: 50%;
763
+ left: 0;
764
+ }
765
+ .ui-spinner-up {
766
+ top: 0;
767
+ }
768
+ .ui-spinner-down {
769
+ bottom: 0;
770
+ }
771
+
772
+ /* TR overrides */
773
+ .ui-spinner .ui-icon-triangle-1-s {
774
+ /* need to fix icons sprite */
775
+ background-position: -65px -16px;
776
+ }
777
+ .ui-tabs {
778
+ position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
779
+ padding: .2em;
780
+ }
781
+ .ui-tabs .ui-tabs-nav {
782
+ margin: 0;
783
+ padding: .2em .2em 0;
784
+ }
785
+ .ui-tabs .ui-tabs-nav li {
786
+ list-style: none;
787
+ float: left;
788
+ position: relative;
789
+ top: 0;
790
+ margin: 1px .2em 0 0;
791
+ border-bottom-width: 0;
792
+ padding: 0;
793
+ white-space: nowrap;
794
+ }
795
+ .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
796
+ float: left;
797
+ padding: .5em 1em;
798
+ text-decoration: none;
799
+ }
800
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
801
+ margin-bottom: -1px;
802
+ padding-bottom: 1px;
803
+ }
804
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
805
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
806
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
807
+ cursor: text;
808
+ }
809
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
810
+ cursor: pointer;
811
+ }
812
+ .ui-tabs .ui-tabs-panel {
813
+ display: block;
814
+ border-width: 0;
815
+ padding: 1em 1.4em;
816
+ background: none;
817
+ }
818
+ .ui-tooltip {
819
+ padding: 8px;
820
+ position: absolute;
821
+ z-index: 9999;
822
+ max-width: 300px;
823
+ -webkit-box-shadow: 0 0 5px #aaa;
824
+ box-shadow: 0 0 5px #aaa;
825
+ }
826
+ body .ui-tooltip {
827
+ border-width: 2px;
828
+ }
829
+
830
+ /* Component containers
831
+ ----------------------------------*/
832
+ .ui-widget {
833
+ font-family: Verdana,Arial,sans-serif;
834
+ font-size: 1.1em;
835
+ }
836
+ .ui-widget .ui-widget {
837
+ font-size: 1em;
838
+ }
839
+ .ui-widget input,
840
+ .ui-widget select,
841
+ .ui-widget textarea,
842
+ .ui-widget button {
843
+ font-family: Verdana,Arial,sans-serif;
844
+ font-size: 1em;
845
+ }
846
+ .ui-widget-content {
847
+ border: 1px solid #aaaaaa;
848
+ background: #ffffff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
849
+ color: #222222;
850
+ }
851
+ .ui-widget-content a {
852
+ color: #222222;
853
+ }
854
+ .ui-widget-header {
855
+ border: 1px solid #aaaaaa;
856
+ background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
857
+ color: #222222;
858
+ font-weight: bold;
859
+ }
860
+ .ui-widget-header a {
861
+ color: #222222;
862
+ }
863
+
864
+ /* Interaction states
865
+ ----------------------------------*/
866
+ .ui-state-default,
867
+ .ui-widget-content .ui-state-default,
868
+ .ui-widget-header .ui-state-default {
869
+ border: 1px solid #d3d3d3;
870
+ background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
871
+ font-weight: normal;
872
+ color: #555555;
873
+ }
874
+ .ui-state-default a,
875
+ .ui-state-default a:link,
876
+ .ui-state-default a:visited {
877
+ color: #555555;
878
+ text-decoration: none;
879
+ }
880
+ .ui-state-hover,
881
+ .ui-widget-content .ui-state-hover,
882
+ .ui-widget-header .ui-state-hover,
883
+ .ui-state-focus,
884
+ .ui-widget-content .ui-state-focus,
885
+ .ui-widget-header .ui-state-focus {
886
+ border: 1px solid #999999;
887
+ background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
888
+ font-weight: normal;
889
+ color: #212121;
890
+ }
891
+ .ui-state-hover a,
892
+ .ui-state-hover a:hover,
893
+ .ui-state-hover a:link,
894
+ .ui-state-hover a:visited,
895
+ .ui-state-focus a,
896
+ .ui-state-focus a:hover,
897
+ .ui-state-focus a:link,
898
+ .ui-state-focus a:visited {
899
+ color: #212121;
900
+ text-decoration: none;
901
+ }
902
+ .ui-state-active,
903
+ .ui-widget-content .ui-state-active,
904
+ .ui-widget-header .ui-state-active {
905
+ border: 1px solid #aaaaaa;
906
+ background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
907
+ font-weight: normal;
908
+ color: #212121;
909
+ }
910
+ .ui-state-active a,
911
+ .ui-state-active a:link,
912
+ .ui-state-active a:visited {
913
+ color: #212121;
914
+ text-decoration: none;
915
+ }
916
+
917
+ /* Interaction Cues
918
+ ----------------------------------*/
919
+ .ui-state-highlight,
920
+ .ui-widget-content .ui-state-highlight,
921
+ .ui-widget-header .ui-state-highlight {
922
+ border: 1px solid #fcefa1;
923
+ background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
924
+ color: #363636;
925
+ }
926
+ .ui-state-highlight a,
927
+ .ui-widget-content .ui-state-highlight a,
928
+ .ui-widget-header .ui-state-highlight a {
929
+ color: #363636;
930
+ }
931
+ .ui-state-error,
932
+ .ui-widget-content .ui-state-error,
933
+ .ui-widget-header .ui-state-error {
934
+ border: 1px solid #cd0a0a;
935
+ background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
936
+ color: #cd0a0a;
937
+ }
938
+ .ui-state-error a,
939
+ .ui-widget-content .ui-state-error a,
940
+ .ui-widget-header .ui-state-error a {
941
+ color: #cd0a0a;
942
+ }
943
+ .ui-state-error-text,
944
+ .ui-widget-content .ui-state-error-text,
945
+ .ui-widget-header .ui-state-error-text {
946
+ color: #cd0a0a;
947
+ }
948
+ .ui-priority-primary,
949
+ .ui-widget-content .ui-priority-primary,
950
+ .ui-widget-header .ui-priority-primary {
951
+ font-weight: bold;
952
+ }
953
+ .ui-priority-secondary,
954
+ .ui-widget-content .ui-priority-secondary,
955
+ .ui-widget-header .ui-priority-secondary {
956
+ opacity: .7;
957
+ filter:Alpha(Opacity=70); /* support: IE8 */
958
+ font-weight: normal;
959
+ }
960
+ .ui-state-disabled,
961
+ .ui-widget-content .ui-state-disabled,
962
+ .ui-widget-header .ui-state-disabled {
963
+ opacity: .35;
964
+ filter:Alpha(Opacity=35); /* support: IE8 */
965
+ background-image: none;
966
+ }
967
+ .ui-state-disabled .ui-icon {
968
+ filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
969
+ }
970
+
971
+ /* Icons
972
+ ----------------------------------*/
973
+
974
+ /* states and images */
975
+ .ui-icon {
976
+ width: 16px;
977
+ height: 16px;
978
+ }
979
+ .ui-icon,
980
+ .ui-widget-content .ui-icon {
981
+ background-image: url("images/ui-icons_222222_256x240.png");
982
+ }
983
+ .ui-widget-header .ui-icon {
984
+ background-image: url("images/ui-icons_222222_256x240.png");
985
+ }
986
+ .ui-state-default .ui-icon {
987
+ background-image: url("images/ui-icons_888888_256x240.png");
988
+ }
989
+ .ui-state-hover .ui-icon,
990
+ .ui-state-focus .ui-icon {
991
+ background-image: url("images/ui-icons_454545_256x240.png");
992
+ }
993
+ .ui-state-active .ui-icon {
994
+ background-image: url("images/ui-icons_454545_256x240.png");
995
+ }
996
+ .ui-state-highlight .ui-icon {
997
+ background-image: url("images/ui-icons_2e83ff_256x240.png");
998
+ }
999
+ .ui-state-error .ui-icon,
1000
+ .ui-state-error-text .ui-icon {
1001
+ background-image: url("images/ui-icons_cd0a0a_256x240.png");
1002
+ }
1003
+
1004
+ /* positioning */
1005
+ .ui-icon-blank { background-position: 16px 16px; }
1006
+ .ui-icon-carat-1-n { background-position: 0 0; }
1007
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
1008
+ .ui-icon-carat-1-e { background-position: -32px 0; }
1009
+ .ui-icon-carat-1-se { background-position: -48px 0; }
1010
+ .ui-icon-carat-1-s { background-position: -64px 0; }
1011
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
1012
+ .ui-icon-carat-1-w { background-position: -96px 0; }
1013
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
1014
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
1015
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
1016
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
1017
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1018
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
1019
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
1020
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
1021
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1022
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
1023
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
1024
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
1025
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
1026
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
1027
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1028
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
1029
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
1030
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
1031
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1032
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
1033
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
1034
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
1035
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
1036
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
1037
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
1038
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
1039
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1040
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1041
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1042
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
1043
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1044
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1045
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
1046
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1047
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1048
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1049
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1050
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1051
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1052
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1053
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1054
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1055
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1056
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1057
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1058
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1059
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1060
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1061
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1062
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1063
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1064
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1065
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1066
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1067
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1068
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1069
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1070
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
1071
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1072
+ .ui-icon-extlink { background-position: -32px -80px; }
1073
+ .ui-icon-newwin { background-position: -48px -80px; }
1074
+ .ui-icon-refresh { background-position: -64px -80px; }
1075
+ .ui-icon-shuffle { background-position: -80px -80px; }
1076
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
1077
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1078
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
1079
+ .ui-icon-folder-open { background-position: -16px -96px; }
1080
+ .ui-icon-document { background-position: -32px -96px; }
1081
+ .ui-icon-document-b { background-position: -48px -96px; }
1082
+ .ui-icon-note { background-position: -64px -96px; }
1083
+ .ui-icon-mail-closed { background-position: -80px -96px; }
1084
+ .ui-icon-mail-open { background-position: -96px -96px; }
1085
+ .ui-icon-suitcase { background-position: -112px -96px; }
1086
+ .ui-icon-comment { background-position: -128px -96px; }
1087
+ .ui-icon-person { background-position: -144px -96px; }
1088
+ .ui-icon-print { background-position: -160px -96px; }
1089
+ .ui-icon-trash { background-position: -176px -96px; }
1090
+ .ui-icon-locked { background-position: -192px -96px; }
1091
+ .ui-icon-unlocked { background-position: -208px -96px; }
1092
+ .ui-icon-bookmark { background-position: -224px -96px; }
1093
+ .ui-icon-tag { background-position: -240px -96px; }
1094
+ .ui-icon-home { background-position: 0 -112px; }
1095
+ .ui-icon-flag { background-position: -16px -112px; }
1096
+ .ui-icon-calendar { background-position: -32px -112px; }
1097
+ .ui-icon-cart { background-position: -48px -112px; }
1098
+ .ui-icon-pencil { background-position: -64px -112px; }
1099
+ .ui-icon-clock { background-position: -80px -112px; }
1100
+ .ui-icon-disk { background-position: -96px -112px; }
1101
+ .ui-icon-calculator { background-position: -112px -112px; }
1102
+ .ui-icon-zoomin { background-position: -128px -112px; }
1103
+ .ui-icon-zoomout { background-position: -144px -112px; }
1104
+ .ui-icon-search { background-position: -160px -112px; }
1105
+ .ui-icon-wrench { background-position: -176px -112px; }
1106
+ .ui-icon-gear { background-position: -192px -112px; }
1107
+ .ui-icon-heart { background-position: -208px -112px; }
1108
+ .ui-icon-star { background-position: -224px -112px; }
1109
+ .ui-icon-link { background-position: -240px -112px; }
1110
+ .ui-icon-cancel { background-position: 0 -128px; }
1111
+ .ui-icon-plus { background-position: -16px -128px; }
1112
+ .ui-icon-plusthick { background-position: -32px -128px; }
1113
+ .ui-icon-minus { background-position: -48px -128px; }
1114
+ .ui-icon-minusthick { background-position: -64px -128px; }
1115
+ .ui-icon-close { background-position: -80px -128px; }
1116
+ .ui-icon-closethick { background-position: -96px -128px; }
1117
+ .ui-icon-key { background-position: -112px -128px; }
1118
+ .ui-icon-lightbulb { background-position: -128px -128px; }
1119
+ .ui-icon-scissors { background-position: -144px -128px; }
1120
+ .ui-icon-clipboard { background-position: -160px -128px; }
1121
+ .ui-icon-copy { background-position: -176px -128px; }
1122
+ .ui-icon-contact { background-position: -192px -128px; }
1123
+ .ui-icon-image { background-position: -208px -128px; }
1124
+ .ui-icon-video { background-position: -224px -128px; }
1125
+ .ui-icon-script { background-position: -240px -128px; }
1126
+ .ui-icon-alert { background-position: 0 -144px; }
1127
+ .ui-icon-info { background-position: -16px -144px; }
1128
+ .ui-icon-notice { background-position: -32px -144px; }
1129
+ .ui-icon-help { background-position: -48px -144px; }
1130
+ .ui-icon-check { background-position: -64px -144px; }
1131
+ .ui-icon-bullet { background-position: -80px -144px; }
1132
+ .ui-icon-radio-on { background-position: -96px -144px; }
1133
+ .ui-icon-radio-off { background-position: -112px -144px; }
1134
+ .ui-icon-pin-w { background-position: -128px -144px; }
1135
+ .ui-icon-pin-s { background-position: -144px -144px; }
1136
+ .ui-icon-play { background-position: 0 -160px; }
1137
+ .ui-icon-pause { background-position: -16px -160px; }
1138
+ .ui-icon-seek-next { background-position: -32px -160px; }
1139
+ .ui-icon-seek-prev { background-position: -48px -160px; }
1140
+ .ui-icon-seek-end { background-position: -64px -160px; }
1141
+ .ui-icon-seek-start { background-position: -80px -160px; }
1142
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1143
+ .ui-icon-seek-first { background-position: -80px -160px; }
1144
+ .ui-icon-stop { background-position: -96px -160px; }
1145
+ .ui-icon-eject { background-position: -112px -160px; }
1146
+ .ui-icon-volume-off { background-position: -128px -160px; }
1147
+ .ui-icon-volume-on { background-position: -144px -160px; }
1148
+ .ui-icon-power { background-position: 0 -176px; }
1149
+ .ui-icon-signal-diag { background-position: -16px -176px; }
1150
+ .ui-icon-signal { background-position: -32px -176px; }
1151
+ .ui-icon-battery-0 { background-position: -48px -176px; }
1152
+ .ui-icon-battery-1 { background-position: -64px -176px; }
1153
+ .ui-icon-battery-2 { background-position: -80px -176px; }
1154
+ .ui-icon-battery-3 { background-position: -96px -176px; }
1155
+ .ui-icon-circle-plus { background-position: 0 -192px; }
1156
+ .ui-icon-circle-minus { background-position: -16px -192px; }
1157
+ .ui-icon-circle-close { background-position: -32px -192px; }
1158
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1159
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1160
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1161
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1162
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1163
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1164
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1165
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1166
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
1167
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
1168
+ .ui-icon-circle-check { background-position: -208px -192px; }
1169
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1170
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1171
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
1172
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1173
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1174
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
1175
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1176
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1177
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1178
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1179
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1180
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1181
+
1182
+
1183
+ /* Misc visuals
1184
+ ----------------------------------*/
1185
+
1186
+ /* Corner radius */
1187
+ .ui-corner-all,
1188
+ .ui-corner-top,
1189
+ .ui-corner-left,
1190
+ .ui-corner-tl {
1191
+ border-top-left-radius: 4px;
1192
+ }
1193
+ .ui-corner-all,
1194
+ .ui-corner-top,
1195
+ .ui-corner-right,
1196
+ .ui-corner-tr {
1197
+ border-top-right-radius: 4px;
1198
+ }
1199
+ .ui-corner-all,
1200
+ .ui-corner-bottom,
1201
+ .ui-corner-left,
1202
+ .ui-corner-bl {
1203
+ border-bottom-left-radius: 4px;
1204
+ }
1205
+ .ui-corner-all,
1206
+ .ui-corner-bottom,
1207
+ .ui-corner-right,
1208
+ .ui-corner-br {
1209
+ border-bottom-right-radius: 4px;
1210
+ }
1211
+
1212
+ /* Overlays */
1213
+ .ui-widget-overlay {
1214
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
1215
+ opacity: .3;
1216
+ filter: Alpha(Opacity=30); /* support: IE8 */
1217
+ }
1218
+ .ui-widget-shadow {
1219
+ margin: -8px 0 0 -8px;
1220
+ padding: 8px;
1221
+ background: #aaaaaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
1222
+ opacity: .3;
1223
+ filter: Alpha(Opacity=30); /* support: IE8 */
1224
+ border-radius: 8px;
1225
+ }
modules/yith-woocommerce-badges-management/class.yith-wcbm-admin.php CHANGED
@@ -209,8 +209,8 @@ if( !class_exists( 'YITH_WCBM_Admin' ) ) {
209
  wp_enqueue_style('wp-color-picker');
210
  wp_enqueue_script('wp-color-picker');
211
  wp_enqueue_script('jquery-ui-tabs');
212
- wp_enqueue_style('jquery-ui-style-css', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/themes/smoothness/jquery-ui.css');
213
- wp_enqueue_style('googleFontsOpenSans', 'http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800,300');
214
 
215
  $screen = get_current_screen();
216
  $metabox_js = defined( 'YITH_WCBM_PREMIUM' ) ? 'metabox_options_premium.js' : 'metabox_options.js';
209
  wp_enqueue_style('wp-color-picker');
210
  wp_enqueue_script('wp-color-picker');
211
  wp_enqueue_script('jquery-ui-tabs');
212
+ wp_enqueue_style( 'jquery-ui-style-css', YITH_WCBM_ASSETS_URL . '/css/jquery-ui.css' );
213
+ wp_enqueue_style( 'googleFontsOpenSans', '//fonts.googleapis.com/css?family=Open+Sans:400,600,700,800,300' );
214
 
215
  $screen = get_current_screen();
216
  $metabox_js = defined( 'YITH_WCBM_PREMIUM' ) ? 'metabox_options_premium.js' : 'metabox_options.js';
modules/yith-woocommerce-badges-management/class.yith-wcbm-frontend.php CHANGED
@@ -81,7 +81,10 @@ if ( !class_exists( 'YITH_WCBM_Frontend' ) ) {
81
  }
82
 
83
  public function add_box_thumb( $thumb, $post_id ) {
84
- if ( !$this->is_in_sidebar() && !is_cart() && !is_checkout() ) {
 
 
 
85
  return self::show_badge_on_product( $thumb, $post_id );
86
  } else {
87
  return $thumb;
@@ -137,13 +140,14 @@ if ( !class_exists( 'YITH_WCBM_Frontend' ) ) {
137
  $hide_on_sale_default = get_option( 'yith-wcbm-hide-on-sale-default' ) == 'yes' ? true : false;
138
 
139
  $product_id = $post->ID;
140
-
141
  $product_id = $this->get_wpml_parent_id( $product_id );
142
 
 
 
143
  $bm_meta = get_post_meta( $product_id, '_yith_wcbm_product_meta', true );
144
  $id_badge = ( isset( $bm_meta[ 'id_badge' ] ) ) ? $bm_meta[ 'id_badge' ] : '';
145
 
146
- if ( $hide_on_sale_default || $id_badge != '' ) {
147
  return '';
148
  }
149
 
@@ -183,8 +187,8 @@ if ( !class_exists( 'YITH_WCBM_Frontend' ) ) {
183
  return $val;
184
 
185
  $product_id = $this->get_wpml_parent_id( $product_id );
186
- $bm_meta = get_post_meta( $product_id, '_yith_wcbm_product_meta', true );
187
- $id_badge = ( isset( $bm_meta[ 'id_badge' ] ) ) ? $bm_meta[ 'id_badge' ] : '';
188
 
189
  if ( empty( $id_badge ) )
190
  return $val;
@@ -205,7 +209,7 @@ if ( !class_exists( 'YITH_WCBM_Frontend' ) ) {
205
 
206
  public function enqueue_scripts() {
207
  wp_enqueue_style( 'yith_wcbm_badge_style', YITH_WCBM_ASSETS_URL . '/css/frontend.css' );
208
- wp_enqueue_style( 'googleFontsOpenSans', 'http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800,300' );
209
  }
210
 
211
  public function get_wpml_parent_id( $id, $post_type = 'product' ) {
81
  }
82
 
83
  public function add_box_thumb( $thumb, $post_id ) {
84
+ $hide_in_sidebar = get_option( 'yith-wcbm-hide-in-sidebar', 'yes' ) == 'yes';
85
+ $show_in_sidebar = !$hide_in_sidebar;
86
+
87
+ if ( ( !$this->is_in_sidebar() || $show_in_sidebar ) && !is_cart() && !is_checkout() ) {
88
  return self::show_badge_on_product( $thumb, $post_id );
89
  } else {
90
  return $thumb;
140
  $hide_on_sale_default = get_option( 'yith-wcbm-hide-on-sale-default' ) == 'yes' ? true : false;
141
 
142
  $product_id = $post->ID;
 
143
  $product_id = $this->get_wpml_parent_id( $product_id );
144
 
145
+ $badge_overrides_default_on_sale = get_option( 'yith-wcbm-product-badge-overrides-default-on-sale', 'yes' ) == 'yes';
146
+
147
  $bm_meta = get_post_meta( $product_id, '_yith_wcbm_product_meta', true );
148
  $id_badge = ( isset( $bm_meta[ 'id_badge' ] ) ) ? $bm_meta[ 'id_badge' ] : '';
149
 
150
+ if ( $hide_on_sale_default || ( $id_badge != '' && $badge_overrides_default_on_sale ) ) {
151
  return '';
152
  }
153
 
187
  return $val;
188
 
189
  $product_id = $this->get_wpml_parent_id( $product_id );
190
+ $bm_meta = get_post_meta( $product_id, '_yith_wcbm_product_meta', true );
191
+ $id_badge = ( isset( $bm_meta[ 'id_badge' ] ) ) ? $bm_meta[ 'id_badge' ] : '';
192
 
193
  if ( empty( $id_badge ) )
194
  return $val;
209
 
210
  public function enqueue_scripts() {
211
  wp_enqueue_style( 'yith_wcbm_badge_style', YITH_WCBM_ASSETS_URL . '/css/frontend.css' );
212
+ wp_enqueue_style( 'googleFontsOpenSans', '//fonts.googleapis.com/css?family=Open+Sans:400,600,700,800,300' );
213
  }
214
 
215
  public function get_wpml_parent_id( $id, $post_type = 'product' ) {
modules/yith-woocommerce-badges-management/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Badge Management
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-badges-management/
5
  * Description: YITH WooCommerce Badge Management allows you to create custom badge for every product.
6
- * Version: 1.2.3
7
  * Author: YIThemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-wcbm
@@ -11,7 +11,7 @@
11
  *
12
  * @author Yithemes
13
  * @package YITH WooCommerce Badge Management
14
- * @version 1.2.3
15
  */
16
  /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -61,7 +61,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
61
 
62
 
63
  if ( ! defined( 'YITH_WCBM_VERSION' ) ){
64
- define( 'YITH_WCBM_VERSION', '1.2.3' );
65
  }
66
 
67
  if ( ! defined( 'YITH_WCBM_FREE_INIT' ) ) {
@@ -121,4 +121,4 @@ function yith_wcbm_install() {
121
  do_action( 'yith_wcbm_init' );
122
  }
123
  }
124
- add_action( 'plugins_loaded', 'yith_wcbm_install', 11 );
3
  * Plugin Name: YITH WooCommerce Badge Management
4
  * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-badges-management/
5
  * Description: YITH WooCommerce Badge Management allows you to create custom badge for every product.
6
+ * Version: 1.2.6
7
  * Author: YIThemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-wcbm
11
  *
12
  * @author Yithemes
13
  * @package YITH WooCommerce Badge Management
14
+ * @version 1.2.6
15
  */
16
  /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
61
 
62
 
63
  if ( ! defined( 'YITH_WCBM_VERSION' ) ){
64
+ define( 'YITH_WCBM_VERSION', '1.2.6' );
65
  }
66
 
67
  if ( ! defined( 'YITH_WCBM_FREE_INIT' ) ) {
121
  do_action( 'yith_wcbm_init' );
122
  }
123
  }
124
+ add_action( 'plugins_loaded', 'yith_wcbm_install', 11 );
modules/yith-woocommerce-badges-management/languages/yith-wcbm.pot CHANGED
@@ -1,10 +1,11 @@
1
  # Copyright (C) 2015 YIThemes
2
  # This file is distributed under the same license as the YITH Plugin Starter package.
 
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: YITH WooCommerce Badge Management\n"
6
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
7
- "POT-Creation-Date: 2015-06-19 17:17+0100\n"
8
  "PO-Revision-Date: 2015-06-19 17:17+0100\n"
9
  "Last-Translator: \n"
10
  "Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
@@ -12,13 +13,13 @@ msgstr ""
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.7.6\n"
16
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
17
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
18
  "esc_html_x:1,2c\n"
19
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
  "X-Poedit-SourceCharset: UTF-8\n"
21
- "X-Poedit-Basepath: ../\n"
22
  "X-Textdomain-Support: yes\n"
23
  "X-Poedit-SearchPath-0: .\n"
24
  "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
@@ -77,15 +78,15 @@ msgstr ""
77
  msgid "Badge Options"
78
  msgstr ""
79
 
80
- #: class.yith-wcbm-admin.php:306
81
  msgid "Product Badge"
82
  msgstr ""
83
 
84
- #: class.yith-wcbm-admin.php:324
85
  msgid "Select Badge"
86
  msgstr ""
87
 
88
- #: class.yith-wcbm-admin.php:326
89
  msgid "none"
90
  msgstr ""
91
 
@@ -121,8 +122,7 @@ msgstr ""
121
  msgid "Size (pixel)"
122
  msgstr ""
123
 
124
- #: functions.yith-wcbm.php:88
125
- #: plugin-fw/templates/metaboxes/types/contactform.php:222
126
  #: plugin-fw/templates/metaboxes/types/contactform.php:409
127
  msgid "Width"
128
  msgstr ""
@@ -162,7 +162,7 @@ msgstr ""
162
  #: init.php:43
163
  msgid ""
164
  "YITH WooCommerce Badge Management is enabled but not effective. It requires "
165
- "Woocommerce in order to work."
166
  msgstr ""
167
 
168
  #: init.php:52
@@ -280,7 +280,8 @@ msgid "Type"
280
  msgstr ""
281
 
282
  #: plugin-fw/lib/yit-cpt-unlimited.php:1052
283
- msgid "Layout for this "
 
284
  msgstr ""
285
 
286
  #: plugin-fw/lib/yit-cpt-unlimited.php:1058
@@ -360,10 +361,10 @@ msgid "Add %s from images"
360
  msgstr ""
361
 
362
  #: plugin-fw/lib/yit-cpt-unlimited.php:1633
363
- msgid "Add with multiupload"
364
  msgstr ""
365
 
366
- #: plugin-fw/lib/yit-plugin-panel-wc.php:295
367
  msgid "The changes you have made will be lost if you leave this page."
368
  msgstr ""
369
 
@@ -375,62 +376,62 @@ msgstr ""
375
  msgid "YIT Plugins"
376
  msgstr ""
377
 
378
- #: plugin-fw/lib/yit-plugin-panel.php:293 plugin-fw/lib/yit-plugin-subpanel.php:143
379
  #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:5
380
  msgid "Save Changes"
381
  msgstr ""
382
 
383
- #: plugin-fw/lib/yit-plugin-panel.php:296
384
  #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:8
385
  msgid "If you continue with this action, you will reset all options in this page."
386
  msgstr ""
387
 
388
- #: plugin-fw/lib/yit-plugin-panel.php:298 plugin-fw/lib/yit-plugin-subpanel.php:148
389
- msgid "Reset to Default"
390
  msgstr ""
391
 
392
- #: plugin-fw/lib/yit-plugin-panel.php:298 plugin-fw/lib/yit-plugin-subpanel.php:148
393
- #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:10
394
  msgid "Are you sure?"
395
  msgstr ""
396
 
397
- #: plugin-fw/lib/yit-plugin-panel.php:432
398
  msgid "The element you have entered already exists. Please, enter another name."
399
  msgstr ""
400
 
401
- #: plugin-fw/lib/yit-plugin-panel.php:433
402
  msgid "Settings saved"
403
  msgstr ""
404
 
405
- #: plugin-fw/lib/yit-plugin-panel.php:434
406
  msgid "Settings reset"
407
  msgstr ""
408
 
409
- #: plugin-fw/lib/yit-plugin-panel.php:435
410
  msgid "Element deleted correctly."
411
  msgstr ""
412
 
413
- #: plugin-fw/lib/yit-plugin-panel.php:436 plugin-fw/lib/yit-plugin-panel.php:437
414
  msgid "Element updated correctly."
415
  msgstr ""
416
 
417
- #: plugin-fw/lib/yit-plugin-panel.php:438
418
  msgid "Database imported correctly."
419
  msgstr ""
420
 
421
- #: plugin-fw/lib/yit-plugin-panel.php:439
422
  msgid "An error has occurred during import. Please try again."
423
  msgstr ""
424
 
425
- #: plugin-fw/lib/yit-plugin-panel.php:440
426
  msgid "The added file is not valid."
427
  msgstr ""
428
 
429
- #: plugin-fw/lib/yit-plugin-panel.php:441
430
  msgid "Sorry, import is disabled."
431
  msgstr ""
432
 
433
- #: plugin-fw/lib/yit-plugin-panel.php:442
434
  msgid "Sorting successful."
435
  msgstr ""
436
 
@@ -493,26 +494,26 @@ msgstr ""
493
  msgid "Update now."
494
  msgstr ""
495
 
496
- #: plugin-fw/lib/yit-upgrade.php:230
497
  msgid "Yithemes Repository"
498
  msgstr ""
499
 
500
- #: plugin-fw/lib/yit-upgrade.php:264
501
  msgid "Invalid URL Provided."
502
  msgstr ""
503
 
504
- #: plugin-fw/lib/yit-upgrade.php:277
505
  msgid "Could not create Temporary file."
506
  msgstr ""
507
 
508
- #: plugin-fw/lib/yit-upgrade.php:419
509
  #, php-format
510
  msgid ""
511
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
512
  "changelog-button\" title=\"%3$s\">View version %4$s details</a>."
513
  msgstr ""
514
 
515
- #: plugin-fw/lib/yit-upgrade.php:421
516
  #, php-format
517
  msgid ""
518
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -521,16 +522,16 @@ msgid ""
521
  "updates.</em>"
522
  msgstr ""
523
 
524
- #: plugin-fw/lib/yit-upgrade.php:423
525
  #, php-format
526
  msgid ""
527
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
528
  "changelog-button\" title=\"%3$s\">View version %4$s details</a>. <em>Automatic "
529
- "update is unavailable for this plugin, please <a href=\"%5$s\" title=\"Licence "
530
  "activation\">activate</a> your copy of %6s.</em>"
531
  msgstr ""
532
 
533
- #: plugin-fw/lib/yit-upgrade.php:425
534
  #, php-format
535
  msgid ""
536
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
@@ -538,175 +539,215 @@ msgid ""
538
  "\">update now</a>."
539
  msgstr ""
540
 
541
- #: plugin-fw/lib/yit-upgrade.php:498
542
  msgid "You can't update the plugins for this site."
543
  msgstr ""
544
 
545
- #: plugin-fw/lib/yit-upgrade.php:502
546
  msgid "You do not have sufficient permissions to update the plugins for this site."
547
  msgstr ""
548
 
549
- #: plugin-fw/lib/yit-upgrade.php:509
550
  msgid "Update Plugin"
551
  msgstr ""
552
 
553
- #: plugin-fw/licence/lib/yit-licence.php:161
554
  #, php-format
555
  msgctxt "%s = field name"
556
  msgid "%s field cannot be empty"
557
  msgstr ""
558
 
559
- #: plugin-fw/licence/lib/yit-licence.php:162
560
  #, php-format
561
  msgid "%s and %s fields cannot be empty"
562
  msgstr ""
563
 
564
- #: plugin-fw/licence/lib/yit-licence.php:163
565
  msgid "Unable to contact the remote server, please try again later. Thanks!"
566
  msgstr ""
567
 
568
- #: plugin-fw/licence/lib/yit-licence.php:548
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
  msgid "Invalid Request"
570
  msgstr ""
571
 
572
- #: plugin-fw/licence/lib/yit-licence.php:549
573
- msgid "Invalid licence key"
574
  msgstr ""
575
 
576
- #: plugin-fw/licence/lib/yit-licence.php:550
577
  msgid "Software has been deactivated"
578
  msgstr ""
579
 
580
- #: plugin-fw/licence/lib/yit-licence.php:551
581
  msgid "Maximum number of activations exceeded"
582
  msgstr ""
583
 
584
- #: plugin-fw/licence/lib/yit-licence.php:552
585
  msgid "Invalid instance ID"
586
  msgstr ""
587
 
588
- #: plugin-fw/licence/lib/yit-licence.php:553
589
  msgid "Invalid security key"
590
  msgstr ""
591
 
592
- #: plugin-fw/licence/lib/yit-licence.php:554
593
- msgid "Licence key has expired"
 
 
 
 
 
 
 
 
 
 
 
 
594
  msgstr ""
595
 
596
- #: plugin-fw/licence/lib/yit-licence.php:555
597
- msgid "Licence key has been banned"
 
 
 
 
598
  msgstr ""
599
 
600
  #: plugin-fw/licence/lib/yit-plugin-licence.php:68
601
  #: plugin-fw/licence/lib/yit-plugin-licence.php:69
602
- #: plugin-fw/licence/lib/yit-theme-licence.php:64
603
- #: plugin-fw/licence/lib/yit-theme-licence.php:65
604
- #: plugin-fw/licence/lib/yit-theme-licence.php:107
605
- #: plugin-fw/licence/lib/yit-theme-licence.php:108
606
- msgid "Licence Activation"
607
  msgstr ""
608
 
609
- #: plugin-fw/licence/lib/yit-theme-licence.php:115
610
- #: plugin-fw/licence/lib/yit-theme-licence.php:116
611
  #, php-format
612
  msgid "%s"
613
  msgstr ""
614
 
615
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:19
616
- msgid "Yithemes Licence Activation"
617
- msgstr ""
618
-
619
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:23
620
  msgid ""
621
  "I cannot find the license key for activating the theme I have bought some time "
622
  "ago. Where can I find it?"
623
  msgstr ""
624
 
625
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:26
626
  msgid ""
627
  "If you have purchased one of our products before 27 January 2015, you can benefit "
628
  "from support and updates (the services offered with the license)\n"
629
- " until 27 January 2016 and you do not have to purchase it again to get "
630
- "a new license key, because, before this date, your license used to be activated "
631
- "automatically by our system.\n"
632
- " After 27 January 2016, instead, if you want to benefit from support "
633
- "and updates you have to buy a new license and activate it through the license key "
634
- "you will be\n"
635
- " provided with and that you can find in your YIThemes account, in "
636
- "section \"My licenses\"."
 
 
 
 
637
  msgstr ""
638
 
639
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:37
640
  msgid ""
641
  "Have you updated your licenses? Have you asked for an extension? Update "
642
  "information concerning your products."
643
  msgstr ""
644
 
645
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:39
646
- msgid "Update licence information"
647
  msgstr ""
648
 
649
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:49
650
- msgid "Products to be activated"
651
- msgstr ""
 
 
652
 
653
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:68
654
  msgid "Activate"
655
  msgstr ""
656
 
657
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:87
658
  msgid "Activated"
659
  msgstr ""
660
 
661
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:91
662
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:123
663
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:147
664
  msgid "Product Name"
665
  msgstr ""
666
 
667
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:92
668
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:124
669
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:148
670
- #: plugin-fw/templates/metaboxes/types/contactform.php:148
671
- #: plugin-fw/templates/metaboxes/types/contactform.php:340
672
- msgid "Email"
673
- msgstr ""
674
-
675
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:93
676
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:125
677
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:149
678
- msgid "Licence Key"
679
- msgstr ""
680
-
681
  #: plugin-fw/licence/templates/panel/activation/activation-panel.php:94
682
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:150
683
  msgid "Expires"
684
  msgstr ""
685
 
686
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:95
687
  msgid "Remaining"
688
  msgstr ""
689
 
690
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:96
691
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:109
692
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:151
693
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:161
694
- msgid "Renew"
695
  msgstr ""
696
 
697
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:107
 
 
 
 
698
  #, php-format
699
  msgid "%1s out of %2s"
700
  msgstr ""
701
 
702
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:119
 
 
 
 
 
 
 
 
 
 
703
  msgid "Banned"
704
  msgstr ""
705
 
706
- #: plugin-fw/licence/templates/panel/activation/activation-panel.php:143
707
  msgid "Expired"
708
  msgstr ""
709
 
 
 
 
 
710
  #: plugin-fw/templates/metaboxes/types/ajax-products.php:23
711
  msgid "Search for a product"
712
  msgstr ""
@@ -900,7 +941,7 @@ msgstr ""
900
  #: plugin-fw/templates/metaboxes/types/select-icon.php:33
901
  #: plugin-fw/templates/metaboxes/types/upload.php:21
902
  #: plugin-fw/templates/panel/types/upload.php:31
903
- #: plugin-fw/templates/panel/woocommerce/woocommerce-upload.php:35
904
  msgid "Upload"
905
  msgstr ""
906
 
@@ -1064,7 +1105,7 @@ msgstr ""
1064
  msgid "Italic bold"
1065
  msgstr ""
1066
 
1067
- #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:10
1068
  msgid "Reset Defaults"
1069
  msgstr ""
1070
 
@@ -1079,3 +1120,21 @@ msgstr ""
1079
  #: plugin-options/settings-options.php:18
1080
  msgid "Select to hide the default Woocommerce \"On sale\" badge."
1081
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Copyright (C) 2015 YIThemes
2
  # This file is distributed under the same license as the YITH Plugin Starter package.
3
+ #, fuzzy
4
  msgid ""
5
  msgstr ""
6
  "Project-Id-Version: YITH WooCommerce Badge Management\n"
7
  "Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
8
+ "POT-Creation-Date: 2015-12-18 11:17+0100\n"
9
  "PO-Revision-Date: 2015-06-19 17:17+0100\n"
10
  "Last-Translator: \n"
11
  "Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
13
  "MIME-Version: 1.0\n"
14
  "Content-Type: text/plain; charset=UTF-8\n"
15
  "Content-Transfer-Encoding: 8bit\n"
16
+ "X-Generator: Poedit 1.8.4\n"
17
  "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
18
  "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
19
  "esc_html_x:1,2c\n"
20
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21
  "X-Poedit-SourceCharset: UTF-8\n"
22
+ "X-Poedit-Basepath: ..\n"
23
  "X-Textdomain-Support: yes\n"
24
  "X-Poedit-SearchPath-0: .\n"
25
  "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
78
  msgid "Badge Options"
79
  msgstr ""
80
 
81
+ #: class.yith-wcbm-admin.php:311
82
  msgid "Product Badge"
83
  msgstr ""
84
 
85
+ #: class.yith-wcbm-admin.php:329
86
  msgid "Select Badge"
87
  msgstr ""
88
 
89
+ #: class.yith-wcbm-admin.php:331
90
  msgid "none"
91
  msgstr ""
92
 
122
  msgid "Size (pixel)"
123
  msgstr ""
124
 
125
+ #: functions.yith-wcbm.php:88 plugin-fw/templates/metaboxes/types/contactform.php:222
 
126
  #: plugin-fw/templates/metaboxes/types/contactform.php:409
127
  msgid "Width"
128
  msgstr ""
162
  #: init.php:43
163
  msgid ""
164
  "YITH WooCommerce Badge Management is enabled but not effective. It requires "
165
+ "WooCommerce in order to work."
166
  msgstr ""
167
 
168
  #: init.php:52
280
  msgstr ""
281
 
282
  #: plugin-fw/lib/yit-cpt-unlimited.php:1052
283
+ #, php-format
284
+ msgid "Layout for this %s"
285
  msgstr ""
286
 
287
  #: plugin-fw/lib/yit-cpt-unlimited.php:1058
361
  msgstr ""
362
 
363
  #: plugin-fw/lib/yit-cpt-unlimited.php:1633
364
+ msgid "Upload multiple files"
365
  msgstr ""
366
 
367
+ #: plugin-fw/lib/yit-plugin-panel-wc.php:336
368
  msgid "The changes you have made will be lost if you leave this page."
369
  msgstr ""
370
 
376
  msgid "YIT Plugins"
377
  msgstr ""
378
 
379
+ #: plugin-fw/lib/yit-plugin-panel.php:288 plugin-fw/lib/yit-plugin-subpanel.php:143
380
  #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:5
381
  msgid "Save Changes"
382
  msgstr ""
383
 
384
+ #: plugin-fw/lib/yit-plugin-panel.php:291
385
  #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:8
386
  msgid "If you continue with this action, you will reset all options in this page."
387
  msgstr ""
388
 
389
+ #: plugin-fw/lib/yit-plugin-panel.php:293 plugin-fw/lib/yit-plugin-subpanel.php:148
390
+ msgid "Reset to default"
391
  msgstr ""
392
 
393
+ #: plugin-fw/lib/yit-plugin-panel.php:293 plugin-fw/lib/yit-plugin-subpanel.php:148
394
+ #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:11
395
  msgid "Are you sure?"
396
  msgstr ""
397
 
398
+ #: plugin-fw/lib/yit-plugin-panel.php:427
399
  msgid "The element you have entered already exists. Please, enter another name."
400
  msgstr ""
401
 
402
+ #: plugin-fw/lib/yit-plugin-panel.php:428
403
  msgid "Settings saved"
404
  msgstr ""
405
 
406
+ #: plugin-fw/lib/yit-plugin-panel.php:429
407
  msgid "Settings reset"
408
  msgstr ""
409
 
410
+ #: plugin-fw/lib/yit-plugin-panel.php:430
411
  msgid "Element deleted correctly."
412
  msgstr ""
413
 
414
+ #: plugin-fw/lib/yit-plugin-panel.php:431 plugin-fw/lib/yit-plugin-panel.php:432
415
  msgid "Element updated correctly."
416
  msgstr ""
417
 
418
+ #: plugin-fw/lib/yit-plugin-panel.php:433
419
  msgid "Database imported correctly."
420
  msgstr ""
421
 
422
+ #: plugin-fw/lib/yit-plugin-panel.php:434
423
  msgid "An error has occurred during import. Please try again."
424
  msgstr ""
425
 
426
+ #: plugin-fw/lib/yit-plugin-panel.php:435
427
  msgid "The added file is not valid."
428
  msgstr ""
429
 
430
+ #: plugin-fw/lib/yit-plugin-panel.php:436
431
  msgid "Sorry, import is disabled."
432
  msgstr ""
433
 
434
+ #: plugin-fw/lib/yit-plugin-panel.php:437
435
  msgid "Sorting successful."
436
  msgstr ""
437
 
494
  msgid "Update now."
495
  msgstr ""
496
 
497
+ #: plugin-fw/lib/yit-upgrade.php:250
498
  msgid "Yithemes Repository"
499
  msgstr ""
500
 
501
+ #: plugin-fw/lib/yit-upgrade.php:284
502
  msgid "Invalid URL Provided."
503
  msgstr ""
504
 
505
+ #: plugin-fw/lib/yit-upgrade.php:297
506
  msgid "Could not create Temporary file."
507
  msgstr ""
508
 
509
+ #: plugin-fw/lib/yit-upgrade.php:439
510
  #, php-format
511
  msgid ""
512
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
513
  "changelog-button\" title=\"%3$s\">View version %4$s details</a>."
514
  msgstr ""
515
 
516
+ #: plugin-fw/lib/yit-upgrade.php:441
517
  #, php-format
518
  msgid ""
519
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
522
  "updates.</em>"
523
  msgstr ""
524
 
525
+ #: plugin-fw/lib/yit-upgrade.php:443
526
  #, php-format
527
  msgid ""
528
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
529
  "changelog-button\" title=\"%3$s\">View version %4$s details</a>. <em>Automatic "
530
+ "update is unavailable for this plugin, please <a href=\"%5$s\" title=\"License "
531
  "activation\">activate</a> your copy of %6s.</em>"
532
  msgstr ""
533
 
534
+ #: plugin-fw/lib/yit-upgrade.php:445
535
  #, php-format
536
  msgid ""
537
  "There is a new version of %1$s available. <a href=\"%2$s\" class=\"thickbox yit-"
539
  "\">update now</a>."
540
  msgstr ""
541
 
542
+ #: plugin-fw/lib/yit-upgrade.php:518
543
  msgid "You can't update the plugins for this site."
544
  msgstr ""
545
 
546
+ #: plugin-fw/lib/yit-upgrade.php:522
547
  msgid "You do not have sufficient permissions to update the plugins for this site."
548
  msgstr ""
549
 
550
+ #: plugin-fw/lib/yit-upgrade.php:529
551
  msgid "Update Plugin"
552
  msgstr ""
553
 
554
+ #: plugin-fw/licence/lib/yit-licence.php:178
555
  #, php-format
556
  msgctxt "%s = field name"
557
  msgid "%s field cannot be empty"
558
  msgstr ""
559
 
560
+ #: plugin-fw/licence/lib/yit-licence.php:179
561
  #, php-format
562
  msgid "%s and %s fields cannot be empty"
563
  msgstr ""
564
 
565
+ #: plugin-fw/licence/lib/yit-licence.php:180
566
  msgid "Unable to contact the remote server, please try again later. Thanks!"
567
  msgstr ""
568
 
569
+ #: plugin-fw/licence/lib/yit-licence.php:181
570
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:90
571
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:168
572
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:199
573
+ #: plugin-fw/templates/metaboxes/types/contactform.php:148
574
+ #: plugin-fw/templates/metaboxes/types/contactform.php:340
575
+ msgid "Email"
576
+ msgstr ""
577
+
578
+ #: plugin-fw/licence/lib/yit-licence.php:182
579
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:91
580
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:169
581
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:200
582
+ msgid "License Key"
583
+ msgstr ""
584
+
585
+ #: plugin-fw/licence/lib/yit-licence.php:183
586
+ msgid "Are you sure you want to deactivate the license for current site?"
587
+ msgstr ""
588
+
589
+ #: plugin-fw/licence/lib/yit-licence.php:646
590
  msgid "Invalid Request"
591
  msgstr ""
592
 
593
+ #: plugin-fw/licence/lib/yit-licence.php:647
594
+ msgid "Invalid license key"
595
  msgstr ""
596
 
597
+ #: plugin-fw/licence/lib/yit-licence.php:648
598
  msgid "Software has been deactivated"
599
  msgstr ""
600
 
601
+ #: plugin-fw/licence/lib/yit-licence.php:649
602
  msgid "Maximum number of activations exceeded"
603
  msgstr ""
604
 
605
+ #: plugin-fw/licence/lib/yit-licence.php:650
606
  msgid "Invalid instance ID"
607
  msgstr ""
608
 
609
+ #: plugin-fw/licence/lib/yit-licence.php:651
610
  msgid "Invalid security key"
611
  msgstr ""
612
 
613
+ #: plugin-fw/licence/lib/yit-licence.php:652
614
+ msgid "License key has expired"
615
+ msgstr ""
616
+
617
+ #: plugin-fw/licence/lib/yit-licence.php:653
618
+ msgid "License key has been banned"
619
+ msgstr ""
620
+
621
+ #: plugin-fw/licence/lib/yit-licence.php:654
622
+ msgid "Current product is not included with your membership key"
623
+ msgstr ""
624
+
625
+ #: plugin-fw/licence/lib/yit-licence.php:655
626
+ msgid "Great"
627
  msgstr ""
628
 
629
+ #: plugin-fw/licence/lib/yit-licence.php:655
630
+ msgid "License successfully activated"
631
+ msgstr ""
632
+
633
+ #: plugin-fw/licence/lib/yit-licence.php:656
634
+ msgid "License key deactivated for website"
635
  msgstr ""
636
 
637
  #: plugin-fw/licence/lib/yit-plugin-licence.php:68
638
  #: plugin-fw/licence/lib/yit-plugin-licence.php:69
639
+ #: plugin-fw/licence/lib/yit-theme-licence.php:70
640
+ #: plugin-fw/licence/lib/yit-theme-licence.php:71
641
+ #: plugin-fw/licence/lib/yit-theme-licence.php:110
642
+ #: plugin-fw/licence/lib/yit-theme-licence.php:111
643
+ msgid "License Activation"
644
  msgstr ""
645
 
646
+ #: plugin-fw/licence/lib/yit-theme-licence.php:118
647
+ #: plugin-fw/licence/lib/yit-theme-licence.php:119
648
  #, php-format
649
  msgid "%s"
650
  msgstr ""
651
 
652
+ #: plugin-fw/licence/lib/yit-theme-licence.php:160
 
 
 
 
653
  msgid ""
654
  "I cannot find the license key for activating the theme I have bought some time "
655
  "ago. Where can I find it?"
656
  msgstr ""
657
 
658
+ #: plugin-fw/licence/lib/yit-theme-licence.php:163
659
  msgid ""
660
  "If you have purchased one of our products before 27 January 2015, you can benefit "
661
  "from support and updates (the services offered with the license)\n"
662
+ " until 27 January 2016 and you do not have to purchase it again "
663
+ "to get a new license key, because, before this date, your license used to be "
664
+ "activated automatically by our system.\n"
665
+ " After 27 January 2016, instead, if you want to benefit from "
666
+ "support and updates you have to buy a new license and activate it through the "
667
+ "license key you will be\n"
668
+ " provided with and that you can find in your YIThemes account, "
669
+ "in section \"My licenses\"."
670
+ msgstr ""
671
+
672
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:23
673
+ msgid "Yithemes License Activation"
674
  msgstr ""
675
 
676
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:29
677
  msgid ""
678
  "Have you updated your licenses? Have you asked for an extension? Update "
679
  "information concerning your products."
680
  msgstr ""
681
 
682
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:31
683
+ msgid "Update license information"
684
  msgstr ""
685
 
686
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:44
687
+ msgid "Product to activate"
688
+ msgid_plural "Products to activate"
689
+ msgstr[0] ""
690
+ msgstr[1] ""
691
 
692
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:63
693
  msgid "Activate"
694
  msgstr ""
695
 
696
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:82
697
  msgid "Activated"
698
  msgstr ""
699
 
700
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:88
701
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:166
702
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:196
703
  msgid "Product Name"
704
  msgstr ""
705
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  #: plugin-fw/licence/templates/panel/activation/activation-panel.php:94
707
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:203
708
  msgid "Expires"
709
  msgstr ""
710
 
711
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:97
712
  msgid "Remaining"
713
  msgstr ""
714
 
715
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:99
716
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:227
717
+ msgid "Membership"
 
 
718
  msgstr ""
719
 
720
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:103
721
+ msgid "License Actions"
722
+ msgstr ""
723
+
724
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:128
725
  #, php-format
726
  msgid "%1s out of %2s"
727
  msgstr ""
728
 
729
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:144
730
+ msgid "Deactivate"
731
+ msgstr ""
732
+
733
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:149
734
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:206
735
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:227
736
+ msgid "Renew"
737
+ msgstr ""
738
+
739
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:162
740
  msgid "Banned"
741
  msgstr ""
742
 
743
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:192
744
  msgid "Expired"
745
  msgstr ""
746
 
747
+ #: plugin-fw/licence/templates/panel/activation/activation-panel.php:227
748
+ msgid "License"
749
+ msgstr ""
750
+
751
  #: plugin-fw/templates/metaboxes/types/ajax-products.php:23
752
  msgid "Search for a product"
753
  msgstr ""
941
  #: plugin-fw/templates/metaboxes/types/select-icon.php:33
942
  #: plugin-fw/templates/metaboxes/types/upload.php:21
943
  #: plugin-fw/templates/panel/types/upload.php:31
944
+ #: plugin-fw/templates/panel/woocommerce/woocommerce-upload.php:40
945
  msgid "Upload"
946
  msgstr ""
947
 
1105
  msgid "Italic bold"
1106
  msgstr ""
1107
 
1108
+ #: plugin-fw/templates/panel/woocommerce/woocommerce-form.php:11
1109
  msgid "Reset Defaults"
1110
  msgstr ""
1111
 
1120
  #: plugin-options/settings-options.php:18
1121
  msgid "Select to hide the default Woocommerce \"On sale\" badge."
1122
  msgstr ""
1123
+
1124
+ #: plugin-options/settings-options.php:24
1125
+ msgid "Hide in sidebars"
1126
+ msgstr ""
1127
+
1128
+ #: plugin-options/settings-options.php:26
1129
+ msgid "Select to hide the badges in sidebars and widgets."
1130
+ msgstr ""
1131
+
1132
+ #: plugin-options/settings-options.php:32
1133
+ msgid "Product Badge overrides default on sale badge"
1134
+ msgstr ""
1135
+
1136
+ #: plugin-options/settings-options.php:34
1137
+ msgid ""
1138
+ "Select if you want to hide WooCommerce default \"On Sale\" badge when the product "
1139
+ "has another badge"
1140
+ msgstr ""
modules/yith-woocommerce-badges-management/plugin-options/settings-options.php CHANGED
@@ -2,28 +2,44 @@
2
 
3
  $settings = array(
4
 
5
- 'settings' => array(
6
-
7
- 'general-options' => array(
8
- 'title' => __( 'General Options', 'yith-wcbm' ),
9
- 'type' => 'title',
10
- 'desc' => '',
11
- 'id' => 'yith-wcbm-general-options'
12
- ),
13
-
14
- 'hide-on-sale-default-badge' => array(
15
- 'id' => 'yith-wcbm-hide-on-sale-default',
16
- 'name' => __( 'Hide "On sale" badge', 'yith-wcbm' ),
17
- 'type' => 'checkbox',
18
- 'desc' => __( 'Select to hide the default Woocommerce "On sale" badge.', 'yith-wcbm' ),
19
- 'default' => 'no'
20
- ),
21
-
22
- 'general-options-end' => array(
23
- 'type' => 'sectionend',
24
- 'id' => 'yith-wcqv-general-options'
25
- )
26
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  );
28
 
29
  return apply_filters( 'yith_wcbm_panel_settings_options', $settings );
2
 
3
  $settings = array(
4
 
5
+ 'settings' => array(
6
+
7
+ 'general-options' => array(
8
+ 'title' => __( 'General Options', 'yith-wcbm' ),
9
+ 'type' => 'title',
10
+ 'desc' => '',
11
+ 'id' => 'yith-wcbm-general-options'
12
+ ),
13
+
14
+ 'hide-on-sale-default-badge' => array(
15
+ 'id' => 'yith-wcbm-hide-on-sale-default',
16
+ 'name' => __( 'Hide "On sale" badge', 'yith-wcbm' ),
17
+ 'type' => 'checkbox',
18
+ 'desc' => __( 'Select to hide the default Woocommerce "On sale" badge.', 'yith-wcbm' ),
19
+ 'default' => 'no'
20
+ ),
21
+
22
+ 'hide-in-sidebar' => array(
23
+ 'id' => 'yith-wcbm-hide-in-sidebar',
24
+ 'name' => __( 'Hide in sidebars', 'yith-wcbm' ),
25
+ 'type' => 'checkbox',
26
+ 'desc' => __( 'Select to hide the badges in sidebars and widgets.', 'yith-wcbm' ),
27
+ 'default' => 'yes'
28
+ ),
29
+
30
+ 'product-badge-overrides-default-on-sale' => array(
31
+ 'id' => 'yith-wcbm-product-badge-overrides-default-on-sale',
32
+ 'name' => __( 'Product Badge overrides default on sale badge', 'yith-wcbm' ),
33
+ 'type' => 'checkbox',
34
+ 'desc' => __( 'Select if you want to hide WooCommerce default "On Sale" badge when the product has another badge', 'yith-wcbm' ),
35
+ 'default' => 'yes'
36
+ ),
37
+
38
+ 'general-options-end' => array(
39
+ 'type' => 'sectionend',
40
+ 'id' => 'yith-wcbm-general-options'
41
+ )
42
+ )
43
  );
44
 
45
  return apply_filters( 'yith_wcbm_panel_settings_options', $settings );
modules/yith-woocommerce-catalog-mode/assets/css/yith-catalog-mode.css CHANGED
@@ -1,3 +1,3 @@
1
- .widget.woocommerce.widget_shopping_cart{
2
- display: none !important;
3
  }
1
+ .widget.woocommerce.widget_shopping_cart{
2
+ display: none !important;
3
  }
modules/yith-woocommerce-catalog-mode/class.yith-woocommerce-catalog-mode.php CHANGED
@@ -1,736 +1,792 @@
1
- <?php
2
-
3
- if ( !defined( 'ABSPATH' ) ) {
4
- exit;
5
- } // Exit if accessed directly
6
-
7
- /**
8
- * Implements features of YITH WooCommerce Catalog Mode plugin
9
- *
10
- * @class YITH_WC_Catalog_Mode
11
- * @package Yithemes
12
- * @since 1.0.0
13
- * @author Your Inspiration Themes
14
- */
15
- class YITH_WC_Catalog_Mode {
16
-
17
- /**
18
- * Panel object
19
- *
20
- * @var /Yit_Plugin_Panel object
21
- * @since 1.0.0
22
- * @see plugin-fw/lib/yit-plugin-panel.php
23
- */
24
- protected $_panel;
25
-
26
- /**
27
- * @var $_premium string Premium tab template file name
28
- */
29
- protected $_premium = 'premium.php';
30
-
31
- /**
32
- * @var string Premium version landing link
33
- */
34
- protected $_premium_landing = 'http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/';
35
-
36
- /**
37
- * @var string Plugin official documentation
38
- */
39
- protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith-woocommerce-catalog-mode/';
40
-
41
- /**
42
- * @var string Yith WooCommerce Catalog Mode panel page
43
- */
44
- protected $_panel_page = 'yith_wc_catalog_mode_panel';
45
-
46
- /**
47
- * Constructor
48
- *
49
- * Initialize plugin and registers actions and filters to be used
50
- *
51
- * @since 1.0.0
52
- * @return mixed
53
- * @author Alberto Ruggiero
54
- */
55
- public function __construct() {
56
- if ( !function_exists( 'WC' ) ) {
57
- return;
58
- }
59
-
60
- // Load Plugin Framework
61
- add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 12 );
62
-
63
- //Add action links
64
- add_filter( 'plugin_action_links_' . plugin_basename( YWCTM_DIR . '/' . basename( YWCTM_FILE ) ), array( $this, 'action_links' ) );
65
- add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
66
-
67
- // Add stylesheets and scripts files
68
- add_action( 'admin_menu', array( $this, 'add_menu_page' ), 5 );
69
- add_action( 'yith_catalog_mode_premium', array( $this, 'premium_tab' ) );
70
-
71
- if ( get_option( 'ywctm_enable_plugin' ) == 'yes' ) {
72
-
73
- if ( $this->check_user_admin_enable() ) {
74
-
75
- if ( !is_admin() || $this->is_quick_view() ) {
76
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
77
-
78
- $priority = has_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ) );
79
- remove_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ), $priority );
80
-
81
- }
82
-
83
- add_action( 'wp', array( $this, 'check_pages_redirect' ) );
84
- add_action( 'get_pages', array( $this, 'hide_cart_checkout_pages' ) );
85
- add_action( 'woocommerce_single_product_summary', array( $this, 'hide_add_to_cart_single' ), 10 );
86
- add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'hide_add_to_cart_loop' ), 5 );
87
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
88
-
89
- add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'avoid_add_to_cart' ), 10, 2 );
90
-
91
- }
92
-
93
- }
94
-
95
- }
96
-
97
- }
98
-
99
- /**
100
- * ADMIN FUNCTIONS
101
- */
102
-
103
- /**
104
- * Add a panel under YITH Plugins tab
105
- *
106
- * @since 1.0.0
107
- * @return void
108
- * @author Alberto Ruggiero
109
- * @use /Yit_Plugin_Panel class
110
- * @see plugin-fw/lib/yit-plugin-panel.php
111
- */
112
- public function add_menu_page() {
113
-
114
- if ( !empty( $this->_panel ) ) {
115
- return;
116
- }
117
-
118
- $admin_tabs = array();
119
-
120
- if ( defined( 'YWCTM_PREMIUM' ) ) {
121
- $admin_tabs['premium-settings'] = __( 'Settings', 'yith-woocommerce-catalog-mode' );
122
- $admin_tabs['exclusions'] = __( 'Exclusion List', 'yith-woocommerce-catalog-mode' );
123
- $admin_tabs['custom-url'] = __( 'Custom Button Url List', 'yith-woocommerce-catalog-mode' );
124
- }
125
- else {
126
- $admin_tabs['settings'] = __( 'Settings', 'yith-woocommerce-catalog-mode' );
127
- $admin_tabs['premium-landing'] = __( 'Premium Version', 'yith-woocommerce-catalog-mode' );
128
- }
129
-
130
- $args = array(
131
- 'create_menu_page' => true,
132
- 'parent_slug' => '',
133
- 'page_title' => __( 'Catalog Mode', 'yith-woocommerce-catalog-mode' ),
134
- 'menu_title' => __( 'Catalog Mode', 'yith-woocommerce-catalog-mode' ),
135
- 'capability' => 'manage_options',
136
- 'parent' => '',
137
- 'parent_page' => 'yit_plugin_panel',
138
- 'page' => $this->_panel_page,
139
- 'admin-tabs' => $admin_tabs,
140
- 'options-path' => YWCTM_DIR . '/plugin-options'
141
- );
142
-
143
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
144
- }
145
-
146
- /**
147
- * FRONTEND FUNCTIONS
148
- */
149
-
150
- /**
151
- * Check if catalog mode is enabled for administrator
152
- *
153
- * @since 1.0.2
154
- * @return bool
155
- * @author Alberto Ruggiero
156
- */
157
- public function check_user_admin_enable() {
158
-
159
- return !( current_user_can( 'administrator' ) && is_user_logged_in() && get_option( 'ywctm_admin_view' ) == 'no' );
160
-
161
- }
162
-
163
- /**
164
- * Checks if "Cart & Checkout pages" needs to be hidden
165
- *
166
- * @since 1.0.2
167
- * @return bool
168
- * @author Alberto Ruggiero
169
- */
170
- public function check_hide_cart_checkout_pages() {
171
-
172
- return get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() && get_option( 'ywctm_hide_cart_header' ) == 'yes';
173
-
174
- }
175
-
176
- /**
177
- * Hides "Add to cart" button from single product page
178
- *
179
- * @since 1.0.0
180
- *
181
- * @param $action
182
- *
183
- * @return void
184
- * @author Alberto Ruggiero
185
- */
186
- public function hide_add_to_cart_single( $action = '' ) {
187
-
188
- if ( $action == '' ) {
189
- $action = 'woocommerce_single_product_summary';
190
- }
191
-
192
- $priority = has_action( $action, 'woocommerce_template_single_add_to_cart' );
193
-
194
- if ( $this->check_add_to_cart_single( $priority ) ) {
195
-
196
- add_action( 'woocommerce_before_add_to_cart_button', array( $this, 'hide_add_to_cart_quick_view' ), 10 );
197
-
198
- }
199
-
200
- }
201
-
202
- /**
203
- * Hide add to cart button in quick view
204
- *
205
- * @since 1.0.7
206
- * @return mixed
207
- * @author Francesco Licandro
208
- */
209
- public function hide_add_to_cart_quick_view() {
210
-
211
- $hide_variations = get_option( 'ywctm_hide_variations' );
212
- ob_start();
213
- ?>
214
- <style>
215
- form.cart button.single_add_to_cart_button <?php if ( $hide_variations == 'yes' ): ?>,
216
- .single_variation_wrap .variations_button <?php endif; ?> {
217
- display: none !important;
218
- }
219
-
220
- <?php if( ! class_exists( 'YITH_YWRAQ_Frontend' ) ) : ?>
221
- form.cart .quantity {
222
- display: none !important;
223
- }
224
-
225
- <?php endif; ?>
226
- </style>
227
- <?php
228
- echo ob_get_clean();
229
-
230
- }
231
-
232
- /**
233
- * Check if price is hidden to hide add to cart button
234
- *
235
- * @since 1.0.4
236
- *
237
- * @param $post_id
238
- *
239
- * @return bool
240
- * @author Alberto Ruggiero
241
- */
242
- public function check_price_hidden( $post_id ) {
243
-
244
- $hide = false;
245
-
246
- if ( get_option( 'ywctm_hide_price' ) == 'yes' ) {
247
-
248
- $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
249
- $user_logged = is_user_logged_in();
250
-
251
- if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
252
-
253
- $exclude_catalog = get_post_meta( $post_id, '_ywctm_exclude_hide_price', true );
254
- $enable_exclusion = get_option( 'ywctm_exclude_hide_price' );
255
-
256
- if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
257
-
258
- $hide = true;
259
-
260
- }
261
- else {
262
-
263
- if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
264
-
265
- $hide = true;
266
-
267
- }
268
-
269
- }
270
-
271
- $reverse_criteria = get_option( 'ywctm_exclude_hide_price_reverse' );
272
-
273
- if ( $reverse_criteria == 'yes' ) {
274
-
275
- $hide = !$hide;
276
-
277
- }
278
-
279
- }
280
-
281
- }
282
-
283
- return $hide;
284
-
285
- }
286
-
287
- /**
288
- * Checks if "Add to cart" needs to be hidden
289
- *
290
- * @since 1.0.2
291
- *
292
- * @param $priority
293
- * @param $product_id
294
- *
295
- * @return bool
296
- * @author Alberto Ruggiero
297
- */
298
- public function check_add_to_cart_single( $priority = true, $product_id = false ) {
299
-
300
- $hide = false;
301
-
302
- if ( get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() ) {
303
-
304
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
305
-
306
- $hide = true;
307
-
308
- }
309
- else {
310
-
311
- global $post;
312
-
313
- if ( !$product_id && !isset( $post ) ) {
314
- return false;
315
- }
316
-
317
- $post_id = ( $product_id ) ? $product_id : $post->ID;
318
-
319
- if ( get_option( 'ywctm_hide_add_to_cart_single' ) == 'yes' ) {
320
-
321
- $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
322
- $user_logged = is_user_logged_in();
323
-
324
- if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
325
-
326
- $exclude_catalog = get_post_meta( $post_id, '_ywctm_exclude_catalog_mode', true );
327
- $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
328
-
329
- if ( $priority ) {
330
-
331
- if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
332
-
333
- $hide = true;
334
-
335
- }
336
- else {
337
-
338
- if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
339
-
340
- $hide = true;
341
-
342
- }
343
-
344
- }
345
-
346
- }
347
-
348
- $reverse_criteria = get_option( 'ywctm_exclude_hide_add_to_cart_reverse' );
349
-
350
- if ( $reverse_criteria == 'yes' ) {
351
-
352
- $hide = !$hide;
353
-
354
- }
355
-
356
- }
357
-
358
- }
359
-
360
- if ( $this->check_price_hidden( $post_id ) ) {
361
-
362
- $hide = true;
363
-
364
- }
365
-
366
- }
367
-
368
- }
369
-
370
- return $hide;
371
- }
372
-
373
- /**
374
- * Checks if "Add to cart" needs to be avoided
375
- *
376
- * @since 1.0.5
377
- *
378
- * @param $passed
379
- * @param $product_id
380
- *
381
- * @return bool
382
- * @author Alberto Ruggiero
383
- */
384
- public function avoid_add_to_cart( $passed, $product_id ) {
385
-
386
- if ( get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() ) {
387
-
388
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
389
-
390
- $passed = false;
391
-
392
- }
393
- else {
394
-
395
- if ( get_option( 'ywctm_hide_add_to_cart_single' ) == 'yes' ) {
396
-
397
- $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
398
- $user_logged = is_user_logged_in();
399
-
400
- if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
401
-
402
- $exclude_catalog = get_post_meta( $product_id, '_ywctm_exclude_catalog_mode', true );
403
- $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
404
-
405
- if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
406
-
407
- $passed = false;
408
-
409
- }
410
- else {
411
-
412
- if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
413
-
414
- $passed = false;
415
-
416
- }
417
-
418
- }
419
-
420
- $reverse_criteria = get_option( 'ywctm_exclude_hide_add_to_cart_reverse' );
421
-
422
- if ( $reverse_criteria == 'yes' ) {
423
-
424
- $passed = !$passed;
425
-
426
- }
427
-
428
- }
429
-
430
- }
431
-
432
- if ( $this->check_price_hidden( $product_id ) ) {
433
-
434
- $passed = false;
435
-
436
- }
437
-
438
- }
439
-
440
- }
441
-
442
- return $passed;
443
- }
444
-
445
- /**
446
- * Checks if "Add to cart" needs to be hidden from loop page
447
- *
448
- * @since 1.0.6
449
- * @return bool
450
- * @author Alberto Ruggiero
451
- */
452
- public function check_hide_add_cart_loop() {
453
-
454
- $remove = false;
455
-
456
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
457
-
458
- $remove = true;
459
-
460
- }
461
- else {
462
-
463
- global $post;
464
-
465
- if ( get_option( 'ywctm_hide_add_to_cart_loop' ) == 'yes' ) {
466
-
467
- $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
468
- $user_logged = is_user_logged_in();
469
-
470
- if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
471
-
472
- $exclude_catalog = get_post_meta( $post->ID, '_ywctm_exclude_catalog_mode', true );
473
- $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
474
-
475
- if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
476
-
477
- $remove = true;
478
-
479
- }
480
- else {
481
-
482
- if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
483
-
484
- $remove = true;
485
-
486
- }
487
- else {
488
-
489
- $remove = false;
490
-
491
- }
492
-
493
- }
494
-
495
- $reverse_criteria = get_option( 'ywctm_exclude_hide_add_to_cart_reverse' );
496
-
497
- if ( $reverse_criteria == 'yes' ) {
498
-
499
- $remove = !$remove;
500
-
501
- }
502
-
503
- }
504
-
505
- }
506
-
507
- if ( $this->check_price_hidden( $post->ID ) ) {
508
-
509
- $remove = true;
510
-
511
- }
512
-
513
- $product = wc_get_product( $post );
514
-
515
- if ( $product->product_type == 'variable' ) {
516
-
517
- $remove = false;
518
-
519
- }
520
-
521
- }
522
-
523
- return $remove;
524
- }
525
-
526
- /**
527
- * Hides "Add to cart" button, if not excluded, from loop page
528
- *
529
- * @since 1.0.0
530
- * @return void
531
- * @author Alberto Ruggiero
532
- */
533
- public function hide_add_to_cart_loop() {
534
-
535
- if ( $this->check_hide_add_cart_loop() ) {
536
-
537
- remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
538
- add_filter( 'woocommerce_loop_add_to_cart_link', '__return_empty_string', 10 );
539
-
540
- }
541
- else {
542
-
543
- add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
544
- remove_filter( 'woocommerce_loop_add_to_cart_link', '__return_empty_string', 10 );
545
-
546
- }
547
-
548
- }
549
-
550
- /**
551
- * Enqueue css file
552
- *
553
- * @since 1.0.0
554
- * @return void
555
- * @author Alberto Ruggiero
556
- */
557
- public function enqueue_styles() {
558
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
559
- wp_enqueue_style( 'ywctm-style', YWCTM_ASSETS_URL . '/css/yith-catalog-mode.css' );
560
- }
561
-
562
- }
563
-
564
- /**
565
- * Avoid Cart and Checkout Pages to be visited
566
- *
567
- * @since 1.0.4
568
- * @return void
569
- * @author Alberto Ruggiero
570
- */
571
- public function check_pages_redirect() {
572
-
573
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
574
-
575
- $cart = is_page( wc_get_page_id( 'cart' ) );
576
- $checkout = is_page( wc_get_page_id( 'checkout' ) );
577
-
578
- wp_reset_query();
579
-
580
- if ( $cart || $checkout ) {
581
-
582
- wp_redirect( home_url() );
583
- exit;
584
-
585
- }
586
-
587
- }
588
-
589
- }
590
-
591
- /**
592
- * Removes Cart and checkout pages from menu
593
- *
594
- * @since 1.0.4
595
- *
596
- * @param $pages
597
- *
598
- * @return mixed
599
- * @author Alberto Ruggiero
600
- */
601
- public function hide_cart_checkout_pages( $pages ) {
602
-
603
- if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
604
-
605
- $excluded_pages = array(
606
- wc_get_page_id( 'cart' ),
607
- wc_get_page_id( 'checkout' )
608
- );
609
-
610
- for ( $i = 0; $i < count( $pages ); $i ++ ) {
611
- $page = &$pages[$i];
612
-
613
- if ( in_array( $page->ID, $excluded_pages ) ) {
614
-
615
- unset( $pages[$i] );
616
-
617
- }
618
-
619
- }
620
-
621
- }
622
-
623
- return $pages;
624
-
625
- }
626
-
627
- /**
628
- * Say if the code is execute by quick view
629
- *
630
- * @since 1.0.7
631
- * @return bool
632
- * @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
633
- */
634
- public function is_quick_view() {
635
- return defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) && ( $_REQUEST['action'] == 'yith_load_product_quick_view' || $_REQUEST['action'] == 'yit_load_product_quick_view' );
636
- }
637
-
638
- /**
639
- * YITH FRAMEWORK
640
- */
641
-
642
- /**
643
- * Load plugin framework
644
- *
645
- * @since 1.0.0
646
- * @return void
647
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
648
- */
649
- public function plugin_fw_loader() {
650
- if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
651
- global $plugin_fw_data;
652
- if( ! empty( $plugin_fw_data ) ){
653
- $plugin_fw_file = array_shift( $plugin_fw_data );
654
- require_once( $plugin_fw_file );
655
- }
656
- }
657
- }
658
-
659
- /**
660
- * Premium Tab Template
661
- *
662
- * Load the premium tab template on admin page
663
- *
664
- * @since 1.0.0
665
- * @return void
666
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
667
- */
668
- public function premium_tab() {
669
- $premium_tab_template = YWCTM_TEMPLATE_PATH . '/admin/' . $this->_premium;
670
- if ( file_exists( $premium_tab_template ) ) {
671
- include_once( $premium_tab_template );
672
- }
673
- }
674
-
675
- /**
676
- * Get the premium landing uri
677
- *
678
- * @since 1.0.0
679
- * @return string The premium landing link
680
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
681
- */
682
- public function get_premium_landing_uri() {
683
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
684
- }
685
-
686
- /**
687
- * Action Links
688
- *
689
- * add the action links to plugin admin page
690
- * @since 1.0.0
691
- *
692
- * @param $links | links plugin array
693
- *
694
- * @return mixed
695
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
696
- * @use plugin_action_links_{$plugin_file_name}
697
- */
698
- public function action_links( $links ) {
699
-
700
- $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-catalog-mode' ) . '</a>';
701
-
702
- if ( defined( 'YWCTM_FREE_INIT' ) ) {
703
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-catalog-mode' ) . '</a>';
704
- }
705
-
706
- return $links;
707
- }
708
-
709
- /**
710
- * Plugin row meta
711
- *
712
- * add the action links to plugin admin page
713
- *
714
- * @since 1.0.0
715
- *
716
- * @param $plugin_meta
717
- * @param $plugin_file
718
- * @param $plugin_data
719
- * @param $status
720
- *
721
- * @return Array
722
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
723
- * @use plugin_row_meta
724
- */
725
- public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
726
- if ( ( defined( 'YWCTM_INIT' ) && ( YWCTM_INIT == $plugin_file ) ) ||
727
- ( defined( 'YWCTM_FREE_INIT' ) && ( YWCTM_FREE_INIT == $plugin_file ) )
728
- ) {
729
-
730
- $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-catalog-mode' ) . '</a>';
731
- }
732
-
733
- return $plugin_meta;
734
- }
735
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  }
1
+ <?php
2
+
3
+ if ( !defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ /**
8
+ * Implements features of YITH WooCommerce Catalog Mode plugin
9
+ *
10
+ * @class YITH_WC_Catalog_Mode
11
+ * @package Yithemes
12
+ * @since 1.0.0
13
+ * @author Your Inspiration Themes
14
+ */
15
+ class YITH_WC_Catalog_Mode {
16
+
17
+ /**
18
+ * Panel object
19
+ *
20
+ * @var /Yit_Plugin_Panel object
21
+ * @since 1.0.0
22
+ * @see plugin-fw/lib/yit-plugin-panel.php
23
+ */
24
+ protected $_panel;
25
+
26
+ /**
27
+ * @var $_premium string Premium tab template file name
28
+ */
29
+ protected $_premium = 'premium.php';
30
+
31
+ /**
32
+ * @var string Premium version landing link
33
+ */
34
+ protected $_premium_landing = 'http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/';
35
+
36
+ /**
37
+ * @var string Plugin official documentation
38
+ */
39
+ protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith-woocommerce-catalog-mode/';
40
+
41
+ /**
42
+ * @var string Yith WooCommerce Catalog Mode panel page
43
+ */
44
+ protected $_panel_page = 'yith_wc_catalog_mode_panel';
45
+
46
+ /**
47
+ * Constructor
48
+ *
49
+ * Initialize plugin and registers actions and filters to be used
50
+ *
51
+ * @since 1.0.0
52
+ * @return mixed
53
+ * @author Alberto Ruggiero
54
+ */
55
+ public function __construct() {
56
+ if ( !function_exists( 'WC' ) ) {
57
+ return;
58
+ }
59
+
60
+ // Load Plugin Framework
61
+ add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 12 );
62
+
63
+ //Add action links
64
+ add_filter( 'plugin_action_links_' . plugin_basename( YWCTM_DIR . '/' . basename( YWCTM_FILE ) ), array( $this, 'action_links' ) );
65
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
66
+
67
+ // Add stylesheets and scripts files
68
+ add_action( 'admin_menu', array( $this, 'add_menu_page' ), 5 );
69
+ add_action( 'yith_catalog_mode_premium', array( $this, 'premium_tab' ) );
70
+
71
+ if ( get_option( 'ywctm_enable_plugin' ) == 'yes' ) {
72
+
73
+ if ( $this->check_user_admin_enable() ) {
74
+
75
+ if ( !is_admin() || $this->is_quick_view() ) {
76
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
77
+
78
+ $priority = has_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ) );
79
+ remove_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ), $priority );
80
+
81
+ }
82
+
83
+ add_action( 'wp', array( $this, 'check_pages_redirect' ) );
84
+ add_action( 'get_pages', array( $this, 'hide_cart_checkout_pages' ) );
85
+ add_action( 'woocommerce_single_product_summary', array( $this, 'hide_add_to_cart_single' ), 10 );
86
+ add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'hide_add_to_cart_loop' ), 5 );
87
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
88
+
89
+ add_filter( 'woocommerce_add_to_cart_validation', array( $this, 'avoid_add_to_cart' ), 10, 2 );
90
+
91
+ if ( defined( 'YITH_WCWL' ) && YITH_WCWL ) {
92
+ add_filter( 'woocommerce_loop_add_to_cart_link', array( $this, 'hide_add_to_cart_wishlist' ), 10, 2 );
93
+
94
+ }
95
+
96
+ }
97
+
98
+ }
99
+
100
+ }
101
+
102
+ }
103
+
104
+ /**
105
+ * ADMIN FUNCTIONS
106
+ */
107
+
108
+ /**
109
+ * Add a panel under YITH Plugins tab
110
+ *
111
+ * @since 1.0.0
112
+ * @return void
113
+ * @author Alberto Ruggiero
114
+ * @use /Yit_Plugin_Panel class
115
+ * @see plugin-fw/lib/yit-plugin-panel.php
116
+ */
117
+ public function add_menu_page() {
118
+
119
+ if ( !empty( $this->_panel ) ) {
120
+ return;
121
+ }
122
+
123
+ $admin_tabs = array();
124
+
125
+ if ( defined( 'YWCTM_PREMIUM' ) ) {
126
+ $admin_tabs['premium-settings'] = __( 'Settings', 'yith-woocommerce-catalog-mode' );
127
+ $admin_tabs['exclusions'] = __( 'Exclusion List', 'yith-woocommerce-catalog-mode' );
128
+ $admin_tabs['custom-url'] = __( 'Custom Button Url List', 'yith-woocommerce-catalog-mode' );
129
+ }
130
+ else {
131
+ $admin_tabs['settings'] = __( 'Settings', 'yith-woocommerce-catalog-mode' );
132
+ $admin_tabs['premium-landing'] = __( 'Premium Version', 'yith-woocommerce-catalog-mode' );
133
+ }
134
+
135
+ $args = array(
136
+ 'create_menu_page' => true,
137
+ 'parent_slug' => '',
138
+ 'page_title' => __( 'Catalog Mode', 'yith-woocommerce-catalog-mode' ),
139
+ 'menu_title' => __( 'Catalog Mode', 'yith-woocommerce-catalog-mode' ),
140
+ 'capability' => 'manage_options',
141
+ 'parent' => '',
142
+ 'parent_page' => 'yit_plugin_panel',
143
+ 'page' => $this->_panel_page,
144
+ 'admin-tabs' => $admin_tabs,
145
+ 'options-path' => YWCTM_DIR . '/plugin-options'
146
+ );
147
+
148
+ $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
149
+ }
150
+
151
+ /**
152
+ * FRONTEND FUNCTIONS
153
+ */
154
+
155
+ /**
156
+ * Check if catalog mode is enabled for administrator
157
+ *
158
+ * @since 1.0.2
159
+ * @return bool
160
+ * @author Alberto Ruggiero
161
+ */
162
+ public function check_user_admin_enable() {
163
+
164
+ return !( current_user_can( 'administrator' ) && is_user_logged_in() && get_option( 'ywctm_admin_view' ) == 'no' );
165
+
166
+ }
167
+
168
+ /**
169
+ * Checks if "Cart & Checkout pages" needs to be hidden
170
+ *
171
+ * @since 1.0.2
172
+ * @return bool
173
+ * @author Alberto Ruggiero
174
+ */
175
+ public function check_hide_cart_checkout_pages() {
176
+
177
+ return get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() && get_option( 'ywctm_hide_cart_header' ) == 'yes';
178
+
179
+ }
180
+
181
+ /**
182
+ * Hides "Add to cart" button from single product page
183
+ *
184
+ * @since 1.0.0
185
+ *
186
+ * @param $action
187
+ *
188
+ * @return void
189
+ * @author Alberto Ruggiero
190
+ */
191
+ public function hide_add_to_cart_single( $action = '' ) {
192
+
193
+ if ( $action == '' ) {
194
+ $action = 'woocommerce_single_product_summary';
195
+ }
196
+
197
+ $priority = has_action( $action, 'woocommerce_template_single_add_to_cart' );
198
+
199
+ if ( $this->check_add_to_cart_single( $priority ) ) {
200
+
201
+ add_action( 'woocommerce_before_add_to_cart_button', array( $this, 'hide_add_to_cart_quick_view' ), 10 );
202
+
203
+ }
204
+
205
+ }
206
+
207
+ /**
208
+ * Hide add to cart button in quick view
209
+ *
210
+ * @since 1.0.7
211
+ * @return mixed
212
+ * @author Francesco Licandro
213
+ */
214
+ public function hide_add_to_cart_quick_view() {
215
+
216
+ $hide_variations = get_option( 'ywctm_hide_variations' );
217
+ ob_start();
218
+
219
+ $args = array(
220
+ 'form.cart button.single_add_to_cart_button'
221
+ );
222
+
223
+ if ( !class_exists( 'YITH_YWRAQ_Frontend' ) ) {
224
+
225
+ $args[] = 'form.cart .quantity';
226
+
227
+ }
228
+
229
+ if ( $hide_variations == 'yes' ) {
230
+
231
+ $args[] = 'table.variations';
232
+ $args[] = 'form.variations_form';
233
+ $args[] = '.single_variation_wrap .variations_button';
234
+
235
+ }
236
+
237
+ $classes = implode( ', ', apply_filters( 'ywctm_catalog_classes', $args ) );
238
+
239
+ ?>
240
+ <style>
241
+
242
+ <?php echo $classes; ?>
243
+ {
244
+ display: none !important
245
+ }
246
+
247
+ </style>
248
+ <?php
249
+ echo ob_get_clean();
250
+
251
+ }
252
+
253
+ /**
254
+ * Check if price is hidden to hide add to cart button
255
+ *
256
+ * @since 1.0.4
257
+ *
258
+ * @param $post_id
259
+ *
260
+ * @return bool
261
+ * @author Alberto Ruggiero
262
+ */
263
+ public function check_price_hidden( $post_id ) {
264
+
265
+ $hide = false;
266
+
267
+ if ( get_option( 'ywctm_hide_price' ) == 'yes' ) {
268
+
269
+ $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
270
+ $user_logged = is_user_logged_in();
271
+
272
+ if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
273
+
274
+ $exclude_catalog = get_post_meta( $post_id, '_ywctm_exclude_hide_price', true );
275
+ $enable_exclusion = get_option( 'ywctm_exclude_hide_price' );
276
+
277
+ if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
278
+
279
+ $hide = true;
280
+
281
+ }
282
+ else {
283
+
284
+ if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
285
+
286
+ $hide = true;
287
+
288
+ }
289
+
290
+ }
291
+
292
+ $reverse_criteria = get_option( 'ywctm_exclude_hide_price_reverse' );
293
+
294
+ if ( $reverse_criteria == 'yes' ) {
295
+
296
+ $hide = !$hide;
297
+
298
+ }
299
+
300
+ }
301
+
302
+ }
303
+
304
+ return $hide;
305
+
306
+ }
307
+
308
+ /**
309
+ * Checks if "Add to cart" needs to be hidden
310
+ *
311
+ * @since 1.0.2
312
+ *
313
+ * @param $priority
314
+ * @param $product_id
315
+ *
316
+ * @return bool
317
+ * @author Alberto Ruggiero
318
+ */
319
+ public function check_add_to_cart_single( $priority = true, $product_id = false ) {
320
+
321
+ $hide = false;
322
+
323
+ if ( get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() ) {
324
+
325
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
326
+
327
+ $hide = true;
328
+
329
+ }
330
+ else {
331
+
332
+ global $post;
333
+
334
+ if ( !$product_id && !isset( $post ) ) {
335
+ return false;
336
+ }
337
+
338
+ $post_id = ( $product_id ) ? $product_id : $post->ID;
339
+
340
+ if ( get_option( 'ywctm_hide_add_to_cart_single' ) == 'yes' ) {
341
+
342
+ $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
343
+ $user_logged = is_user_logged_in();
344
+
345
+ if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
346
+
347
+ $exclude_catalog = get_post_meta( $post_id, '_ywctm_exclude_catalog_mode', true );
348
+ $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
349
+
350
+ if ( $priority ) {
351
+
352
+ if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
353
+
354
+ $hide = true;
355
+
356
+ }
357
+ else {
358
+
359
+ if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
360
+
361
+ $hide = true;
362
+
363
+ }
364
+
365
+ }
366
+
367
+ }
368
+
369
+ $reverse_criteria = get_option( 'ywctm_exclude_hide_add_to_cart_reverse' );
370
+
371
+ if ( $reverse_criteria == 'yes' ) {
372
+
373
+ $hide = !$hide;
374
+
375
+ }
376
+
377
+ }
378
+
379
+ }
380
+
381
+ if ( $this->check_price_hidden( $post_id ) ) {
382
+
383
+ $hide = true;
384
+
385
+ }
386
+
387
+ }
388
+
389
+ }
390
+
391
+ return $hide;
392
+ }
393
+
394
+ /**
395
+ * Checks if "Add to cart" needs to be avoided
396
+ *
397
+ * @since 1.0.5
398
+ *
399
+ * @param $passed
400
+ * @param $product_id
401
+ *
402
+ * @return bool
403
+ * @author Alberto Ruggiero
404
+ */
405
+ public function avoid_add_to_cart( $passed, $product_id ) {
406
+
407
+ if ( get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() ) {
408
+
409
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
410
+
411
+ $passed = false;
412
+
413
+ }
414
+ else {
415
+
416
+ if ( get_option( 'ywctm_hide_add_to_cart_single' ) == 'yes' ) {
417
+
418
+ $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
419
+ $user_logged = is_user_logged_in();
420
+
421
+ if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
422
+
423
+ $exclude_catalog = get_post_meta( $product_id, '_ywctm_exclude_catalog_mode', true );
424
+ $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
425
+
426
+ if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
427
+
428
+ $passed = false;
429
+
430
+ }
431
+ else {
432
+
433
+ if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
434
+
435
+ $passed = false;
436
+
437
+ }
438
+
439
+ }
440
+
441
+ $reverse_criteria = get_option( 'ywctm_exclude_hide_add_to_cart_reverse' );
442
+
443
+ if ( $reverse_criteria == 'yes' ) {
444
+
445
+ $passed = !$passed;
446
+
447
+ }
448
+
449
+ }
450
+
451
+ }
452
+
453
+ if ( $this->check_price_hidden( $product_id ) ) {
454
+
455
+ $passed = false;
456
+
457
+ }
458
+
459
+ }
460
+
461
+ }
462
+
463
+ return $passed;
464
+ }
465
+
466
+ /**
467
+ * Checks if "Add to cart" needs to be hidden from loop page
468
+ *
469
+ * @since 1.0.6
470
+ * @return bool
471
+ * @author Alberto Ruggiero
472
+ */
473
+ public function check_hide_add_cart_loop() {
474
+
475
+ $remove = false;
476
+
477
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
478
+
479
+ $remove = true;
480
+
481
+ }
482
+ else {
483
+
484
+ global $post;
485
+
486
+ if ( get_option( 'ywctm_hide_add_to_cart_loop' ) == 'yes' ) {
487
+
488
+ $ywctm_hide_price_users = ( get_option( 'ywctm_hide_price_users' ) != 'unregistered' ) ? true : false;
489
+ $user_logged = is_user_logged_in();
490
+
491
+ if ( !( !$ywctm_hide_price_users && $user_logged ) ) {
492
+
493
+ $exclude_catalog = get_post_meta( $post->ID, '_ywctm_exclude_catalog_mode', true );
494
+ $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
495
+
496
+ if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
497
+
498
+ $remove = true;
499
+
500
+ }
501
+ else {
502
+
503
+ if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
504
+
505
+ $remove = true;
506
+
507
+ }
508
+ else {
509
+
510
+ $remove = false;
511
+
512
+ }
513
+
514
+ }
515
+
516
+ $product = wc_get_product( $post );
517
+
518
+ if ( $product->product_type == 'variable' ) {
519
+
520
+ if ( get_option( 'ywctm_hide_variations' ) == 'yes' ) {
521
+
522
+ $remove = true;
523
+
524
+ }
525
+ else {
526
+
527
+ $remove = false;
528
+
529
+ }
530
+
531
+ }
532
+
533
+ $reverse_criteria = get_option( 'ywctm_exclude_hide_add_to_cart_reverse' );
534
+
535
+ if ( $reverse_criteria == 'yes' ) {
536
+
537
+ $remove = !$remove;
538
+
539
+ }
540
+
541
+ }
542
+
543
+ }
544
+
545
+ if ( $this->check_price_hidden( $post->ID ) ) {
546
+
547
+ $remove = true;
548
+
549
+ }
550
+
551
+
552
+ }
553
+
554
+ return $remove;
555
+ }
556
+
557
+ /**
558
+ * Hides "Add to cart" button, if not excluded, from loop page
559
+ *
560
+ * @since 1.0.0
561
+ * @return void
562
+ * @author Alberto Ruggiero
563
+ */
564
+ public function hide_add_to_cart_loop() {
565
+
566
+ if ( $this->check_hide_add_cart_loop() ) {
567
+
568
+ remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
569
+ add_filter( 'woocommerce_loop_add_to_cart_link', '__return_empty_string', 10 );
570
+
571
+ }
572
+ else {
573
+
574
+ add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
575
+ remove_filter( 'woocommerce_loop_add_to_cart_link', '__return_empty_string', 10 );
576
+
577
+ }
578
+
579
+ }
580
+
581
+ /**
582
+ * Enqueue css file
583
+ *
584
+ * @since 1.0.0
585
+ * @return void
586
+ * @author Alberto Ruggiero
587
+ */
588
+ public function enqueue_styles() {
589
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
590
+ wp_enqueue_style( 'ywctm-style', YWCTM_ASSETS_URL . '/css/yith-catalog-mode.css' );
591
+ }
592
+
593
+ }
594
+
595
+ /**
596
+ * Avoid Cart and Checkout Pages to be visited
597
+ *
598
+ * @since 1.0.4
599
+ * @return void
600
+ * @author Alberto Ruggiero
601
+ */
602
+ public function check_pages_redirect() {
603
+
604
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
605
+
606
+ $cart = is_page( wc_get_page_id( 'cart' ) );
607
+ $checkout = is_page( wc_get_page_id( 'checkout' ) );
608
+
609
+ wp_reset_query();
610
+
611
+ if ( $cart || $checkout ) {
612
+
613
+ wp_redirect( home_url() );
614
+ exit;
615
+
616
+ }
617
+
618
+ }
619
+
620
+ }
621
+
622
+ /**
623
+ * Removes Cart and checkout pages from menu
624
+ *
625
+ * @since 1.0.4
626
+ *
627
+ * @param $pages
628
+ *
629
+ * @return mixed
630
+ * @author Alberto Ruggiero
631
+ */
632
+ public function hide_cart_checkout_pages( $pages ) {
633
+
634
+ if ( get_option( 'ywctm_hide_cart_header' ) == 'yes' ) {
635
+
636
+ $excluded_pages = array(
637
+ wc_get_page_id( 'cart' ),
638
+ wc_get_page_id( 'checkout' )
639
+ );
640
+
641
+ for ( $i = 0; $i < count( $pages ); $i ++ ) {
642
+ $page = &$pages[$i];
643
+
644
+ if ( in_array( $page->ID, $excluded_pages ) ) {
645
+
646
+ unset( $pages[$i] );
647
+
648
+ }
649
+
650
+ }
651
+
652
+ }
653
+
654
+ return $pages;
655
+
656
+ }
657
+
658
+ /**
659
+ * Say if the code is execute by quick view
660
+ *
661
+ * @since 1.0.7
662
+ * @return bool
663
+ * @author Andrea Frascaspata <andrea.frascaspata@yithemes.com>
664
+ */
665
+ public function is_quick_view() {
666
+ return defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['action'] ) && ( $_REQUEST['action'] == 'yith_load_product_quick_view' || $_REQUEST['action'] == 'yit_load_product_quick_view' );
667
+ }
668
+
669
+ /**
670
+ * Hides add to cart on wishlist
671
+ *
672
+ * @since 1.2.2
673
+ *
674
+ * @param $value
675
+ * @param $product
676
+ *
677
+ * @return string
678
+ * @author Alberto Ruggiero
679
+ */
680
+ public function hide_add_to_cart_wishlist( $value, $product ) {
681
+
682
+ global $yith_wcwl_is_wishlist;
683
+
684
+ if ( $this->check_add_to_cart_single( true, $product->id ) && $yith_wcwl_is_wishlist ) {
685
+
686
+ $value = '';
687
+
688
+ }
689
+
690
+ return $value;
691
+
692
+ }
693
+
694
+ /**
695
+ * YITH FRAMEWORK
696
+ */
697
+
698
+ /**
699
+ * Load plugin framework
700
+ *
701
+ * @since 1.0.0
702
+ * @return void
703
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
704
+ */
705
+ public function plugin_fw_loader() {
706
+ if ( !defined( 'YIT_CORE_PLUGIN' ) ) {
707
+ global $plugin_fw_data;
708
+ if ( !empty( $plugin_fw_data ) ) {
709
+ $plugin_fw_file = array_shift( $plugin_fw_data );
710
+ require_once( $plugin_fw_file );
711
+ }
712
+ }
713
+ }
714
+
715
+ /**
716
+ * Premium Tab Template
717
+ *
718
+ * Load the premium tab template on admin page
719
+ *
720
+ * @since 1.0.0
721
+ * @return void
722
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
723
+ */
724
+ public function premium_tab() {
725
+ $premium_tab_template = YWCTM_TEMPLATE_PATH . '/admin/' . $this->_premium;
726
+ if ( file_exists( $premium_tab_template ) ) {
727
+ include_once( $premium_tab_template );
728
+ }
729
+ }
730
+
731
+ /**
732
+ * Get the premium landing uri
733
+ *
734
+ * @since 1.0.0
735
+ * @return string The premium landing link
736
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
737
+ */
738
+ public function get_premium_landing_uri() {
739
+ return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
740
+ }
741
+
742
+ /**
743
+ * Action Links
744
+ *
745
+ * add the action links to plugin admin page
746
+ * @since 1.0.0
747
+ *
748
+ * @param $links | links plugin array
749
+ *
750
+ * @return mixed
751
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
752
+ * @use plugin_action_links_{$plugin_file_name}
753
+ */
754
+ public function action_links( $links ) {
755
+
756
+ $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-catalog-mode' ) . '</a>';
757
+
758
+ if ( defined( 'YWCTM_FREE_INIT' ) ) {
759
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-catalog-mode' ) . '</a>';
760
+ }
761
+
762
+ return $links;
763
+ }
764
+
765
+ /**
766
+ * Plugin row meta
767
+ *
768
+ * add the action links to plugin admin page
769
+ *
770
+ * @since 1.0.0
771
+ *
772
+ * @param $plugin_meta
773
+ * @param $plugin_file
774
+ * @param $plugin_data
775
+ * @param $status
776
+ *
777
+ * @return Array
778
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
779
+ * @use plugin_row_meta
780
+ */
781
+ public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
782
+ if ( ( defined( 'YWCTM_INIT' ) && ( YWCTM_INIT == $plugin_file ) ) ||
783
+ ( defined( 'YWCTM_FREE_INIT' ) && ( YWCTM_FREE_INIT == $plugin_file ) )
784
+ ) {
785
+
786
+ $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-catalog-mode' ) . '</a>';
787
+ }
788
+
789
+ return $plugin_meta;
790
+ }
791
+
792
  }
modules/yith-woocommerce-catalog-mode/init.php CHANGED
@@ -1,123 +1,123 @@
1
- <?php
2
- /*
3
- Plugin Name: YITH WooCommerce Catalog Mode
4
- Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
5
- Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
6
- Author: Yithemes
7
- Text Domain: yith-woocommerce-catalog-mode
8
- Version: 1.2.0
9
- Author URI: http://yithemes.com/
10
- */
11
-
12
- if ( !defined( 'ABSPATH' ) ) {
13
- exit;
14
- } // Exit if accessed directly
15
-
16
- if ( !function_exists( 'is_plugin_active' ) ) {
17
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18
- }
19
-
20
- function ywctm_install_woocommerce_admin_notice() {
21
- ?>
22
- <div class="error">
23
- <p><?php _e( 'YITH WooCommerce Catalog Mode is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-catalog-mode' ); ?></p>
24
- </div>
25
- <?php
26
- }
27
-
28
- function ywctm_install_free_admin_notice() {
29
- ?>
30
- <div class="error">
31
- <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Catalog Mode while you are using the premium one.', 'yith-woocommerce-catalog-mode' ); ?></p>
32
- </div>
33
- <?php
34
- }
35
-
36
- if ( !defined( 'YWCTM_VERSION' ) ) {
37
- define( 'YWCTM_VERSION', '1.2.0' );
38
- }
39
-
40
- if ( !defined( 'YWCTM_FREE_INIT' ) ) {
41
- define( 'YWCTM_FREE_INIT', plugin_basename( __FILE__ ) );
42
- }
43
-
44
- if ( !defined( 'YWCTM_FILE' ) ) {
45
- define( 'YWCTM_FILE', __FILE__ );
46
- }
47
-
48
- if ( !defined( 'YWCTM_DIR' ) ) {
49
- define( 'YWCTM_DIR', plugin_dir_path( __FILE__ ) );
50
- }
51
-
52
- if ( !defined( 'YWCTM_URL' ) ) {
53
- define( 'YWCTM_URL', plugins_url( '/', __FILE__ ) );
54
- }
55
-
56
- if ( !defined( 'YWCTM_ASSETS_URL' ) ) {
57
- define( 'YWCTM_ASSETS_URL', YWCTM_URL . 'assets/' );
58
- }
59
-
60
- if ( !defined( 'YWCTM_TEMPLATE_PATH' ) ) {
61
- define( 'YWCTM_TEMPLATE_PATH', YWCTM_DIR . 'templates/' );
62
- }
63
-
64
- function ywctm_init() {
65
-
66
- /* Load YWCTM text domain */
67
- load_plugin_textdomain( 'yith-woocommerce-catalog-mode', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
-
69
- global $YITH_WC_Catalog_Mode;
70
- $YITH_WC_Catalog_Mode = new YITH_WC_Catalog_Mode();
71
- }
72
-
73
- add_action( 'ywctm_init', 'ywctm_init' );
74
-
75
- function ywctm_install() {
76
-
77
- require_once( YWCTM_DIR . 'class.yith-woocommerce-catalog-mode.php' );
78
-
79
- if ( !function_exists( 'WC' ) ) {
80
- add_action( 'admin_notices', 'ywctm_install_woocommerce_admin_notice' );
81
- }
82
- elseif ( defined( 'YWCTM_PREMIUM' ) ) {
83
- add_action( 'admin_notices', 'ywctm_install_free_admin_notice' );
84
- deactivate_plugins( plugin_basename( __FILE__ ) );
85
- }
86
- else {
87
- do_action( 'ywctm_init' );
88
- }
89
- }
90
-
91
- add_action( 'plugins_loaded', 'ywctm_install', 11 );
92
-
93
- /**
94
- * Init default plugin settings
95
- */
96
- if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
97
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
98
- }
99
-
100
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
101
- register_activation_hook( __FILE__, 'ywctm_plugin_activation' );
102
-
103
- function ywctm_plugin_activation() {
104
-
105
- $pages_to_check = array(
106
- get_option( 'woocommerce_cart_page_id' ),
107
- get_option( 'woocommerce_checkout_page_id' )
108
- );
109
-
110
- foreach ( $pages_to_check as $page_id ) {
111
- if ( get_post_status( $page_id ) != 'publish' ) {
112
- $page = array(
113
- 'ID' => $page_id,
114
- 'post_status' => 'publish'
115
- );
116
-
117
- wp_update_post( $page );
118
- }
119
- }
120
- }
121
-
122
-
123
-
1
+ <?php
2
+ /*
3
+ Plugin Name: YITH WooCommerce Catalog Mode
4
+ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
5
+ Description: YITH WooCommerce Catalog Mode allows you to disable shop functions.
6
+ Author: YIThemes
7
+ Text Domain: yith-woocommerce-catalog-mode
8
+ Version: 1.2.2
9
+ Author URI: http://yithemes.com/
10
+ */
11
+
12
+ if ( !defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ } // Exit if accessed directly
15
+
16
+ if ( !function_exists( 'is_plugin_active' ) ) {
17
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18
+ }
19
+
20
+ function ywctm_install_woocommerce_admin_notice() {
21
+ ?>
22
+ <div class="error">
23
+ <p><?php _e( 'YITH WooCommerce Catalog Mode is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-catalog-mode' ); ?></p>
24
+ </div>
25
+ <?php
26
+ }
27
+
28
+ function ywctm_install_free_admin_notice() {
29
+ ?>
30
+ <div class="error">
31
+ <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Catalog Mode while you are using the premium one.', 'yith-woocommerce-catalog-mode' ); ?></p>
32
+ </div>
33
+ <?php
34
+ }
35
+
36
+ if ( !defined( 'YWCTM_VERSION' ) ) {
37
+ define( 'YWCTM_VERSION', '1.2.2' );
38
+ }
39
+
40
+ if ( !defined( 'YWCTM_FREE_INIT' ) ) {
41
+ define( 'YWCTM_FREE_INIT', plugin_basename( __FILE__ ) );
42
+ }
43
+
44
+ if ( !defined( 'YWCTM_FILE' ) ) {
45
+ define( 'YWCTM_FILE', __FILE__ );
46
+ }
47
+
48
+ if ( !defined( 'YWCTM_DIR' ) ) {
49
+ define( 'YWCTM_DIR', plugin_dir_path( __FILE__ ) );
50
+ }
51
+
52
+ if ( !defined( 'YWCTM_URL' ) ) {
53
+ define( 'YWCTM_URL', plugins_url( '/', __FILE__ ) );
54
+ }
55
+
56
+ if ( !defined( 'YWCTM_ASSETS_URL' ) ) {
57
+ define( 'YWCTM_ASSETS_URL', YWCTM_URL . 'assets/' );
58
+ }
59
+
60
+ if ( !defined( 'YWCTM_TEMPLATE_PATH' ) ) {
61
+ define( 'YWCTM_TEMPLATE_PATH', YWCTM_DIR . 'templates/' );
62
+ }
63
+
64
+ function ywctm_init() {
65
+
66
+ /* Load YWCTM text domain */
67
+ load_plugin_textdomain( 'yith-woocommerce-catalog-mode', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
+
69
+ global $YITH_WC_Catalog_Mode;
70
+ $YITH_WC_Catalog_Mode = new YITH_WC_Catalog_Mode();
71
+ }
72
+
73
+ add_action( 'ywctm_init', 'ywctm_init' );
74
+
75
+ function ywctm_install() {
76
+
77
+ require_once( YWCTM_DIR . 'class.yith-woocommerce-catalog-mode.php' );
78
+
79
+ if ( !function_exists( 'WC' ) ) {
80
+ add_action( 'admin_notices', 'ywctm_install_woocommerce_admin_notice' );
81
+ }
82
+ elseif ( defined( 'YWCTM_PREMIUM' ) ) {
83
+ add_action( 'admin_notices', 'ywctm_install_free_admin_notice' );
84
+ deactivate_plugins( plugin_basename( __FILE__ ) );
85
+ }
86
+ else {
87
+ do_action( 'ywctm_init' );
88
+ }
89
+ }
90
+
91
+ add_action( 'plugins_loaded', 'ywctm_install', 11 );
92
+
93
+ /**
94
+ * Init default plugin settings
95
+ */
96
+ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
97
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
98
+ }
99
+
100
+ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
101
+ register_activation_hook( __FILE__, 'ywctm_plugin_activation' );
102
+
103
+ function ywctm_plugin_activation() {
104
+
105
+ $pages_to_check = array(
106
+ get_option( 'woocommerce_cart_page_id' ),
107
+ get_option( 'woocommerce_checkout_page_id' )
108
+ );
109
+
110
+ foreach ( $pages_to_check as $page_id ) {
111
+ if ( get_post_status( $page_id ) != 'publish' ) {
112
+ $page = array(
113
+ 'ID' => $page_id,
114
+ 'post_status' => 'publish'
115
+ );
116
+
117
+ wp_update_post( $page );
118
+ }
119
+ }
120
+ }
121
+
122
+
123
+
modules/yith-woocommerce-catalog-mode/languages/yith-woocommerce-catalog-mode-nl_NL.po CHANGED
@@ -1,294 +1,294 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: YITH WooCommerce Catalog Mode\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-10-02 09:48+0100\n"
6
- "PO-Revision-Date: Sun Oct 18 2015 12:56:28 GMT+0200 (West-Europa "
7
- "(zomertijd))\n"
8
- "Last-Translator: admin <admin@localhost.local>\n"
9
- "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
10
- "Language: Dutch\n"
11
- "Plural-Forms: nplurals=2; plural=n != 1\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Generator: Loco - https://localise.biz/\n"
17
- "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
18
- "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
19
- "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
20
- "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
21
- "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
22
- "X-Poedit-Basepath: .\n"
23
- "X-Poedit-SearchPath-0: ..\n"
24
- "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
25
- "X-Loco-Target-Locale: nl_NL"
26
-
27
- #: ../class.yith-woocommerce-catalog-mode.php:602
28
- #: ../class.yith-woocommerce-catalog-mode.php:671
29
- msgid "Settings"
30
- msgstr "Instellingen"
31
-
32
- #: ../class.yith-woocommerce-catalog-mode.php:606
33
- msgid "Premium Settings"
34
- msgstr "Geavanceerde Instellingen"
35
-
36
- #: ../class.yith-woocommerce-catalog-mode.php:607
37
- msgid "Exclusion List"
38
- msgstr "UItsluitingslijst"
39
-
40
- #: ../class.yith-woocommerce-catalog-mode.php:610
41
- #: ../class.yith-woocommerce-catalog-mode.php:674
42
- msgid "Premium Version"
43
- msgstr "Premium Versie"
44
-
45
- #: ../class.yith-woocommerce-catalog-mode.php:616
46
- #: ../class.yith-woocommerce-catalog-mode.php:617
47
- msgid "Catalog Mode"
48
- msgstr "Cataloog mode"
49
-
50
- #: ../class.yith-woocommerce-catalog-mode.php:700
51
- msgid "Plugin Documentation"
52
- msgstr "Plugin Documentatie"
53
-
54
- #: ../init.php:23
55
- msgid ""
56
- "YITH WooCommerce Catalog Mode is enabled but not effective. It requires "
57
- "WooCommerce in order to work."
58
- msgstr ""
59
- "YITH WooCommerce Catalog Mode is ingeschakeld maar niet werkzaam. "
60
- "WooCommerce is nodig om te werken."
61
-
62
- #: ../init.php:31
63
- msgid ""
64
- "You can't activate the free version of YITH WooCommerce Catalog Mode while "
65
- "you are using the premium one."
66
- msgstr ""
67
- "U kunt het gratis versie vanYITH WooCommerce Catalog Mode niet activeren als "
68
- "u het premium versie gebruikt."
69
-
70
- #: ../plugin-options/settings-options.php:18
71
- msgid "Upgrade to the PREMIUM VERSION"
72
- msgstr "Upgrade naar het PREMIUM VERSIE"
73
-
74
- #: ../plugin-options/settings-options.php:21
75
- #: ../plugin-options/settings-options.php:27
76
- msgid "YITH WooCommerce Catalog Mode"
77
- msgstr "YITH WooCommerce Catalog Mode"
78
-
79
- #: ../plugin-options/settings-options.php:22
80
- msgid "Discover the Advanced Features"
81
- msgstr "Ontdek de Speciale Eigenschappen"
82
-
83
- #: ../plugin-options/settings-options.php:23
84
- msgid ""
85
- "Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit "
86
- "from all features!"
87
- msgstr ""
88
- "Upgrade naar het PREMIUM VERSIE van YITH WooCommerce Catalog Mode om van "
89
- "alle functies te profiteren."
90
-
91
- #: ../plugin-options/settings-options.php:29
92
- msgid "Get Support and Pro Features"
93
- msgstr "Krijg Support en Pro functies"
94
-
95
- #: ../plugin-options/settings-options.php:30
96
- msgid ""
97
- "By purchasing the premium version of the plugin, you will take advantage of "
98
- "the advanced features of the product and you will get one year of free "
99
- "updates and support through our platform available 24h/24."
100
- msgstr ""
101
- "Door de aankoop van de premium-versie van de plugin, zult u profiteren van "
102
- "de geavanceerde functies van het product en u zult een jaar gratis updates "
103
- "ontvangen en de ondersteuning door middel van ons beschikbaar platform 24u / "
104
- "24."
105
-
106
- #: ../plugin-options/settings-options.php:40
107
- #: ../plugin-options/settings-options.php:49
108
- #: ../plugin-options/settings-options.php:99
109
- #: ../plugin-options/settings-options.php:107
110
- msgid "\"Add to cart\" button"
111
- msgstr "\"Toevoegen aan winkelwagen\" button"
112
-
113
- #: ../plugin-options/settings-options.php:42
114
- msgid "Exclude selected products (See \"Exclusions\" tab)"
115
- msgstr "Uitsluiten geselecteerde producten ( zie \"Uitsluitings\" tab)"
116
-
117
- #: ../plugin-options/settings-options.php:51
118
- msgid "Reverse Exclusion List (Restrict Catalog Mode to selected items only)"
119
- msgstr ""
120
- "Omgekeerde Uitsluitingslijst ( Alleen Restrict Catalog Mode geselecteerde "
121
- "items)"
122
-
123
- #: ../plugin-options/settings-options.php:58
124
- msgid "Variable products"
125
- msgstr "Variabele producten"
126
-
127
- #: ../plugin-options/settings-options.php:60
128
- msgid "Hide product variations"
129
- msgstr "Verberg product variaties"
130
-
131
- #: ../plugin-options/settings-options.php:71
132
- msgid "General Settings"
133
- msgstr "Algemene instellingen"
134
-
135
- #: ../plugin-options/settings-options.php:76
136
- msgid "Enable YITH Woocommerce Catalog Mode"
137
- msgstr "YITH Woocommerce Catalog Mode inschakelen"
138
-
139
- #: ../plugin-options/settings-options.php:83
140
- msgid "Admin View"
141
- msgstr "Admin weergave"
142
-
143
- #: ../plugin-options/settings-options.php:85
144
- msgid "Enable Catalog Mode also for administrators"
145
- msgstr "Catalog Mode ook voor beheerders inschakelen"
146
-
147
- #: ../plugin-options/settings-options.php:94
148
- msgid "Catalog Mode Settings"
149
- msgstr "Catalog Mode instellingen"
150
-
151
- #: ../plugin-options/settings-options.php:101
152
- msgid "Hide in product details page"
153
- msgstr "Verberg in productdetail pagina"
154
-
155
- #: ../plugin-options/settings-options.php:109
156
- msgid "Hide in other pages"
157
- msgstr "Verberg in andere pagina's"
158
-
159
- #: ../plugin-options/settings-options.php:118
160
- msgid "\"Cart\" and \"Checkout\" pages"
161
- msgstr "\"Winkelwagen\" en \"afrekenen\" pagina's"
162
-
163
- #: ../plugin-options/settings-options.php:120
164
- msgid "Hide and disable all shop features"
165
- msgstr "Verberg en schakel alle winkel functies uit"
166
-
167
- #: ../templates/admin/premium.php:226 ../templates/admin/premium.php:352
168
- #, php-format
169
- msgid ""
170
- "Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Catalog Mode%2$s "
171
- "to benefit from all features!"
172
- msgstr ""
173
- "Upgrade naar %1$spremium version%2$s of %1$sYITH WooCommerce Catalog "
174
- "Mode%2$s om te profiteren van alle functies!"
175
-
176
- #: ../templates/admin/premium.php:229 ../templates/admin/premium.php:355
177
- msgid "UPGRADE"
178
- msgstr "UPGRADE"
179
-
180
- #: ../templates/admin/premium.php:230 ../templates/admin/premium.php:356
181
- msgid "to the premium version"
182
- msgstr "naar het premium versie"
183
-
184
- #: ../templates/admin/premium.php:236
185
- msgid "Premium Features"
186
- msgstr "Premium Functies"
187
-
188
- #: ../templates/admin/premium.php:244
189
- msgid "Hide price"
190
- msgstr "Verberg prijs"
191
-
192
- #: ../templates/admin/premium.php:247
193
- #, php-format
194
- msgid ""
195
- "Hide the price of products in your shop and replace it with a text. Decide "
196
- "if some of the products have to be excluded and if %1$shiding price%2$s has "
197
- "to be applied to all or restricted only to unlogged users."
198
- msgstr ""
199
- "Verberg de prijs van de producten in uw winkel en vervang deze door een "
200
- "tekst. Beslis of sommige van de producten worden uitgesloten en indien "
201
- "%1$shiding price%2$s moet worden toegepast op alle of beperkt tot niet "
202
- "ingelogde gebruikers."
203
-
204
- #: ../templates/admin/premium.php:257
205
- msgid "Inquiry form"
206
- msgstr "Aanvraagformulier"
207
-
208
- #: ../templates/admin/premium.php:260
209
- #, php-format
210
- msgid ""
211
- "Improve single product page by adding a tab with an %1$sinquiry form%2$s "
212
- "explicitly thought to let them send messages to site administrator."
213
- msgstr ""
214
- "Verbeter de enkel product pagina door het toevoegen van een tab met "
215
- "%1$sinquiry form%2$s expliciet bedacht om hun berichten te laten sturen naar "
216
- "de websitebeheerder."
217
-
218
- #: ../templates/admin/premium.php:276
219
- msgid "Custom button"
220
- msgstr "Aangepaste button"
221
-
222
- #: ../templates/admin/premium.php:279
223
- #, php-format
224
- msgid ""
225
- "Add a button in single product page to call users to a specific "
226
- "%1$saction%2$s, depending on the specified %1$slink%2$s (email sending, "
227
- "skype call, telephone call)."
228
- msgstr ""
229
- "Voeg een button toe in de enkel product pagina om gebruikers te laten bellen "
230
- "voor een specifieke %1$saction%2$s, afhankelijk van de opgegeven "
231
- "%1$slink%2$s (email sending, skype call, telephone call)."
232
-
233
- #: ../templates/admin/premium.php:289
234
- msgid "Product reviews"
235
- msgstr "Product beoordeling"
236
-
237
- #: ../templates/admin/premium.php:292
238
- #, php-format
239
- msgid ""
240
- "You can disable product %1$sreviewing system%2$s of your shop and decide if "
241
- "applying it to all users or just to unlogged ones."
242
- msgstr ""
243
- "U kunt uw product %1$sreviewing system%2$s uitschakelen in uw winkel en "
244
- "beslissen of dit voor alle gebruikers is of alleen voor niet ingelogde "
245
- "gebruikers."
246
-
247
- #: ../templates/admin/premium.php:308
248
- msgid "Exclusion list"
249
- msgstr "Uitgesloten lijst"
250
-
251
- #: ../templates/admin/premium.php:311
252
- #, php-format
253
- msgid ""
254
- "Set plugin options, but if you want that options concerning price visibility "
255
- "and ‘Add to cart’ do not apply to specific products, add them to "
256
- "%1$sexclusion list%2$s and, voilà, problem solved."
257
- msgstr ""
258
- "Stel plugin opties in, maar als je wilt dat de opties met betrekking tot "
259
- "prijs zichtbaarheid en 'Bestellen' niet van toepassing zijn op specifieke "
260
- "producten, voeg ze toe aan %1$sexclusion list%2$s en, voilà probleem "
261
- "opgelost."
262
-
263
- #: ../templates/admin/premium.php:321
264
- msgid "REVERSE EXCLUSION LIST"
265
- msgstr "OMGEKEERDE UITSLUITINGSLIJST"
266
-
267
- #: ../templates/admin/premium.php:324
268
- #, php-format
269
- msgid ""
270
- "Apply Catalog Mode to some items only: add them to the \"Exclusion List\" and "
271
- "%1$smake it work in the opposite way as usual%2$s. All items in the shop "
272
- "show price and “Add to Cart” button, while items in the list don’t."
273
- msgstr ""
274
- "Catalog Mode toepassing voor slechts enkele items: voeg ze toe aan de "
275
- "\"Uitsluitingslijst\" en %1$smake it work in the opposite way as usual%2$s. "
276
- "Van alle items in de winkel de prijs tonen en de \"Toevoegen aan winkelwagen\" "
277
- "button, terwijl items niet in de lijst staan."
278
-
279
- #: ../templates/admin/premium.php:340
280
- msgid "Source page of the request"
281
- msgstr "Bronpagina van de aanvraag"
282
-
283
- #: ../templates/admin/premium.php:343
284
- #, php-format
285
- msgid ""
286
- "Thanks to the %1$s\"Product Permalink\"%2$s option you will be able to know "
287
- "from which page your users have generated the request.%3$sThe email "
288
- "generated from the request form will include the address of the page: "
289
- "another important information that can be really useful for you."
290
- msgstr ""
291
- "Met dank aan de %1$s\"Product Permalink\"%2$s optie is het mogelijk om te "
292
- "weten welke pagina je gebruiker heeft gemaakt de aanvraag %3$s De e-mail "
293
- "gegenereerd op basis van het aanvraagformulier zal het adres van de pagina: "
294
- "en andere belangrijke informatie die kan nuttig zijn voor jou."
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: YITH WooCommerce Catalog Mode\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-10-02 09:48+0100\n"
6
+ "PO-Revision-Date: Sun Oct 18 2015 12:56:28 GMT+0200 (West-Europa "
7
+ "(zomertijd))\n"
8
+ "Last-Translator: admin <admin@localhost.local>\n"
9
+ "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
10
+ "Language: Dutch\n"
11
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Loco - https://localise.biz/\n"
17
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
18
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
19
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
20
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
21
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
22
+ "X-Poedit-Basepath: .\n"
23
+ "X-Poedit-SearchPath-0: ..\n"
24
+ "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
25
+ "X-Loco-Target-Locale: nl_NL"
26
+
27
+ #: ../class.yith-woocommerce-catalog-mode.php:602
28
+ #: ../class.yith-woocommerce-catalog-mode.php:671
29
+ msgid "Settings"
30
+ msgstr "Instellingen"
31
+
32
+ #: ../class.yith-woocommerce-catalog-mode.php:606
33
+ msgid "Premium Settings"
34
+ msgstr "Geavanceerde Instellingen"
35
+
36
+ #: ../class.yith-woocommerce-catalog-mode.php:607
37
+ msgid "Exclusion List"
38
+ msgstr "UItsluitingslijst"
39
+
40
+ #: ../class.yith-woocommerce-catalog-mode.php:610
41
+ #: ../class.yith-woocommerce-catalog-mode.php:674
42
+ msgid "Premium Version"
43
+ msgstr "Premium Versie"
44
+
45
+ #: ../class.yith-woocommerce-catalog-mode.php:616
46
+ #: ../class.yith-woocommerce-catalog-mode.php:617
47
+ msgid "Catalog Mode"
48
+ msgstr "Cataloog mode"
49
+
50
+ #: ../class.yith-woocommerce-catalog-mode.php:700
51
+ msgid "Plugin Documentation"
52
+ msgstr "Plugin Documentatie"
53
+
54
+ #: ../init.php:23
55
+ msgid ""
56
+ "YITH WooCommerce Catalog Mode is enabled but not effective. It requires "
57
+ "WooCommerce in order to work."
58
+ msgstr ""
59
+ "YITH WooCommerce Catalog Mode is ingeschakeld maar niet werkzaam. "
60
+ "WooCommerce is nodig om te werken."
61
+
62
+ #: ../init.php:31
63
+ msgid ""
64
+ "You can't activate the free version of YITH WooCommerce Catalog Mode while "
65
+ "you are using the premium one."
66
+ msgstr ""
67
+ "U kunt het gratis versie vanYITH WooCommerce Catalog Mode niet activeren als "
68
+ "u het premium versie gebruikt."
69
+
70
+ #: ../plugin-options/settings-options.php:18
71
+ msgid "Upgrade to the PREMIUM VERSION"
72
+ msgstr "Upgrade naar het PREMIUM VERSIE"
73
+
74
+ #: ../plugin-options/settings-options.php:21
75
+ #: ../plugin-options/settings-options.php:27
76
+ msgid "YITH WooCommerce Catalog Mode"
77
+ msgstr "YITH WooCommerce Catalog Mode"
78
+
79
+ #: ../plugin-options/settings-options.php:22
80
+ msgid "Discover the Advanced Features"
81
+ msgstr "Ontdek de Speciale Eigenschappen"
82
+
83
+ #: ../plugin-options/settings-options.php:23
84
+ msgid ""
85
+ "Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit "
86
+ "from all features!"
87
+ msgstr ""
88
+ "Upgrade naar het PREMIUM VERSIE van YITH WooCommerce Catalog Mode om van "
89
+ "alle functies te profiteren."
90
+
91
+ #: ../plugin-options/settings-options.php:29
92
+ msgid "Get Support and Pro Features"
93
+ msgstr "Krijg Support en Pro functies"
94
+
95
+ #: ../plugin-options/settings-options.php:30
96
+ msgid ""
97
+ "By purchasing the premium version of the plugin, you will take advantage of "
98
+ "the advanced features of the product and you will get one year of free "
99
+ "updates and support through our platform available 24h/24."
100
+ msgstr ""
101
+ "Door de aankoop van de premium-versie van de plugin, zult u profiteren van "
102
+ "de geavanceerde functies van het product en u zult een jaar gratis updates "
103
+ "ontvangen en de ondersteuning door middel van ons beschikbaar platform 24u / "
104
+ "24."
105
+
106
+ #: ../plugin-options/settings-options.php:40
107
+ #: ../plugin-options/settings-options.php:49
108
+ #: ../plugin-options/settings-options.php:99
109
+ #: ../plugin-options/settings-options.php:107
110
+ msgid "\"Add to cart\" button"
111
+ msgstr "\"Toevoegen aan winkelwagen\" button"
112
+
113
+ #: ../plugin-options/settings-options.php:42
114
+ msgid "Exclude selected products (See \"Exclusions\" tab)"
115
+ msgstr "Uitsluiten geselecteerde producten ( zie \"Uitsluitings\" tab)"
116
+
117
+ #: ../plugin-options/settings-options.php:51
118
+ msgid "Reverse Exclusion List (Restrict Catalog Mode to selected items only)"
119
+ msgstr ""
120
+ "Omgekeerde Uitsluitingslijst ( Alleen Restrict Catalog Mode geselecteerde "
121
+ "items)"
122
+
123
+ #: ../plugin-options/settings-options.php:58
124
+ msgid "Variable products"
125
+ msgstr "Variabele producten"
126
+
127
+ #: ../plugin-options/settings-options.php:60
128
+ msgid "Hide product variations"
129
+ msgstr "Verberg product variaties"
130
+
131
+ #: ../plugin-options/settings-options.php:71
132
+ msgid "General Settings"
133
+ msgstr "Algemene instellingen"
134
+
135
+ #: ../plugin-options/settings-options.php:76
136
+ msgid "Enable YITH Woocommerce Catalog Mode"
137
+ msgstr "YITH Woocommerce Catalog Mode inschakelen"
138
+
139
+ #: ../plugin-options/settings-options.php:83
140
+ msgid "Admin View"
141
+ msgstr "Admin weergave"
142
+
143
+ #: ../plugin-options/settings-options.php:85
144
+ msgid "Enable Catalog Mode also for administrators"
145
+ msgstr "Catalog Mode ook voor beheerders inschakelen"
146
+
147
+ #: ../plugin-options/settings-options.php:94
148
+ msgid "Catalog Mode Settings"
149
+ msgstr "Catalog Mode instellingen"
150
+
151
+ #: ../plugin-options/settings-options.php:101
152
+ msgid "Hide in product details page"
153
+ msgstr "Verberg in productdetail pagina"
154
+
155
+ #: ../plugin-options/settings-options.php:109
156
+ msgid "Hide in other pages"
157
+ msgstr "Verberg in andere pagina's"
158
+
159
+ #: ../plugin-options/settings-options.php:118
160
+ msgid "\"Cart\" and \"Checkout\" pages"
161
+ msgstr "\"Winkelwagen\" en \"afrekenen\" pagina's"
162
+
163
+ #: ../plugin-options/settings-options.php:120
164
+ msgid "Hide and disable all shop features"
165
+ msgstr "Verberg en schakel alle winkel functies uit"
166
+
167
+ #: ../templates/admin/premium.php:226 ../templates/admin/premium.php:352
168
+ #, php-format
169
+ msgid ""
170
+ "Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Catalog Mode%2$s "
171
+ "to benefit from all features!"
172
+ msgstr ""
173
+ "Upgrade naar %1$spremium version%2$s of %1$sYITH WooCommerce Catalog "
174
+ "Mode%2$s om te profiteren van alle functies!"
175
+
176
+ #: ../templates/admin/premium.php:229 ../templates/admin/premium.php:355
177
+ msgid "UPGRADE"
178
+ msgstr "UPGRADE"
179
+
180
+ #: ../templates/admin/premium.php:230 ../templates/admin/premium.php:356
181
+ msgid "to the premium version"
182
+ msgstr "naar het premium versie"
183
+
184
+ #: ../templates/admin/premium.php:236
185
+ msgid "Premium Features"
186
+ msgstr "Premium Functies"
187
+
188
+ #: ../templates/admin/premium.php:244
189
+ msgid "Hide price"
190
+ msgstr "Verberg prijs"
191
+
192
+ #: ../templates/admin/premium.php:247
193
+ #, php-format
194
+ msgid ""
195
+ "Hide the price of products in your shop and replace it with a text. Decide "
196
+ "if some of the products have to be excluded and if %1$shiding price%2$s has "
197
+ "to be applied to all or restricted only to unlogged users."
198
+ msgstr ""
199
+ "Verberg de prijs van de producten in uw winkel en vervang deze door een "
200
+ "tekst. Beslis of sommige van de producten worden uitgesloten en indien "
201
+ "%1$shiding price%2$s moet worden toegepast op alle of beperkt tot niet "
202
+ "ingelogde gebruikers."
203
+
204
+ #: ../templates/admin/premium.php:257
205
+ msgid "Inquiry form"
206
+ msgstr "Aanvraagformulier"
207
+
208
+ #: ../templates/admin/premium.php:260
209
+ #, php-format
210
+ msgid ""
211
+ "Improve single product page by adding a tab with an %1$sinquiry form%2$s "
212
+ "explicitly thought to let them send messages to site administrator."
213
+ msgstr ""
214
+ "Verbeter de enkel product pagina door het toevoegen van een tab met "
215
+ "%1$sinquiry form%2$s expliciet bedacht om hun berichten te laten sturen naar "
216
+ "de websitebeheerder."
217
+
218
+ #: ../templates/admin/premium.php:276
219
+ msgid "Custom button"
220
+ msgstr "Aangepaste button"
221
+
222
+ #: ../templates/admin/premium.php:279
223
+ #, php-format
224
+ msgid ""
225
+ "Add a button in single product page to call users to a specific "
226
+ "%1$saction%2$s, depending on the specified %1$slink%2$s (email sending, "
227
+ "skype call, telephone call)."
228
+ msgstr ""
229
+ "Voeg een button toe in de enkel product pagina om gebruikers te laten bellen "
230
+ "voor een specifieke %1$saction%2$s, afhankelijk van de opgegeven "
231
+ "%1$slink%2$s (email sending, skype call, telephone call)."
232
+
233
+ #: ../templates/admin/premium.php:289
234
+ msgid "Product reviews"
235
+ msgstr "Product beoordeling"
236
+
237
+ #: ../templates/admin/premium.php:292
238
+ #, php-format
239
+ msgid ""
240
+ "You can disable product %1$sreviewing system%2$s of your shop and decide if "
241
+ "applying it to all users or just to unlogged ones."
242
+ msgstr ""
243
+ "U kunt uw product %1$sreviewing system%2$s uitschakelen in uw winkel en "
244
+ "beslissen of dit voor alle gebruikers is of alleen voor niet ingelogde "
245
+ "gebruikers."
246
+
247
+ #: ../templates/admin/premium.php:308
248
+ msgid "Exclusion list"
249
+ msgstr "Uitgesloten lijst"
250
+
251
+ #: ../templates/admin/premium.php:311
252
+ #, php-format
253
+ msgid ""
254
+ "Set plugin options, but if you want that options concerning price visibility "
255
+ "and ‘Add to cart’ do not apply to specific products, add them to "
256
+ "%1$sexclusion list%2$s and, voilà, problem solved."
257
+ msgstr ""
258
+ "Stel plugin opties in, maar als je wilt dat de opties met betrekking tot "
259
+ "prijs zichtbaarheid en 'Bestellen' niet van toepassing zijn op specifieke "
260
+ "producten, voeg ze toe aan %1$sexclusion list%2$s en, voilà probleem "
261
+ "opgelost."
262
+
263
+ #: ../templates/admin/premium.php:321
264
+ msgid "REVERSE EXCLUSION LIST"
265
+ msgstr "OMGEKEERDE UITSLUITINGSLIJST"
266
+
267
+ #: ../templates/admin/premium.php:324
268
+ #, php-format
269
+ msgid ""
270
+ "Apply Catalog Mode to some items only: add them to the \"Exclusion List\" and "
271
+ "%1$smake it work in the opposite way as usual%2$s. All items in the shop "
272
+ "show price and “Add to Cart” button, while items in the list don’t."
273
+ msgstr ""
274
+ "Catalog Mode toepassing voor slechts enkele items: voeg ze toe aan de "
275
+ "\"Uitsluitingslijst\" en %1$smake it work in the opposite way as usual%2$s. "
276
+ "Van alle items in de winkel de prijs tonen en de \"Toevoegen aan winkelwagen\" "
277
+ "button, terwijl items niet in de lijst staan."
278
+
279
+ #: ../templates/admin/premium.php:340
280
+ msgid "Source page of the request"
281
+ msgstr "Bronpagina van de aanvraag"
282
+
283
+ #: ../templates/admin/premium.php:343
284
+ #, php-format
285
+ msgid ""
286
+ "Thanks to the %1$s\"Product Permalink\"%2$s option you will be able to know "
287
+ "from which page your users have generated the request.%3$sThe email "
288
+ "generated from the request form will include the address of the page: "
289
+ "another important information that can be really useful for you."
290
+ msgstr ""
291
+ "Met dank aan de %1$s\"Product Permalink\"%2$s optie is het mogelijk om te "
292
+ "weten welke pagina je gebruiker heeft gemaakt de aanvraag %3$s De e-mail "
293
+ "gegenereerd op basis van het aanvraagformulier zal het adres van de pagina: "
294
+ "en andere belangrijke informatie die kan nuttig zijn voor jou."
modules/yith-woocommerce-catalog-mode/plugin-options/premium-landing-options.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
-
16
- return array(
17
- 'premium-landing' => array(
18
- 'home' => array(
19
- 'type' => 'custom_tab',
20
- 'action' => 'yith_catalog_mode_premium'
21
- )
22
- )
23
  );
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+
16
+ return array(
17
+ 'premium-landing' => array(
18
+ 'home' => array(
19
+ 'type' => 'custom_tab',
20
+ 'action' => 'yith_catalog_mode_premium'
21
+ )
22
+ )
23
  );
modules/yith-woocommerce-catalog-mode/plugin-options/settings-options.php CHANGED
@@ -1,104 +1,104 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- global $YITH_WC_Catalog_Mode;
16
-
17
- return array(
18
- 'settings' => array(
19
- 'ywctm_videobox' => array(
20
- 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-catalog-mode' ),
21
- 'type' => 'videobox',
22
- 'default' => array(
23
- 'plugin_name' => __( 'YITH WooCommerce Catalog Mode', 'yith-woocommerce-catalog-mode' ),
24
- 'title_first_column' => __( 'Discover the Advanced Features', 'yith-woocommerce-catalog-mode' ),
25
- 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit from all features!', 'yith-woocommerce-catalog-mode' ),
26
- 'video' => array(
27
- 'video_id' => '120697979',
28
- 'video_image_url' => YWCTM_ASSETS_URL . 'images/yith-woocommerce-catalog-mode.jpg',
29
- 'video_description' => __( 'YITH WooCommerce Catalog Mode', 'yith-woocommerce-catalog-mode' ),
30
- ),
31
- 'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-catalog-mode' ),
32
- 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-catalog-mode' ),
33
- 'button' => array(
34
- 'href' => $YITH_WC_Catalog_Mode->get_premium_landing_uri(),
35
- 'title' => 'Get Support and Pro Features'
36
- )
37
- ),
38
- 'id' => 'ywctm_general_videobox'
39
- ),
40
-
41
- 'ywctm_general_title' => array(
42
- 'name' => __( 'General Settings', 'yith-woocommerce-catalog-mode' ),
43
- 'type' => 'title',
44
- ),
45
- 'ywctm_enable_plugin' => array(
46
- 'name' => __( 'Enable YITH WooCommerce Catalog Mode', 'yith-woocommerce-catalog-mode' ),
47
- 'type' => 'checkbox',
48
- 'desc' => '',
49
- 'id' => 'ywctm_enable_plugin',
50
- 'default' => 'yes',
51
- ),
52
- 'ywctm_general_end' => array(
53
- 'type' => 'sectionend',
54
- ),
55
-
56
- 'ywctm_catalog_mode_title' => array(
57
- 'name' => __( 'Catalog Mode Settings', 'yith-woocommerce-catalog-mode' ),
58
- 'type' => 'title',
59
- ),
60
- 'ywctm_catalog_mode_disable_add_to_cart_single' => array(
61
- 'name' => __( '"Add to cart" button', 'yith-woocommerce-catalog-mode' ),
62
- 'type' => 'checkbox',
63
- 'desc' => __( 'Hide in product detail page', 'yith-woocommerce-catalog-mode' ),
64
- 'id' => 'ywctm_hide_add_to_cart_single',
65
- 'default' => 'no',
66
- 'checkboxgroup' => 'start'
67
- ),
68
- 'ywctm_catalog_mode_disable_add_to_cart_loop' => array(
69
- 'type' => 'checkbox',
70
- 'desc' => __( 'Hide in other shop pages', 'yith-woocommerce-catalog-mode' ),
71
- 'id' => 'ywctm_hide_add_to_cart_loop',
72
- 'default' => 'no',
73
- 'checkboxgroup' => ''
74
-
75
- ),
76
- 'ywctm_catalog_mode_admin_view' => array(
77
- 'name' => __( 'Admin View', 'yith-woocommerce-catalog-mode' ),
78
- 'type' => 'checkbox',
79
- 'desc' => __( 'Enable Catalog Mode also for administrators', 'yith-woocommerce-catalog-mode' ),
80
- 'id' => 'ywctm_admin_view',
81
- 'default' => 'yes',
82
- ),
83
- 'ywctm_catalog_mode_section_end' => array(
84
- 'type' => 'sectionend',
85
- ),
86
-
87
- 'ywctm_other_section_title' => array(
88
- 'name' => __( 'Other Settings', 'yith-woocommerce-catalog-mode' ),
89
- 'type' => 'title',
90
- 'desc' => '',
91
- ),
92
- 'ywctm_other_disable_cart_in_header' => array(
93
- 'name' => __( 'Disable shop', 'yith-woocommerce-catalog-mode' ),
94
- 'type' => 'checkbox',
95
- 'desc' => __( 'Hide and disable "Cart" page, "Checkout" page and all "Add to Cart" buttons', 'yith-woocommerce-catalog-mode' ),
96
- 'id' => 'ywctm_hide_cart_header',
97
- 'default' => 'no',
98
- ),
99
- 'ywctm_other_section_end' => array(
100
- 'type' => 'sectionend',
101
- )
102
- )
103
-
104
  );
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ global $YITH_WC_Catalog_Mode;
16
+
17
+ return array(
18
+ 'settings' => array(
19
+ 'ywctm_videobox' => array(
20
+ 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-catalog-mode' ),
21
+ 'type' => 'videobox',
22
+ 'default' => array(
23
+ 'plugin_name' => __( 'YITH WooCommerce Catalog Mode', 'yith-woocommerce-catalog-mode' ),
24
+ 'title_first_column' => __( 'Discover the Advanced Features', 'yith-woocommerce-catalog-mode' ),
25
+ 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit from all features!', 'yith-woocommerce-catalog-mode' ),
26
+ 'video' => array(
27
+ 'video_id' => '120697979',
28
+ 'video_image_url' => YWCTM_ASSETS_URL . 'images/yith-woocommerce-catalog-mode.jpg',
29
+ 'video_description' => __( 'YITH WooCommerce Catalog Mode', 'yith-woocommerce-catalog-mode' ),
30
+ ),
31
+ 'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-catalog-mode' ),
32
+ 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-catalog-mode' ),
33
+ 'button' => array(
34
+ 'href' => $YITH_WC_Catalog_Mode->get_premium_landing_uri(),
35
+ 'title' => 'Get Support and Pro Features'
36
+ )
37
+ ),
38
+ 'id' => 'ywctm_general_videobox'
39
+ ),
40
+
41
+ 'ywctm_general_title' => array(
42
+ 'name' => __( 'General Settings', 'yith-woocommerce-catalog-mode' ),
43
+ 'type' => 'title',
44
+ ),
45
+ 'ywctm_enable_plugin' => array(
46
+ 'name' => __( 'Enable YITH WooCommerce Catalog Mode', 'yith-woocommerce-catalog-mode' ),
47
+ 'type' => 'checkbox',
48
+ 'desc' => '',
49
+ 'id' => 'ywctm_enable_plugin',
50
+ 'default' => 'yes',
51
+ ),
52
+ 'ywctm_general_end' => array(
53
+ 'type' => 'sectionend',
54
+ ),
55
+
56
+ 'ywctm_catalog_mode_title' => array(
57
+ 'name' => __( 'Catalog Mode Settings', 'yith-woocommerce-catalog-mode' ),
58
+ 'type' => 'title',
59
+ ),
60
+ 'ywctm_catalog_mode_disable_add_to_cart_single' => array(
61
+ 'name' => __( '"Add to cart" button', 'yith-woocommerce-catalog-mode' ),
62
+ 'type' => 'checkbox',
63
+ 'desc' => __( 'Hide in product detail page', 'yith-woocommerce-catalog-mode' ),
64
+ 'id' => 'ywctm_hide_add_to_cart_single',
65
+ 'default' => 'no',
66
+ 'checkboxgroup' => 'start'
67
+ ),
68
+ 'ywctm_catalog_mode_disable_add_to_cart_loop' => array(
69
+ 'type' => 'checkbox',
70
+ 'desc' => __( 'Hide in other shop pages', 'yith-woocommerce-catalog-mode' ),
71
+ 'id' => 'ywctm_hide_add_to_cart_loop',
72
+ 'default' => 'no',
73
+ 'checkboxgroup' => ''
74
+
75
+ ),
76
+ 'ywctm_catalog_mode_admin_view' => array(
77
+ 'name' => __( 'Admin View', 'yith-woocommerce-catalog-mode' ),
78
+ 'type' => 'checkbox',
79
+ 'desc' => __( 'Enable Catalog Mode also for administrators', 'yith-woocommerce-catalog-mode' ),
80
+ 'id' => 'ywctm_admin_view',
81
+ 'default' => 'yes',
82
+ ),
83
+ 'ywctm_catalog_mode_section_end' => array(
84
+ 'type' => 'sectionend',
85
+ ),
86
+
87
+ 'ywctm_other_section_title' => array(
88
+ 'name' => __( 'Other Settings', 'yith-woocommerce-catalog-mode' ),
89
+ 'type' => 'title',
90
+ 'desc' => '',
91
+ ),
92
+ 'ywctm_other_disable_cart_in_header' => array(
93
+ 'name' => __( 'Disable shop', 'yith-woocommerce-catalog-mode' ),
94
+ 'type' => 'checkbox',
95
+ 'desc' => __( 'Hide and disable "Cart" page, "Checkout" page and all "Add to Cart" buttons', 'yith-woocommerce-catalog-mode' ),
96
+ 'id' => 'ywctm_hide_cart_header',
97
+ 'default' => 'no',
98
+ ),
99
+ 'ywctm_other_section_end' => array(
100
+ 'type' => 'sectionend',
101
+ )
102
+ )
103
+
104
  );
modules/yith-woocommerce-catalog-mode/templates/admin/premium.php CHANGED
@@ -1,361 +1,361 @@
1
- <style>
2
- .section{
3
- margin-left: -20px;
4
- margin-right: -20px;
5
- font-family: "Raleway",san-serif;
6
- }
7
- .section h1{
8
- text-align: center;
9
- text-transform: uppercase;
10
- color: #808a97;
11
- font-size: 35px;
12
- font-weight: 700;
13
- line-height: normal;
14
- display: inline-block;
15
- width: 100%;
16
- margin: 50px 0 0;
17
- }
18
- .section ul{
19
- list-style-type: disc;
20
- padding-left: 15px;
21
- }
22
- .section:nth-child(even){
23
- background-color: #fff;
24
- }
25
- .section:nth-child(odd){
26
- background-color: #f1f1f1;
27
- }
28
- .section .section-title img{
29
- display: table-cell;
30
- vertical-align: middle;
31
- width: auto;
32
- margin-right: 15px;
33
- }
34
- .section h2,
35
- .section h3 {
36
- display: inline-block;
37
- vertical-align: middle;
38
- padding: 0;
39
- font-size: 24px;
40
- font-weight: 700;
41
- color: #808a97;
42
- text-transform: uppercase;
43
- }
44
-
45
- .section .section-title h2{
46
- display: table-cell;
47
- vertical-align: middle;
48
- line-height: 25px;
49
- }
50
-
51
- .section-title{
52
- display: table;
53
- }
54
-
55
- .section h3 {
56
- font-size: 14px;
57
- line-height: 28px;
58
- margin-bottom: 0;
59
- display: block;
60
- }
61
-
62
- .section p{
63
- font-size: 13px;
64
- margin: 25px 0;
65
- }
66
- .section ul li{
67
- margin-bottom: 4px;
68
- }
69
- .landing-container{
70
- max-width: 750px;
71
- margin-left: auto;
72
- margin-right: auto;
73
- padding: 50px 0 30px;
74
- }
75
- .landing-container:after{
76
- display: block;
77
- clear: both;
78
- content: '';
79
- }
80
- .landing-container .col-1,
81
- .landing-container .col-2{
82
- float: left;
83
- box-sizing: border-box;
84
- padding: 0 15px;
85
- }
86
- .landing-container .col-1 img{
87
- width: 100%;
88
- }
89
- .landing-container .col-1{
90
- width: 55%;
91
- }
92
- .landing-container .col-2{
93
- width: 45%;
94
- }
95
- .premium-cta{
96
- background-color: #808a97;
97
- color: #fff;
98
- border-radius: 6px;
99
- padding: 20px 15px;
100
- }
101
- .premium-cta:after{
102
- content: '';
103
- display: block;
104
- clear: both;
105
- }
106
- .premium-cta p{
107
- margin: 7px 0;
108
- font-size: 14px;
109
- font-weight: 500;
110
- display: inline-block;
111
- width: 60%;
112
- }
113
- .premium-cta a.button{
114
- border-radius: 6px;
115
- height: 60px;
116
- float: right;
117
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/upgrade.png) #ff643f no-repeat 13px 13px;
118
- border-color: #ff643f;
119
- box-shadow: none;
120
- outline: none;
121
- color: #fff;
122
- position: relative;
123
- padding: 9px 50px 9px 70px;
124
- }
125
- .premium-cta a.button:hover,
126
- .premium-cta a.button:active,
127
- .premium-cta a.button:focus{
128
- color: #fff;
129
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/upgrade.png) #971d00 no-repeat 13px 13px;
130
- border-color: #971d00;
131
- box-shadow: none;
132
- outline: none;
133
- }
134
- .premium-cta a.button:focus{
135
- top: 1px;
136
- }
137
- .premium-cta a.button span{
138
- line-height: 13px;
139
- }
140
- .premium-cta a.button .highlight{
141
- display: block;
142
- font-size: 20px;
143
- font-weight: 700;
144
- line-height: 20px;
145
- }
146
- .premium-cta .highlight{
147
- text-transform: uppercase;
148
- background: none;
149
- font-weight: 800;
150
- color: #fff;
151
- }
152
-
153
- .section.one{
154
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%
155
- }
156
- .section.two{
157
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/02-bg.png) no-repeat #fff; background-position: 85% 75%
158
- }
159
- .section.three{
160
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/03-bg.png) no-repeat #fff; background-position: 85% 75%
161
- }
162
- .section.four{
163
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/04-bg.png) no-repeat #fff; background-position: 85% 75%
164
- }
165
- .section.five{
166
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/05-bg.png) no-repeat #fff; background-position: 85% 75%
167
- }
168
- .section.six{
169
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/06-bg.png) no-repeat #fff; background-position: 85% 75%
170
- }
171
-
172
- .section.seven{
173
- background: url(<?php echo YWCTM_ASSETS_URL?>/images/07-bg.png) no-repeat #fff; background-position: 85% 75%
174
- }
175
-
176
- @media (max-width: 768px) {
177
- .section{margin: 0}
178
- .premium-cta p{
179
- width: 100%;
180
- }
181
- .premium-cta{
182
- text-align: center;
183
- }
184
- .premium-cta a.button{
185
- float: none;
186
- }
187
- }
188
-
189
- @media (max-width: 480px){
190
- .wrap{
191
- margin-right: 0;
192
- }
193
- .section{
194
- margin: 0;
195
- }
196
- .landing-container .col-1,
197
- .landing-container .col-2{
198
- width: 100%;
199
- padding: 0 15px;
200
- }
201
- .section-odd .col-1 {
202
- float: left;
203
- margin-right: -100%;
204
- }
205
- .section-odd .col-2 {
206
- float: right;
207
- margin-top: 65%;
208
- }
209
- }
210
-
211
- @media (max-width: 320px){
212
- .premium-cta a.button{
213
- padding: 9px 20px 9px 70px;
214
- }
215
-
216
- .section .section-title img{
217
- display: none;
218
- }
219
- }
220
- </style>
221
- <div class="landing">
222
- <div class="section section-cta section-odd">
223
- <div class="landing-container">
224
- <div class="premium-cta">
225
- <p>
226
- <?php echo sprintf( __('Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Catalog Mode%2$s to benefit from all features!','yith-woocommerce-catalog-mode'),'<span class="highlight">','</span>' );?>
227
- </p>
228
- <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
229
- <span class="highlight"><?php _e('UPGRADE','yith-woocommerce-catalog-mode');?></span>
230
- <span><?php _e('to the premium version','yith-woocommerce-catalog-mode');?></span>
231
- </a>
232
- </div>
233
- </div>
234
- </div>
235
- <div class="one section section-even clear">
236
- <h1><?php _e('Premium Features','yith-woocommerce-catalog-mode');?></h1>
237
- <div class="landing-container">
238
- <div class="col-1">
239
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/01.png" alt="Hide price" />
240
- </div>
241
- <div class="col-2">
242
- <div class="section-title">
243
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/01-icon.png" alt="icon 01"/>
244
- <h2><?php _e('Hide price','yith-woocommerce-catalog-mode');?></h2>
245
- </div>
246
- <p>
247
- <?php echo sprintf(__('Hide the price of products in your shop and replace it with a text. Decide if some of the products have to be excluded and if %1$shiding price%2$s has to be applied to all or restricted only to unlogged users.', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
248
- </p>
249
- </div>
250
- </div>
251
- </div>
252
- <div class="two section section-odd clear">
253
- <div class="landing-container">
254
- <div class="col-2">
255
- <div class="section-title">
256
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/02-icon.png" alt="icon 02" />
257
- <h2><?php _e('Inquiry form','yith-woocommerce-catalog-mode');?></h2>
258
- </div>
259
- <p>
260
- <?php echo sprintf(__('Improve single product page by adding a tab with an %1$sinquiry form%2$s explicitly thought to let them send messages to site administrator.', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
261
- </p>
262
- </div>
263
- <div class="col-1">
264
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/02.png" alt="Inquiry form" />
265
- </div>
266
- </div>
267
- </div>
268
- <div class="three section section-even clear">
269
- <div class="landing-container">
270
- <div class="col-1">
271
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/03.png" alt="Custom button" />
272
- </div>
273
- <div class="col-2">
274
- <div class="section-title">
275
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/03-icon.png" alt="icon 03" />
276
- <h2><?php _e( 'Custom button','yith-woocommerce-catalog-mode');?></h2>
277
- </div>
278
- <p>
279
- <?php echo sprintf(__('Add a button in single product page to call users to a specific %1$saction%2$s, depending on the specified %1$slink%2$s (email sending, skype call, telephone call).', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
280
- </p>
281
- </div>
282
- </div>
283
- </div>
284
- <div class="four section section-odd clear">
285
- <div class="landing-container">
286
- <div class="col-2">
287
- <div class="section-title">
288
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/04-icon.png" alt="icon 04" />
289
- <h2><?php _e('Product reviews','yith-woocommerce-catalog-mode');?></h2>
290
- </div>
291
- <p>
292
- <?php echo sprintf(__('You can disable product %1$sreviewing system%2$s of your shop and decide if applying it to all users or just to unlogged ones.', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
293
- </p>
294
- </div>
295
- <div class="col-1">
296
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/04.png" alt="Product reviews" />
297
- </div>
298
- </div>
299
- </div>
300
- <div class="five section section-even clear">
301
- <div class="landing-container">
302
- <div class="col-1">
303
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/05.png" alt="Exclusion list" />
304
- </div>
305
- <div class="col-2">
306
- <div class="section-title">
307
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/05-icon.png" alt="icon 05" />
308
- <h2><?php _e('Exclusion list','yith-woocommerce-catalog-mode');?></h2>
309
- </div>
310
- <p>
311
- <?php echo sprintf( __('Set plugin options, but if you want that options concerning price visibility and ‘Add to cart’ do not apply to specific products, add them to %1$sexclusion list%2$s and, voilà, problem solved.','yith-woocommerce-catalog-mode'),'<b>','</b>'); ?>
312
- </p>
313
- </div>
314
- </div>
315
- </div>
316
- <div class="six section section-odd clear">
317
- <div class="landing-container">
318
- <div class="col-2">
319
- <div class="section-title">
320
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/06-icon.png" alt="icon 06" />
321
- <h2><?php _e('REVERSE EXCLUSION LIST','yith-woocommerce-catalog-mode');?></h2>
322
- </div>
323
- <p>
324
- <?php echo sprintf( __( 'Apply Catalog Mode to some items only: add them to the "Exclusion List" and %1$smake it work in the opposite way as usual%2$s. All items in the shop show price and “Add to Cart” button, while items in the list don’t.','yith-woocommerce-catalog-mode' ),'<b>','</b>' ) ?>
325
- </p>
326
- </div>
327
- <div class="col-1">
328
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/06.png" alt="REVERSE EXCLUSION LIST" />
329
- </div>
330
- </div>
331
- </div>
332
- <div class="seven section section-even clear">
333
- <div class="landing-container">
334
- <div class="col-1">
335
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/07.png" alt="Source page of the request" />
336
- </div>
337
- <div class="col-2">
338
- <div class="section-title">
339
- <img src="<?php echo YWCTM_ASSETS_URL?>/images/07-icon.png" alt="icon 05" />
340
- <h2><?php _e('Source page of the request','yith-woocommerce-catalog-mode');?></h2>
341
- </div>
342
- <p>
343
- <?php echo sprintf( __('Thanks to the %1$s"Product Permalink"%2$s option you will be able to know from which page your users have generated the request.%3$sThe email generated from the request form will include the address of the page: another important information that can be really useful for you.','yith-woocommerce-catalog-mode'),'<b>','</b>','<br>'); ?>
344
- </p>
345
- </div>
346
- </div>
347
- </div>
348
- <div class="section section-cta section-odd">
349
- <div class="landing-container">
350
- <div class="premium-cta">
351
- <p>
352
- <?php echo sprintf( __('Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Catalog Mode%2$s to benefit from all features!','yith-woocommerce-catalog-mode'),'<span class="highlight">','</span>' );?>
353
- </p>
354
- <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
355
- <span class="highlight"><?php _e('UPGRADE','yith-woocommerce-catalog-mode');?></span>
356
- <span><?php _e('to the premium version','yith-woocommerce-catalog-mode');?></span>
357
- </a>
358
- </div>
359
- </div>
360
- </div>
361
  </div>
1
+ <style>
2
+ .section{
3
+ margin-left: -20px;
4
+ margin-right: -20px;
5
+ font-family: "Raleway",san-serif;
6
+ }
7
+ .section h1{
8
+ text-align: center;
9
+ text-transform: uppercase;
10
+ color: #808a97;
11
+ font-size: 35px;
12
+ font-weight: 700;
13
+ line-height: normal;
14
+ display: inline-block;
15
+ width: 100%;
16
+ margin: 50px 0 0;
17
+ }
18
+ .section ul{
19
+ list-style-type: disc;
20
+ padding-left: 15px;
21
+ }
22
+ .section:nth-child(even){
23
+ background-color: #fff;
24
+ }
25
+ .section:nth-child(odd){
26
+ background-color: #f1f1f1;
27
+ }
28
+ .section .section-title img{
29
+ display: table-cell;
30
+ vertical-align: middle;
31
+ width: auto;
32
+ margin-right: 15px;
33
+ }
34
+ .section h2,
35
+ .section h3 {
36
+ display: inline-block;
37
+ vertical-align: middle;
38
+ padding: 0;
39
+ font-size: 24px;
40
+ font-weight: 700;
41
+ color: #808a97;
42
+ text-transform: uppercase;
43
+ }
44
+
45
+ .section .section-title h2{
46
+ display: table-cell;
47
+ vertical-align: middle;
48
+ line-height: 25px;
49
+ }
50
+
51
+ .section-title{
52
+ display: table;
53
+ }
54
+
55
+ .section h3 {
56
+ font-size: 14px;
57
+ line-height: 28px;
58
+ margin-bottom: 0;
59
+ display: block;
60
+ }
61
+
62
+ .section p{
63
+ font-size: 13px;
64
+ margin: 25px 0;
65
+ }
66
+ .section ul li{
67
+ margin-bottom: 4px;
68
+ }
69
+ .landing-container{
70
+ max-width: 750px;
71
+ margin-left: auto;
72
+ margin-right: auto;
73
+ padding: 50px 0 30px;
74
+ }
75
+ .landing-container:after{
76
+ display: block;
77
+ clear: both;
78
+ content: '';
79
+ }
80
+ .landing-container .col-1,
81
+ .landing-container .col-2{
82
+ float: left;
83
+ box-sizing: border-box;
84
+ padding: 0 15px;
85
+ }
86
+ .landing-container .col-1 img{
87
+ width: 100%;
88
+ }
89
+ .landing-container .col-1{
90
+ width: 55%;
91
+ }
92
+ .landing-container .col-2{
93
+ width: 45%;
94
+ }
95
+ .premium-cta{
96
+ background-color: #808a97;
97
+ color: #fff;
98
+ border-radius: 6px;
99
+ padding: 20px 15px;
100
+ }
101
+ .premium-cta:after{
102
+ content: '';
103
+ display: block;
104
+ clear: both;
105
+ }
106
+ .premium-cta p{
107
+ margin: 7px 0;
108
+ font-size: 14px;
109
+ font-weight: 500;
110
+ display: inline-block;
111
+ width: 60%;
112
+ }
113
+ .premium-cta a.button{
114
+ border-radius: 6px;
115
+ height: 60px;
116
+ float: right;
117
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/upgrade.png) #ff643f no-repeat 13px 13px;
118
+ border-color: #ff643f;
119
+ box-shadow: none;
120
+ outline: none;
121
+ color: #fff;
122
+ position: relative;
123
+ padding: 9px 50px 9px 70px;
124
+ }
125
+ .premium-cta a.button:hover,
126
+ .premium-cta a.button:active,
127
+ .premium-cta a.button:focus{
128
+ color: #fff;
129
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/upgrade.png) #971d00 no-repeat 13px 13px;
130
+ border-color: #971d00;
131
+ box-shadow: none;
132
+ outline: none;
133
+ }
134
+ .premium-cta a.button:focus{
135
+ top: 1px;
136
+ }
137
+ .premium-cta a.button span{
138
+ line-height: 13px;
139
+ }
140
+ .premium-cta a.button .highlight{
141
+ display: block;
142
+ font-size: 20px;
143
+ font-weight: 700;
144
+ line-height: 20px;
145
+ }
146
+ .premium-cta .highlight{
147
+ text-transform: uppercase;
148
+ background: none;
149
+ font-weight: 800;
150
+ color: #fff;
151
+ }
152
+
153
+ .section.one{
154
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%
155
+ }
156
+ .section.two{
157
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/02-bg.png) no-repeat #fff; background-position: 85% 75%
158
+ }
159
+ .section.three{
160
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/03-bg.png) no-repeat #fff; background-position: 85% 75%
161
+ }
162
+ .section.four{
163
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/04-bg.png) no-repeat #fff; background-position: 85% 75%
164
+ }
165
+ .section.five{
166
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/05-bg.png) no-repeat #fff; background-position: 85% 75%
167
+ }
168
+ .section.six{
169
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/06-bg.png) no-repeat #fff; background-position: 85% 75%
170
+ }
171
+
172
+ .section.seven{
173
+ background: url(<?php echo YWCTM_ASSETS_URL?>/images/07-bg.png) no-repeat #fff; background-position: 85% 75%
174
+ }
175
+
176
+ @media (max-width: 768px) {
177
+ .section{margin: 0}
178
+ .premium-cta p{
179
+ width: 100%;
180
+ }
181
+ .premium-cta{
182
+ text-align: center;
183
+ }
184
+ .premium-cta a.button{
185
+ float: none;
186
+ }
187
+ }
188
+
189
+ @media (max-width: 480px){
190
+ .wrap{
191
+ margin-right: 0;
192
+ }
193
+ .section{
194
+ margin: 0;
195
+ }
196
+ .landing-container .col-1,
197
+ .landing-container .col-2{
198
+ width: 100%;
199
+ padding: 0 15px;
200
+ }
201
+ .section-odd .col-1 {
202
+ float: left;
203
+ margin-right: -100%;
204
+ }
205
+ .section-odd .col-2 {
206
+ float: right;
207
+ margin-top: 65%;
208
+ }
209
+ }
210
+
211
+ @media (max-width: 320px){
212
+ .premium-cta a.button{
213
+ padding: 9px 20px 9px 70px;
214
+ }
215
+
216
+ .section .section-title img{
217
+ display: none;
218
+ }
219
+ }
220
+ </style>
221
+ <div class="landing">
222
+ <div class="section section-cta section-odd">
223
+ <div class="landing-container">
224
+ <div class="premium-cta">
225
+ <p>
226
+ <?php echo sprintf( __('Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Catalog Mode%2$s to benefit from all features!','yith-woocommerce-catalog-mode'),'<span class="highlight">','</span>' );?>
227
+ </p>
228
+ <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
229
+ <span class="highlight"><?php _e('UPGRADE','yith-woocommerce-catalog-mode');?></span>
230
+ <span><?php _e('to the premium version','yith-woocommerce-catalog-mode');?></span>
231
+ </a>
232
+ </div>
233
+ </div>
234
+ </div>
235
+ <div class="one section section-even clear">
236
+ <h1><?php _e('Premium Features','yith-woocommerce-catalog-mode');?></h1>
237
+ <div class="landing-container">
238
+ <div class="col-1">
239
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/01.png" alt="Hide price" />
240
+ </div>
241
+ <div class="col-2">
242
+ <div class="section-title">
243
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/01-icon.png" alt="icon 01"/>
244
+ <h2><?php _e('Hide price','yith-woocommerce-catalog-mode');?></h2>
245
+ </div>
246
+ <p>
247
+ <?php echo sprintf(__('Hide the price of products in your shop and replace it with a text. Decide if some of the products have to be excluded and if %1$shiding price%2$s has to be applied to all or restricted only to unlogged users.', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
248
+ </p>
249
+ </div>
250
+ </div>
251
+ </div>
252
+ <div class="two section section-odd clear">
253
+ <div class="landing-container">
254
+ <div class="col-2">
255
+ <div class="section-title">
256
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/02-icon.png" alt="icon 02" />
257
+ <h2><?php _e('Inquiry form','yith-woocommerce-catalog-mode');?></h2>
258
+ </div>
259
+ <p>
260
+ <?php echo sprintf(__('Improve single product page by adding a tab with an %1$sinquiry form%2$s explicitly thought to let them send messages to site administrator.', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
261
+ </p>
262
+ </div>
263
+ <div class="col-1">
264
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/02.png" alt="Inquiry form" />
265
+ </div>
266
+ </div>
267
+ </div>
268
+ <div class="three section section-even clear">
269
+ <div class="landing-container">
270
+ <div class="col-1">
271
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/03.png" alt="Custom button" />
272
+ </div>
273
+ <div class="col-2">
274
+ <div class="section-title">
275
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/03-icon.png" alt="icon 03" />
276
+ <h2><?php _e( 'Custom button','yith-woocommerce-catalog-mode');?></h2>
277
+ </div>
278
+ <p>
279
+ <?php echo sprintf(__('Add a button in single product page to call users to a specific %1$saction%2$s, depending on the specified %1$slink%2$s (email sending, skype call, telephone call).', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
280
+ </p>
281
+ </div>
282
+ </div>
283
+ </div>
284
+ <div class="four section section-odd clear">
285
+ <div class="landing-container">
286
+ <div class="col-2">
287
+ <div class="section-title">
288
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/04-icon.png" alt="icon 04" />
289
+ <h2><?php _e('Product reviews','yith-woocommerce-catalog-mode');?></h2>
290
+ </div>
291
+ <p>
292
+ <?php echo sprintf(__('You can disable product %1$sreviewing system%2$s of your shop and decide if applying it to all users or just to unlogged ones.', 'yith-woocommerce-catalog-mode'), '<b>', '</b>');?>
293
+ </p>
294
+ </div>
295
+ <div class="col-1">
296
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/04.png" alt="Product reviews" />
297
+ </div>
298
+ </div>
299
+ </div>
300
+ <div class="five section section-even clear">
301
+ <div class="landing-container">
302
+ <div class="col-1">
303
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/05.png" alt="Exclusion list" />
304
+ </div>
305
+ <div class="col-2">
306
+ <div class="section-title">
307
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/05-icon.png" alt="icon 05" />
308
+ <h2><?php _e('Exclusion list','yith-woocommerce-catalog-mode');?></h2>
309
+ </div>
310
+ <p>
311
+ <?php echo sprintf( __('Set plugin options, but if you want that options concerning price visibility and ‘Add to cart’ do not apply to specific products, add them to %1$sexclusion list%2$s and, voilà, problem solved.','yith-woocommerce-catalog-mode'),'<b>','</b>'); ?>
312
+ </p>
313
+ </div>
314
+ </div>
315
+ </div>
316
+ <div class="six section section-odd clear">
317
+ <div class="landing-container">
318
+ <div class="col-2">
319
+ <div class="section-title">
320
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/06-icon.png" alt="icon 06" />
321
+ <h2><?php _e('REVERSE EXCLUSION LIST','yith-woocommerce-catalog-mode');?></h2>
322
+ </div>
323
+ <p>
324
+ <?php echo sprintf( __( 'Apply Catalog Mode to some items only: add them to the "Exclusion List" and %1$smake it work in the opposite way as usual%2$s. All items in the shop show price and “Add to Cart” button, while items in the list don’t.','yith-woocommerce-catalog-mode' ),'<b>','</b>' ) ?>
325
+ </p>
326
+ </div>
327
+ <div class="col-1">
328
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/06.png" alt="REVERSE EXCLUSION LIST" />
329
+ </div>
330
+ </div>
331
+ </div>
332
+ <div class="seven section section-even clear">
333
+ <div class="landing-container">
334
+ <div class="col-1">
335
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/07.png" alt="Source page of the request" />
336
+ </div>
337
+ <div class="col-2">
338
+ <div class="section-title">
339
+ <img src="<?php echo YWCTM_ASSETS_URL?>/images/07-icon.png" alt="icon 05" />
340
+ <h2><?php _e('Source page of the request','yith-woocommerce-catalog-mode');?></h2>
341
+ </div>
342
+ <p>
343
+ <?php echo sprintf( __('Thanks to the %1$s"Product Permalink"%2$s option you will be able to know from which page your users have generated the request.%3$sThe email generated from the request form will include the address of the page: another important information that can be really useful for you.','yith-woocommerce-catalog-mode'),'<b>','</b>','<br>'); ?>
344
+ </p>
345
+ </div>
346
+ </div>
347
+ </div>
348
+ <div class="section section-cta section-odd">
349
+ <div class="landing-container">
350
+ <div class="premium-cta">
351
+ <p>
352
+ <?php echo sprintf( __('Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Catalog Mode%2$s to benefit from all features!','yith-woocommerce-catalog-mode'),'<span class="highlight">','</span>' );?>
353
+ </p>
354
+ <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
355
+ <span class="highlight"><?php _e('UPGRADE','yith-woocommerce-catalog-mode');?></span>
356
+ <span><?php _e('to the premium version','yith-woocommerce-catalog-mode');?></span>
357
+ </a>
358
+ </div>
359
+ </div>
360
+ </div>
361
  </div>
modules/yith-woocommerce-mailchimp/assets/css/admin/yith-wcmc.css CHANGED
@@ -1,253 +1,262 @@
1
- /**
2
- * General admin style
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Mailchimp
6
- * @version 1.0.0
7
- */
8
-
9
- /* === INTEGRATION STATUS === */
10
- .yith_wcmc_integration_status .account-banner{
11
- border: 1px solid #ddd;
12
- border-radius: 5px;
13
- padding: 30px;
14
- position: relative;
15
- }
16
-
17
- .yith_wcmc_integration_status .account-banner:after{
18
- content: '';
19
- display: block;
20
- clear: both;
21
- }
22
-
23
- .yith_wcmc_integration_status .account-banner .account-avatar{
24
- text-align: center;
25
- width: 20%;
26
- float: left;
27
- border-right: 1px solid #eee;
28
- box-sizing: border-box;
29
- }
30
-
31
- .yith_wcmc_integration_status .account-banner .account-avatar .account-thumb{
32
- border: 5px solid #eee;
33
- display: inline-block;
34
- border-radius: 50%;
35
- overflow: hidden;
36
- margin-bottom: 10px;
37
- height: 96px;
38
- width: 96px;
39
- }
40
-
41
- .yith_wcmc_integration_status .account-banner .account-avatar .account-name{
42
- font-weight: 700;
43
- }
44
-
45
- .yith_wcmc_integration_status .account-banner .account-details{
46
- float: right;
47
- width: 80%;
48
- padding: 20px;
49
- box-sizing: border-box;
50
- }
51
-
52
- .yith_wcmc_integration_status .account-banner .account-details p{
53
- margin-bottom: 10px;
54
- }
55
-
56
- .yith_wcmc_integration_status .account-banner .account-details p .label{
57
- margin-right: 10px;
58
- }
59
-
60
- .yith_wcmc_integration_status mark {
61
- display: inline-block;
62
- text-indent: -9999px;
63
- position: relative;
64
- height: 1em;
65
- width: 1em;
66
- background: 0 0;
67
- font-size: 1.4em;
68
- margin: 0 auto;
69
- vertical-align: middle;
70
- }
71
-
72
- .yith_wcmc_integration_status mark.cancelled:after, .yith_wcmc_integration_status mark.completed:after {
73
- font-family: WooCommerce;
74
- font-weight: 400;
75
- font-variant: normal;
76
- text-transform: none;
77
- line-height: 1;
78
- -webkit-font-smoothing: antialiased;
79
- margin: 0;
80
- text-indent: 0;
81
- position: absolute;
82
- top: 0;
83
- left: 0;
84
- width: 100%;
85
- height: 100%;
86
- text-align: center;
87
- }
88
-
89
- .yith_wcmc_integration_status mark.completed:after {
90
- content: "\e015";
91
- color: #73a724;
92
- }
93
-
94
- .yith_wcmc_integration_status mark.cancelled:after {
95
- content: "\e013";
96
- color: #a00;
97
- }
98
-
99
- /* === DASHBOARD WIDGET === */
100
- #yith_wcmc_dashboard_widget .inside:after{
101
- content: '';
102
- display: block;
103
- clear: both;
104
- }
105
-
106
- #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner{
107
- padding: 20px;
108
- }
109
-
110
- #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-avatar{
111
- width: 25%;
112
- border: none;
113
- }
114
-
115
- #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-avatar .account-thumb{
116
- width: 66px;
117
- height: 66px;
118
- }
119
-
120
- #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-details{
121
- width: 75%;
122
- padding: 10px;
123
- }
124
-
125
- #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-details p:first-child{
126
- margin-top: 0;
127
- }
128
-
129
- #yith_wcmc_dashboard_widget .list-stat-container{
130
- position: relative;
131
- }
132
-
133
- #yith_wcmc_dashboard_widget .carousel_controls{
134
- position: absolute;
135
- right: 10px;
136
- top: 10px;
137
- z-index: 10;
138
- }
139
-
140
- #yith_wcmc_dashboard_widget .carousel_controls a{
141
- display: inline-block;
142
- text-indent: -9999px;
143
- position: relative;
144
- width: 1.4em;
145
- height: 1.4em;
146
- }
147
-
148
- #yith_wcmc_dashboard_widget .carousel_controls a:before{
149
- font-family: WooCommerce;
150
- font-weight: 400;
151
- font-variant: normal;
152
- text-transform: none;
153
- line-height: 1;
154
- -webkit-font-smoothing: antialiased;
155
- margin: 0;
156
- text-indent: 0;
157
- position: absolute;
158
- top: 0;
159
- left: 0;
160
- width: 100%;
161
- height: 100%;
162
- text-align: center;
163
- color: #ebebeb;
164
- font-size: 1.4em;
165
- background: #fff;
166
- border-radius: 50%;
167
- }
168
-
169
- #yith_wcmc_dashboard_widget .carousel_controls a:focus,
170
- #yith_wcmc_dashboard_widget .carousel_controls a:active{
171
- box-shadow: none!important;
172
- -webkit-box-shadow: none!important;
173
- -moz-box-shadow: none!important;
174
- }
175
-
176
- #yith_wcmc_dashboard_widget .carousel_controls a:hover:before{
177
- color: #aaa;
178
- }
179
-
180
- #yith_wcmc_dashboard_widget .carousel_controls a.prev:before{
181
- content: '\e00b';
182
- }
183
-
184
- #yith_wcmc_dashboard_widget .carousel_controls a.next:before{
185
- content: '\e008';
186
- }
187
-
188
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats{
189
- border: 1px solid #ebebeb;
190
- border-radius: 5px;
191
- margin-top: 10px;
192
- }
193
-
194
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat{
195
- padding: 10px;
196
- }
197
-
198
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat h3 {
199
- padding: 5px 0;
200
- border-bottom: 1px solid #ebebeb;
201
- margin-bottom: 10px;
202
- }
203
-
204
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat table {
205
- width: 100%;
206
- }
207
-
208
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat th,
209
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat td {
210
- border-bottom: 1px dashed #ebebeb;
211
- padding-bottom: 5px;
212
- }
213
-
214
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat tr:last-child th,
215
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat tr:last-child td{
216
- border: none;
217
- }
218
-
219
- #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat table th {
220
- text-align: left;
221
- }
222
-
223
- #yith_wcmc_dashboard_widget .refresh-list-stats{
224
- margin-top: 10px;
225
- float: right;
226
- }
227
-
228
- #yith_wcmc_dashboard_widget .refresh-list-stats:before{
229
- font-family: WooCommerce;
230
- font-weight: 400;
231
- content: '\e031';
232
- vertical-align: middle;
233
- display: inline-block;
234
- margin-right: 5px;
235
- }
236
-
237
- /* === LIST UPDATER === */
238
-
239
- a.ajax-mailchimp-updater-list,
240
- a.ajax-mailchimp-updater-group,
241
- a.update-fields{
242
- vertical-align: middle!important;
243
- margin: 0 5px!important;
244
- }
245
-
246
- .select2-container.chosen_select,
247
- .select2-container.select2-container-multi{
248
- display: inline-block!important;
249
- }
250
-
251
- #yith_wcmc_panel_export input[type="submit"]:not(.visible){
252
- display: none;
 
 
 
 
 
 
 
 
 
253
  }
1
+ /**
2
+ * General admin style
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Mailchimp
6
+ * @version 1.0.0
7
+ */
8
+
9
+ /* === INTEGRATION STATUS === */
10
+ .yith_wcmc_integration_status .account-banner{
11
+ border: 1px solid #ddd;
12
+ border-radius: 5px;
13
+ padding: 30px;
14
+ position: relative;
15
+ }
16
+
17
+ .yith_wcmc_integration_status .account-banner:after{
18
+ content: '';
19
+ display: block;
20
+ clear: both;
21
+ }
22
+
23
+ .yith_wcmc_integration_status .account-banner .account-avatar{
24
+ text-align: center;
25
+ width: 20%;
26
+ float: left;
27
+ border-right: 1px solid #eee;
28
+ box-sizing: border-box;
29
+ }
30
+
31
+ .yith_wcmc_integration_status .account-banner .account-avatar .account-thumb{
32
+ border: 5px solid #eee;
33
+ display: inline-block;
34
+ border-radius: 50%;
35
+ overflow: hidden;
36
+ margin-bottom: 10px;
37
+ height: 96px;
38
+ width: 96px;
39
+ }
40
+
41
+ .yith_wcmc_integration_status .account-banner .account-avatar .account-name{
42
+ font-weight: 700;
43
+ }
44
+
45
+ .yith_wcmc_integration_status .account-banner .account-details{
46
+ float: right;
47
+ width: 80%;
48
+ padding: 20px;
49
+ box-sizing: border-box;
50
+ }
51
+
52
+ .yith_wcmc_integration_status .account-banner .account-details p{
53
+ margin-bottom: 10px;
54
+ }
55
+
56
+ .yith_wcmc_integration_status .account-banner .account-details p .label{
57
+ margin-right: 10px;
58
+ }
59
+
60
+ .yith_wcmc_integration_status mark {
61
+ display: inline-block;
62
+ text-indent: -9999px;
63
+ position: relative;
64
+ height: 1em;
65
+ width: 1em;
66
+ background: 0 0;
67
+ font-size: 1.4em;
68
+ margin: 0 auto;
69
+ vertical-align: middle;
70
+ }
71
+
72
+ .yith_wcmc_integration_status mark.cancelled:after, .yith_wcmc_integration_status mark.completed:after {
73
+ font-family: WooCommerce;
74
+ font-weight: 400;
75
+ font-variant: normal;
76
+ text-transform: none;
77
+ line-height: 1;
78
+ -webkit-font-smoothing: antialiased;
79
+ margin: 0;
80
+ text-indent: 0;
81
+ position: absolute;
82
+ top: 0;
83
+ left: 0;
84
+ width: 100%;
85
+ height: 100%;
86
+ text-align: center;
87
+ }
88
+
89
+ .yith_wcmc_integration_status mark.completed:after {
90
+ content: "\e015";
91
+ color: #73a724;
92
+ }
93
+
94
+ .yith_wcmc_integration_status mark.cancelled:after {
95
+ content: "\e013";
96
+ color: #a00;
97
+ }
98
+
99
+ /* === DASHBOARD WIDGET === */
100
+ #yith_wcmc_dashboard_widget .inside:after{
101
+ content: '';
102
+ display: block;
103
+ clear: both;
104
+ }
105
+
106
+ #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner{
107
+ padding: 20px;
108
+ }
109
+
110
+ #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-avatar{
111
+ width: 25%;
112
+ border: none;
113
+ }
114
+
115
+ #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-avatar .account-thumb{
116
+ width: 66px;
117
+ height: 66px;
118
+ }
119
+
120
+ #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-details{
121
+ width: 75%;
122
+ padding: 10px;
123
+ }
124
+
125
+ #yith_wcmc_dashboard_widget .yith_wcmc_integration_status .account-banner .account-details p:first-child{
126
+ margin-top: 0;
127
+ }
128
+
129
+ #yith_wcmc_dashboard_widget .list-stat-container{
130
+ position: relative;
131
+ }
132
+
133
+ #yith_wcmc_dashboard_widget .carousel_controls{
134
+ position: absolute;
135
+ right: 10px;
136
+ top: 10px;
137
+ z-index: 10;
138
+ }
139
+
140
+ #yith_wcmc_dashboard_widget .carousel_controls a{
141
+ display: inline-block;
142
+ text-indent: -9999px;
143
+ position: relative;
144
+ width: 1.4em;
145
+ height: 1.4em;
146
+ }
147
+
148
+ #yith_wcmc_dashboard_widget .carousel_controls a:before{
149
+ font-family: WooCommerce;
150
+ font-weight: 400;
151
+ font-variant: normal;
152
+ text-transform: none;
153
+ line-height: 1;
154
+ -webkit-font-smoothing: antialiased;
155
+ margin: 0;
156
+ text-indent: 0;
157
+ position: absolute;
158
+ top: 0;
159
+ left: 0;
160
+ width: 100%;
161
+ height: 100%;
162
+ text-align: center;
163
+ color: #ebebeb;
164
+ font-size: 1.4em;
165
+ background: #fff;
166
+ border-radius: 50%;
167
+ }
168
+
169
+ #yith_wcmc_dashboard_widget .carousel_controls a:focus,
170
+ #yith_wcmc_dashboard_widget .carousel_controls a:active{
171
+ box-shadow: none!important;
172
+ -webkit-box-shadow: none!important;
173
+ -moz-box-shadow: none!important;
174
+ }
175
+
176
+ #yith_wcmc_dashboard_widget .carousel_controls a:hover:before{
177
+ color: #aaa;
178
+ }
179
+
180
+ #yith_wcmc_dashboard_widget .carousel_controls a.prev:before{
181
+ content: '\e00b';
182
+ }
183
+
184
+ #yith_wcmc_dashboard_widget .carousel_controls a.next:before{
185
+ content: '\e008';
186
+ }
187
+
188
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats{
189
+ border: 1px solid #ebebeb;
190
+ border-radius: 5px;
191
+ margin-top: 10px;
192
+ }
193
+
194
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat{
195
+ padding: 10px;
196
+ }
197
+
198
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat h3 {
199
+ padding: 5px 0;
200
+ border-bottom: 1px solid #ebebeb;
201
+ margin-bottom: 10px;
202
+ }
203
+
204
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat table {
205
+ width: 100%;
206
+ }
207
+
208
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat th,
209
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat td {
210
+ border-bottom: 1px dashed #ebebeb;
211
+ padding-bottom: 5px;
212
+ }
213
+
214
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat tr:last-child th,
215
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat tr:last-child td{
216
+ border: none;
217
+ }
218
+
219
+ #yith_wcmc_dashboard_widget .yith_wcmc_list_stats .list-stat table th {
220
+ text-align: left;
221
+ }
222
+
223
+ #yith_wcmc_dashboard_widget .refresh-list-stats{
224
+ margin-top: 10px;
225
+ float: right;
226
+ }
227
+
228
+ #yith_wcmc_dashboard_widget .refresh-list-stats:before{
229
+ font-family: WooCommerce;
230
+ font-weight: 400;
231
+ content: '\e031';
232
+ vertical-align: middle;
233
+ display: inline-block;
234
+ margin-right: 5px;
235
+ }
236
+
237
+ /* === LIST UPDATER === */
238
+
239
+ a.ajax-mailchimp-updater-list,
240
+ a.ajax-mailchimp-updater-group,
241
+ a.update-fields{
242
+ vertical-align: middle!important;
243
+ margin: 0 5px!important;
244
+ }
245
+
246
+ .select2-container.chosen_select,
247
+ .select2-container.select2-container-multi{
248
+ display: inline-block!important;
249
+ }
250
+
251
+ #yith_wcmc_panel_export input[type="submit"]:not(.visible){
252
+ display: none;
253
+ }
254
+
255
+ /* === PANEL WIDGET === */
256
+ #yith_wcmc_panel_shortcode .forminp-textarea p,
257
+ #yith_wcmc_panel_widget .forminp-textarea p{
258
+ font-size: 13px;
259
+ font-style: italic;
260
+
261
+ margin-bottom: 15px;
262
  }
modules/yith-woocommerce-mailchimp/assets/js/admin/unminified/yith-wcmc.js CHANGED
@@ -1,270 +1,270 @@
1
- /**
2
- * General admin panel handling
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Mailchimp
6
- * @version 1.0.0
7
- */
8
-
9
- jQuery( document ).ready( function( $ ){
10
- var list_select = $( '#yith_wcmc_mailchimp_list, #yith_wcmc_shortcode_mailchimp_list, #yith_wcmc_widget_mailchimp_list, #yith_wcmc_export_list'),
11
- group_select = $( '#yith_wcmc_mailchimp_groups, #yith_wcmc_shortcode_mailchimp_groups, #yith_wcmc_widget_mailchimp_groups');
12
-
13
- // add updater button
14
- list_select.after( $( '<a>').addClass( 'button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-list').attr( 'id', 'yith_wmcm_mailchimp_list_updater').attr( 'href', '#').text( yith_wcmc.labels.update_list_button ));
15
- group_select.after( $( '<a>').addClass( 'button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-group').attr( 'id', 'yith_wcmc_mailchimp_group_updater').attr( 'href', '#').text( yith_wcmc.labels.update_group_button ));
16
-
17
- var handle_lists = function( ev ){
18
- var t = $(this),
19
- list = t.prev( 'select'),
20
- selected_option = list.find( 'option:selected' ).val();
21
-
22
- ev.preventDefault();
23
-
24
- $.ajax({
25
- beforeSend: function(){
26
- t.block({
27
- message: null,
28
- overlayCSS: {
29
- background: '#fff',
30
- opacity: 0.6
31
- }
32
- });
33
-
34
-
35
- },
36
- complete: function(){
37
- t.unblock();
38
- },
39
- data: {
40
- request: 'lists/list',
41
- force_update: true,
42
- args: {
43
- sort_field: 'web'
44
- },
45
- action: yith_wcmc.actions.do_request_via_ajax_action,
46
- yith_wcmc_ajax_request_nonce: yith_wcmc.ajax_request_nonce
47
- },
48
- dataType: 'json',
49
- method: 'POST',
50
- success: function( lists ){
51
- var new_options = '',
52
- i = 0;
53
-
54
- if( lists.data.length != 0 ){
55
- for( i in lists.data ){
56
- new_options += '<option value="' + lists.data[i].id + '" ' + ( ( selected_option == lists.data[i].id ) ? 'selected="selected"' : '' ) + ' >' + lists.data[i].name + '</option>';
57
- }
58
- }
59
-
60
- list.html( new_options );
61
-
62
- if( new_options.length == 0 ){
63
- list.prop( 'disabled' );
64
- }
65
- else{
66
- list.removeProp( 'disabled' );
67
- }
68
-
69
- },
70
- url: ajaxurl
71
- });
72
- },
73
- handle_groups = function( ev ){
74
- var t = $( this).hasClass( 'ajax-mailchimp-updater-group' ) ? $(this).prev( 'select' ) : $(this).parents('tr').next().find('select'),
75
- row = t.closest( 'td'),
76
- list_id = t.closest('tr').prev().find('select').find( 'option:selected' ).val(),
77
- selected_options_dom = t.find( 'option:selected'),
78
- selected_options = [];
79
-
80
- selected_options_dom.each( function( i, v ){
81
- selected_options[i] = $(v).val();
82
- } );
83
-
84
- ev.preventDefault();
85
-
86
- if( list_id.length == 0 ){
87
- t.prop( 'disabled' );
88
- }
89
- else{
90
- t.removeProp( 'disabled' );
91
- }
92
-
93
- $.ajax({
94
- beforeSend: function(){
95
- row.block({
96
- message: null,
97
- overlayCSS: {
98
- background: '#fff',
99
- opacity: 0.6
100
- }
101
- });
102
- },
103
- complete: function(){
104
- row.unblock();
105
- },
106
- data: {
107
- request: 'lists/interest-groupings',
108
- force_update: true,
109
- args: {
110
- id: list_id
111
- },
112
- action: yith_wcmc.actions.do_request_via_ajax_action,
113
- yith_wcmc_ajax_request_nonce: yith_wcmc.ajax_request_nonce
114
- },
115
- dataType: 'json',
116
- method: 'POST',
117
- success: function( groups ){
118
- var new_options = '',
119
- i = 0;
120
-
121
- if( groups.length != 0 ){
122
- for( i in groups ){
123
- var j = 0,
124
- interest_group = groups[i];
125
-
126
- if( interest_group.groups.length != 0 ){
127
- for( j in interest_group.groups ){
128
- var group = interest_group.groups[j];
129
-
130
- new_options += '<option value="' + interest_group.id + '-' + group.name + '" ' + ( ( $.inArray( interest_group.id + '-' + group.name, selected_options ) > -1 ) ? 'selected="selected"' : '' ) + ' >' + interest_group.name + ' - ' + group.name + '</option>';
131
- }
132
- }
133
- }
134
- }
135
-
136
- console.log( new_options );
137
-
138
- t.html( new_options );
139
-
140
- if( new_options.length == 0 ){
141
- t.prop( 'disabled' );
142
- }
143
- else{
144
- t.removeProp( 'disabled' );
145
- }
146
-
147
- t.select2();
148
- },
149
- url: ajaxurl
150
- });
151
- },
152
- add_updater_functions = function(){
153
- $( document ).off( 'click', '.ajax-mailchimp-updater-list' );
154
- $( document ).off( 'click', '.ajax-mailchimp-updater-group' );
155
- $( document ).off( 'change', '.list-select' );
156
-
157
- // add updater button handler
158
- $( document ).on( 'click', '.ajax-mailchimp-updater-list', handle_lists );
159
- $( document ).on( 'click', '.ajax-mailchimp-updater-group', handle_groups );
160
- $( document ).on( 'change', '.list-select', handle_groups );
161
- };
162
-
163
- add_updater_functions();
164
- $( 'body').on( 'add_updater_handler', add_updater_functions );
165
-
166
- // add dependencies handler
167
- $( '#yith_wcmc_checkout_trigger').on( 'change', function(){
168
- var t = $(this),
169
- subscription_checkbox = $( '#yith_wcmc_subscription_checkbox'),
170
- double_optin = $( '#yith_wcmc_double_optin' );
171
-
172
- if( t.val() != 'never' ){
173
- subscription_checkbox.parents( 'tr' ).show();
174
- double_optin.parents( 'tr').show();
175
- $( '#yith_wcmc_email_type').parents( 'tr').show();
176
- $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).show();
177
- $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).show();
178
- $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).show();
179
- $( '#yith_wcmc_update_existing').parents( 'tr').show();
180
- $( '#yith_wcmc_replace_interests').parents( 'tr').show();
181
- $( '#yith_wcmc_send_welcome').parents( 'tr').show();
182
-
183
- subscription_checkbox.change();
184
- double_optin.change();
185
- }
186
- else{
187
- subscription_checkbox.parents( 'tr' ).hide();
188
- double_optin.parents( 'tr').hide();
189
- $( '#yith_wcmc_email_type').parents( 'tr').hide();
190
- $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).hide();
191
- $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).hide();
192
- $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).hide();
193
- $( '#yith_wcmc_update_existing').parents( 'tr').hide();
194
- $( '#yith_wcmc_replace_interests').parents( 'tr').hide();
195
- $( '#yith_wcmc_send_welcome').parents( 'tr').hide();
196
- }
197
- }).change();
198
- $( '#yith_wcmc_ecommerce360_enable').on( 'change', function(){
199
- var t = $(this),
200
- cookie_lifetime = $( '#yith_wcmc_ecommerce360_cookie_lifetime');
201
-
202
- if( t.is(':checked') ){
203
- cookie_lifetime.parents( 'tr').show();
204
- }
205
- else{
206
- cookie_lifetime.parents( 'tr').hide();
207
- }
208
- }).change();
209
-
210
- $( '#yith_wcmc_subscription_checkbox' ).on( 'change', function(){
211
- var t = $(this);
212
-
213
- if( ! t.is(':visible') ){
214
- return;
215
- }
216
-
217
- if( t.is( ':checked' ) ){
218
- $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).show();
219
- $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).show();
220
- $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).show();
221
- }
222
- else{
223
- $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).hide();
224
- $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).hide();
225
- $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).hide();
226
- }
227
- }).change();
228
- $( '#yith_wcmc_double_optin').on( 'change', function(){
229
- var t = $(this);
230
-
231
- if( ! t.is(':visible') ){
232
- return;
233
- }
234
-
235
- if( t.is( ':checked' ) ) {
236
- $( '#yith_wcmc_send_welcome').parents( 'tr').hide();
237
- }
238
- else{
239
- $( '#yith_wcmc_send_welcome').parents( 'tr').show();
240
- }
241
- }).change();
242
- $( '#yith_wcmc_shortcode_double_optin').on( 'change', function(){
243
- var t = $(this);
244
-
245
- if( ! t.is(':visible') ){
246
- return;
247
- }
248
-
249
- if( t.is( ':checked' ) ) {
250
- $( '#yith_wcmc_shortcode_send_welcome').parents( 'tr').hide();
251
- }
252
- else{
253
- $( '#yith_wcmc_shortcode_send_welcome').parents( 'tr').show();
254
- }
255
- }).change();
256
- $( '#yith_wcmc_widget_double_optin').on( 'change', function(){
257
- var t = $(this);
258
-
259
- if( ! t.is(':visible') ){
260
- return;
261
- }
262
-
263
- if( t.is( ':checked' ) ) {
264
- $( '#yith_wcmc_widget_send_welcome').parents( 'tr').hide();
265
- }
266
- else{
267
- $( '#yith_wcmc_widget_send_welcome').parents( 'tr').show();
268
- }
269
- }).change();
270
  } );
1
+ /**
2
+ * General admin panel handling
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Mailchimp
6
+ * @version 1.0.0
7
+ */
8
+
9
+ jQuery( document ).ready( function( $ ){
10
+ var list_select = $( '#yith_wcmc_mailchimp_list, #yith_wcmc_shortcode_mailchimp_list, #yith_wcmc_widget_mailchimp_list, #yith_wcmc_export_list'),
11
+ group_select = $( '#yith_wcmc_mailchimp_groups, #yith_wcmc_shortcode_mailchimp_groups, #yith_wcmc_widget_mailchimp_groups');
12
+
13
+ // add updater button
14
+ list_select.after( $( '<a>').addClass( 'button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-list').attr( 'id', 'yith_wmcm_mailchimp_list_updater').attr( 'href', '#').text( yith_wcmc.labels.update_list_button ));
15
+ group_select.after( $( '<a>').addClass( 'button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-group').attr( 'id', 'yith_wcmc_mailchimp_group_updater').attr( 'href', '#').text( yith_wcmc.labels.update_group_button ));
16
+
17
+ var handle_lists = function( ev ){
18
+ var t = $(this),
19
+ list = t.prev( 'select'),
20
+ selected_option = list.find( 'option:selected' ).val();
21
+
22
+ ev.preventDefault();
23
+
24
+ $.ajax({
25
+ beforeSend: function(){
26
+ t.block({
27
+ message: null,
28
+ overlayCSS: {
29
+ background: '#fff',
30
+ opacity: 0.6
31
+ }
32
+ });
33
+
34
+
35
+ },
36
+ complete: function(){
37
+ t.unblock();
38
+ },
39
+ data: {
40
+ request: 'lists/list',
41
+ force_update: true,
42
+ args: {
43
+ sort_field: 'web'
44
+ },
45
+ action: yith_wcmc.actions.do_request_via_ajax_action,
46
+ yith_wcmc_ajax_request_nonce: yith_wcmc.ajax_request_nonce
47
+ },
48
+ dataType: 'json',
49
+ method: 'POST',
50
+ success: function( lists ){
51
+ var new_options = '',
52
+ i = 0;
53
+
54
+ if( lists.data.length != 0 ){
55
+ for( i in lists.data ){
56
+ new_options += '<option value="' + lists.data[i].id + '" ' + ( ( selected_option == lists.data[i].id ) ? 'selected="selected"' : '' ) + ' >' + lists.data[i].name + '</option>';
57
+ }
58
+ }
59
+
60
+ list.html( new_options );
61
+
62
+ if( new_options.length == 0 ){
63
+ list.prop( 'disabled' );
64
+ }
65
+ else{
66
+ list.removeProp( 'disabled' );
67
+ }
68
+
69
+ },
70
+ url: ajaxurl
71
+ });
72
+ },
73
+ handle_groups = function( ev ){
74
+ var t = $( this).hasClass( 'ajax-mailchimp-updater-group' ) ? $(this).prev( 'select' ) : $(this).parents('tr').next().find('select'),
75
+ row = t.closest( 'td'),
76
+ list_id = t.closest('tr').prev().find('select').find( 'option:selected' ).val(),
77
+ selected_options_dom = t.find( 'option:selected'),
78
+ selected_options = [];
79
+
80
+ selected_options_dom.each( function( i, v ){
81
+ selected_options[i] = $(v).val();
82
+ } );
83
+
84
+ ev.preventDefault();
85
+
86
+ if( list_id.length == 0 ){
87
+ t.prop( 'disabled' );
88
+ }
89
+ else{
90
+ t.removeProp( 'disabled' );
91
+ }
92
+
93
+ $.ajax({
94
+ beforeSend: function(){
95
+ row.block({
96
+ message: null,
97
+ overlayCSS: {
98
+ background: '#fff',
99
+ opacity: 0.6
100
+ }
101
+ });
102
+ },
103
+ complete: function(){
104
+ row.unblock();
105
+ },
106
+ data: {
107
+ request: 'lists/interest-groupings',
108
+ force_update: true,
109
+ args: {
110
+ id: list_id
111
+ },
112
+ action: yith_wcmc.actions.do_request_via_ajax_action,
113
+ yith_wcmc_ajax_request_nonce: yith_wcmc.ajax_request_nonce
114
+ },
115
+ dataType: 'json',
116
+ method: 'POST',
117
+ success: function( groups ){
118
+ var new_options = '',
119
+ i = 0;
120
+
121
+ if( groups.length != 0 ){
122
+ for( i in groups ){
123
+ var j = 0,
124
+ interest_group = groups[i];
125
+
126
+ if( interest_group.groups.length != 0 ){
127
+ for( j in interest_group.groups ){
128
+ var group = interest_group.groups[j];
129
+
130
+ new_options += '<option value="' + interest_group.id + '-' + group.name + '" ' + ( ( $.inArray( interest_group.id + '-' + group.name, selected_options ) > -1 ) ? 'selected="selected"' : '' ) + ' >' + interest_group.name + ' - ' + group.name + '</option>';
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ console.log( new_options );
137
+
138
+ t.html( new_options );
139
+
140
+ if( new_options.length == 0 ){
141
+ t.prop( 'disabled' );
142
+ }
143
+ else{
144
+ t.removeProp( 'disabled' );
145
+ }
146
+
147
+ t.select2();
148
+ },
149
+ url: ajaxurl
150
+ });
151
+ },
152
+ add_updater_functions = function(){
153
+ $( document ).off( 'click', '.ajax-mailchimp-updater-list' );
154
+ $( document ).off( 'click', '.ajax-mailchimp-updater-group' );
155
+ $( document ).off( 'change', '.list-select' );
156
+
157
+ // add updater button handler
158
+ $( document ).on( 'click', '.ajax-mailchimp-updater-list', handle_lists );
159
+ $( document ).on( 'click', '.ajax-mailchimp-updater-group', handle_groups );
160
+ $( document ).on( 'change', '.list-select', handle_groups );
161
+ };
162
+
163
+ add_updater_functions();
164
+ $( 'body').on( 'add_updater_handler', add_updater_functions );
165
+
166
+ // add dependencies handler
167
+ $( '#yith_wcmc_checkout_trigger').on( 'change', function(){
168
+ var t = $(this),
169
+ subscription_checkbox = $( '#yith_wcmc_subscription_checkbox'),
170
+ double_optin = $( '#yith_wcmc_double_optin' );
171
+
172
+ if( t.val() != 'never' ){
173
+ subscription_checkbox.parents( 'tr' ).show();
174
+ double_optin.parents( 'tr').show();
175
+ $( '#yith_wcmc_email_type').parents( 'tr').show();
176
+ $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).show();
177
+ $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).show();
178
+ $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).show();
179
+ $( '#yith_wcmc_update_existing').parents( 'tr').show();
180
+ $( '#yith_wcmc_replace_interests').parents( 'tr').show();
181
+ $( '#yith_wcmc_send_welcome').parents( 'tr').show();
182
+
183
+ subscription_checkbox.change();
184
+ double_optin.change();
185
+ }
186
+ else{
187
+ subscription_checkbox.parents( 'tr' ).hide();
188
+ double_optin.parents( 'tr').hide();
189
+ $( '#yith_wcmc_email_type').parents( 'tr').hide();
190
+ $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).hide();
191
+ $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).hide();
192
+ $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).hide();
193
+ $( '#yith_wcmc_update_existing').parents( 'tr').hide();
194
+ $( '#yith_wcmc_replace_interests').parents( 'tr').hide();
195
+ $( '#yith_wcmc_send_welcome').parents( 'tr').hide();
196
+ }
197
+ }).change();
198
+ $( '#yith_wcmc_ecommerce360_enable').on( 'change', function(){
199
+ var t = $(this),
200
+ cookie_lifetime = $( '#yith_wcmc_ecommerce360_cookie_lifetime');
201
+
202
+ if( t.is(':checked') ){
203
+ cookie_lifetime.parents( 'tr').show();
204
+ }
205
+ else{
206
+ cookie_lifetime.parents( 'tr').hide();
207
+ }
208
+ }).change();
209
+
210
+ $( '#yith_wcmc_subscription_checkbox' ).on( 'change', function(){
211
+ var t = $(this);
212
+
213
+ if( ! t.is(':visible') ){
214
+ return;
215
+ }
216
+
217
+ if( t.is( ':checked' ) ){
218
+ $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).show();
219
+ $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).show();
220
+ $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).show();
221
+ }
222
+ else{
223
+ $( '#yith_wcmc_subscription_checkbox_label' ).parents( 'tr' ).hide();
224
+ $( '#yith_wcmc_subscription_checkbox_position' ).parents( 'tr' ).hide();
225
+ $( '#yith_wcmc_subscription_checkbox_default' ).parents( 'tr' ).hide();
226
+ }
227
+ }).change();
228
+ $( '#yith_wcmc_double_optin').on( 'change', function(){
229
+ var t = $(this);
230
+
231
+ if( ! t.is(':visible') ){
232
+ return;
233
+ }
234
+
235
+ if( t.is( ':checked' ) ) {
236
+ $( '#yith_wcmc_send_welcome').parents( 'tr').hide();
237
+ }
238
+ else{
239
+ $( '#yith_wcmc_send_welcome').parents( 'tr').show();
240
+ }
241
+ }).change();
242
+ $( '#yith_wcmc_shortcode_double_optin').on( 'change', function(){
243
+ var t = $(this);
244
+
245
+ if( ! t.is(':visible') ){
246
+ return;
247
+ }
248
+
249
+ if( t.is( ':checked' ) ) {
250
+ $( '#yith_wcmc_shortcode_send_welcome').parents( 'tr').hide();
251
+ }
252
+ else{
253
+ $( '#yith_wcmc_shortcode_send_welcome').parents( 'tr').show();
254
+ }
255
+ }).change();
256
+ $( '#yith_wcmc_widget_double_optin').on( 'change', function(){
257
+ var t = $(this);
258
+
259
+ if( ! t.is(':visible') ){
260
+ return;
261
+ }
262
+
263
+ if( t.is( ':checked' ) ) {
264
+ $( '#yith_wcmc_widget_send_welcome').parents( 'tr').hide();
265
+ }
266
+ else{
267
+ $( '#yith_wcmc_widget_send_welcome').parents( 'tr').show();
268
+ }
269
+ }).change();
270
  } );
modules/yith-woocommerce-mailchimp/assets/js/admin/yith-wcmc.min.js CHANGED
@@ -1,11 +1,11 @@
1
- jQuery(document).ready(function(a){var e=a("#yith_wcmc_mailchimp_list, #yith_wcmc_shortcode_mailchimp_list, #yith_wcmc_widget_mailchimp_list, #yith_wcmc_export_list"),l=a("#yith_wcmc_mailchimp_groups, #yith_wcmc_shortcode_mailchimp_groups, #yith_wcmc_widget_mailchimp_groups");e.after(a("<a>").addClass("button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-list").attr("id","yith_wmcm_mailchimp_list_updater").attr("href","#").text(yith_wcmc.labels.update_list_button));l.after(a("<a>").addClass("button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-group").attr("id",
2
- "yith_wcmc_mailchimp_group_updater").attr("href","#").text(yith_wcmc.labels.update_group_button));var m=function(b){var c=a(this),d=c.prev("select"),e=d.find("option:selected").val();b.preventDefault();a.ajax({beforeSend:function(){c.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},complete:function(){c.unblock()},data:{request:"lists/list",force_update:!0,args:{sort_field:"web"},action:yith_wcmc.actions.do_request_via_ajax_action,yith_wcmc_ajax_request_nonce:yith_wcmc.ajax_request_nonce},
3
- dataType:"json",method:"POST",success:function(a){var c="",b=0;if(0!=a.data.length)for(b in a.data)c+='<option value="'+a.data[b].id+'" '+(e==a.data[b].id?'selected="selected"':"")+" >"+a.data[b].name+"</option>";d.html(c);0==c.length?d.prop("disabled"):d.removeProp("disabled")},url:ajaxurl})},g=function(b){var c=a(this).hasClass("ajax-mailchimp-updater-group")?a(this).prev("select"):a(this).parents("tr").next().find("select"),d=c.closest("td"),e=c.closest("tr").prev().find("select").find("option:selected").val(),
4
- g=[];c.find("option:selected").each(function(c,b){g[c]=a(b).val()});b.preventDefault();0==e.length?c.prop("disabled"):c.removeProp("disabled");a.ajax({beforeSend:function(){d.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},complete:function(){d.unblock()},data:{request:"lists/interest-groupings",force_update:!0,args:{id:e},action:yith_wcmc.actions.do_request_via_ajax_action,yith_wcmc_ajax_request_nonce:yith_wcmc.ajax_request_nonce},dataType:"json",method:"POST",success:function(b){var d=
5
- "",e=0;if(0!=b.length)for(e in b){var k=0,f=b[e];if(0!=f.groups.length)for(k in f.groups)var h=f.groups[k],d=d+('<option value="'+f.id+"-"+h.name+'" '+(-1<a.inArray(f.id+"-"+h.name,g)?'selected="selected"':"")+" >"+f.name+" - "+h.name+"</option>")}console.log(d);c.html(d);0==d.length?c.prop("disabled"):c.removeProp("disabled");c.select2()},url:ajaxurl})},e=function(){a(document).off("click",".ajax-mailchimp-updater-list");a(document).off("click",".ajax-mailchimp-updater-group");a(document).off("change",
6
- ".list-select");a(document).on("click",".ajax-mailchimp-updater-list",m);a(document).on("click",".ajax-mailchimp-updater-group",g);a(document).on("change",".list-select",g)};e();a("body").on("add_updater_handler",e);a("#yith_wcmc_checkout_trigger").on("change",function(){var b=a(this),c=a("#yith_wcmc_subscription_checkbox"),d=a("#yith_wcmc_double_optin");"never"!=b.val()?(c.parents("tr").show(),d.parents("tr").show(),a("#yith_wcmc_email_type").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_label").parents("tr").show(),
7
- a("#yith_wcmc_subscription_checkbox_position").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_default").parents("tr").show(),a("#yith_wcmc_update_existing").parents("tr").show(),a("#yith_wcmc_replace_interests").parents("tr").show(),a("#yith_wcmc_send_welcome").parents("tr").show(),c.change(),d.change()):(c.parents("tr").hide(),d.parents("tr").hide(),a("#yith_wcmc_email_type").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_label").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_position").parents("tr").hide(),
8
- a("#yith_wcmc_subscription_checkbox_default").parents("tr").hide(),a("#yith_wcmc_update_existing").parents("tr").hide(),a("#yith_wcmc_replace_interests").parents("tr").hide(),a("#yith_wcmc_send_welcome").parents("tr").hide())}).change();a("#yith_wcmc_ecommerce360_enable").on("change",function(){var b=a(this),c=a("#yith_wcmc_ecommerce360_cookie_lifetime");b.is(":checked")?c.parents("tr").show():c.parents("tr").hide()}).change();a("#yith_wcmc_subscription_checkbox").on("change",function(){var b=a(this);
9
- b.is(":visible")&&(b.is(":checked")?(a("#yith_wcmc_subscription_checkbox_label").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_position").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_default").parents("tr").show()):(a("#yith_wcmc_subscription_checkbox_label").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_position").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_default").parents("tr").hide()))}).change();a("#yith_wcmc_double_optin").on("change",function(){var b=
10
- a(this);b.is(":visible")&&(b.is(":checked")?a("#yith_wcmc_send_welcome").parents("tr").hide():a("#yith_wcmc_send_welcome").parents("tr").show())}).change();a("#yith_wcmc_shortcode_double_optin").on("change",function(){var b=a(this);b.is(":visible")&&(b.is(":checked")?a("#yith_wcmc_shortcode_send_welcome").parents("tr").hide():a("#yith_wcmc_shortcode_send_welcome").parents("tr").show())}).change();a("#yith_wcmc_widget_double_optin").on("change",function(){var b=a(this);b.is(":visible")&&(b.is(":checked")?
11
  a("#yith_wcmc_widget_send_welcome").parents("tr").hide():a("#yith_wcmc_widget_send_welcome").parents("tr").show())}).change()});
1
+ jQuery(document).ready(function(a){var e=a("#yith_wcmc_mailchimp_list, #yith_wcmc_shortcode_mailchimp_list, #yith_wcmc_widget_mailchimp_list, #yith_wcmc_export_list"),l=a("#yith_wcmc_mailchimp_groups, #yith_wcmc_shortcode_mailchimp_groups, #yith_wcmc_widget_mailchimp_groups");e.after(a("<a>").addClass("button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-list").attr("id","yith_wmcm_mailchimp_list_updater").attr("href","#").text(yith_wcmc.labels.update_list_button));l.after(a("<a>").addClass("button button-secondary ajax-mailchimp-updater ajax-mailchimp-updater-group").attr("id",
2
+ "yith_wcmc_mailchimp_group_updater").attr("href","#").text(yith_wcmc.labels.update_group_button));var m=function(b){var c=a(this),d=c.prev("select"),e=d.find("option:selected").val();b.preventDefault();a.ajax({beforeSend:function(){c.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},complete:function(){c.unblock()},data:{request:"lists/list",force_update:!0,args:{sort_field:"web"},action:yith_wcmc.actions.do_request_via_ajax_action,yith_wcmc_ajax_request_nonce:yith_wcmc.ajax_request_nonce},
3
+ dataType:"json",method:"POST",success:function(a){var c="",b=0;if(0!=a.data.length)for(b in a.data)c+='<option value="'+a.data[b].id+'" '+(e==a.data[b].id?'selected="selected"':"")+" >"+a.data[b].name+"</option>";d.html(c);0==c.length?d.prop("disabled"):d.removeProp("disabled")},url:ajaxurl})},g=function(b){var c=a(this).hasClass("ajax-mailchimp-updater-group")?a(this).prev("select"):a(this).parents("tr").next().find("select"),d=c.closest("td"),e=c.closest("tr").prev().find("select").find("option:selected").val(),
4
+ g=[];c.find("option:selected").each(function(c,b){g[c]=a(b).val()});b.preventDefault();0==e.length?c.prop("disabled"):c.removeProp("disabled");a.ajax({beforeSend:function(){d.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},complete:function(){d.unblock()},data:{request:"lists/interest-groupings",force_update:!0,args:{id:e},action:yith_wcmc.actions.do_request_via_ajax_action,yith_wcmc_ajax_request_nonce:yith_wcmc.ajax_request_nonce},dataType:"json",method:"POST",success:function(b){var d=
5
+ "",e=0;if(0!=b.length)for(e in b){var k=0,f=b[e];if(0!=f.groups.length)for(k in f.groups)var h=f.groups[k],d=d+('<option value="'+f.id+"-"+h.name+'" '+(-1<a.inArray(f.id+"-"+h.name,g)?'selected="selected"':"")+" >"+f.name+" - "+h.name+"</option>")}console.log(d);c.html(d);0==d.length?c.prop("disabled"):c.removeProp("disabled");c.select2()},url:ajaxurl})},e=function(){a(document).off("click",".ajax-mailchimp-updater-list");a(document).off("click",".ajax-mailchimp-updater-group");a(document).off("change",
6
+ ".list-select");a(document).on("click",".ajax-mailchimp-updater-list",m);a(document).on("click",".ajax-mailchimp-updater-group",g);a(document).on("change",".list-select",g)};e();a("body").on("add_updater_handler",e);a("#yith_wcmc_checkout_trigger").on("change",function(){var b=a(this),c=a("#yith_wcmc_subscription_checkbox"),d=a("#yith_wcmc_double_optin");"never"!=b.val()?(c.parents("tr").show(),d.parents("tr").show(),a("#yith_wcmc_email_type").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_label").parents("tr").show(),
7
+ a("#yith_wcmc_subscription_checkbox_position").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_default").parents("tr").show(),a("#yith_wcmc_update_existing").parents("tr").show(),a("#yith_wcmc_replace_interests").parents("tr").show(),a("#yith_wcmc_send_welcome").parents("tr").show(),c.change(),d.change()):(c.parents("tr").hide(),d.parents("tr").hide(),a("#yith_wcmc_email_type").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_label").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_position").parents("tr").hide(),
8
+ a("#yith_wcmc_subscription_checkbox_default").parents("tr").hide(),a("#yith_wcmc_update_existing").parents("tr").hide(),a("#yith_wcmc_replace_interests").parents("tr").hide(),a("#yith_wcmc_send_welcome").parents("tr").hide())}).change();a("#yith_wcmc_ecommerce360_enable").on("change",function(){var b=a(this),c=a("#yith_wcmc_ecommerce360_cookie_lifetime");b.is(":checked")?c.parents("tr").show():c.parents("tr").hide()}).change();a("#yith_wcmc_subscription_checkbox").on("change",function(){var b=a(this);
9
+ b.is(":visible")&&(b.is(":checked")?(a("#yith_wcmc_subscription_checkbox_label").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_position").parents("tr").show(),a("#yith_wcmc_subscription_checkbox_default").parents("tr").show()):(a("#yith_wcmc_subscription_checkbox_label").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_position").parents("tr").hide(),a("#yith_wcmc_subscription_checkbox_default").parents("tr").hide()))}).change();a("#yith_wcmc_double_optin").on("change",function(){var b=
10
+ a(this);b.is(":visible")&&(b.is(":checked")?a("#yith_wcmc_send_welcome").parents("tr").hide():a("#yith_wcmc_send_welcome").parents("tr").show())}).change();a("#yith_wcmc_shortcode_double_optin").on("change",function(){var b=a(this);b.is(":visible")&&(b.is(":checked")?a("#yith_wcmc_shortcode_send_welcome").parents("tr").hide():a("#yith_wcmc_shortcode_send_welcome").parents("tr").show())}).change();a("#yith_wcmc_widget_double_optin").on("change",function(){var b=a(this);b.is(":visible")&&(b.is(":checked")?
11
  a("#yith_wcmc_widget_send_welcome").parents("tr").hide():a("#yith_wcmc_widget_send_welcome").parents("tr").show())}).change()});
modules/yith-woocommerce-mailchimp/includes/class.yith-wcmc-admin.php CHANGED
@@ -1,263 +1,271 @@
1
- <?php
2
- /**
3
- * Admin class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Mailchimp
7
- * @version 1.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMC' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCMC_Admin' ) ) {
15
- /**
16
- * WooCommerce Mailchimp Admin
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCMC_Admin {
21
- /**
22
- * Single instance of the class
23
- *
24
- * @var \YITH_WCMC_Admin
25
- * @since 1.0.0
26
- */
27
- protected static $instance;
28
-
29
- /**
30
- * List of available tab for mailchimp panel
31
- *
32
- * @var array
33
- * @access public
34
- * @since 1.0.0
35
- */
36
- public $available_tabs = array();
37
-
38
- /**
39
- * Landing url
40
- *
41
- * @var string
42
- * @since 1.0.0
43
- */
44
- public $premium_landing_url = 'http://yithemes.com/themes/plugins/yith-woocommerce-mailchimp/';
45
-
46
- /**
47
- * Documentation url
48
- *
49
- * @var string
50
- * @since 1.0.0
51
- */
52
- public $doc_url = 'http://yithemes.com/docs-plugins/yith-woocommerce-mailchimp/';
53
-
54
- /**
55
- * Returns single instance of the class
56
- *
57
- * @return \YITH_WCMC_Admin
58
- * @since 1.0.0
59
- */
60
- public static function get_instance(){
61
- if( is_null( self::$instance ) ){
62
- self::$instance = new self;
63
- }
64
-
65
- return self::$instance;
66
- }
67
-
68
- /* === REGISTER AND PRINT MAILCHIMP PANEL === */
69
-
70
- /**
71
- * Constructor.
72
- *
73
- * @param array $details
74
- * @return \YITH_WCMC_Admin
75
- * @since 1.0.0
76
- */
77
- public function __construct() {
78
- $this->available_tabs = apply_filters( 'yith_wcmc_available_admin_tabs', array(
79
- 'integration' => __( 'Integration', 'yith-wcmc' ),
80
- 'checkout' => __( 'Checkout', 'yith-wcmc' ),
81
- 'premium' => __( 'Premium Version', 'yith-wcmc' )
82
- ) );
83
-
84
- // register mailchimp panel
85
- add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
86
- add_action( 'woocommerce_admin_field_yith_wcmc_integration_status', array( $this, 'print_custom_yith_wcmc_integration_status' ) );
87
- add_action( 'yith_wcmc_premium_tab', array( $this, 'print_premium_tab' ) );
88
-
89
- // handle licence changing
90
- add_action( 'update_option_yith_wcmc_mailchimp_api_key', array( $this, 'delete_old_key_options' ), 10, 2 );
91
-
92
- // register plugin actions and row meta
93
- add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCMC_DIR . 'init.php' ), array( $this, 'action_links' ) );
94
- add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta' ), 10, 2 );
95
-
96
- // enqueue style
97
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
98
- }
99
-
100
- /**
101
- * Get the premium landing uri
102
- *
103
- * @since 1.0.0
104
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
105
- * @return string The premium landing link
106
- */
107
- public function get_premium_landing_uri(){
108
- return defined( 'YITH_REFER_ID' ) ? $this->premium_landing_url . '?refer_id=' . YITH_REFER_ID : $this->premium_landing_url;
109
- }
110
-
111
- /**
112
- * Enqueue scripts and stuffs
113
- *
114
- * @return void
115
- * @since 1.0.0
116
- */
117
- public function enqueue() {
118
- global $pagenow;
119
- $path = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? '/unminified' : '';
120
- $prefix = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? '' : '.min';
121
-
122
- if( $pagenow == 'admin.php' && isset( $_GET['page'] ) && 'yith_wcmc_panel' == $_GET['page'] ){
123
- wp_enqueue_style( 'yith-wcmc-admin', YITH_WCMC_URL . '/assets/css/admin/yith-wcmc.css' );
124
- wp_enqueue_script( 'yith-wcmc-admin', YITH_WCMC_URL . '/assets/js/admin' . $path . '/yith-wcmc' . $prefix . '.js', array( 'jquery', 'jquery-blockui' ), false, true );
125
-
126
- wp_localize_script( 'yith-wcmc-admin', 'yith_wcmc', array(
127
- 'labels' => array(
128
- 'update_list_button' => __( 'Update Lists', 'yith-wcmc' ),
129
- 'update_group_button' => __( 'Update Groups', 'yith-wcmc' )
130
- ),
131
- 'actions' => array(
132
- 'do_request_via_ajax_action' => 'do_request_via_ajax'
133
- ),
134
- 'ajax_request_nonce' => wp_create_nonce( 'yith_wcmc_ajax_request' )
135
- ) );
136
- }
137
- }
138
-
139
- /**
140
- * Register panel
141
- *
142
- * @return void
143
- * @since 1.0.0
144
- */
145
- public function register_panel() {
146
- $args = array(
147
- 'create_menu_page' => true,
148
- 'parent_slug' => '',
149
- 'page_title' => __( 'Mailchimp', 'yith-wcmc' ),
150
- 'menu_title' => __( 'Mailchimp', 'yith-wcmc' ),
151
- 'capability' => 'manage_options',
152
- 'parent' => '',
153
- 'parent_page' => 'yit_plugin_panel',
154
- 'page' => 'yith_wcmc_panel',
155
- 'admin-tabs' => $this->available_tabs,
156
- 'options-path' => YITH_WCMC_DIR . 'plugin-options'
157
- );
158
-
159
- /* === Fixed: not updated theme === */
160
- if( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
161
- require_once( YITH_WCMC_DIR . 'plugin-fw/lib/yit-plugin-panel-wc.php' );
162
- }
163
-
164
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
165
- }
166
-
167
- /**
168
- * Output integration status filed
169
- *
170
- * @param $value array Array representing the field to print
171
- *
172
- * @return void
173
- * @since 1.0.0
174
- */
175
- public function print_custom_yith_wcmc_integration_status( $value ){
176
- $result = YITH_WCMC()->do_request( 'users/profile' );
177
-
178
- $user_id = isset( $result['id'] ) ? $result['id'] : false;
179
- $username = isset( $result['username'] ) ? $result['username'] : false;
180
- $name = isset( $result['name'] ) ? $result['name'] : false;
181
- $email = isset( $result['email'] ) ? $result['email'] : false;
182
- $avatar = isset( $result['avatar'] ) ? $result['avatar'] : false;
183
-
184
- include( YITH_WCMC_DIR . 'templates/admin/types/integration-status.php' );
185
- }
186
-
187
- /**
188
- * Prints tab premium of the plugin
189
- *
190
- * @return void
191
- * @since 1.0.0
192
- */
193
- public function print_premium_tab() {
194
- $premium_tab = YITH_WCMC_DIR . 'templates/admin/mailchimp-panel-premium.php';
195
-
196
- if( file_exists( $premium_tab ) ){
197
- include( $premium_tab );
198
- }
199
- }
200
-
201
- /**
202
- * Register plugins action links
203
- *
204
- * @param array $links Array of current links
205
- *
206
- * @return array
207
- * @since 1.0.0
208
- */
209
- public function action_links( $links ) {
210
- $plugin_links = array(
211
- '<a href="' . admin_url( 'admin.php?page=yith_wcmc_panel&tab=integration' ) . '">' . __( 'Settings', 'yith-wcmc' ) . '</a>'
212
- );
213
-
214
- if( ! defined( 'YITH_WCMC_PREMIUM_INIT' ) ){
215
- $plugin_links[] = '<a target="_blank" href="' . $this->get_premium_landing_uri() . '">' . __( 'Premium Version', 'yith-wcmc' ) . '</a>';
216
- }
217
-
218
- return array_merge( $links, $plugin_links );
219
- }
220
-
221
- /**
222
- * Adds plugin row meta
223
- *
224
- * @param $plugin_meta array
225
- * @param $plugin_file string
226
- *
227
- * @return array
228
- * @since 1.0.0
229
- */
230
- public function add_plugin_meta( $plugin_meta, $plugin_file ){
231
- if ( $plugin_file == plugin_basename( YITH_WCMC_DIR . 'init.php' ) ) {
232
- // documentation link
233
- $plugin_meta['documentation'] = '<a target="_blank" href="' . $this->doc_url . '">' . __( 'Plugin Documentation', 'yith-wcmc' ) . '</a>';
234
- }
235
-
236
- return $plugin_meta;
237
- }
238
-
239
- /**
240
- * Delete options specific to an API Key
241
- *
242
- * @param $old_value string Old key value
243
- * @param $value string New key value
244
- *
245
- * @return void
246
- * @since 1.0.0
247
- */
248
- public function delete_old_key_options( $old_value, $value ) {
249
- delete_transient( 'yith_wcmc_' . md5( $old_value ) );
250
- delete_option( 'yith_wcmc_mailchimp_list' );
251
- }
252
- }
253
- }
254
-
255
- /**
256
- * Unique access to instance of YITH_WCMC_Admin class
257
- *
258
- * @return \YITH_WCMC_Admin
259
- * @since 1.0.0
260
- */
261
- function YITH_WCMC_Admin(){
262
- return YITH_WCMC_Admin::get_instance();
 
 
 
 
 
 
 
 
263
  }
1
+ <?php
2
+ /**
3
+ * Admin class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCMC_Admin' ) ) {
15
+ /**
16
+ * WooCommerce Mailchimp Admin
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCMC_Admin {
21
+ /**
22
+ * Single instance of the class
23
+ *
24
+ * @var \YITH_WCMC_Admin
25
+ * @since 1.0.0
26
+ */
27
+ protected static $instance;
28
+
29
+ /**
30
+ * List of available tab for mailchimp panel
31
+ *
32
+ * @var array
33
+ * @access public
34
+ * @since 1.0.0
35
+ */
36
+ public $available_tabs = array();
37
+
38
+ /**
39
+ * Landing url
40
+ *
41
+ * @var string
42
+ * @since 1.0.0
43
+ */
44
+ public $premium_landing_url = 'http://yithemes.com/themes/plugins/yith-woocommerce-mailchimp/';
45
+
46
+ /**
47
+ * Documentation url
48
+ *
49
+ * @var string
50
+ * @since 1.0.0
51
+ */
52
+ public $doc_url = 'http://yithemes.com/docs-plugins/yith-woocommerce-mailchimp/';
53
+
54
+ /**
55
+ * Live demo url
56
+ * @var string Live demo url
57
+ * @since 1.0.0
58
+ */
59
+ public $live_demo_url = 'http://plugins.yithemes.com/yith-woocommerce-mailchimp/';
60
+
61
+ /**
62
+ * Returns single instance of the class
63
+ *
64
+ * @return \YITH_WCMC_Admin
65
+ * @since 1.0.0
66
+ */
67
+ public static function get_instance(){
68
+ if( is_null( self::$instance ) ){
69
+ self::$instance = new self;
70
+ }
71
+
72
+ return self::$instance;
73
+ }
74
+
75
+ /* === REGISTER AND PRINT MAILCHIMP PANEL === */
76
+
77
+ /**
78
+ * Constructor.
79
+ *
80
+ * @param array $details
81
+ * @return \YITH_WCMC_Admin
82
+ * @since 1.0.0
83
+ */
84
+ public function __construct() {
85
+ $this->available_tabs = apply_filters( 'yith_wcmc_available_admin_tabs', array(
86
+ 'integration' => __( 'Integration', 'yith-wcmc' ),
87
+ 'checkout' => __( 'Checkout', 'yith-wcmc' ),
88
+ 'premium' => __( 'Premium Version', 'yith-wcmc' )
89
+ ) );
90
+
91
+ // register mailchimp panel
92
+ add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
93
+ add_action( 'woocommerce_admin_field_yith_wcmc_integration_status', array( $this, 'print_custom_yith_wcmc_integration_status' ) );
94
+ add_action( 'yith_wcmc_premium_tab', array( $this, 'print_premium_tab' ) );
95
+
96
+ // handle licence changing
97
+ add_action( 'update_option_yith_wcmc_mailchimp_api_key', array( $this, 'delete_old_key_options' ), 10, 2 );
98
+
99
+ // register plugin actions and row meta
100
+ add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCMC_DIR . 'init.php' ), array( $this, 'action_links' ) );
101
+ add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta' ), 10, 2 );
102
+
103
+ // enqueue style
104
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
105
+ }
106
+
107
+ /**
108
+ * Get the premium landing uri
109
+ *
110
+ * @since 1.0.0
111
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
112
+ * @return string The premium landing link
113
+ */
114
+ public function get_premium_landing_uri(){
115
+ return defined( 'YITH_REFER_ID' ) ? $this->premium_landing_url . '?refer_id=' . YITH_REFER_ID : $this->premium_landing_url;
116
+ }
117
+
118
+ /**
119
+ * Enqueue scripts and stuffs
120
+ *
121
+ * @return void
122
+ * @since 1.0.0
123
+ */
124
+ public function enqueue() {
125
+ global $pagenow;
126
+ $path = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? '/unminified' : '';
127
+ $prefix = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? '' : '.min';
128
+
129
+ if( $pagenow == 'admin.php' && isset( $_GET['page'] ) && 'yith_wcmc_panel' == $_GET['page'] ){
130
+ wp_enqueue_style( 'yith-wcmc-admin', YITH_WCMC_URL . '/assets/css/admin/yith-wcmc.css', array(), YITH_WCMC_VERSION );
131
+ wp_enqueue_script( 'yith-wcmc-admin', YITH_WCMC_URL . '/assets/js/admin' . $path . '/yith-wcmc' . $prefix . '.js', array( 'jquery', 'jquery-blockui' ), YITH_WCMC_VERSION, true );
132
+
133
+ wp_localize_script( 'yith-wcmc-admin', 'yith_wcmc', array(
134
+ 'labels' => array(
135
+ 'update_list_button' => __( 'Update Lists', 'yith-wcmc' ),
136
+ 'update_group_button' => __( 'Update Groups', 'yith-wcmc' )
137
+ ),
138
+ 'actions' => array(
139
+ 'do_request_via_ajax_action' => 'do_request_via_ajax'
140
+ ),
141
+ 'ajax_request_nonce' => wp_create_nonce( 'yith_wcmc_ajax_request' )
142
+ ) );
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Register panel
148
+ *
149
+ * @return void
150
+ * @since 1.0.0
151
+ */
152
+ public function register_panel() {
153
+ $args = array(
154
+ 'create_menu_page' => true,
155
+ 'parent_slug' => '',
156
+ 'page_title' => __( 'Mailchimp', 'yith-wcmc' ),
157
+ 'menu_title' => __( 'Mailchimp', 'yith-wcmc' ),
158
+ 'capability' => 'manage_options',
159
+ 'parent' => '',
160
+ 'parent_page' => 'yit_plugin_panel',
161
+ 'page' => 'yith_wcmc_panel',
162
+ 'admin-tabs' => $this->available_tabs,
163
+ 'options-path' => YITH_WCMC_DIR . 'plugin-options'
164
+ );
165
+
166
+ /* === Fixed: not updated theme === */
167
+ if( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
168
+ require_once( YITH_WCMC_DIR . 'plugin-fw/lib/yit-plugin-panel-wc.php' );
169
+ }
170
+
171
+ $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
172
+ }
173
+
174
+ /**
175
+ * Output integration status filed
176
+ *
177
+ * @param $value array Array representing the field to print
178
+ *
179
+ * @return void
180
+ * @since 1.0.0
181
+ */
182
+ public function print_custom_yith_wcmc_integration_status( $value ){
183
+ $result = YITH_WCMC()->do_request( 'users/profile' );
184
+
185
+ $user_id = isset( $result['id'] ) ? $result['id'] : false;
186
+ $username = isset( $result['username'] ) ? $result['username'] : false;
187
+ $name = isset( $result['name'] ) ? $result['name'] : false;
188
+ $email = isset( $result['email'] ) ? $result['email'] : false;
189
+ $avatar = isset( $result['avatar'] ) ? $result['avatar'] : false;
190
+
191
+ include( YITH_WCMC_DIR . 'templates/admin/types/integration-status.php' );
192
+ }
193
+
194
+ /**
195
+ * Prints tab premium of the plugin
196
+ *
197
+ * @return void
198
+ * @since 1.0.0
199
+ */
200
+ public function print_premium_tab() {
201
+ $premium_tab = YITH_WCMC_DIR . 'templates/admin/mailchimp-panel-premium.php';
202
+
203
+ if( file_exists( $premium_tab ) ){
204
+ include( $premium_tab );
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Register plugins action links
210
+ *
211
+ * @param array $links Array of current links
212
+ *
213
+ * @return array
214
+ * @since 1.0.0
215
+ */
216
+ public function action_links( $links ) {
217
+ $plugin_links = array(
218
+ '<a href="' . admin_url( 'admin.php?page=yith_wcmc_panel&tab=integration' ) . '">' . __( 'Settings', 'yith-wcmc' ) . '</a>'
219
+ );
220
+
221
+ if( ! defined( 'YITH_WCMC_PREMIUM_INIT' ) ){
222
+ $plugin_links[] = '<a target="_blank" href="' . $this->get_premium_landing_uri() . '">' . __( 'Premium Version', 'yith-wcmc' ) . '</a>';
223
+ $plugin_links[] = '<a target="_blank" href="' . $this->live_demo_url . '">' . __( 'Live Demo', 'yith-wcmc' ) . '</a>';
224
+ }
225
+
226
+ return array_merge( $links, $plugin_links );
227
+ }
228
+
229
+ /**
230
+ * Adds plugin row meta
231
+ *
232
+ * @param $plugin_meta array
233
+ * @param $plugin_file string
234
+ *
235
+ * @return array
236
+ * @since 1.0.0
237
+ */
238
+ public function add_plugin_meta( $plugin_meta, $plugin_file ){
239
+ if ( $plugin_file == plugin_basename( YITH_WCMC_DIR . 'init.php' ) ) {
240
+ // documentation link
241
+ $plugin_meta['documentation'] = '<a target="_blank" href="' . $this->doc_url . '">' . __( 'Plugin Documentation', 'yith-wcmc' ) . '</a>';
242
+ }
243
+
244
+ return $plugin_meta;
245
+ }
246
+
247
+ /**
248
+ * Delete options specific to an API Key
249
+ *
250
+ * @param $old_value string Old key value
251
+ * @param $value string New key value
252
+ *
253
+ * @return void
254
+ * @since 1.0.0
255
+ */
256
+ public function delete_old_key_options( $old_value, $value ) {
257
+ delete_transient( 'yith_wcmc_' . md5( $old_value ) );
258
+ delete_option( 'yith_wcmc_mailchimp_list' );
259
+ }
260
+ }
261
+ }
262
+
263
+ /**
264
+ * Unique access to instance of YITH_WCMC_Admin class
265
+ *
266
+ * @return \YITH_WCMC_Admin
267
+ * @since 1.0.0
268
+ */
269
+ function YITH_WCMC_Admin(){
270
+ return YITH_WCMC_Admin::get_instance();
271
  }
modules/yith-woocommerce-mailchimp/includes/class.yith-wcmc.php CHANGED
@@ -1,479 +1,497 @@
1
- <?php
2
- /**
3
- * Main class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Mailchimp
7
- * @version 1.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMC' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCMC' ) ) {
15
- /**
16
- * WooCommerce Mailchimp
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCMC {
21
- /**
22
- * Single instance of the class
23
- *
24
- * @var \YITH_WCMC
25
- * @since 1.0.0
26
- */
27
- protected static $instance;
28
-
29
- /**
30
- * Mailchimp API wrapper class
31
- *
32
- * @var \Mailchimp
33
- * @since 1.0.0
34
- */
35
- protected $mailchimp = null;
36
-
37
- /**
38
- * Cachable requests
39
- *
40
- * @var array
41
- * @since 1.0.0
42
- */
43
- public $cachable_requests = array();
44
-
45
- /**
46
- * Returns single instance of the class
47
- *
48
- * @return \YITH_WCMC
49
- * @since 1.0.0
50
- */
51
- public static function get_instance(){
52
- if( is_null( self::$instance ) ){
53
- self::$instance = new self;
54
- }
55
-
56
- return self::$instance;
57
- }
58
-
59
- /**
60
- * Constructor.
61
- *
62
- * @param array $details
63
- * @return \YITH_WCMC
64
- * @since 1.0.0
65
- */
66
- public function __construct() {
67
- // init cachable requests
68
- $this->cachable_requests = apply_filters( 'yith_wcmc_cachable_requests', array(
69
- 'lists/list',
70
- 'users/profile'
71
- ) );
72
-
73
- // load plugin-fw
74
- add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 15 );
75
-
76
- // init api key
77
- add_action( 'update_option_yith_wcmc_mailchimp_api_key', array( $this, 'init_api' ) );
78
- $this->init_api();
79
-
80
- // handle ajax requests
81
- add_action( 'wp_ajax_do_request_via_ajax', array( $this, 'do_request_via_ajax' ) );
82
-
83
- // update checkout page
84
- add_action( 'init', array( $this, 'add_subscription_checkbox' ) );
85
-
86
- // register subscription functions
87
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'adds_order_meta' ), 10, 1 );
88
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'subscribe_on_checkout' ), 10, 1 );
89
- add_action( 'woocommerce_order_status_completed', array( $this, 'subscribe_on_completed' ), 15, 1 );
90
- }
91
-
92
- /* === PLUGIN FW LOADER === */
93
-
94
- /**
95
- * Loads plugin fw, if not yet created
96
- *
97
- * @return void
98
- * @since 2.0.0
99
- */
100
- public function plugin_fw_loader() {
101
- if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
102
- global $plugin_fw_data;
103
- if( ! empty( $plugin_fw_data ) ){
104
- $plugin_fw_file = array_shift( $plugin_fw_data );
105
- require_once( $plugin_fw_file );
106
- }
107
- }
108
- }
109
-
110
- /* === HANDLE REQUEST TO MAILCHIMP === */
111
-
112
- /**
113
- * Init Api class
114
- *
115
- * @return void
116
- * @since 1.0.0
117
- */
118
- public function init_api() {
119
- $api_key = get_option( 'yith_wcmc_mailchimp_api_key' );
120
-
121
- $init_options = array( 'ssl_verifypeer' => false );
122
-
123
- if( ! empty( $api_key ) ){
124
- $this->mailchimp = new Mailchimp( $api_key, $init_options );
125
- }
126
- else{
127
- $this->mailchimp = null;
128
- }
129
- }
130
-
131
- /**
132
- * Retrieve lists registered for current API Key
133
- *
134
- * @return array Array of available list, in id -> name format
135
- * @since 1.0.0
136
- */
137
- public function retrieve_lists() {
138
- $lists = $this->do_request( 'lists/list', array( 'sort_field' => 'web' ) );
139
-
140
- $list_options = array();
141
- if( ! empty( $lists['data'] ) ){
142
- foreach( $lists['data'] as $list ){
143
- $list_options[ $list['id'] ] = $list['name'];
144
- }
145
- }
146
-
147
- return $list_options;
148
- }
149
-
150
- /**
151
- * Retrieve interest groups registered for passed list
152
- *
153
- * @param string $list Id of the list, used to retrieve groups
154
- *
155
- * @return array Array of available groups, formatted as ( group_id - interest_name ) -> ( group_name - interest_name ) format
156
- * @since 1.0.0
157
- */
158
- public function retrieve_groups( $list ) {
159
- $groups_options = array();
160
- if( ! empty( $list ) ){
161
- $groups = YITH_WCMC()->do_request( 'lists/interest-groupings', array( 'id' => $list ) );
162
-
163
- if( ! empty( $groups ) ){
164
- foreach( $groups as $interest_group ){
165
- if( ! empty( $interest_group['groups'] ) ){
166
- foreach( $interest_group['groups'] as $group ){
167
- $groups_options[ $interest_group['id'] . '-' . $group['name'] ] = $interest_group['name'] . ' - ' .$group['name'];
168
- }
169
- }
170
- }
171
- }
172
- }
173
-
174
- return $groups_options;
175
- }
176
-
177
- /**
178
- * Retrieve merge fields for passed list
179
- *
180
- * @param string $list Id of the list, used to retrieve groups
181
- *
182
- * @return array Array of available merge vars, formatted as tag -> name format
183
- * @since 1.0.0
184
- */
185
- public function retrieve_fields( $list ) {
186
- $fields = array();
187
-
188
- if( ! empty( $list ) ){
189
- $response = $this->do_request( 'lists/merge-vars', array( 'id' => array( $list ) ) );
190
-
191
- if( ! empty( $response['data'] ) ){
192
- $merge_fields_array = $response['data'];
193
-
194
- foreach( $merge_fields_array as $merge_fields ){
195
- if( ! empty( $merge_fields['merge_vars'] ) ){
196
- $merge_fields = $merge_fields['merge_vars'];
197
-
198
- foreach( $merge_fields as $field ){
199
- $fields[ $field['tag'] ] = $field['name'];
200
- }
201
- }
202
- }
203
- }
204
- }
205
-
206
- return $fields;
207
- }
208
-
209
- /**
210
- * Send a request to mailchimp servers
211
- *
212
- * @param $request string API handle to call (e.g. 'lists/list')
213
- * @param $args array Associative array of params to use in the request (default to empty array)
214
- * @param $force_update boolean Whether or not to update cached data with a fresh request (applied only for requests in $cachable_requests, default to false)
215
- *
216
- * @return mixed API response (as an associative array)
217
- * @since 1.0.0
218
- */
219
- public function do_request( $request, $args = array(), $force_update = false ) {
220
- if( is_null( $this->mailchimp ) ){
221
- return false;
222
- }
223
-
224
- $api_key = get_option( 'yith_wcmc_mailchimp_api_key' );
225
- $transient_name = 'yith_wcmc_' . md5( $api_key );
226
- $data = get_transient( $transient_name );
227
-
228
- if( in_array( $request, $this->cachable_requests ) && ! $force_update && ! empty( $data ) && isset( $data[ $request ] ) ) {
229
- return $data[ $request ];
230
- }
231
-
232
- try {
233
- $result = $this->mailchimp->call( $request, $args );
234
-
235
- if( in_array( $request, $this->cachable_requests ) ){
236
- $data[ $request ] = $result;
237
- set_transient( $transient_name, $data, apply_filters( 'yith_wcmc_transient_expiration', DAY_IN_SECONDS ) );
238
- }
239
-
240
- return $result;
241
- }
242
- catch( Exception $e ){
243
- return array(
244
- 'status' => false,
245
- 'code' => $e->getCode(),
246
- 'message' => $e->getMessage()
247
- );
248
- }
249
- }
250
-
251
- /**
252
- * Handles AJAX request, used to call API handles
253
- *
254
- * @return void
255
- * @since 1.0.0
256
- */
257
- public function do_request_via_ajax() {
258
- // return if not ajax request
259
- if( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ){
260
- wp_send_json( false );
261
- }
262
-
263
- // retrieve params for the request
264
- $request = isset( $_REQUEST['request'] ) ? trim( $_REQUEST['request'] ) : false;
265
- $args = isset( $_REQUEST['args'] ) ? $_REQUEST['args'] : array();
266
- $force_update = isset( $_REQUEST['force_update'] ) ? $_REQUEST['force_update'] : false;
267
-
268
- // return if required params are missing
269
- if( empty( $request ) || empty( $_REQUEST['yith_wcmc_ajax_request_nonce'] ) ){
270
- wp_send_json( false );
271
- }
272
-
273
- // return if non check fails
274
- if( ! wp_verify_nonce( $_REQUEST['yith_wcmc_ajax_request_nonce'], 'yith_wcmc_ajax_request' ) ){
275
- wp_send_json( false );
276
- }
277
-
278
- // do request
279
- $result = $this->do_request( $request, $args, $force_update );
280
-
281
- // send empty response, if there was an error
282
- if( isset( $result['status'] ) && ! $result['status'] ){
283
- wp_send_json( false );
284
- }
285
-
286
- // return json encoded result
287
- wp_send_json( $result );
288
- }
289
-
290
- /* === ADDS FRONTEND CHECKBOX === */
291
-
292
- /**
293
- * Register action to print subscription checkbox
294
- *
295
- * @return void
296
- * @since 1.0.0
297
- */
298
- public function add_subscription_checkbox() {
299
- $trigger = get_option( 'yith_wcmc_checkout_trigger', 'never' );
300
- $show_checkbox = 'yes' == get_option( 'yith_wcmc_subscription_checkbox' );
301
- $checkbox_position = get_option( 'yith_wcmc_subscription_checkbox_position' );
302
-
303
- if( $trigger != 'never' && $show_checkbox ){
304
- $positions_hook_relation = array(
305
- 'above_customer' => 'woocommerce_checkout_before_customer_details',
306
- 'below_customer' => 'woocommerce_checkout_after_customer_details',
307
- 'above_place_order' => 'woocommerce_review_order_before_submit',
308
- 'below_place_order' => 'woocommerce_review_order_after_submit',
309
- 'above_total' => 'woocommerce_review_order_before_order_total',
310
- 'above_billing' => 'woocommerce_checkout_billing',
311
- 'below_billing' => 'woocommerce_checkout_shipping',
312
- 'above_shipping' => 'woocommerce_after_checkout_billing_form'
313
- );
314
-
315
- if( ! in_array( $checkbox_position, array_keys( $positions_hook_relation ) ) ){
316
- $checkbox_position = 'below_customer';
317
- }
318
-
319
- $hook = $positions_hook_relation[ $checkbox_position ];
320
-
321
- add_action( $hook, array( $this, 'print_subscription_checkbox' ) );
322
- }
323
- }
324
-
325
- /**
326
- * Prints subscription checkbox
327
- *
328
- * @return void
329
- * @since 1.0.0
330
- */
331
- public function print_subscription_checkbox() {
332
- $checkbox_label = get_option( 'yith_wcmc_subscription_checkbox_label' );
333
- $checkbox_checked = 'yes' == get_option( 'yith_wcmc_subscription_checkbox_default' );
334
-
335
- $template_name = 'mailchimp-subscription-checkbox.php';
336
- $located = locate_template( array(
337
- trailingslashit( WC()->template_path() ) . 'wcmc/' . $template_name,
338
- trailingslashit( WC()->template_path() ) . $template_name,
339
- 'wcmc/' . $template_name,
340
- $template_name
341
- ) );
342
-
343
- if( ! $located ){
344
- $located = YITH_WCMC_DIR . 'templates/' . $template_name;
345
- }
346
-
347
- include_once( $located );
348
- }
349
-
350
- /* === HANDLES ORDER SUBSCRIPTION === */
351
-
352
- /**
353
- * Adds metas to order post, saving mailchimp informations
354
- *
355
- * @param $order_id int Order id
356
- *
357
- * @return void
358
- * @since 1.0.0
359
- */
360
- public function adds_order_meta( $order_id ) {
361
- $show_checkbox = 'yes' == get_option( 'yith_wcmc_subscription_checkbox' );
362
- $submitted_value = isset( $_POST['yith_wcmc_subscribe_me'] ) ? 'yes' : 'no';
363
-
364
- update_post_meta( $order_id, '_yith_wcmc_show_checkbox', $show_checkbox );
365
- update_post_meta( $order_id, '_yith_wcmc_submitted_value', $submitted_value );
366
- }
367
-
368
- /**
369
- * Subscribe user to newsletter (called on order placed)
370
- *
371
- * @param $order_id int Order id
372
- *
373
- * @return bool Status of the operation
374
- * @since 1.0.0
375
- */
376
- public function subscribe_on_checkout( $order_id ) {
377
- $trigger = get_option( 'yith_wcmc_checkout_trigger' );
378
- $show_checkbox = get_post_meta( $order_id, '_yith_wcmc_show_checkbox', true );
379
- $submitted_value = get_post_meta( $order_id, '_yith_wcmc_submitted_value', true );
380
-
381
- // return if admin don't want to subscribe users at this point
382
- if( $trigger != 'created' ){
383
- return false;
384
- }
385
-
386
- // return if subscription checkbox is printed, but not submitted
387
- if( $show_checkbox && $submitted_value == 'no' ){
388
- return false;
389
- }
390
-
391
- return $this->order_subscribe( $order_id );
392
- }
393
-
394
- /**
395
- * Subscribe user to newsletter (called on order completed)
396
- *
397
- * @param $order_id int Order id
398
- *
399
- * @return bool Status of the operation
400
- * @since 1.0.0
401
- */
402
- public function subscribe_on_completed( $order_id ) {
403
- $trigger = get_option( 'yith_wcmc_checkout_trigger' );
404
- $show_checkbox = get_post_meta( $order_id, '_yith_wcmc_show_checkbox', true );
405
- $submitted_value = get_post_meta( $order_id, '_yith_wcmc_submitted_value', true );
406
-
407
- // return if admin don't want to subscribe users at this point
408
- if( $trigger != 'completed' ){
409
- return false;
410
- }
411
-
412
- // return if subscription checkbox is printed, but not submitted
413
- if( $show_checkbox && $submitted_value == 'no' ){
414
- return false;
415
- }
416
-
417
- return $this->order_subscribe( $order_id );
418
- }
419
-
420
- /**
421
- * Call subscribe API handle, to register user to a specific list
422
- *
423
- * @param $order_id int Order id
424
- *
425
- * @return bool status of the operation
426
- */
427
- public function order_subscribe( $order_id, $args = array() ){
428
- $order = wc_get_order( $order_id );
429
-
430
- $list_id = get_option( 'yith_wcmc_mailchimp_list' );
431
- $email_type = get_option( 'yith_wcmc_email_type' );
432
- $double_optin = 'yes' == get_option( 'yith_wcmc_double_optin' );
433
- $update_existing = 'yes' == get_option( 'yith_wcmc_update_existing' );
434
- $send_welcome = 'yes' == get_option( 'yith_wcmc_send_welcome' );
435
-
436
- if( empty( $list_id ) ){
437
- return false;
438
- }
439
-
440
- $args = array_merge( array(
441
- 'id' => $list_id,
442
- 'email' => array(
443
- 'email' => $order->billing_email
444
- ),
445
- 'merge_vars' => apply_filters( 'yith_wcmc_subscribe_merge_vars', array(
446
- 'FNAME' => $order->billing_first_name,
447
- 'LNAME' => $order->billing_last_name
448
- ) ),
449
- 'email_type' => $email_type,
450
- 'double_optin' => $double_optin,
451
- 'update_existing' => $update_existing,
452
- 'send_welcome' => $send_welcome
453
- ), $args );
454
-
455
- do_action( 'yith_wcmc_user_subscribing', $order_id );
456
-
457
- $res = $this->do_request( 'lists/subscribe', apply_filters( 'yith_wcmc_subscribe_args', $args ) );
458
-
459
- if( isset( $res['status'] ) && ! $res['status'] ){
460
- $order->add_order_note( sprintf( __( 'MAILCHIMP ERROR: (%s) %s', 'yith-wcmc' ), $res['code'], $res['message'] ) );
461
- return $res;
462
- }
463
-
464
- do_action( 'yith_wcmc_user_subscribed', $order_id );
465
-
466
- return $res;
467
- }
468
- }
469
- }
470
-
471
- /**
472
- * Unique access to instance of YITH_WCMC class
473
- *
474
- * @return \YITH_WCMC
475
- * @since 1.0.0
476
- */
477
- function YITH_WCMC(){
478
- return YITH_WCMC::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
  }
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCMC' ) ) {
15
+ /**
16
+ * WooCommerce Mailchimp
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCMC {
21
+ /**
22
+ * Single instance of the class
23
+ *
24
+ * @var \YITH_WCMC
25
+ * @since 1.0.0
26
+ */
27
+ protected static $instance;
28
+
29
+ /**
30
+ * Mailchimp API wrapper class
31
+ *
32
+ * @var \Mailchimp
33
+ * @since 1.0.0
34
+ */
35
+ protected $mailchimp = null;
36
+
37
+ /**
38
+ * Cachable requests
39
+ *
40
+ * @var array
41
+ * @since 1.0.0
42
+ */
43
+ public $cachable_requests = array();
44
+
45
+ /**
46
+ * Returns single instance of the class
47
+ *
48
+ * @return \YITH_WCMC
49
+ * @since 1.0.0
50
+ */
51
+ public static function get_instance(){
52
+ if( is_null( self::$instance ) ){
53
+ self::$instance = new self;
54
+ }
55
+
56
+ return self::$instance;
57
+ }
58
+
59
+ /**
60
+ * Constructor.
61
+ *
62
+ * @param array $details
63
+ * @return \YITH_WCMC
64
+ * @since 1.0.0
65
+ */
66
+ public function __construct() {
67
+ // init cachable requests
68
+ $this->cachable_requests = apply_filters( 'yith_wcmc_cachable_requests', array(
69
+ 'lists/list',
70
+ 'users/profile'
71
+ ) );
72
+
73
+ // load plugin-fw
74
+ add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 15 );
75
+
76
+ // init api key
77
+ add_action( 'update_option_yith_wcmc_mailchimp_api_key', array( $this, 'init_api' ) );
78
+ $this->init_api();
79
+
80
+ // handle ajax requests
81
+ add_action( 'wp_ajax_do_request_via_ajax', array( $this, 'do_request_via_ajax' ) );
82
+
83
+ // update checkout page
84
+ add_action( 'init', array( $this, 'add_subscription_checkbox' ) );
85
+
86
+ // register subscription functions
87
+ add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'adds_order_meta' ), 10, 1 );
88
+ add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'subscribe_on_checkout' ), 10, 1 );
89
+ add_action( 'woocommerce_order_status_completed', array( $this, 'subscribe_on_completed' ), 15, 1 );
90
+ }
91
+
92
+ /* === PLUGIN FW LOADER === */
93
+
94
+ /**
95
+ * Loads plugin fw, if not yet created
96
+ *
97
+ * @return void
98
+ * @since 2.0.0
99
+ */
100
+ public function plugin_fw_loader() {
101
+ if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
102
+ global $plugin_fw_data;
103
+ if( ! empty( $plugin_fw_data ) ){
104
+ $plugin_fw_file = array_shift( $plugin_fw_data );
105
+ require_once( $plugin_fw_file );
106
+ }
107
+ }
108
+ }
109
+
110
+ /* === HANDLE REQUEST TO MAILCHIMP === */
111
+
112
+ /**
113
+ * Init Api class
114
+ *
115
+ * @return void
116
+ * @since 1.0.0
117
+ */
118
+ public function init_api() {
119
+ $api_key = get_option( 'yith_wcmc_mailchimp_api_key' );
120
+
121
+ $init_options = array( 'ssl_verifypeer' => false );
122
+
123
+ if( ! empty( $api_key ) ){
124
+ $this->mailchimp = new Mailchimp( $api_key, $init_options );
125
+ }
126
+ else{
127
+ $this->mailchimp = null;
128
+ }
129
+ }
130
+
131
+ /**
132
+ * Retrieve lists registered for current API Key
133
+ *
134
+ * @return array Array of available list, in id -> name format
135
+ * @since 1.0.0
136
+ */
137
+ public function retrieve_lists() {
138
+ $lists = $this->do_request( 'lists/list', array( 'sort_field' => 'web' ) );
139
+
140
+ $list_options = array();
141
+ if( ! empty( $lists['data'] ) ){
142
+ foreach( $lists['data'] as $list ){
143
+ $list_options[ $list['id'] ] = $list['name'];
144
+ }
145
+ }
146
+
147
+ return $list_options;
148
+ }
149
+
150
+ /**
151
+ * Retrieve interest groups registered for passed list
152
+ *
153
+ * @param string $list Id of the list, used to retrieve groups
154
+ *
155
+ * @return array Array of available groups, formatted as ( group_id - interest_name ) -> ( group_name - interest_name ) format
156
+ * @since 1.0.0
157
+ */
158
+ public function retrieve_groups( $list ) {
159
+ $groups_options = array();
160
+ if( ! empty( $list ) ){
161
+ $groups = YITH_WCMC()->do_request( 'lists/interest-groupings', array( 'id' => $list ) );
162
+
163
+ if( ! empty( $groups ) ){
164
+ foreach( $groups as $interest_group ){
165
+ if( ! empty( $interest_group['groups'] ) ){
166
+ foreach( $interest_group['groups'] as $group ){
167
+ $groups_options[ $interest_group['id'] . '-' . $group['name'] ] = $interest_group['name'] . ' - ' .$group['name'];
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+
174
+ return $groups_options;
175
+ }
176
+
177
+ /**
178
+ * Retrieve merge fields for passed list
179
+ *
180
+ * @param string $list Id of the list, used to retrieve groups
181
+ *
182
+ * @return array Array of available merge vars, formatted as tag -> name format
183
+ * @since 1.0.0
184
+ */
185
+ public function retrieve_fields( $list ) {
186
+ $fields = array();
187
+
188
+ if( ! empty( $list ) ){
189
+ $response = $this->do_request( 'lists/merge-vars', array( 'id' => array( $list ) ) );
190
+
191
+ if( ! empty( $response['data'] ) ){
192
+ $merge_fields_array = $response['data'];
193
+
194
+ foreach( $merge_fields_array as $merge_fields ){
195
+ if( ! empty( $merge_fields['merge_vars'] ) ){
196
+ $merge_fields = $merge_fields['merge_vars'];
197
+
198
+ foreach( $merge_fields as $field ){
199
+ $fields[ $field['tag'] ] = $field['name'];
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+ return $fields;
207
+ }
208
+
209
+ /**
210
+ * Send a request to mailchimp servers
211
+ *
212
+ * @param $request string API handle to call (e.g. 'lists/list')
213
+ * @param $args array Associative array of params to use in the request (default to empty array)
214
+ * @param $force_update boolean Whether or not to update cached data with a fresh request (applied only for requests in $cachable_requests, default to false)
215
+ *
216
+ * @return mixed API response (as an associative array)
217
+ * @since 1.0.0
218
+ */
219
+ public function do_request( $request, $args = array(), $force_update = false ) {
220
+ if( is_null( $this->mailchimp ) ){
221
+ return false;
222
+ }
223
+
224
+ $api_key = get_option( 'yith_wcmc_mailchimp_api_key' );
225
+ $transient_name = 'yith_wcmc_' . md5( $api_key );
226
+ $data = get_transient( $transient_name );
227
+
228
+ if( in_array( $request, $this->cachable_requests ) && ! $force_update && ! empty( $data ) && isset( $data[ $request ] ) ) {
229
+ return $data[ $request ];
230
+ }
231
+
232
+ try {
233
+ $result = $this->mailchimp->call( $request, $args );
234
+
235
+ if( in_array( $request, $this->cachable_requests ) ){
236
+ $data[ $request ] = $result;
237
+ set_transient( $transient_name, $data, apply_filters( 'yith_wcmc_transient_expiration', DAY_IN_SECONDS ) );
238
+ }
239
+
240
+ return $result;
241
+ }
242
+ catch( Exception $e ){
243
+ return array(
244
+ 'status' => false,
245
+ 'code' => $e->getCode(),
246
+ 'message' => $this->maybe_translate( $e->getCode(), $e->getMessage() )
247
+ );
248
+ }
249
+ }
250
+
251
+ /**
252
+ * Handles AJAX request, used to call API handles
253
+ *
254
+ * @return void
255
+ * @since 1.0.0
256
+ */
257
+ public function do_request_via_ajax() {
258
+ // return if not ajax request
259
+ if( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ){
260
+ wp_send_json( false );
261
+ }
262
+
263
+ // retrieve params for the request
264
+ $request = isset( $_REQUEST['request'] ) ? trim( $_REQUEST['request'] ) : false;
265
+ $args = isset( $_REQUEST['args'] ) ? $_REQUEST['args'] : array();
266
+ $force_update = isset( $_REQUEST['force_update'] ) ? $_REQUEST['force_update'] : false;
267
+
268
+ // return if required params are missing
269
+ if( empty( $request ) || empty( $_REQUEST['yith_wcmc_ajax_request_nonce'] ) ){
270
+ wp_send_json( false );
271
+ }
272
+
273
+ // return if non check fails
274
+ if( ! wp_verify_nonce( $_REQUEST['yith_wcmc_ajax_request_nonce'], 'yith_wcmc_ajax_request' ) ){
275
+ wp_send_json( false );
276
+ }
277
+
278
+ // do request
279
+ $result = $this->do_request( $request, $args, $force_update );
280
+
281
+ // send empty response, if there was an error
282
+ if( isset( $result['status'] ) && ! $result['status'] ){
283
+ wp_send_json( false );
284
+ }
285
+
286
+ // return json encoded result
287
+ wp_send_json( $result );
288
+ }
289
+
290
+ /**
291
+ * Search for translated error messages; default API response, if no translation is found
292
+ *
293
+ * @param $code string Error code
294
+ * @param $default string Error message as returned by MailChimp server
295
+ * @return string Translated message or default server response
296
+ * @since 1.0.5
297
+ */
298
+ public function maybe_translate( $code, $default ) {
299
+ $translation = yith_wcmc_include_available_translations();
300
+
301
+ if( isset( $translation[ $code ] ) ){
302
+ return $translation[ $code ];
303
+ }
304
+
305
+ return $default;
306
+ }
307
+
308
+ /* === ADDS FRONTEND CHECKBOX === */
309
+
310
+ /**
311
+ * Register action to print subscription checkbox
312
+ *
313
+ * @return void
314
+ * @since 1.0.0
315
+ */
316
+ public function add_subscription_checkbox() {
317
+ $trigger = get_option( 'yith_wcmc_checkout_trigger', 'never' );
318
+ $show_checkbox = 'yes' == get_option( 'yith_wcmc_subscription_checkbox' );
319
+ $checkbox_position = get_option( 'yith_wcmc_subscription_checkbox_position' );
320
+
321
+ if( $trigger != 'never' && $show_checkbox ){
322
+ $positions_hook_relation = array(
323
+ 'above_customer' => 'woocommerce_checkout_before_customer_details',
324
+ 'below_customer' => 'woocommerce_checkout_after_customer_details',
325
+ 'above_place_order' => 'woocommerce_review_order_before_submit',
326
+ 'below_place_order' => 'woocommerce_review_order_after_submit',
327
+ 'above_total' => 'woocommerce_review_order_before_order_total',
328
+ 'above_billing' => 'woocommerce_checkout_billing',
329
+ 'below_billing' => 'woocommerce_checkout_shipping',
330
+ 'above_shipping' => 'woocommerce_after_checkout_billing_form'
331
+ );
332
+
333
+ if( ! in_array( $checkbox_position, array_keys( $positions_hook_relation ) ) ){
334
+ $checkbox_position = 'below_customer';
335
+ }
336
+
337
+ $hook = $positions_hook_relation[ $checkbox_position ];
338
+
339
+ add_action( $hook, array( $this, 'print_subscription_checkbox' ) );
340
+ }
341
+ }
342
+
343
+ /**
344
+ * Prints subscription checkbox
345
+ *
346
+ * @return void
347
+ * @since 1.0.0
348
+ */
349
+ public function print_subscription_checkbox() {
350
+ $checkbox_label = get_option( 'yith_wcmc_subscription_checkbox_label' );
351
+ $checkbox_checked = 'yes' == get_option( 'yith_wcmc_subscription_checkbox_default' );
352
+
353
+ $template_name = 'mailchimp-subscription-checkbox.php';
354
+ $located = locate_template( array(
355
+ trailingslashit( WC()->template_path() ) . 'wcmc/' . $template_name,
356
+ trailingslashit( WC()->template_path() ) . $template_name,
357
+ 'wcmc/' . $template_name,
358
+ $template_name
359
+ ) );
360
+
361
+ if( ! $located ){
362
+ $located = YITH_WCMC_DIR . 'templates/' . $template_name;
363
+ }
364
+
365
+ include_once( $located );
366
+ }
367
+
368
+ /* === HANDLES ORDER SUBSCRIPTION === */
369
+
370
+ /**
371
+ * Adds metas to order post, saving mailchimp informations
372
+ *
373
+ * @param $order_id int Order id
374
+ *
375
+ * @return void
376
+ * @since 1.0.0
377
+ */
378
+ public function adds_order_meta( $order_id ) {
379
+ $show_checkbox = 'yes' == get_option( 'yith_wcmc_subscription_checkbox' );
380
+ $submitted_value = isset( $_POST['yith_wcmc_subscribe_me'] ) ? 'yes' : 'no';
381
+
382
+ update_post_meta( $order_id, '_yith_wcmc_show_checkbox', $show_checkbox );
383
+ update_post_meta( $order_id, '_yith_wcmc_submitted_value', $submitted_value );
384
+ }
385
+
386
+ /**
387
+ * Subscribe user to newsletter (called on order placed)
388
+ *
389
+ * @param $order_id int Order id
390
+ *
391
+ * @return bool Status of the operation
392
+ * @since 1.0.0
393
+ */
394
+ public function subscribe_on_checkout( $order_id ) {
395
+ $trigger = get_option( 'yith_wcmc_checkout_trigger' );
396
+ $show_checkbox = get_post_meta( $order_id, '_yith_wcmc_show_checkbox', true );
397
+ $submitted_value = get_post_meta( $order_id, '_yith_wcmc_submitted_value', true );
398
+
399
+ // return if admin don't want to subscribe users at this point
400
+ if( $trigger != 'created' ){
401
+ return false;
402
+ }
403
+
404
+ // return if subscription checkbox is printed, but not submitted
405
+ if( $show_checkbox && $submitted_value == 'no' ){
406
+ return false;
407
+ }
408
+
409
+ return $this->order_subscribe( $order_id );
410
+ }
411
+
412
+ /**
413
+ * Subscribe user to newsletter (called on order completed)
414
+ *
415
+ * @param $order_id int Order id
416
+ *
417
+ * @return bool Status of the operation
418
+ * @since 1.0.0
419
+ */
420
+ public function subscribe_on_completed( $order_id ) {
421
+ $trigger = get_option( 'yith_wcmc_checkout_trigger' );
422
+ $show_checkbox = get_post_meta( $order_id, '_yith_wcmc_show_checkbox', true );
423
+ $submitted_value = get_post_meta( $order_id, '_yith_wcmc_submitted_value', true );
424
+
425
+ // return if admin don't want to subscribe users at this point
426
+ if( $trigger != 'completed' ){
427
+ return false;
428
+ }
429
+
430
+ // return if subscription checkbox is printed, but not submitted
431
+ if( $show_checkbox && $submitted_value == 'no' ){
432
+ return false;
433
+ }
434
+
435
+ return $this->order_subscribe( $order_id );
436
+ }
437
+
438
+ /**
439
+ * Call subscribe API handle, to register user to a specific list
440
+ *
441
+ * @param $order_id int Order id
442
+ *
443
+ * @return bool status of the operation
444
+ */
445
+ public function order_subscribe( $order_id, $args = array() ){
446
+ $order = wc_get_order( $order_id );
447
+
448
+ $list_id = get_option( 'yith_wcmc_mailchimp_list' );
449
+ $email_type = get_option( 'yith_wcmc_email_type' );
450
+ $double_optin = 'yes' == get_option( 'yith_wcmc_double_optin' );
451
+ $update_existing = 'yes' == get_option( 'yith_wcmc_update_existing' );
452
+ $send_welcome = 'yes' == get_option( 'yith_wcmc_send_welcome' );
453
+
454
+ if( empty( $list_id ) ){
455
+ return false;
456
+ }
457
+
458
+ $args = array_merge( array(
459
+ 'id' => $list_id,
460
+ 'email' => array(
461
+ 'email' => $order->billing_email
462
+ ),
463
+ 'merge_vars' => apply_filters( 'yith_wcmc_subscribe_merge_vars', array(
464
+ 'FNAME' => $order->billing_first_name,
465
+ 'LNAME' => $order->billing_last_name
466
+ ) ),
467
+ 'email_type' => $email_type,
468
+ 'double_optin' => $double_optin,
469
+ 'update_existing' => $update_existing,
470
+ 'send_welcome' => $send_welcome
471
+ ), $args );
472
+
473
+ do_action( 'yith_wcmc_user_subscribing', $order_id );
474
+
475
+ $res = $this->do_request( 'lists/subscribe', apply_filters( 'yith_wcmc_subscribe_args', $args ) );
476
+
477
+ if( isset( $res['status'] ) && ! $res['status'] ){
478
+ $order->add_order_note( sprintf( __( 'MAILCHIMP ERROR: (%s) %s', 'yith-wcmc' ), $res['code'], $res['message'] ) );
479
+ return $res;
480
+ }
481
+
482
+ do_action( 'yith_wcmc_user_subscribed', $order_id );
483
+
484
+ return $res;
485
+ }
486
+ }
487
+ }
488
+
489
+ /**
490
+ * Unique access to instance of YITH_WCMC class
491
+ *
492
+ * @return \YITH_WCMC
493
+ * @since 1.0.0
494
+ */
495
+ function YITH_WCMC(){
496
+ return YITH_WCMC::get_instance();
497
  }
modules/yith-woocommerce-mailchimp/includes/functions.yith-wcmc.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * General functions
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 2.0.10
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if( ! function_exists( 'yith_wcmc_include_available_translations' ) ){
15
+ function yith_wcmc_include_available_translations(){
16
+ $translations = array(
17
+ // general section
18
+ '-50' => _x( 'You have made too many connections on the MailChimp server.', 'Mailchimp error translation (-50)', 'yith-wcmc' ),
19
+ '101' => _x( 'You cannot use your APIs, because your user profile has been deactivated.', 'MailChimp error translation (101)', 'yith-wcmc' ),
20
+ '104' => _x( 'Your API key may be invalid, or you\'ve attempted to access the wrong datacenter.', 'MailChimp error translation (104)', 'yith-wcmc' ),
21
+ '105' => _x( 'You cannot use your APIs, because your user profile is under maintenance.', 'MailChimp error translation (105)', 'yith-wcmc' ),
22
+ '109' => _x( 'You cannot complete your operation, because you don\'t have the necessary authorization.', 'MailChimp error translation (109)', 'yith-wcmc' ),
23
+ '120' => _x( 'You have requested an invalid operation.', 'MailChimp error translation (120)', 'yith-wcmc' ),
24
+ '232' => _x( 'The email you have written is not valid, please try to write it again.', 'MailChimp error translation (232)', 'yith-wcmc' ),
25
+ '500' => _x( 'The sent information are not valid, please double check them.', 'MailChimp error translation (500)', 'yith-wcmc' ),
26
+
27
+ // list/subscribe section
28
+ '-99' => _x( 'You submitted an invalid email address that cannot be imported.', 'MailChimp error translation (-99)', 'yith-wcmc' ),
29
+ '200' => _x( 'Invalid MailChimp List ID.', 'MailChimp error translation (200)', 'yith-wcmc' ),
30
+ '214' => _x( 'You submitted an email address that is already subscribed to the list.', 'MailChimp error translation (214)', 'yith-wcmc' )
31
+
32
+ );
33
+
34
+ return apply_filters( 'yith_wcmc_available_translations', $translations );
35
+ }
36
+ }
37
+
modules/yith-woocommerce-mailchimp/init.php CHANGED
@@ -1,124 +1,131 @@
1
- <?php
2
- /**
3
- * Plugin Name: YITH WooCommerce Mailchimp
4
- * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-mailchimp/
5
- * Description: YITH WooCommerce Mailchimp allows you to integrate the most popular newsletter campaign manager on your ecommerce.
6
- * Version: 1.0.4
7
- * Author: Yithemes
8
- * Author URI: http://yithemes.com/
9
- * Text Domain: yith-wcmc
10
- * Domain Path: /languages/
11
- *
12
- * @author Your Inspiration Themes
13
- * @package YITH WooCommerce Mailchimp
14
- * @version 1.0.0
15
- */
16
-
17
- /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
18
-
19
- This program is free software; you can redistribute it and/or modify
20
- it under the terms of the GNU General Public License, version 2, as
21
- published by the Free Software Foundation.
22
-
23
- This program is distributed in the hope that it will be useful,
24
- but WITHOUT ANY WARRANTY; without even the implied warranty of
25
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
- GNU General Public License for more details.
27
-
28
- You should have received a copy of the GNU General Public License
29
- along with this program; if not, write to the Free Software
30
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
- */
32
-
33
- if ( ! defined( 'ABSPATH' ) ) {
34
- exit;
35
- } // Exit if accessed directly
36
-
37
- if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
38
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
39
- }
40
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
41
-
42
- if ( ! defined( 'YITH_WCMC' ) ) {
43
- define( 'YITH_WCMC', true );
44
- }
45
-
46
- if ( ! defined( 'YITH_WCMC_URL' ) ) {
47
- define( 'YITH_WCMC_URL', plugin_dir_url( __FILE__ ) );
48
- }
49
-
50
- if ( ! defined( 'YITH_WCMC_DIR' ) ) {
51
- define( 'YITH_WCMC_DIR', plugin_dir_path( __FILE__ ) );
52
- }
53
-
54
- if ( ! defined( 'YITH_WCMC_INC' ) ) {
55
- define( 'YITH_WCMC_INC', YITH_WCMC_DIR . 'includes/' );
56
- }
57
-
58
- if ( ! defined( 'YITH_WCMC_INIT' ) ) {
59
- define( 'YITH_WCMC_INIT', plugin_basename( __FILE__ ) );
60
- }
61
-
62
- if ( ! defined( 'YITH_WCMC_FREE_INIT' ) ) {
63
- define( 'YITH_WCMC_FREE_INIT', plugin_basename( __FILE__ ) );
64
- }
65
-
66
- if( ! function_exists( 'yith_mailchimp_constructor' ) ) {
67
- function yith_mailchimp_constructor() {
68
- load_plugin_textdomain( 'yith-wcmc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
69
-
70
- require_once( YITH_WCMC_INC . 'mailchimp/Mailchimp.php' );
71
- require_once( YITH_WCMC_INC . 'class.yith-wcmc.php' );
72
-
73
- // Let's start the game
74
- YITH_WCMC();
75
-
76
- if( is_admin() ){
77
- require_once( YITH_WCMC_INC . 'class.yith-wcmc-admin.php' );
78
-
79
- YITH_WCMC_Admin();
80
- }
81
- }
82
- }
83
- add_action( 'yith_wcmc_init', 'yith_mailchimp_constructor' );
84
-
85
- if( ! function_exists( 'yith_mailchimp_install' ) ) {
86
- function yith_mailchimp_install() {
87
-
88
- if ( ! function_exists( 'is_plugin_active' ) ) {
89
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
90
- }
91
-
92
- if ( ! function_exists( 'WC' ) ) {
93
- add_action( 'admin_notices', 'yith_wcmc_install_woocommerce_admin_notice' );
94
- }
95
- elseif( defined( 'YITH_WCMC_PREMIUM' ) ) {
96
- add_action( 'admin_notices', 'yith_wcmc_install_free_admin_notice' );
97
- deactivate_plugins( plugin_basename( __FILE__ ) );
98
- }
99
- else {
100
- do_action( 'yith_wcmc_init' );
101
- }
102
- }
103
- }
104
- add_action( 'plugins_loaded', 'yith_mailchimp_install', 11 );
105
-
106
- if( ! function_exists( 'yith_wcmc_install_woocommerce_admin_notice' ) ) {
107
- function yith_wcmc_install_woocommerce_admin_notice() {
108
- ?>
109
- <div class="error">
110
- <p><?php _e( 'YITH WooCommerce MailChimp is enabled but not effective. It requires WooCommerce in order to work.', 'yith-wcmc' ); ?></p>
111
- </div>
112
- <?php
113
- }
114
- }
115
-
116
- if( ! function_exists( 'yith_wcmc_install_free_admin_notice' ) ){
117
- function yith_wcmc_install_free_admin_notice() {
118
- ?>
119
- <div class="error">
120
- <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce MailChimp while you are using the premium one.', 'yith-wcmc' ); ?></p>
121
- </div>
122
- <?php
123
- }
 
 
 
 
 
 
 
124
  }
1
+ <?php
2
+ /**
3
+ * Plugin Name: YITH WooCommerce Mailchimp
4
+ * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-mailchimp/
5
+ * Description: YITH WooCommerce Mailchimp allows you to integrate the most popular newsletter campaign manager on your ecommerce.
6
+ * Version: 1.0.5
7
+ * Author: Yithemes
8
+ * Author URI: http://yithemes.com/
9
+ * Text Domain: yith-wcmc
10
+ * Domain Path: /languages/
11
+ *
12
+ * @author Your Inspiration Themes
13
+ * @package YITH WooCommerce Mailchimp
14
+ * @version 1.0.0
15
+ */
16
+
17
+ /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
18
+
19
+ This program is free software; you can redistribute it and/or modify
20
+ it under the terms of the GNU General Public License, version 2, as
21
+ published by the Free Software Foundation.
22
+
23
+ This program is distributed in the hope that it will be useful,
24
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
+ GNU General Public License for more details.
27
+
28
+ You should have received a copy of the GNU General Public License
29
+ along with this program; if not, write to the Free Software
30
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
+ */
32
+
33
+ if ( ! defined( 'ABSPATH' ) ) {
34
+ exit;
35
+ } // Exit if accessed directly
36
+
37
+ if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
38
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
39
+ }
40
+ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
41
+
42
+ if ( ! defined( 'YITH_WCMC' ) ) {
43
+ define( 'YITH_WCMC', true );
44
+ }
45
+
46
+ if ( ! defined( 'YITH_WCMC_VERSION' ) ) {
47
+ define( 'YITH_WCMC_VERSION', '1.0.5' );
48
+ }
49
+
50
+ if ( ! defined( 'YITH_WCMC_URL' ) ) {
51
+ define( 'YITH_WCMC_URL', plugin_dir_url( __FILE__ ) );
52
+ }
53
+
54
+ if ( ! defined( 'YITH_WCMC_DIR' ) ) {
55
+ define( 'YITH_WCMC_DIR', plugin_dir_path( __FILE__ ) );
56
+ }
57
+
58
+ if ( ! defined( 'YITH_WCMC_INC' ) ) {
59
+ define( 'YITH_WCMC_INC', YITH_WCMC_DIR . 'includes/' );
60
+ }
61
+
62
+ if ( ! defined( 'YITH_WCMC_INIT' ) ) {
63
+ define( 'YITH_WCMC_INIT', plugin_basename( __FILE__ ) );
64
+ }
65
+
66
+ if ( ! defined( 'YITH_WCMC_FREE_INIT' ) ) {
67
+ define( 'YITH_WCMC_FREE_INIT', plugin_basename( __FILE__ ) );
68
+ }
69
+
70
+ if( ! function_exists( 'yith_mailchimp_constructor' ) ) {
71
+ function yith_mailchimp_constructor() {
72
+ load_plugin_textdomain( 'yith-wcmc', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
73
+
74
+ if( ! class_exists( 'Mailchimp' ) ) {
75
+ require_once( YITH_WCMC_INC . 'mailchimp/Mailchimp.php' );
76
+ }
77
+ require_once( YITH_WCMC_INC . 'functions.yith-wcmc.php' );
78
+ require_once( YITH_WCMC_INC . 'class.yith-wcmc.php' );
79
+
80
+ // Let's start the game
81
+ YITH_WCMC();
82
+
83
+ if( is_admin() ){
84
+ require_once( YITH_WCMC_INC . 'class.yith-wcmc-admin.php' );
85
+
86
+ YITH_WCMC_Admin();
87
+ }
88
+ }
89
+ }
90
+ add_action( 'yith_wcmc_init', 'yith_mailchimp_constructor' );
91
+
92
+ if( ! function_exists( 'yith_mailchimp_install' ) ) {
93
+ function yith_mailchimp_install() {
94
+
95
+ if ( ! function_exists( 'is_plugin_active' ) ) {
96
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
97
+ }
98
+
99
+ if ( ! function_exists( 'WC' ) ) {
100
+ add_action( 'admin_notices', 'yith_wcmc_install_woocommerce_admin_notice' );
101
+ }
102
+ elseif( defined( 'YITH_WCMC_PREMIUM' ) ) {
103
+ add_action( 'admin_notices', 'yith_wcmc_install_free_admin_notice' );
104
+ deactivate_plugins( plugin_basename( __FILE__ ) );
105
+ }
106
+ else {
107
+ do_action( 'yith_wcmc_init' );
108
+ }
109
+ }
110
+ }
111
+ add_action( 'plugins_loaded', 'yith_mailchimp_install', 11 );
112
+
113
+ if( ! function_exists( 'yith_wcmc_install_woocommerce_admin_notice' ) ) {
114
+ function yith_wcmc_install_woocommerce_admin_notice() {
115
+ ?>
116
+ <div class="error">
117
+ <p><?php _e( 'YITH WooCommerce MailChimp is enabled but not effective. It requires WooCommerce in order to work.', 'yith-wcmc' ); ?></p>
118
+ </div>
119
+ <?php
120
+ }
121
+ }
122
+
123
+ if( ! function_exists( 'yith_wcmc_install_free_admin_notice' ) ){
124
+ function yith_wcmc_install_free_admin_notice() {
125
+ ?>
126
+ <div class="error">
127
+ <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce MailChimp while you are using the premium one.', 'yith-wcmc' ); ?></p>
128
+ </div>
129
+ <?php
130
+ }
131
  }
modules/yith-woocommerce-mailchimp/languages/yith-wcmc.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Mailchimp\n"
5
- "POT-Creation-Date: 2015-10-23 17:07+0100\n"
6
  "PO-Revision-Date: 2015-04-20 10:10+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
@@ -18,52 +18,117 @@ msgstr ""
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
20
 
21
- #: includes/class.yith-wcmc-admin.php:79
22
  msgid "Integration"
23
  msgstr ""
24
 
25
- #: includes/class.yith-wcmc-admin.php:80
26
  msgid "Checkout"
27
  msgstr ""
28
 
29
- #: includes/class.yith-wcmc-admin.php:81
30
- #: includes/class.yith-wcmc-admin.php:215
31
  msgid "Premium Version"
32
  msgstr ""
33
 
34
- #: includes/class.yith-wcmc-admin.php:128
35
  msgid "Update Lists"
36
  msgstr ""
37
 
38
- #: includes/class.yith-wcmc-admin.php:129
39
  msgid "Update Groups"
40
  msgstr ""
41
 
42
- #: includes/class.yith-wcmc-admin.php:149
43
- #: includes/class.yith-wcmc-admin.php:150
44
  msgid "Mailchimp"
45
  msgstr ""
46
 
47
- #: includes/class.yith-wcmc-admin.php:211
48
  msgid "Settings"
49
  msgstr ""
50
 
51
- #: includes/class.yith-wcmc-admin.php:233
 
 
 
 
52
  msgid "Plugin Documentation"
53
  msgstr ""
54
 
55
- #: includes/class.yith-wcmc.php:460
56
  #, php-format
57
  msgid "MAILCHIMP ERROR: (%s) %s"
58
  msgstr ""
59
 
60
- #: init.php:114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  msgid ""
62
  "YITH WooCommerce MailChimp is enabled but not effective. It requires "
63
  "WooCommerce in order to work."
64
  msgstr ""
65
 
66
- #: init.php:124
67
  msgid ""
68
  "You can't activate the free version of YITH WooCommerce MailChimp while you "
69
  "are using the premium one."
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Mailchimp\n"
5
+ "POT-Creation-Date: 2015-12-14 16:34+0100\n"
6
  "PO-Revision-Date: 2015-04-20 10:10+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
20
 
21
+ #: includes/class.yith-wcmc-admin.php:86
22
  msgid "Integration"
23
  msgstr ""
24
 
25
+ #: includes/class.yith-wcmc-admin.php:87
26
  msgid "Checkout"
27
  msgstr ""
28
 
29
+ #: includes/class.yith-wcmc-admin.php:88
30
+ #: includes/class.yith-wcmc-admin.php:222
31
  msgid "Premium Version"
32
  msgstr ""
33
 
34
+ #: includes/class.yith-wcmc-admin.php:135
35
  msgid "Update Lists"
36
  msgstr ""
37
 
38
+ #: includes/class.yith-wcmc-admin.php:136
39
  msgid "Update Groups"
40
  msgstr ""
41
 
42
+ #: includes/class.yith-wcmc-admin.php:156
43
+ #: includes/class.yith-wcmc-admin.php:157
44
  msgid "Mailchimp"
45
  msgstr ""
46
 
47
+ #: includes/class.yith-wcmc-admin.php:218
48
  msgid "Settings"
49
  msgstr ""
50
 
51
+ #: includes/class.yith-wcmc-admin.php:223
52
+ msgid "Live Demo"
53
+ msgstr ""
54
+
55
+ #: includes/class.yith-wcmc-admin.php:241
56
  msgid "Plugin Documentation"
57
  msgstr ""
58
 
59
+ #: includes/class.yith-wcmc.php:478
60
  #, php-format
61
  msgid "MAILCHIMP ERROR: (%s) %s"
62
  msgstr ""
63
 
64
+ #: includes/functions.yith-wcmc.php:18
65
+ msgctxt "Mailchimp error translation (-50)"
66
+ msgid "You have made too many connections on the MailChimp server."
67
+ msgstr ""
68
+
69
+ #: includes/functions.yith-wcmc.php:19
70
+ msgctxt "MailChimp error translation (101)"
71
+ msgid ""
72
+ "You cannot use your APIs, because your user profile has been deactivated."
73
+ msgstr ""
74
+
75
+ #: includes/functions.yith-wcmc.php:20
76
+ msgctxt "MailChimp error translation (104)"
77
+ msgid ""
78
+ "Your API key may be invalid, or you've attempted to access the wrong "
79
+ "datacenter."
80
+ msgstr ""
81
+
82
+ #: includes/functions.yith-wcmc.php:21
83
+ msgctxt "MailChimp error translation (105)"
84
+ msgid ""
85
+ "You cannot use your APIs, because your user profile is under maintenance."
86
+ msgstr ""
87
+
88
+ #: includes/functions.yith-wcmc.php:22
89
+ msgctxt "MailChimp error translation (109)"
90
+ msgid ""
91
+ "You cannot complete your operation, because you don't have the necessary "
92
+ "authorization."
93
+ msgstr ""
94
+
95
+ #: includes/functions.yith-wcmc.php:23
96
+ msgctxt "MailChimp error translation (120)"
97
+ msgid "You have requested an invalid operation."
98
+ msgstr ""
99
+
100
+ #: includes/functions.yith-wcmc.php:24
101
+ msgctxt "MailChimp error translation (232)"
102
+ msgid "The email you have written is not valid, please try to write it again."
103
+ msgstr ""
104
+
105
+ #: includes/functions.yith-wcmc.php:25
106
+ msgctxt "MailChimp error translation (500)"
107
+ msgid "The sent information are not valid, please double check them."
108
+ msgstr ""
109
+
110
+ #: includes/functions.yith-wcmc.php:28
111
+ msgctxt "MailChimp error translation (-99)"
112
+ msgid "You submitted an invalid email address that cannot be imported."
113
+ msgstr ""
114
+
115
+ #: includes/functions.yith-wcmc.php:29
116
+ msgctxt "MailChimp error translation (200)"
117
+ msgid "Invalid MailChimp List ID."
118
+ msgstr ""
119
+
120
+ #: includes/functions.yith-wcmc.php:30
121
+ msgctxt "MailChimp error translation (214)"
122
+ msgid "You submitted an email address that is already subscribed to the list."
123
+ msgstr ""
124
+
125
+ #: init.php:123
126
  msgid ""
127
  "YITH WooCommerce MailChimp is enabled but not effective. It requires "
128
  "WooCommerce in order to work."
129
  msgstr ""
130
 
131
+ #: init.php:133
132
  msgid ""
133
  "You can't activate the free version of YITH WooCommerce MailChimp while you "
134
  "are using the premium one."
modules/yith-woocommerce-mailchimp/plugin-options/checkout-options.php CHANGED
@@ -1,150 +1,150 @@
1
- <?php
2
- /**
3
- * Checkout settings page
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Mailchimp
7
- * @version 1.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMC' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- // retrieve lists
15
- $list_options = YITH_WCMC()->retrieve_lists();
16
- $selected_list = get_option( 'yith_wcmc_mailchimp_list' );
17
-
18
- return apply_filters( 'yith_wcmc_checkout_options', array(
19
- 'checkout' => array(
20
- 'checkout-options' => array(
21
- 'title' => __( 'Mailchimp Options', 'yith-wcmc' ),
22
- 'type' => 'title',
23
- 'desc' => '',
24
- 'id' => 'yith_wcmc_checkout_options'
25
- ),
26
-
27
- 'checkout-trigger' => array(
28
- 'title' => __( 'Register after', 'yith-wcmc' ),
29
- 'type' => 'select',
30
- 'desc' => __( 'Select when the user should be added to the list', 'yith-wcmc' ),
31
- 'id' => 'yith_wcmc_checkout_trigger',
32
- 'options' => array(
33
- 'never' => __( 'Never', 'yith-wcmc' ),
34
- 'completed' => __( 'Order completed', 'yith-wcmc' ),
35
- 'created' => __( 'Order placed', 'yith-wcmc' )
36
- ),
37
- 'css' => 'min-width:300px;'
38
- ),
39
-
40
- 'checkout-checkbox' => array(
41
- 'title' => __( 'Show "Newsletter subscription" checkbox', 'yith-wcmc' ),
42
- 'type' => 'checkbox',
43
- 'id' => 'yith_wcmc_subscription_checkbox',
44
- 'desc' => __( 'When you select this option, a checkbox will be added to the checkout form, inviting users to subscribe to the newsletter; otherwise, users will be subscribed automatically', 'yith-wcmc' ),
45
- 'default' => ''
46
- ),
47
-
48
- 'checkout-checkbox-label' => array(
49
- 'title' => __( '"Newsletter subscription" label', 'yith-wcmc' ),
50
- 'type' => 'text',
51
- 'desc' => __( 'Enter here the label you want to use for the "Newsletter subscription" checkbox', 'yith-wcmc' ),
52
- 'id' => 'yith_wcmc_subscription_checkbox_label',
53
- 'default' => __( 'Subscribe to our cool newsletter', 'yith-wcmc' ),
54
- 'css' => 'min-width:300px;'
55
- ),
56
-
57
- 'checkout-checkbox-position' => array(
58
- 'title' => __( 'Position for "Newsletter subscription"', 'yith-wcmc' ),
59
- 'type' => 'select',
60
- 'desc' => __( 'Select position for "Newsletter subscription" checkbox in the page', 'yith-wcmc' ),
61
- 'id' => 'yith_wcmc_subscription_checkbox_position',
62
- 'options' => array(
63
- 'above_customer' => __( 'Above customer details', 'yith-wcmc' ),
64
- 'below_customer' => __( 'Below customer details', 'yith-wcmc' ),
65
- 'above_place_order' => __( 'Above "Place order" button', 'yith-wcmc' ),
66
- 'below_place_order' => __( 'Below "Place order" button', 'yith-wcmc' ),
67
- 'above_total' => __( 'Above "Review order" total', 'yith-wcmc' ),
68
- 'above_billing' => __( 'Above billing details', 'yith-wcmc' ),
69
- 'below_billing' => __( 'Below billing details', 'yith-wcmc' ),
70
- 'above_shipping' => __( 'Above shipping details', 'yith-wcmc' ),
71
- ),
72
- 'default' => 'below_customer',
73
- 'css' => 'min-width:300px;'
74
- ),
75
-
76
- 'checkout-checkbox-default' => array(
77
- 'title' => __( 'Show "Newsletter subscription" checked', 'yith-wcmc' ),
78
- 'type' => 'checkbox',
79
- 'id' => 'yith_wcmc_subscription_checkbox_default',
80
- 'desc' => __( 'When you check this option, "Newsletter subscription" checkbox will be printed as already checked', 'yith-wcmc' ),
81
- 'default' => ''
82
- ),
83
-
84
- 'checkout-email-type' => array(
85
- 'title' => __( 'Email type', 'yith-wcmc' ),
86
- 'type' => 'select',
87
- 'id' => 'yith_wcmc_email_type',
88
- 'desc' => __( 'User\'s preferential email type (HTML or plain text)', 'yith-wcmc' ),
89
- 'options' => array(
90
- 'html' => __( 'HTML', 'yith-wcmc' ),
91
- 'text' => __( 'Text', 'yith-wcmc' )
92
- ),
93
- 'default' => 'html'
94
- ),
95
-
96
- 'checkout-double-optin' => array(
97
- 'title' => __( 'Double Opt-in', 'yith-wcmc' ),
98
- 'type' => 'checkbox',
99
- 'id' => 'yith_wcmc_double_optin',
100
- 'desc' => __( 'When you check this option, MailChimp will send a confirmation email before adding the user to the list', 'yith-wcmc' ),
101
- 'default' => ''
102
- ),
103
-
104
- 'checkout-update-existing' => array(
105
- 'title' => __( 'Update existing', 'yith-wcmc' ),
106
- 'type' => 'checkbox',
107
- 'id' => 'yith_wcmc_update_existing',
108
- 'desc' => __( 'When you check this option, existing users will be updated and MailChimp servers will not show errors', 'yith-wcmc' ),
109
- 'default' => ''
110
- ),
111
-
112
- 'checkout-send-welcome' => array(
113
- 'title' => __( 'Send welcome email', 'yith-wcmc' ),
114
- 'type' => 'checkbox',
115
- 'id' => 'yith_wcmc_send_welcome',
116
- 'desc' => __( 'Send a welcome email to the user (only available when double opt-in is disabled)', 'yith-wcmc' ),
117
- 'default' => ''
118
- ),
119
-
120
- 'checkout-options-end' => array(
121
- 'type' => 'sectionend',
122
- 'id' => 'yith_wcmc_checkout_options'
123
- ),
124
-
125
- 'checkout-list-basic-options' => array(
126
- 'title' => __( 'List Options', 'yith-wcmc' ),
127
- 'type' => 'title',
128
- 'desc' => '',
129
- 'id' => 'yith_wcmc_list_basic_options'
130
- ),
131
-
132
- 'checkout-list' => array(
133
- 'title' => __( 'MailChimp list', 'yith-wcmc' ),
134
- 'type' => 'select',
135
- 'desc' => __( 'Select a list for the new user', 'yith-wcmc' ),
136
- 'id' => 'yith_wcmc_mailchimp_list',
137
- 'options' => $list_options,
138
- 'custom_attributes' => empty( $list_options ) ? array(
139
- 'disabled' => 'disabled'
140
- ) : array(),
141
- 'css' => 'min-width:300px;',
142
- 'class' => 'list-select'
143
- ),
144
-
145
- 'checkout-list-basic-options-end' => array(
146
- 'type' => 'sectionend',
147
- 'id' => 'yith_wcmc_list_basic_options'
148
- ),
149
- )
150
  ) );
1
+ <?php
2
+ /**
3
+ * Checkout settings page
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ // retrieve lists
15
+ $list_options = YITH_WCMC()->retrieve_lists();
16
+ $selected_list = get_option( 'yith_wcmc_mailchimp_list' );
17
+
18
+ return apply_filters( 'yith_wcmc_checkout_options', array(
19
+ 'checkout' => array(
20
+ 'checkout-options' => array(
21
+ 'title' => __( 'Mailchimp Options', 'yith-wcmc' ),
22
+ 'type' => 'title',
23
+ 'desc' => '',
24
+ 'id' => 'yith_wcmc_checkout_options'
25
+ ),
26
+
27
+ 'checkout-trigger' => array(
28
+ 'title' => __( 'Register after', 'yith-wcmc' ),
29
+ 'type' => 'select',
30
+ 'desc' => __( 'Select when the user should be added to the list', 'yith-wcmc' ),
31
+ 'id' => 'yith_wcmc_checkout_trigger',
32
+ 'options' => array(
33
+ 'never' => __( 'Never', 'yith-wcmc' ),
34
+ 'completed' => __( 'Order completed', 'yith-wcmc' ),
35
+ 'created' => __( 'Order placed', 'yith-wcmc' )
36
+ ),
37
+ 'css' => 'min-width:300px;'
38
+ ),
39
+
40
+ 'checkout-checkbox' => array(
41
+ 'title' => __( 'Show "Newsletter subscription" checkbox', 'yith-wcmc' ),
42
+ 'type' => 'checkbox',
43
+ 'id' => 'yith_wcmc_subscription_checkbox',
44
+ 'desc' => __( 'When you select this option, a checkbox will be added to the checkout form, inviting users to subscribe to the newsletter; otherwise, users will be subscribed automatically', 'yith-wcmc' ),
45
+ 'default' => ''
46
+ ),
47
+
48
+ 'checkout-checkbox-label' => array(
49
+ 'title' => __( '"Newsletter subscription" label', 'yith-wcmc' ),
50
+ 'type' => 'text',
51
+ 'desc' => __( 'Enter here the label you want to use for the "Newsletter subscription" checkbox', 'yith-wcmc' ),
52
+ 'id' => 'yith_wcmc_subscription_checkbox_label',
53
+ 'default' => __( 'Subscribe to our cool newsletter', 'yith-wcmc' ),
54
+ 'css' => 'min-width:300px;'
55
+ ),
56
+
57
+ 'checkout-checkbox-position' => array(
58
+ 'title' => __( 'Position for "Newsletter subscription"', 'yith-wcmc' ),
59
+ 'type' => 'select',
60
+ 'desc' => __( 'Select position for "Newsletter subscription" checkbox in the page', 'yith-wcmc' ),
61
+ 'id' => 'yith_wcmc_subscription_checkbox_position',
62
+ 'options' => array(
63
+ 'above_customer' => __( 'Above customer details', 'yith-wcmc' ),
64
+ 'below_customer' => __( 'Below customer details', 'yith-wcmc' ),
65
+ 'above_place_order' => __( 'Above "Place order" button', 'yith-wcmc' ),
66
+ 'below_place_order' => __( 'Below "Place order" button', 'yith-wcmc' ),
67
+ 'above_total' => __( 'Above "Review order" total', 'yith-wcmc' ),
68
+ 'above_billing' => __( 'Above billing details', 'yith-wcmc' ),
69
+ 'below_billing' => __( 'Below billing details', 'yith-wcmc' ),
70
+ 'above_shipping' => __( 'Above shipping details', 'yith-wcmc' ),
71
+ ),
72
+ 'default' => 'below_customer',
73
+ 'css' => 'min-width:300px;'
74
+ ),
75
+
76
+ 'checkout-checkbox-default' => array(
77
+ 'title' => __( 'Show "Newsletter subscription" checked', 'yith-wcmc' ),
78
+ 'type' => 'checkbox',
79
+ 'id' => 'yith_wcmc_subscription_checkbox_default',
80
+ 'desc' => __( 'When you check this option, "Newsletter subscription" checkbox will be printed as already checked', 'yith-wcmc' ),
81
+ 'default' => ''
82
+ ),
83
+
84
+ 'checkout-email-type' => array(
85
+ 'title' => __( 'Email type', 'yith-wcmc' ),
86
+ 'type' => 'select',
87
+ 'id' => 'yith_wcmc_email_type',
88
+ 'desc' => __( 'User\'s preferential email type (HTML or plain text)', 'yith-wcmc' ),
89
+ 'options' => array(
90
+ 'html' => __( 'HTML', 'yith-wcmc' ),
91
+ 'text' => __( 'Text', 'yith-wcmc' )
92
+ ),
93
+ 'default' => 'html'
94
+ ),
95
+
96
+ 'checkout-double-optin' => array(
97
+ 'title' => __( 'Double Opt-in', 'yith-wcmc' ),
98
+ 'type' => 'checkbox',
99
+ 'id' => 'yith_wcmc_double_optin',
100
+ 'desc' => __( 'When you check this option, MailChimp will send a confirmation email before adding the user to the list', 'yith-wcmc' ),
101
+ 'default' => ''
102
+ ),
103
+
104
+ 'checkout-update-existing' => array(
105
+ 'title' => __( 'Update existing', 'yith-wcmc' ),
106
+ 'type' => 'checkbox',
107
+ 'id' => 'yith_wcmc_update_existing',
108
+ 'desc' => __( 'When you check this option, existing users will be updated and MailChimp servers will not show errors', 'yith-wcmc' ),
109
+ 'default' => ''
110
+ ),
111
+
112
+ 'checkout-send-welcome' => array(
113
+ 'title' => __( 'Send welcome email', 'yith-wcmc' ),
114
+ 'type' => 'checkbox',
115
+ 'id' => 'yith_wcmc_send_welcome',
116
+ 'desc' => __( 'Send a welcome email to the user (only available when double opt-in is disabled)', 'yith-wcmc' ),
117
+ 'default' => ''
118
+ ),
119
+
120
+ 'checkout-options-end' => array(
121
+ 'type' => 'sectionend',
122
+ 'id' => 'yith_wcmc_checkout_options'
123
+ ),
124
+
125
+ 'checkout-list-basic-options' => array(
126
+ 'title' => __( 'List Options', 'yith-wcmc' ),
127
+ 'type' => 'title',
128
+ 'desc' => '',
129
+ 'id' => 'yith_wcmc_list_basic_options'
130
+ ),
131
+
132
+ 'checkout-list' => array(
133
+ 'title' => __( 'MailChimp list', 'yith-wcmc' ),
134
+ 'type' => 'select',
135
+ 'desc' => __( 'Select a list for the new user', 'yith-wcmc' ),
136
+ 'id' => 'yith_wcmc_mailchimp_list',
137
+ 'options' => $list_options,
138
+ 'custom_attributes' => empty( $list_options ) ? array(
139
+ 'disabled' => 'disabled'
140
+ ) : array(),
141
+ 'css' => 'min-width:300px;',
142
+ 'class' => 'list-select'
143
+ ),
144
+
145
+ 'checkout-list-basic-options-end' => array(
146
+ 'type' => 'sectionend',
147
+ 'id' => 'yith_wcmc_list_basic_options'
148
+ ),
149
+ )
150
  ) );
modules/yith-woocommerce-mailchimp/plugin-options/integration-options.php CHANGED
@@ -1,65 +1,65 @@
1
- <?php
2
- /**
3
- * Integration settings page
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Mailchimp
7
- * @version 1.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMC' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- return apply_filters( 'yith_wcmc_integration_options', array(
15
- 'integration' => array(
16
- 'mailchimp-video-box' => array(
17
- 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-wcmc' ),
18
- 'type' => 'videobox',
19
- 'default' => array(
20
- 'plugin_name' => __( 'YITH WooCommerce Mailchimp', 'yith-wcmc' ),
21
- 'title_first_column' => __( 'Discover the Advanced Features', 'yith-wcmc' ),
22
- 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE MAILCHIMP to benefit from all features!', 'yith-wcmc' ),
23
- 'video' => array(
24
- 'video_id' => '125238913',
25
- 'video_image_url' => YITH_WCMC_URL . '/assets/images/video-thumb.jpg',
26
- 'video_description' => '',
27
- ),
28
- 'title_second_column' => __( 'Get Support and Pro Features', 'yit' ),
29
- 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-wcmc' ),
30
- 'button' => array(
31
- 'href' => function_exists( 'YITH_WCMC_Admin_Premium' ) ? YITH_WCMC_Admin_Premium()->get_premium_landing_uri() : YITH_WCMC_Admin()->get_premium_landing_uri(),
32
- 'title' => 'Get Support and Pro Features'
33
- )
34
- ),
35
- 'id' => 'yith_wcmc_general_videobox'
36
- ),
37
-
38
- 'mailchimp-options' => array(
39
- 'title' => __( 'MailChimp Options', 'yith-wcmc' ),
40
- 'type' => 'title',
41
- 'desc' => '',
42
- 'id' => 'yith_wcmc_mailchimp_options'
43
- ),
44
-
45
- 'mailchimp-api-key' => array(
46
- 'title' => __( 'MailChimp API Key', 'yith-wcmc' ),
47
- 'type' => 'text',
48
- 'id' => 'yith_wcmc_mailchimp_api_key',
49
- 'desc' => __( 'API key used to access MailChimp account; you can get one <a href="//admin.mailchimp.com/account/api/">here</a>', 'yith-wcmc' ),
50
- 'default' => '',
51
- 'css' => 'min-width:300px;'
52
- ),
53
-
54
- 'mailchimp-status' => array(
55
- 'title' => __( 'Integration status', 'yith-wctc' ),
56
- 'type' => 'yith_wcmc_integration_status',
57
- 'id' => 'yith_wcmc_integration_status'
58
- ),
59
-
60
- 'mailchimp-options-end' => array(
61
- 'type' => 'sectionend',
62
- 'id' => 'yith_wcmc_mailchimp_options'
63
- ),
64
- )
65
  ) );
1
+ <?php
2
+ /**
3
+ * Integration settings page
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ return apply_filters( 'yith_wcmc_integration_options', array(
15
+ 'integration' => array(
16
+ 'mailchimp-video-box' => array(
17
+ 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-wcmc' ),
18
+ 'type' => 'videobox',
19
+ 'default' => array(
20
+ 'plugin_name' => __( 'YITH WooCommerce Mailchimp', 'yith-wcmc' ),
21
+ 'title_first_column' => __( 'Discover the Advanced Features', 'yith-wcmc' ),
22
+ 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE MAILCHIMP to benefit from all features!', 'yith-wcmc' ),
23
+ 'video' => array(
24
+ 'video_id' => '125238913',
25
+ 'video_image_url' => YITH_WCMC_URL . '/assets/images/video-thumb.jpg',
26
+ 'video_description' => '',
27
+ ),
28
+ 'title_second_column' => __( 'Get Support and Pro Features', 'yit' ),
29
+ 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-wcmc' ),
30
+ 'button' => array(
31
+ 'href' => function_exists( 'YITH_WCMC_Admin_Premium' ) ? YITH_WCMC_Admin_Premium()->get_premium_landing_uri() : YITH_WCMC_Admin()->get_premium_landing_uri(),
32
+ 'title' => 'Get Support and Pro Features'
33
+ )
34
+ ),
35
+ 'id' => 'yith_wcmc_general_videobox'
36
+ ),
37
+
38
+ 'mailchimp-options' => array(
39
+ 'title' => __( 'MailChimp Options', 'yith-wcmc' ),
40
+ 'type' => 'title',
41
+ 'desc' => '',
42
+ 'id' => 'yith_wcmc_mailchimp_options'
43
+ ),
44
+
45
+ 'mailchimp-api-key' => array(
46
+ 'title' => __( 'MailChimp API Key', 'yith-wcmc' ),
47
+ 'type' => 'text',
48
+ 'id' => 'yith_wcmc_mailchimp_api_key',
49
+ 'desc' => __( 'API key used to access MailChimp account; you can get one <a href="//admin.mailchimp.com/account/api/">here</a>', 'yith-wcmc' ),
50
+ 'default' => '',
51
+ 'css' => 'min-width:300px;'
52
+ ),
53
+
54
+ 'mailchimp-status' => array(
55
+ 'title' => __( 'Integration status', 'yith-wctc' ),
56
+ 'type' => 'yith_wcmc_integration_status',
57
+ 'id' => 'yith_wcmc_integration_status'
58
+ ),
59
+
60
+ 'mailchimp-options-end' => array(
61
+ 'type' => 'sectionend',
62
+ 'id' => 'yith_wcmc_mailchimp_options'
63
+ ),
64
+ )
65
  ) );
modules/yith-woocommerce-mailchimp/plugin-options/premium-options.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * Color settings page
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Wishlist
7
- * @version 2.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMC' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- return array(
15
- 'premium' => array(
16
- 'landing' => array(
17
- 'type' => 'custom_tab',
18
- 'action' => 'yith_wcmc_premium_tab'
19
- )
20
- )
21
  );
1
+ <?php
2
+ /**
3
+ * Color settings page
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Wishlist
7
+ * @version 2.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ return array(
15
+ 'premium' => array(
16
+ 'landing' => array(
17
+ 'type' => 'custom_tab',
18
+ 'action' => 'yith_wcmc_premium_tab'
19
+ )
20
+ )
21
  );
modules/yith-woocommerce-mailchimp/templates/admin/mailchimp-panel-premium.php CHANGED
@@ -1,374 +1,374 @@
1
- <style>
2
- .section{
3
- margin-left: -20px;
4
- margin-right: -20px;
5
- font-family: "Raleway",san-serif;
6
- }
7
- .section h1{
8
- text-align: center;
9
- text-transform: uppercase;
10
- color: #808a97;
11
- font-size: 35px;
12
- font-weight: 700;
13
- line-height: normal;
14
- display: inline-block;
15
- width: 100%;
16
- margin: 50px 0 0;
17
- }
18
- .section:nth-child(even){
19
- background-color: #fff;
20
- }
21
- .section:nth-child(odd){
22
- background-color: #f1f1f1;
23
- }
24
- .section .section-title img{
25
- display: table-cell;
26
- vertical-align: middle;
27
- width: auto;
28
- margin-right: 15px;
29
- }
30
- .section h2,
31
- .section h3 {
32
- display: inline-block;
33
- vertical-align: middle;
34
- padding: 0;
35
- font-size: 24px;
36
- font-weight: 700;
37
- color: #808a97;
38
- text-transform: uppercase;
39
- }
40
-
41
- .section .section-title h2{
42
- display: table-cell;
43
- vertical-align: middle;
44
- }
45
-
46
- .section-title{
47
- display: table;
48
- }
49
-
50
- .section h3 {
51
- font-size: 14px;
52
- line-height: 28px;
53
- margin-bottom: 0;
54
- display: block;
55
- }
56
-
57
- .section p{
58
- font-size: 13px;
59
- margin: 25px 0;
60
- }
61
- .section ul li{
62
- margin-bottom: 4px;
63
- }
64
- .landing-container{
65
- max-width: 750px;
66
- margin-left: auto;
67
- margin-right: auto;
68
- padding: 50px 0 30px;
69
- }
70
- .landing-container:after{
71
- display: block;
72
- clear: both;
73
- content: '';
74
- }
75
- .landing-container .col-1,
76
- .landing-container .col-2{
77
- float: left;
78
- box-sizing: border-box;
79
- padding: 0 15px;
80
- }
81
- .landing-container .col-1 img{
82
- width: 100%;
83
- }
84
- .landing-container .col-1{
85
- width: 55%;
86
- }
87
- .landing-container .col-2{
88
- width: 45%;
89
- }
90
- .premium-cta{
91
- background-color: #808a97;
92
- color: #fff;
93
- border-radius: 6px;
94
- padding: 20px 15px;
95
- }
96
- .premium-cta:after{
97
- content: '';
98
- display: block;
99
- clear: both;
100
- }
101
- .premium-cta p{
102
- margin: 7px 0;
103
- font-size: 15px;
104
- font-weight: 500;
105
- display: inline-block;
106
- width: 60%;
107
- }
108
- .premium-cta a.button{
109
- border-radius: 6px;
110
- height: 60px;
111
- float: right;
112
- background: url(<?php echo YITH_WCMC_URL?>assets/images/upgrade.png) #ff643f no-repeat 13px 13px;
113
- border-color: #ff643f;
114
- box-shadow: none;
115
- outline: none;
116
- color: #fff;
117
- position: relative;
118
- padding: 9px 50px 9px 70px;
119
- }
120
- .premium-cta a.button:hover,
121
- .premium-cta a.button:active,
122
- .premium-cta a.button:focus{
123
- color: #fff;
124
- background: url(<?php echo YITH_WCMC_URL?>assets/images/upgrade.png) #971d00 no-repeat 13px 13px;
125
- border-color: #971d00;
126
- box-shadow: none;
127
- outline: none;
128
- }
129
- .premium-cta a.button:focus{
130
- top: 1px;
131
- }
132
- .premium-cta a.button span{
133
- line-height: 13px;
134
- }
135
- .premium-cta a.button .highlight{
136
- display: block;
137
- font-size: 20px;
138
- font-weight: 700;
139
- line-height: 20px;
140
- }
141
- .premium-cta .highlight{
142
- text-transform: uppercase;
143
- background: none;
144
- font-weight: 800;
145
- color: #fff;
146
- }
147
-
148
- @media (max-width: 768px) {
149
- .section{margin: 0}
150
- .premium-cta p{
151
- width: 100%;
152
- }
153
- .premium-cta{
154
- text-align: center;
155
- }
156
- .premium-cta a.button{
157
- float: none;
158
- }
159
- }
160
-
161
- @media (max-width: 480px){
162
- .wrap{
163
- margin-right: 0;
164
- }
165
- .section{
166
- margin: 0;
167
- }
168
- .landing-container .col-1,
169
- .landing-container .col-2{
170
- width: 100%;
171
- padding: 0 15px;
172
- }
173
- .section-odd .col-1 {
174
- float: left;
175
- margin-right: -100%;
176
- }
177
- .section-odd .col-2 {
178
- float: right;
179
- margin-top: 65%;
180
- }
181
- }
182
-
183
- @media (max-width: 320px){
184
- .premium-cta a.button{
185
- padding: 9px 20px 9px 70px;
186
- }
187
-
188
- .section .section-title img{
189
- display: none;
190
- }
191
- }
192
- </style>
193
- <div class="landing">
194
- <div class="section section-cta section-odd">
195
- <div class="landing-container">
196
- <div class="premium-cta">
197
- <p>
198
- Upgrade to the <span class="highlight">premium version</span>
199
- of <span class="highlight">YITH WooCommerce Mailchimp</span> to benefit from all features!
200
- </p>
201
- <a href="<?php echo YITH_WCMC_Admin()->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
202
- <span class="highlight">UPGRADE</span>
203
- <span>to the premium version</span>
204
- </a>
205
- </div>
206
-
207
- </div>
208
- </div>
209
- <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
210
- <h1>Premium Features</h1>
211
- <div class="landing-container">
212
- <div class="col-1">
213
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/01.png" alt="Review Title" />
214
- </div>
215
- <div class="col-2">
216
- <div class="section-title">
217
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/01-icon.png" alt="Review Title"/>
218
- <h2>Ecommerce 360</h2>
219
- </div>
220
- <p>
221
- Which users come from a <b>MailChimp campaign</b>? Discover it with Ecommerce 360, the system that uses two
222
- identifying values in the email they receive to store them in a cookie of your store for period of
223
- time you can set freely.
224
- </p>
225
- </div>
226
- </div>
227
- </div>
228
- <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/02-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
229
- <div class="landing-container">
230
- <div class="col-2">
231
- <div class="section-title">
232
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/02-icon.png" alt="Attachment List" />
233
- <h2>Replace interests</h2>
234
- </div>
235
- <p>
236
- Don't get caught unprepared if your users subscribe again to your list and the related interest
237
- groups. "Replace interests" gives you the chance to substitute the <b>interest groups</b> of the users, or
238
- add new ones when they subscribe again.
239
- </p>
240
-
241
- </div>
242
- <div class="col-1">
243
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/02.png" alt="Attachment List" />
244
- </div>
245
- </div>
246
- </div>
247
- <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/03-bg.png) no-repeat #fff; background-position: 85% 100%">
248
- <div class="landing-container">
249
- <div class="col-1">
250
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/03.png" alt="Vote the review" />
251
- </div>
252
- <div class="col-2">
253
- <div class="section-title">
254
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/03-icon.png" alt="Vote the review" />
255
- <h2>Interest Groups</h2>
256
- </div>
257
- <p>
258
- You can create one or more interest groups inside a list of your MailChimp account. <b>Just one click</b>
259
- and these will be at your disposal from the plugin. You will just have to select the interest groups
260
- in which you want to include the users that <b>subscribe</b> to your list.
261
- </p>
262
- </div>
263
- </div>
264
- </div>
265
- <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/04-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
266
- <div class="landing-container">
267
- <div class="col-2">
268
- <div class="section-title">
269
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/04-icon.png" alt="Number" />
270
- <h2>Integration Mode</h2>
271
- </div>
272
- <p>
273
- You have two different ways to integrate in your MailChimp lists the users that buy from your store.
274
- The <b>basic</b> one lets you choose a single list and possible interest groups for all the users; on the
275
- contrary, with the <b>advanced</b> one you can filter the users. Following the settings you can choose (as
276
- purchased products or total purchase amount), you may decide in which list users can be subscribed.
277
- </p>
278
-
279
- </div>
280
- <div class="col-1">
281
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/04.png" alt="Number" />
282
- </div>
283
- </div>
284
- </div>
285
- <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/05-bg.png) no-repeat #fff; background-position: 85% 75%">
286
- <div class="landing-container">
287
- <div class="col-1">
288
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/05.png" alt="Review Title" />
289
- </div>
290
- <div class="col-2">
291
- <div class="section-title">
292
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/05-icon.png" alt="Review Title"/>
293
- <h2>Shortcode</h2>
294
- </div>
295
- <p>
296
- Thanks to the shortcode, you can add a <b>subscription form</b> for your newsletter in every page of your
297
- site. In the settings panel of your plugin, you can find the rich "<b>Shortcode"</b> section, tailored to
298
- let you set the perfect shortcode for your needs.
299
- </p>
300
- </div>
301
- </div>
302
- </div>
303
- <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/06-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
304
- <div class="landing-container">
305
- <div class="col-2">
306
- <div class="section-title">
307
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/06-icon.png" alt="Attachment List" />
308
- <h2>Widget</h2>
309
- </div>
310
- <p>
311
- Every tool can be an added value for your site and this is why the premium version of the plugin
312
- offers you the <b>"MailChimp Subscription Form"</b> widget, to invite your users to subscribe to your
313
- newsletter directly from the sidebar of your store.
314
- </p>
315
-
316
- </div>
317
- <div class="col-1">
318
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/06.png" alt="Attachment List" />
319
- </div>
320
- </div>
321
- </div>
322
- <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/07-bg.png) no-repeat #fff; background-position: 85% 100%">
323
- <div class="landing-container">
324
- <div class="col-1">
325
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/07.png" alt="Vote the review" />
326
- </div>
327
- <div class="col-2">
328
- <div class="section-title">
329
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/07-icon.png" alt="Vote the review" />
330
- <h2>Custom Style</h2>
331
- </div>
332
- <p>
333
- Shortcodes and widgets style can be set easily from the plugin itself, without messing with the
334
- theme or plugin' files. You will find many options and a textarea where you can write the CSS code
335
- you prefer.
336
- </p>
337
- </div>
338
- </div>
339
- </div>
340
- <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/08-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
341
- <div class="landing-container">
342
- <div class="col-2">
343
- <div class="section-title">
344
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/08-icon.png" alt="Number" />
345
- <h2>Export</h2>
346
- </div>
347
- <p>
348
- Export the users of your store in the MailChimp list you want. Choose the <b>set of users</b> you want to
349
- include (all or just a part of them) and with just one click, you will add them to the list you have
350
- chosen; and if you don't like automatic processes, you can always download the <b>CSV</b> file with all
351
- their details, so that you can manage it as you prefer.
352
- </p>
353
-
354
- </div>
355
- <div class="col-1">
356
- <img src="<?php echo YITH_WCMC_URL ?>assets/images/08.png" alt="Number" />
357
- </div>
358
- </div>
359
- </div>
360
- <div class="section section-cta section-odd">
361
- <div class="landing-container">
362
- <div class="premium-cta">
363
- <p>
364
- Upgrade to the <span class="highlight">premium version</span>
365
- of <span class="highlight">YITH WooCommerce Mailchimp</span> to benefit from all features!
366
- </p>
367
- <a href="<?php echo YITH_WCMC_Admin()->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
368
- <span class="highlight">UPGRADE</span>
369
- <span>to the premium version</span>
370
- </a>
371
- </div>
372
- </div>
373
- </div>
374
  </div>
1
+ <style>
2
+ .section{
3
+ margin-left: -20px;
4
+ margin-right: -20px;
5
+ font-family: "Raleway",san-serif;
6
+ }
7
+ .section h1{
8
+ text-align: center;
9
+ text-transform: uppercase;
10
+ color: #808a97;
11
+ font-size: 35px;
12
+ font-weight: 700;
13
+ line-height: normal;
14
+ display: inline-block;
15
+ width: 100%;
16
+ margin: 50px 0 0;
17
+ }
18
+ .section:nth-child(even){
19
+ background-color: #fff;
20
+ }
21
+ .section:nth-child(odd){
22
+ background-color: #f1f1f1;
23
+ }
24
+ .section .section-title img{
25
+ display: table-cell;
26
+ vertical-align: middle;
27
+ width: auto;
28
+ margin-right: 15px;
29
+ }
30
+ .section h2,
31
+ .section h3 {
32
+ display: inline-block;
33
+ vertical-align: middle;
34
+ padding: 0;
35
+ font-size: 24px;
36
+ font-weight: 700;
37
+ color: #808a97;
38
+ text-transform: uppercase;
39
+ }
40
+
41
+ .section .section-title h2{
42
+ display: table-cell;
43
+ vertical-align: middle;
44
+ }
45
+
46
+ .section-title{
47
+ display: table;
48
+ }
49
+
50
+ .section h3 {
51
+ font-size: 14px;
52
+ line-height: 28px;
53
+ margin-bottom: 0;
54
+ display: block;
55
+ }
56
+
57
+ .section p{
58
+ font-size: 13px;
59
+ margin: 25px 0;
60
+ }
61
+ .section ul li{
62
+ margin-bottom: 4px;
63
+ }
64
+ .landing-container{
65
+ max-width: 750px;
66
+ margin-left: auto;
67
+ margin-right: auto;
68
+ padding: 50px 0 30px;
69
+ }
70
+ .landing-container:after{
71
+ display: block;
72
+ clear: both;
73
+ content: '';
74
+ }
75
+ .landing-container .col-1,
76
+ .landing-container .col-2{
77
+ float: left;
78
+ box-sizing: border-box;
79
+ padding: 0 15px;
80
+ }
81
+ .landing-container .col-1 img{
82
+ width: 100%;
83
+ }
84
+ .landing-container .col-1{
85
+ width: 55%;
86
+ }
87
+ .landing-container .col-2{
88
+ width: 45%;
89
+ }
90
+ .premium-cta{
91
+ background-color: #808a97;
92
+ color: #fff;
93
+ border-radius: 6px;
94
+ padding: 20px 15px;
95
+ }
96
+ .premium-cta:after{
97
+ content: '';
98
+ display: block;
99
+ clear: both;
100
+ }
101
+ .premium-cta p{
102
+ margin: 7px 0;
103
+ font-size: 15px;
104
+ font-weight: 500;
105
+ display: inline-block;
106
+ width: 60%;
107
+ }
108
+ .premium-cta a.button{
109
+ border-radius: 6px;
110
+ height: 60px;
111
+ float: right;
112
+ background: url(<?php echo YITH_WCMC_URL?>assets/images/upgrade.png) #ff643f no-repeat 13px 13px;
113
+ border-color: #ff643f;
114
+ box-shadow: none;
115
+ outline: none;
116
+ color: #fff;
117
+ position: relative;
118
+ padding: 9px 50px 9px 70px;
119
+ }
120
+ .premium-cta a.button:hover,
121
+ .premium-cta a.button:active,
122
+ .premium-cta a.button:focus{
123
+ color: #fff;
124
+ background: url(<?php echo YITH_WCMC_URL?>assets/images/upgrade.png) #971d00 no-repeat 13px 13px;
125
+ border-color: #971d00;
126
+ box-shadow: none;
127
+ outline: none;
128
+ }
129
+ .premium-cta a.button:focus{
130
+ top: 1px;
131
+ }
132
+ .premium-cta a.button span{
133
+ line-height: 13px;
134
+ }
135
+ .premium-cta a.button .highlight{
136
+ display: block;
137
+ font-size: 20px;
138
+ font-weight: 700;
139
+ line-height: 20px;
140
+ }
141
+ .premium-cta .highlight{
142
+ text-transform: uppercase;
143
+ background: none;
144
+ font-weight: 800;
145
+ color: #fff;
146
+ }
147
+
148
+ @media (max-width: 768px) {
149
+ .section{margin: 0}
150
+ .premium-cta p{
151
+ width: 100%;
152
+ }
153
+ .premium-cta{
154
+ text-align: center;
155
+ }
156
+ .premium-cta a.button{
157
+ float: none;
158
+ }
159
+ }
160
+
161
+ @media (max-width: 480px){
162
+ .wrap{
163
+ margin-right: 0;
164
+ }
165
+ .section{
166
+ margin: 0;
167
+ }
168
+ .landing-container .col-1,
169
+ .landing-container .col-2{
170
+ width: 100%;
171
+ padding: 0 15px;
172
+ }
173
+ .section-odd .col-1 {
174
+ float: left;
175
+ margin-right: -100%;
176
+ }
177
+ .section-odd .col-2 {
178
+ float: right;
179
+ margin-top: 65%;
180
+ }
181
+ }
182
+
183
+ @media (max-width: 320px){
184
+ .premium-cta a.button{
185
+ padding: 9px 20px 9px 70px;
186
+ }
187
+
188
+ .section .section-title img{
189
+ display: none;
190
+ }
191
+ }
192
+ </style>
193
+ <div class="landing">
194
+ <div class="section section-cta section-odd">
195
+ <div class="landing-container">
196
+ <div class="premium-cta">
197
+ <p>
198
+ Upgrade to the <span class="highlight">premium version</span>
199
+ of <span class="highlight">YITH WooCommerce Mailchimp</span> to benefit from all features!
200
+ </p>
201
+ <a href="<?php echo YITH_WCMC_Admin()->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
202
+ <span class="highlight">UPGRADE</span>
203
+ <span>to the premium version</span>
204
+ </a>
205
+ </div>
206
+
207
+ </div>
208
+ </div>
209
+ <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
210
+ <h1>Premium Features</h1>
211
+ <div class="landing-container">
212
+ <div class="col-1">
213
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/01.png" alt="Review Title" />
214
+ </div>
215
+ <div class="col-2">
216
+ <div class="section-title">
217
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/01-icon.png" alt="Review Title"/>
218
+ <h2>Ecommerce 360</h2>
219
+ </div>
220
+ <p>
221
+ Which users come from a <b>MailChimp campaign</b>? Discover it with Ecommerce 360, the system that uses two
222
+ identifying values in the email they receive to store them in a cookie of your store for period of
223
+ time you can set freely.
224
+ </p>
225
+ </div>
226
+ </div>
227
+ </div>
228
+ <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/02-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
229
+ <div class="landing-container">
230
+ <div class="col-2">
231
+ <div class="section-title">
232
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/02-icon.png" alt="Attachment List" />
233
+ <h2>Replace interests</h2>
234
+ </div>
235
+ <p>
236
+ Don't get caught unprepared if your users subscribe again to your list and the related interest
237
+ groups. "Replace interests" gives you the chance to substitute the <b>interest groups</b> of the users, or
238
+ add new ones when they subscribe again.
239
+ </p>
240
+
241
+ </div>
242
+ <div class="col-1">
243
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/02.png" alt="Attachment List" />
244
+ </div>
245
+ </div>
246
+ </div>
247
+ <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/03-bg.png) no-repeat #fff; background-position: 85% 100%">
248
+ <div class="landing-container">
249
+ <div class="col-1">
250
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/03.png" alt="Vote the review" />
251
+ </div>
252
+ <div class="col-2">
253
+ <div class="section-title">
254
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/03-icon.png" alt="Vote the review" />
255
+ <h2>Interest Groups</h2>
256
+ </div>
257
+ <p>
258
+ You can create one or more interest groups inside a list of your MailChimp account. <b>Just one click</b>
259
+ and these will be at your disposal from the plugin. You will just have to select the interest groups
260
+ in which you want to include the users that <b>subscribe</b> to your list.
261
+ </p>
262
+ </div>
263
+ </div>
264
+ </div>
265
+ <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/04-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
266
+ <div class="landing-container">
267
+ <div class="col-2">
268
+ <div class="section-title">
269
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/04-icon.png" alt="Number" />
270
+ <h2>Integration Mode</h2>
271
+ </div>
272
+ <p>
273
+ You have two different ways to integrate in your MailChimp lists the users that buy from your store.
274
+ The <b>basic</b> one lets you choose a single list and possible interest groups for all the users; on the
275
+ contrary, with the <b>advanced</b> one you can filter the users. Following the settings you can choose (as
276
+ purchased products or total purchase amount), you may decide in which list users can be subscribed.
277
+ </p>
278
+
279
+ </div>
280
+ <div class="col-1">
281
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/04.png" alt="Number" />
282
+ </div>
283
+ </div>
284
+ </div>
285
+ <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/05-bg.png) no-repeat #fff; background-position: 85% 75%">
286
+ <div class="landing-container">
287
+ <div class="col-1">
288
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/05.png" alt="Review Title" />
289
+ </div>
290
+ <div class="col-2">
291
+ <div class="section-title">
292
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/05-icon.png" alt="Review Title"/>
293
+ <h2>Shortcode</h2>
294
+ </div>
295
+ <p>
296
+ Thanks to the shortcode, you can add a <b>subscription form</b> for your newsletter in every page of your
297
+ site. In the settings panel of your plugin, you can find the rich "<b>Shortcode"</b> section, tailored to
298
+ let you set the perfect shortcode for your needs.
299
+ </p>
300
+ </div>
301
+ </div>
302
+ </div>
303
+ <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/06-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
304
+ <div class="landing-container">
305
+ <div class="col-2">
306
+ <div class="section-title">
307
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/06-icon.png" alt="Attachment List" />
308
+ <h2>Widget</h2>
309
+ </div>
310
+ <p>
311
+ Every tool can be an added value for your site and this is why the premium version of the plugin
312
+ offers you the <b>"MailChimp Subscription Form"</b> widget, to invite your users to subscribe to your
313
+ newsletter directly from the sidebar of your store.
314
+ </p>
315
+
316
+ </div>
317
+ <div class="col-1">
318
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/06.png" alt="Attachment List" />
319
+ </div>
320
+ </div>
321
+ </div>
322
+ <div class="section section-even clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/07-bg.png) no-repeat #fff; background-position: 85% 100%">
323
+ <div class="landing-container">
324
+ <div class="col-1">
325
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/07.png" alt="Vote the review" />
326
+ </div>
327
+ <div class="col-2">
328
+ <div class="section-title">
329
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/07-icon.png" alt="Vote the review" />
330
+ <h2>Custom Style</h2>
331
+ </div>
332
+ <p>
333
+ Shortcodes and widgets style can be set easily from the plugin itself, without messing with the
334
+ theme or plugin' files. You will find many options and a textarea where you can write the CSS code
335
+ you prefer.
336
+ </p>
337
+ </div>
338
+ </div>
339
+ </div>
340
+ <div class="section section-odd clear" style="background: url(<?php echo YITH_WCMC_URL ?>assets/images/08-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
341
+ <div class="landing-container">
342
+ <div class="col-2">
343
+ <div class="section-title">
344
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/08-icon.png" alt="Number" />
345
+ <h2>Export</h2>
346
+ </div>
347
+ <p>
348
+ Export the users of your store in the MailChimp list you want. Choose the <b>set of users</b> you want to
349
+ include (all or just a part of them) and with just one click, you will add them to the list you have
350
+ chosen; and if you don't like automatic processes, you can always download the <b>CSV</b> file with all
351
+ their details, so that you can manage it as you prefer.
352
+ </p>
353
+
354
+ </div>
355
+ <div class="col-1">
356
+ <img src="<?php echo YITH_WCMC_URL ?>assets/images/08.png" alt="Number" />
357
+ </div>
358
+ </div>
359
+ </div>
360
+ <div class="section section-cta section-odd">
361
+ <div class="landing-container">
362
+ <div class="premium-cta">
363
+ <p>
364
+ Upgrade to the <span class="highlight">premium version</span>
365
+ of <span class="highlight">YITH WooCommerce Mailchimp</span> to benefit from all features!
366
+ </p>
367
+ <a href="<?php echo YITH_WCMC_Admin()->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
368
+ <span class="highlight">UPGRADE</span>
369
+ <span>to the premium version</span>
370
+ </a>
371
+ </div>
372
+ </div>
373
+ </div>
374
  </div>
modules/yith-woocommerce-mailchimp/templates/admin/types/integration-status.php CHANGED
@@ -1,46 +1,46 @@
1
- <tr valign="top">
2
- <th scope="row" class="titledesc">
3
- <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
4
- </th>
5
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo sanitize_title( $value['type'] ) ?>">
6
- <div class="account-banner">
7
- <div class="account-avatar">
8
- <div class="account-thumb">
9
- <?php if( ! empty( $avatar ) ): ?>
10
- <img src="<?php echo $avatar ?>" alt="<?php echo $username; ?>" width="96" heigth="96" />
11
- <?php
12
- else:
13
- echo get_avatar( 0, 96 );
14
- endif;
15
- ?>
16
- </div>
17
- <div class="account-name tips" data-tip="<?php echo ! empty( $username ) ? __( 'MailChimp user', 'yith-wcmc' ) : __( 'No user can be found with this API key', 'yith-wcmc' )?>">
18
- <?php echo ! empty( $username ) ? $username : __( '&lt; Not Found &gt;' ); ?>
19
- </div>
20
- </div>
21
- <div class="account-details">
22
- <p class="account-info">
23
- <span class="label"><b><?php _e( 'Status:', 'yith-wcmc' )?></b></span>
24
-
25
- <?php if( ! empty( $user_id ) ): ?>
26
- <mark class="completed tips" data-tip="<?php _e( 'Correctly synchronized', 'yith-wcmc' )?>"><?php _e( 'OK', 'yith-wcmc' )?></mark>
27
- <?php else: ?>
28
- <mark class="cancelled tips" data-tip="<?php _e( 'Wrong API key', 'yith-wcmc' )?>"><?php _e( 'KO', 'yith-wcmc' )?></mark>
29
- <?php endif; ?>
30
- </p>
31
-
32
- <p class="account-info">
33
- <span class="label"><b><?php _e( 'Name:', 'yith-wcmc' )?></b></span>
34
-
35
- <?php echo ! empty( $name ) ? $name : __( '&lt; Not Found &gt;', 'yith-wcmc' ) ?>
36
- </p>
37
-
38
- <p class="account-info">
39
- <span class="label"><b><?php _e( 'Email:', 'yith-wcmc' )?></b></span>
40
-
41
- <?php echo ! empty( $email ) ? $email : __( '&lt; Not Found &gt;', 'yith-wcmc' ) ?>
42
- </p>
43
- </div>
44
- </div>
45
- </td>
46
  </tr>
1
+ <tr valign="top">
2
+ <th scope="row" class="titledesc">
3
+ <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
4
+ </th>
5
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo sanitize_title( $value['type'] ) ?>">
6
+ <div class="account-banner">
7
+ <div class="account-avatar">
8
+ <div class="account-thumb">
9
+ <?php if( ! empty( $avatar ) ): ?>
10
+ <img src="<?php echo $avatar ?>" alt="<?php echo $username; ?>" width="96" heigth="96" />
11
+ <?php
12
+ else:
13
+ echo get_avatar( 0, 96 );
14
+ endif;
15
+ ?>
16
+ </div>
17
+ <div class="account-name tips" data-tip="<?php echo ! empty( $username ) ? __( 'MailChimp user', 'yith-wcmc' ) : __( 'No user can be found with this API key', 'yith-wcmc' )?>">
18
+ <?php echo ! empty( $username ) ? $username : __( '&lt; Not Found &gt;' ); ?>
19
+ </div>
20
+ </div>
21
+ <div class="account-details">
22
+ <p class="account-info">
23
+ <span class="label"><b><?php _e( 'Status:', 'yith-wcmc' )?></b></span>
24
+
25
+ <?php if( ! empty( $user_id ) ): ?>
26
+ <mark class="completed tips" data-tip="<?php _e( 'Correctly synchronized', 'yith-wcmc' )?>"><?php _e( 'OK', 'yith-wcmc' )?></mark>
27
+ <?php else: ?>
28
+ <mark class="cancelled tips" data-tip="<?php _e( 'Wrong API key', 'yith-wcmc' )?>"><?php _e( 'KO', 'yith-wcmc' )?></mark>
29
+ <?php endif; ?>
30
+ </p>
31
+
32
+ <p class="account-info">
33
+ <span class="label"><b><?php _e( 'Name:', 'yith-wcmc' )?></b></span>
34
+
35
+ <?php echo ! empty( $name ) ? $name : __( '&lt; Not Found &gt;', 'yith-wcmc' ) ?>
36
+ </p>
37
+
38
+ <p class="account-info">
39
+ <span class="label"><b><?php _e( 'Email:', 'yith-wcmc' )?></b></span>
40
+
41
+ <?php echo ! empty( $email ) ? $email : __( '&lt; Not Found &gt;', 'yith-wcmc' ) ?>
42
+ </p>
43
+ </div>
44
+ </div>
45
+ </td>
46
  </tr>
modules/yith-woocommerce-mailchimp/templates/mailchimp-subscription-checkbox.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * Subscription checkbox template
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Mailchimp
7
- * @version 1.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCMC' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- ?>
15
-
16
- <label>
17
- <input type="checkbox" name="yith_wcmc_subscribe_me" id="yith_wcmc_subscribe_me" value="yes" <?php checked( $checkbox_checked ) ?>/>
18
- <?php echo esc_html( $checkbox_label )?>
19
  </label>
1
+ <?php
2
+ /**
3
+ * Subscription checkbox template
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 1.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCMC' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ ?>
15
+
16
+ <label>
17
+ <input type="checkbox" name="yith_wcmc_subscribe_me" id="yith_wcmc_subscribe_me" value="yes" <?php checked( $checkbox_checked ) ?>/>
18
+ <?php echo esc_html( $checkbox_label )?>
19
  </label>
modules/yith-woocommerce-mailchimp/uninstall.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * Uninstall plugin
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Mailchimp
7
- * @version 1.0.0
8
- */
9
-
10
- // If uninstall not called from WordPress exit
11
- if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12
- exit;
13
  }
1
+ <?php
2
+ /**
3
+ * Uninstall plugin
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Mailchimp
7
+ * @version 1.0.0
8
+ */
9
+
10
+ // If uninstall not called from WordPress exit
11
+ if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12
+ exit;
13
  }
modules/yith-woocommerce-mailchimp/wpml-config.xml CHANGED
@@ -1,5 +1,5 @@
1
- <wpml-config>
2
- <admin-texts>
3
- <key name="yith_wcmc_subscription_checkbox_label" />
4
- </admin-texts>
5
  </wpml-config>
1
+ <wpml-config>
2
+ <admin-texts>
3
+ <key name="yith_wcmc_subscription_checkbox_label" />
4
+ </admin-texts>
5
  </wpml-config>
modules/yith-woocommerce-order-tracking/class.yith-woocommerce-order-tracking.php CHANGED
@@ -411,7 +411,7 @@ if (!class_exists('YITH_WooCommerce_Order_Tracking')) {
411
  */
412
  public function plugin_fw_loader()
413
  {
414
- if ( !defined('YIT_CORE_PLUGIN') ) {
415
  require_once('plugin-fw/yit-plugin.php');
416
  }
417
  }
411
  */
412
  public function plugin_fw_loader()
413
  {
414
+ if ( !defined('YIT_CORE_PLUGIN')) {
415
  require_once('plugin-fw/yit-plugin.php');
416
  }
417
  }
modules/yith-woocommerce-product-vendors/includes/class.yith-orders.php CHANGED
@@ -380,11 +380,14 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
380
 
381
  $suborder_ids = self::get_suborder ( $parent_order_id );
382
  if ( ! empty( $suborder_ids ) ) {
 
383
  foreach ( $suborder_ids as $suborder_id ) {
384
  /** @var $suborder WC_Order */
385
  $suborder = wc_get_order ( $suborder_id );
386
  $suborder->update_status ( $new_status, _x ( 'Update by admin: ', 'Order note', 'yith_wc_product_vendors' ) );
387
  }
 
 
388
  }
389
  }
390
 
@@ -1619,7 +1622,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1619
  *
1620
  * @return array
1621
  * @author Lorenzo Giuffrida
1622
- * @since 1.0.0
1623
  */
1624
  public static function get_order_items_by_vendor ( $parent_order_id, $args = array () ) {
1625
 
380
 
381
  $suborder_ids = self::get_suborder ( $parent_order_id );
382
  if ( ! empty( $suborder_ids ) ) {
383
+ remove_action( 'woocommerce_order_status_completed', 'wc_paying_customer' );
384
  foreach ( $suborder_ids as $suborder_id ) {
385
  /** @var $suborder WC_Order */
386
  $suborder = wc_get_order ( $suborder_id );
387
  $suborder->update_status ( $new_status, _x ( 'Update by admin: ', 'Order note', 'yith_wc_product_vendors' ) );
388
  }
389
+ add_action( 'woocommerce_order_status_completed', 'wc_paying_customer' );
390
+
391
  }
392
  }
393
 
1622
  *
1623
  * @return array
1624
  * @author Lorenzo Giuffrida
1625
+ * @since 1.6.0
1626
  */
1627
  public static function get_order_items_by_vendor ( $parent_order_id, $args = array () ) {
1628
 
modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-admin.php CHANGED
@@ -90,6 +90,9 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
90
  add_action( 'created_' . $this->_taxonomy_name, array( $this, 'save_taxonomy_fields' ), 10, 2 );
91
  add_action( 'pre_delete_term', array( $this, 'remove_vendor_data' ), 10, 2 );
92
 
 
 
 
93
  /* Taxonomy Table Management */
94
  add_filter( "bulk_actions-edit-{$this->_taxonomy_name}", '__return_empty_array' );
95
 
@@ -234,7 +237,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
234
  global $sitepress;
235
  if( isset( $sitepress ) ){
236
  $vendor_id = yit_wpml_object_id( $vendor->id, YITH_Vendors()->get_taxonomy_name(), true );
237
- $wpml_vendor = get_term_by( 'id', $vendor_id, $vendor->term->taxonomy, $current_language );
238
  $slug = $wpml_vendor->slug;
239
  }
240
  $request[ $vendor->term->taxonomy ] = $slug;
@@ -290,6 +293,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
290
  * @use save_post action
291
  */
292
  public function add_vendor_taxonomy_to_product( $post_id, $post ) {
 
293
  $current_vendor = yith_get_vendor( 'current', 'user' );
294
 
295
  if ( 'product' == $post->post_type && current_user_can( 'edit_post', $post_id ) ) {
@@ -819,17 +823,44 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
819
  *
820
  * @return void
821
  */
822
- public function single_taxonomy_meta_box( $taxonomy, $taxonomy_box ) {
823
  $taxonomy_label = YITH_Vendors()->get_vendors_taxonomy_label();
824
  $vendor = yith_get_vendor( 'current', 'product' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
 
826
  $args = array(
827
  'id' => 'tax-input-yith_shop_vendor',
828
  'name' => 'tax_input[yith_shop_vendor]',
829
  'taxonomy' => $this->_taxonomy_name,
830
- 'show_option_none' => !$vendor->is_super_user() ? '' : sprintf( __( 'No %s' ), strtolower( $taxonomy_label[ 'singular_name' ] ) ),
831
- 'hide_empty' => !$vendor->is_super_user(),
832
- 'selected' => $vendor ? $vendor->id : 0,
833
  'walker' => YITH_Walker_CategoryDropdown(),
834
  'option_none_value' => '', // Avoid to save -1 as new vendor when you create a new product
835
  );
@@ -837,7 +868,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
837
  $vendor = yith_get_vendor( 'current', 'user' );
838
 
839
  if ( $vendor->is_valid() && $vendor->has_limited_access() && $vendor->is_user_admin() ) {
840
- echo $vendor->name;
841
  } else {
842
  wp_dropdown_categories( $args );
843
  }
@@ -1395,5 +1426,17 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1395
  flush_rewrite_rules();
1396
  }
1397
  }
 
 
 
 
 
 
 
 
 
 
 
 
1398
  }
1399
  }
90
  add_action( 'created_' . $this->_taxonomy_name, array( $this, 'save_taxonomy_fields' ), 10, 2 );
91
  add_action( 'pre_delete_term', array( $this, 'remove_vendor_data' ), 10, 2 );
92
 
93
+ /* Support to YITH Themes FW 2.0 */
94
+ add_filter( 'yit_layouts_taxonomies_list', array( $this, 'add_taxonomy_to_layouts' ) );
95
+
96
  /* Taxonomy Table Management */
97
  add_filter( "bulk_actions-edit-{$this->_taxonomy_name}", '__return_empty_array' );
98
 
237
  global $sitepress;
238
  if( isset( $sitepress ) ){
239
  $vendor_id = yit_wpml_object_id( $vendor->id, YITH_Vendors()->get_taxonomy_name(), true );
240
+ $wpml_vendor = get_term_by( 'id', $vendor_id, $vendor->term->taxonomy );
241
  $slug = $wpml_vendor->slug;
242
  }
243
  $request[ $vendor->term->taxonomy ] = $slug;
293
  * @use save_post action
294
  */
295
  public function add_vendor_taxonomy_to_product( $post_id, $post ) {
296
+ global $pagenow, $sitepress;
297
  $current_vendor = yith_get_vendor( 'current', 'user' );
298
 
299
  if ( 'product' == $post->post_type && current_user_can( 'edit_post', $post_id ) ) {
823
  *
824
  * @return void
825
  */
826
+ public function single_taxonomy_meta_box( $taxonomy, $taxonomy_box ) {
827
  $taxonomy_label = YITH_Vendors()->get_vendors_taxonomy_label();
828
  $vendor = yith_get_vendor( 'current', 'product' );
829
+ $vendor_id = 0;
830
+ $wpml_vendor = null;
831
+
832
+ /* WPML Support */
833
+ global $sitepress, $pagenow;
834
+ if ( $vendor->is_valid() ) {
835
+ if ( isset( $sitepress ) ) {
836
+ $vendor_id = yit_wpml_object_id( $vendor->id, YITH_Vendors()->get_taxonomy_name(), true );
837
+ $wpml_vendor = get_term_by( 'id', $vendor_id, $vendor->term->taxonomy );
838
+ $vendor_id = $wpml_vendor->term_id;
839
+ }
840
+
841
+ else {
842
+ $vendor_id = $vendor->id;
843
+ }
844
+ }
845
+
846
+ elseif( isset( $sitepress ) && $vendor->is_super_user() && 'post-new.php' == $pagenow && ! empty( $_GET['trid'] ) ){
847
+ $original_product_id = SitePress::get_original_element_id_by_trid( $_GET['trid'] );
848
+ $original_vendor = yith_get_vendor( $original_product_id, 'product' );
849
+ if( $original_vendor->is_valid() ){
850
+ $vendor_id = yit_wpml_object_id( $original_vendor->id, YITH_Vendors()->get_taxonomy_name(), true );
851
+ $wpml_vendor = get_term_by( 'id', $vendor_id, $original_vendor->term->taxonomy );
852
+ $vendor_id = $wpml_vendor->term_id;
853
+ }
854
+ }
855
+
856
 
857
  $args = array(
858
  'id' => 'tax-input-yith_shop_vendor',
859
  'name' => 'tax_input[yith_shop_vendor]',
860
  'taxonomy' => $this->_taxonomy_name,
861
+ 'show_option_none' => ! $vendor->is_super_user() ? '' : sprintf( __( 'No %s' ), strtolower( $taxonomy_label[ 'singular_name' ] ) ),
862
+ 'hide_empty' => ! $vendor->is_super_user(),
863
+ 'selected' => $vendor_id,
864
  'walker' => YITH_Walker_CategoryDropdown(),
865
  'option_none_value' => '', // Avoid to save -1 as new vendor when you create a new product
866
  );
868
  $vendor = yith_get_vendor( 'current', 'user' );
869
 
870
  if ( $vendor->is_valid() && $vendor->has_limited_access() && $vendor->is_user_admin() ) {
871
+ echo is_null( $wpml_vendor ) ? $vendor->name : $wpml_vendor->name;
872
  } else {
873
  wp_dropdown_categories( $args );
874
  }
1426
  flush_rewrite_rules();
1427
  }
1428
  }
1429
+
1430
+ /**
1431
+ * Add vendor taxonomy to YITH Theme fw 2.0 in layouts section
1432
+ *
1433
+ * @return mixed Taxonomies array
1434
+ * @since 1.8.1
1435
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
1436
+ */
1437
+ public function add_taxonomy_to_layouts( $taxonomies ){
1438
+ $taxonomies[ YITH_Vendors()->get_taxonomy_name() ] = get_taxonomy( YITH_Vendors()->get_taxonomy_name() );
1439
+ return $taxonomies;
1440
+ }
1441
  }
1442
  }
modules/yith-woocommerce-product-vendors/includes/functions.yith-update.php CHANGED
@@ -6,7 +6,7 @@
6
 
7
  //Add support to YITH Product Vendors db version 1.0.1
8
  function yith_vendors_update_db_1_0_1() {
9
- $vendors_db_option = get_option( 'yith_product_vendors_db_version' );
10
  if ( $vendors_db_option && version_compare( $vendors_db_option, '1.0.1', '<' ) ) {
11
  global $wpdb;
12
 
@@ -39,7 +39,7 @@ function yith_vendors_update_db_1_0_1() {
39
 
40
  //Add support to YITH Product Vendors db version 1.0.2
41
  function yith_vendors_update_db_1_0_2() {
42
- $vendors_db_option = get_option( 'yith_product_vendors_db_version' );
43
  if ( $vendors_db_option && version_compare( $vendors_db_option, '1.0.2', '<' ) ) {
44
  global $wpdb;
45
 
@@ -50,9 +50,9 @@ function yith_vendors_update_db_1_0_2() {
50
  }
51
  }
52
 
53
- //Add support to YITH Product Vendors db version 1.0.6
54
  function yith_vendors_update_db_1_0_3(){
55
- $vendors_db_option = get_option( 'yith_product_vendors_db_version' );
56
  if ( $vendors_db_option && version_compare( $vendors_db_option, '1.0.3', '<' ) ) {
57
  /**
58
  * Create "Become a Vendor" Page
@@ -82,9 +82,26 @@ add_action( 'admin_init', 'yith_vendors_update_db_1_0_3' );
82
  /**
83
  * Plugin Version Update
84
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  function yith_vendors_plugin_update() {
86
- $db_plugin_version = get_option( 'yith_wcmv_version', '1.0.0' );
87
- if ( version_compare( $db_plugin_version, YITH_Vendors()->version, '<' ) ) {
88
  /* Check if Vendor Role Exists */
89
  YITH_Vendors::add_vendor_role();
90
  /* Add Vendor Role to vendor owner and admins */
@@ -92,6 +109,6 @@ function yith_vendors_plugin_update() {
92
  update_option( 'yith_wcmv_version', YITH_Vendors()->version );
93
  }
94
  }
95
-
96
- add_action( 'admin_init', 'yith_vendors_plugin_update', 20 ); //priority set to 20 after vendor register taxonomy
97
 
6
 
7
  //Add support to YITH Product Vendors db version 1.0.1
8
  function yith_vendors_update_db_1_0_1() {
9
+ $vendors_db_option = get_option( 'yith_product_vendors_db_version', '1.0.0' );
10
  if ( $vendors_db_option && version_compare( $vendors_db_option, '1.0.1', '<' ) ) {
11
  global $wpdb;
12
 
39
 
40
  //Add support to YITH Product Vendors db version 1.0.2
41
  function yith_vendors_update_db_1_0_2() {
42
+ $vendors_db_option = get_option( 'yith_product_vendors_db_version', '1.0.0' );
43
  if ( $vendors_db_option && version_compare( $vendors_db_option, '1.0.2', '<' ) ) {
44
  global $wpdb;
45
 
50
  }
51
  }
52
 
53
+ //Add support to YITH Product Vendors db version 1.0.3
54
  function yith_vendors_update_db_1_0_3(){
55
+ $vendors_db_option = get_option( 'yith_product_vendors_db_version', '1.0.0' );
56
  if ( $vendors_db_option && version_compare( $vendors_db_option, '1.0.3', '<' ) ) {
57
  /**
58
  * Create "Become a Vendor" Page
82
  /**
83
  * Plugin Version Update
84
  */
85
+ //Add support to YITH Product Vendors plugin version 1.8.1
86
+ function yith_vendors_plugin_update_1_8_1() {
87
+ $plugin_version = get_option( 'yith_wcmv_version', '1.0.0' );
88
+ if ( version_compare( $plugin_version, YITH_Vendors()->version, '<' ) ) {
89
+ // _money_spent and _order_count may be out of sync - clear them
90
+ delete_metadata( 'user', 0, '_money_spent', '', true );
91
+ delete_metadata( 'user', 0, '_order_count', '', true );
92
+ }
93
+ }
94
+
95
+ //priority set to 20 after vendor register taxonomy
96
+ add_action( 'admin_init', 'yith_vendors_plugin_update_1_8_1', 20 );
97
+
98
+ /**
99
+ * Regenerate Vendor Role Capabilities fter update by FTP
100
+ */
101
+
102
  function yith_vendors_plugin_update() {
103
+ $plugin_version = get_option( 'yith_wcmv_version', '1.0.0' );
104
+ if ( version_compare( $plugin_version, YITH_Vendors()->version, '<' ) ) {
105
  /* Check if Vendor Role Exists */
106
  YITH_Vendors::add_vendor_role();
107
  /* Add Vendor Role to vendor owner and admins */
109
  update_option( 'yith_wcmv_version', YITH_Vendors()->version );
110
  }
111
  }
112
+ //priority set to 30 after vendor register taxonomy and other actions
113
+ add_action( 'admin_init', 'yith_vendors_plugin_update', 30 );
114
 
modules/yith-woocommerce-product-vendors/init.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-product-vendors/
5
  Description: YITH WooCommerce Multi Vendor is a plugin explicitly developed to switch your website into a platform hosting more than one shop.
6
  Author: yithemes
7
  Text Domain: yith_wc_product_vendors
8
- Version: 1.8.0
9
  Author URI: http://yithemes.com/
10
  */
11
 
@@ -46,7 +46,7 @@ if ( ! function_exists( 'WC' ) ) {
46
  if ( defined( 'YITH_WPV_VERSION' ) ) {
47
  return;
48
  } else {
49
- define( 'YITH_WPV_VERSION', '1.8.0' );
50
  }
51
 
52
  if ( ! defined( 'YITH_WPV_DB_VERSION' ) ) {
5
  Description: YITH WooCommerce Multi Vendor is a plugin explicitly developed to switch your website into a platform hosting more than one shop.
6
  Author: yithemes
7
  Text Domain: yith_wc_product_vendors
8
+ Version: 1.8.1
9
  Author URI: http://yithemes.com/
10
  */
11
 
46
  if ( defined( 'YITH_WPV_VERSION' ) ) {
47
  return;
48
  } else {
49
+ define( 'YITH_WPV_VERSION', '1.8.1' );
50
  }
51
 
52
  if ( ! defined( 'YITH_WPV_DB_VERSION' ) ) {
modules/yith-woocommerce-request-a-quote/yith-woocommerce-request-a-quote.php CHANGED
@@ -1,137 +1,137 @@
1
- <?php
2
- /*
3
- Plugin Name: YITH Woocommerce Request A Quote
4
- Description: The YITH Woocommerce Request A Quote plugin lets your customers ask for an estimate of a list of products they are interested into.
5
- Version: 1.2.0
6
- Author: Yithemes
7
- Author URI: http://yithemes.com/
8
- Text Domain: yith-woocommerce-request-a-quote
9
- License: GPLv2 or later
10
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
- */
12
-
13
- /*
14
- * @package YITH Woocommerce Request A Quote
15
- * @since 1.0.3
16
- * @author Yithemes
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- } // Exit if accessed directly
22
-
23
- if ( ! function_exists( 'is_plugin_active' ) ) {
24
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
25
- }
26
-
27
- if ( ! defined( 'YITH_YWRAQ_DIR' ) ) {
28
- define( 'YITH_YWRAQ_DIR', plugin_dir_path( __FILE__ ) );
29
- }
30
-
31
- // This version can't be activate if premium version is active ________________________________________
32
- if ( defined( 'YITH_YWRAQ_PREMIUM' ) ) {
33
- function yith_ywraq_install_free_admin_notice() {
34
- ?>
35
- <div class="error">
36
- <p><?php _e( 'You can\'t activate the free version of YITH Woocommerce Request A Quote while you are using the premium one.', 'yith-woocommerce-request-a-quote' ); ?></p>
37
- </div>
38
- <?php
39
- }
40
-
41
- add_action( 'admin_notices', 'yith_ywraq_install_free_admin_notice' );
42
-
43
- deactivate_plugins( plugin_basename( __FILE__ ) );
44
- return;
45
- }
46
-
47
- // Registration hook ________________________________________
48
- if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
49
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
50
- }
51
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
52
-
53
-
54
- // Define constants ________________________________________
55
- if ( defined( 'YITH_YWRAQ_VERSION' ) ) {
56
- return;
57
- }else{
58
- define( 'YITH_YWRAQ_VERSION', '1.2.0' );
59
- }
60
-
61
- if ( ! defined( 'YITH_YWRAQ_FREE_INIT' ) ) {
62
- define( 'YITH_YWRAQ_FREE_INIT', plugin_basename( __FILE__ ) );
63
- }
64
-
65
- if ( ! defined( 'YITH_YWRAQ_INIT' ) ) {
66
- define( 'YITH_YWRAQ_INIT', plugin_basename( __FILE__ ) );
67
- }
68
-
69
- if ( ! defined( 'YITH_YWRAQ_FILE' ) ) {
70
- define( 'YITH_YWRAQ_FILE', __FILE__ );
71
- }
72
-
73
- if ( ! defined( 'YITH_YWRAQ_DIR' ) ) {
74
- define( 'YITH_YWRAQ_DIR', plugin_dir_path( __FILE__ ) );
75
- }
76
-
77
- if ( ! defined( 'YITH_YWRAQ_URL' ) ) {
78
- define( 'YITH_YWRAQ_URL', plugins_url( '/', __FILE__ ) );
79
- }
80
-
81
- if ( ! defined( 'YITH_YWRAQ_ASSETS_URL' ) ) {
82
- define( 'YITH_YWRAQ_ASSETS_URL', YITH_YWRAQ_URL . 'assets' );
83
- }
84
-
85
- if ( ! defined( 'YITH_YWRAQ_TEMPLATE_PATH' ) ) {
86
- define( 'YITH_YWRAQ_TEMPLATE_PATH', YITH_YWRAQ_DIR . 'templates' );
87
- }
88
-
89
- if ( ! defined( 'YITH_YWRAQ_INC' ) ) {
90
- define( 'YITH_YWRAQ_INC', YITH_YWRAQ_DIR . '/includes/' );
91
- }
92
-
93
-
94
- function yith_ywraq_constructor() {
95
-
96
- // Woocommerce installation check _________________________
97
- if ( !function_exists( 'WC' ) ) {
98
-
99
-
100
- function yith_ywraq_install_woocommerce_admin_notice() {
101
- ?>
102
- <div class="error">
103
- <p><?php _e( 'YITH Woocommerce Request A Quote is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-request-a-quote' ); ?></p>
104
- </div>
105
- <?php
106
- }
107
-
108
- add_action( 'admin_notices', 'yith_ywraq_install_woocommerce_admin_notice' );
109
- return;
110
- }
111
-
112
- // Load YWCM text domain ___________________________________
113
- load_plugin_textdomain( 'yith-woocommerce-request-a-quote', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
114
-
115
- // Load required classes and functions
116
-
117
- if( ! class_exists('WC_Session') ){
118
- include_once( WC()->plugin_path().'/includes/abstracts/abstract-wc-session.php');
119
- }
120
-
121
- require_once( YITH_YWRAQ_INC . 'functions.yith-request-quote.php' );
122
- require_once( YITH_YWRAQ_INC . 'class.yith-ywraq-session.php' );
123
- require_once( YITH_YWRAQ_INC . 'class.yith-ywraq-shortcodes.php' );
124
-
125
- require_once( YITH_YWRAQ_INC . 'class.yith-request-quote.php' );
126
- if ( is_admin() ) {
127
- require_once( YITH_YWRAQ_INC . 'class.yith-request-quote-admin.php' );
128
- }
129
- else {
130
- require_once( YITH_YWRAQ_INC . 'class.yith-request-quote-frontend.php' );
131
- YITH_YWRAQ_Frontend();
132
- }
133
-
134
- YITH_Request_Quote();
135
-
136
- }
137
  add_action( 'plugins_loaded', 'yith_ywraq_constructor' );
1
+ <?php
2
+ /*
3
+ Plugin Name: YITH Woocommerce Request A Quote
4
+ Description: The YITH Woocommerce Request A Quote plugin lets your customers ask for an estimate of a list of products they are interested into.
5
+ Version: 1.2.0
6
+ Author: Yithemes
7
+ Author URI: http://yithemes.com/
8
+ Text Domain: yith-woocommerce-request-a-quote
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+ */
12
+
13
+ /*
14
+ * @package YITH Woocommerce Request A Quote
15
+ * @since 1.0.3
16
+ * @author Yithemes
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ } // Exit if accessed directly
22
+
23
+ if ( ! function_exists( 'is_plugin_active' ) ) {
24
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
25
+ }
26
+
27
+ if ( ! defined( 'YITH_YWRAQ_DIR' ) ) {
28
+ define( 'YITH_YWRAQ_DIR', plugin_dir_path( __FILE__ ) );
29
+ }
30
+
31
+ // This version can't be activate if premium version is active ________________________________________
32
+ if ( defined( 'YITH_YWRAQ_PREMIUM' ) ) {
33
+ function yith_ywraq_install_free_admin_notice() {
34
+ ?>
35
+ <div class="error">
36
+ <p><?php _e( 'You can\'t activate the free version of YITH Woocommerce Request A Quote while you are using the premium one.', 'yith-woocommerce-request-a-quote' ); ?></p>
37
+ </div>
38
+ <?php
39
+ }
40
+
41
+ add_action( 'admin_notices', 'yith_ywraq_install_free_admin_notice' );
42
+
43
+ deactivate_plugins( plugin_basename( __FILE__ ) );
44
+ return;
45
+ }
46
+
47
+ // Registration hook ________________________________________
48
+ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
49
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
50
+ }
51
+ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
52
+
53
+
54
+ // Define constants ________________________________________
55
+ if ( defined( 'YITH_YWRAQ_VERSION' ) ) {
56
+ return;
57
+ }else{
58
+ define( 'YITH_YWRAQ_VERSION', '1.2.0' );
59
+ }
60
+
61
+ if ( ! defined( 'YITH_YWRAQ_FREE_INIT' ) ) {
62
+ define( 'YITH_YWRAQ_FREE_INIT', plugin_basename( __FILE__ ) );
63
+ }
64
+
65
+ if ( ! defined( 'YITH_YWRAQ_INIT' ) ) {
66
+ define( 'YITH_YWRAQ_INIT', plugin_basename( __FILE__ ) );
67
+ }
68
+
69
+ if ( ! defined( 'YITH_YWRAQ_FILE' ) ) {
70
+ define( 'YITH_YWRAQ_FILE', __FILE__ );
71
+ }
72
+
73
+ if ( ! defined( 'YITH_YWRAQ_DIR' ) ) {
74
+ define( 'YITH_YWRAQ_DIR', plugin_dir_path( __FILE__ ) );
75
+ }
76
+
77
+ if ( ! defined( 'YITH_YWRAQ_URL' ) ) {
78
+ define( 'YITH_YWRAQ_URL', plugins_url( '/', __FILE__ ) );
79
+ }
80
+
81
+ if ( ! defined( 'YITH_YWRAQ_ASSETS_URL' ) ) {
82
+ define( 'YITH_YWRAQ_ASSETS_URL', YITH_YWRAQ_URL . 'assets' );
83
+ }
84
+
85
+ if ( ! defined( 'YITH_YWRAQ_TEMPLATE_PATH' ) ) {
86
+ define( 'YITH_YWRAQ_TEMPLATE_PATH', YITH_YWRAQ_DIR . 'templates' );
87
+ }
88
+
89
+ if ( ! defined( 'YITH_YWRAQ_INC' ) ) {
90
+ define( 'YITH_YWRAQ_INC', YITH_YWRAQ_DIR . '/includes/' );
91
+ }
92
+
93
+
94
+ function yith_ywraq_constructor() {
95
+
96
+ // Woocommerce installation check _________________________
97
+ if ( !function_exists( 'WC' ) ) {
98
+
99
+
100
+ function yith_ywraq_install_woocommerce_admin_notice() {
101
+ ?>
102
+ <div class="error">
103
+ <p><?php _e( 'YITH Woocommerce Request A Quote is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-request-a-quote' ); ?></p>
104
+ </div>
105
+ <?php
106
+ }
107
+
108
+ add_action( 'admin_notices', 'yith_ywraq_install_woocommerce_admin_notice' );
109
+ return;
110
+ }
111
+
112
+ // Load YWCM text domain ___________________________________
113
+ load_plugin_textdomain( 'yith-woocommerce-request-a-quote', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
114
+
115
+ // Load required classes and functions
116
+
117
+ if( ! class_exists('WC_Session') ){
118
+ include_once( WC()->plugin_path().'/includes/abstracts/abstract-wc-session.php');
119
+ }
120
+
121
+ require_once( YITH_YWRAQ_INC . 'functions.yith-request-quote.php' );
122
+ require_once( YITH_YWRAQ_INC . 'class.yith-ywraq-session.php' );
123
+ require_once( YITH_YWRAQ_INC . 'class.yith-ywraq-shortcodes.php' );
124
+
125
+ require_once( YITH_YWRAQ_INC . 'class.yith-request-quote.php' );
126
+ if ( is_admin() ) {
127
+ require_once( YITH_YWRAQ_INC . 'class.yith-request-quote-admin.php' );
128
+ }
129
+ else {
130
+ require_once( YITH_YWRAQ_INC . 'class.yith-request-quote-frontend.php' );
131
+ YITH_YWRAQ_Frontend();
132
+ }
133
+
134
+ YITH_Request_Quote();
135
+
136
+ }
137
  add_action( 'plugins_loaded', 'yith_ywraq_constructor' );
modules/yith-woocommerce-review-reminder/class.yith-woocommerce-review-reminder.php CHANGED
@@ -1,621 +1,625 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YWRR_Review_Reminder' ) ) {
16
-
17
- /**
18
- * Implements features of YWRR plugin
19
- *
20
- * @class YWRR_Review_Reminder
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- */
25
- class YWRR_Review_Reminder {
26
-
27
- /**
28
- * Panel object
29
- *
30
- * @var /Yit_Plugin_Panel object
31
- * @since 1.0.0
32
- * @see plugin-fw/lib/yit-plugin-panel.php
33
- */
34
- protected $_panel;
35
-
36
- /**
37
- * @var $_premium string Premium tab template file name
38
- */
39
- protected $_premium = 'premium.php';
40
-
41
- /**
42
- * @var string Premium version landing link
43
- */
44
- protected $_premium_landing = 'http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/';
45
-
46
- /**
47
- * @var string Plugin official documentation
48
- */
49
- protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith_woocommerce_review_reminder/';
50
-
51
- /**
52
- * @var string Yith WooCommerce Review Reminder panel page
53
- */
54
- protected $_panel_page = 'yith_ywrr_panel';
55
-
56
- /**
57
- * @var array
58
- */
59
- protected $_email_types = array();
60
-
61
- /**
62
- * @var array
63
- */
64
- var $_email_templates = array();
65
-
66
- /**
67
- * Constructor
68
- *
69
- * Initialize plugin and registers actions and filters to be used
70
- *
71
- * @since 1.0.0
72
- * @return mixed
73
- * @author Alberto Ruggiero
74
- */
75
- public function __construct() {
76
-
77
- if ( !function_exists( 'WC' ) ) {
78
- return;
79
- }
80
-
81
- $this->_email_types = array(
82
- 'request' => array(
83
- 'class' => 'YWRR_Request_Mail',
84
- 'file' => 'class-ywrr-request-email.php',
85
- 'hide' => false,
86
- ),
87
- 'unsubscribe' => array(
88
- 'class' => 'YWRR_Unsubscribe_Mail',
89
- 'file' => 'class-ywrr-unsubscribe-email.php',
90
- 'hide' => true,
91
- ),
92
- );
93
-
94
- // Load Plugin Framework
95
- add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 12 );
96
-
97
- //Add action links
98
- add_filter( 'plugin_action_links_' . plugin_basename( YWRR_DIR . '/' . basename( YWRR_FILE ) ), array(
99
- $this,
100
- 'action_links'
101
- ) );
102
- add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
103
-
104
- // Include required files
105
- $this->includes();
106
-
107
- // Add stylesheets and scripts files
108
- add_action( 'admin_menu', array( $this, 'add_menu_page' ), 5 );
109
- add_action( 'yith_review_reminder_premium', array( $this, 'premium_tab' ) );
110
-
111
- if ( is_admin() ) {
112
- add_filter( 'set-screen-option', 'YWRR_Blocklist_Table::set_options', 10, 3 );
113
-
114
- add_action( 'woocommerce_admin_field_customtext', 'YWRR_Custom_Textarea::output' );
115
- add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'save_ywrr_textarea' ), 10, 3 );
116
-
117
- add_action( 'ywrr_blocklist', 'YWRR_Blocklist_Table::output' );
118
- add_action( 'current_screen', 'YWRR_Blocklist_Table::add_options' );
119
- add_action( 'admin_notices', array( $this, 'ywrr_protect_unsubscribe_page_notice' ) );
120
- add_action( 'wp_trash_post', array( $this, 'ywrr_protect_unsubscribe_page' ), 10, 1 );
121
- add_action( 'before_delete_post', array( $this, 'ywrr_protect_unsubscribe_page' ), 10, 1 );
122
- }
123
- else {
124
- add_action( 'template_redirect', array( YWRR_Form_Handler(), 'unsubscribe_review_request' ) );
125
- add_shortcode( 'ywrr_unsubscribe', array( $this, 'ywrr_unsubscribe' ) );
126
- add_filter( 'wp_get_nav_menu_items', array( $this, 'ywrr_hide_unsubscribe_page' ), 10, 3 );
127
- }
128
-
129
- if ( get_option( 'ywrr_enable_plugin' ) == 'yes' ) {
130
-
131
- add_action( 'woocommerce_order_status_completed', array( YWRR_Schedule(), 'schedule_mail' ) );
132
- add_action( 'ywrr_daily_send_mail_job', array( YWRR_Schedule(), 'daily_schedule' ) );
133
-
134
- }
135
-
136
- add_action( 'init', array( $this, 'ywrr_post_status' ) );
137
- add_action( 'init', array( $this, 'ywrr_create_pages' ) );
138
-
139
- add_filter( 'woocommerce_email_classes', array( $this, 'ywrr_custom_email' ) );
140
- add_filter( 'woocommerce_get_sections_email', array( $this, 'ywrr_hide_sections' ) );
141
-
142
- add_option( 'ywrr_mail_schedule_day', 7 );
143
- add_option( 'ywrr_mail_template', 'base' );
144
-
145
- add_action( 'ywrr_email_header', array( $this, 'ywrr_email_header' ), 10, 2 );
146
- add_action( 'ywrr_email_footer', array( $this, 'ywrr_email_footer' ), 10, 2 );
147
-
148
- }
149
-
150
- /**
151
- * Files inclusion
152
- *
153
- * @since 1.0.0
154
- * @return void
155
- * @author Alberto Ruggiero
156
- */
157
- private function includes() {
158
-
159
- include_once( 'includes/class-ywrr-emails.php' );
160
- include_once( 'includes/class-ywrr-blocklist.php' );
161
- include_once( 'includes/class-ywrr-schedule.php' );
162
-
163
- if ( is_admin() ) {
164
- include_once( 'includes/admin/class-yith-custom-table.php' );
165
- include_once( 'templates/admin/custom-textarea.php' );
166
- include_once( 'templates/admin/blocklist-table.php' );
167
- }
168
-
169
- if ( !is_admin() || defined( 'DOING_AJAX' ) ) {
170
- include_once( 'includes/class-ywrr-form-handler.php' );
171
- }
172
-
173
- }
174
-
175
- /**
176
- * Saves custom textarea content
177
- *
178
- * @since 1.0.6
179
- *
180
- * @param $value
181
- * @param $option
182
- * @param $raw_value
183
- *
184
- * @return string
185
- * @author Alberto ruggiero
186
- */
187
- public function save_ywrr_textarea( $value, $option, $raw_value ) {
188
-
189
- if ( $option['type'] == 'customtext' ) {
190
- $value = wp_kses_post( trim( $raw_value ) );
191
-
192
- }
193
-
194
- return $value;
195
-
196
- }
197
-
198
- /**
199
- * Get the email header.
200
- *
201
- * @since 1.0.0
202
- *
203
- * @param $email_heading
204
- * @param $template
205
- *
206
- * @return void
207
- * @author Alberto Ruggiero
208
- */
209
- public function ywrr_email_header( $email_heading, $template = false ) {
210
-
211
- if ( !$template ) {
212
- $template = get_option( 'ywrr_mail_template' );
213
- }
214
-
215
- if ( array_key_exists( $template, $this->_email_templates ) ) {
216
- $path = $this->_email_templates[$template]['path'];
217
- $folder = $this->_email_templates[$template]['folder'];
218
-
219
- wc_get_template( $folder . '/email-header.php', array( 'email_heading' => $email_heading ), $path, $path );
220
-
221
- }
222
- else {
223
- wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading, 'mail_type' => 'yith-review-reminder' ) );
224
-
225
- }
226
-
227
- }
228
-
229
- /**
230
- * Get the email footer.
231
- *
232
- * @since 1.0.0
233
- *
234
- * @param $unsubscribe
235
- * @param $template
236
- *
237
- * @return void
238
- * @author Alberto Ruggiero
239
- */
240
- public function ywrr_email_footer( $unsubscribe, $template = false ) {
241
-
242
- if ( !$template ) {
243
- $template = get_option( 'ywrr_mail_template' );
244
- }
245
-
246
- if ( array_key_exists( $template, $this->_email_templates ) ) {
247
- $path = $this->_email_templates[$template]['path'];
248
- $folder = $this->_email_templates[$template]['folder'];
249
-
250
- wc_get_template( $folder . '/email-footer.php', array( 'unsubscribe' => $unsubscribe ), $path, $path );
251
-
252
- }
253
- else {
254
- echo '<p><a href="' . $unsubscribe . '">' . get_option( 'ywrr_mail_unsubscribe_text' ) . '</a></p>';
255
- wc_get_template( 'emails/email-footer.php', array( 'mail_type' => 'yith-review-reminder' ) );
256
- }
257
-
258
- }
259
-
260
- /**
261
- * Set the list item for the selected template.
262
- *
263
- * @since 1.0.0
264
- *
265
- * @param $item_list
266
- * @param $template
267
- *
268
- * @return string
269
- * @author Alberto Ruggiero
270
- */
271
- public function ywrr_email_items_list( $item_list, $template = false ) {
272
-
273
- if ( !$template ) {
274
- $template = get_option( 'ywrr_mail_template' );
275
- }
276
-
277
- if ( array_key_exists( $template, $this->_email_templates ) ) {
278
-
279
- $path = $this->_email_templates[$template]['path'];
280
- $folder = $this->_email_templates[$template]['folder'];
281
-
282
- $style = include( $path . $folder . '/email-items-list.php' );
283
-
284
- }
285
- elseif ( defined( 'YITH_WCET_PREMIUM' ) && get_option( 'ywrr_mail_template_enable' ) == 'yes' ) {
286
-
287
- $style = include( YITH_WCET_TEMPLATE_PATH . '/emails/email-items-list.php' );
288
-
289
- }
290
- else {
291
-
292
- $style = include( YWRR_TEMPLATE_PATH . '/emails/email-items-list.php' );
293
-
294
- }
295
-
296
- return $style;
297
-
298
- }
299
-
300
- /**
301
- * ADMIN FUNCTIONS
302
- */
303
-
304
- /**
305
- * Add a panel under YITH Plugins tab
306
- *
307
- * @since 1.0.0
308
- * @return void
309
- * @author Alberto Ruggiero
310
- * @use /Yit_Plugin_Panel class
311
- * @see plugin-fw/lib/yit-plugin-panel.php
312
- */
313
- public function add_menu_page() {
314
- if ( !empty( $this->_panel ) ) {
315
- return;
316
- }
317
-
318
- $admin_tabs = array(
319
- 'mail' => __( 'Mail Settings', 'yith-woocommerce-review-reminder' ),
320
- 'blocklist' => __( 'Blocklist', 'yith-woocommerce-review-reminder' )
321
- );
322
-
323
- if ( defined( 'YWRR_PREMIUM' ) ) {
324
- $admin_tabs['settings'] = __( 'Request Settings', 'yith-woocommerce-review-reminder' );
325
- $admin_tabs['mandrill'] = __( 'Mandrill Settings', 'yith-woocommerce-review-reminder' );
326
- $admin_tabs['schedule'] = __( 'Schedule List', 'yith-woocommerce-review-reminder' );
327
- }
328
- else {
329
- $admin_tabs['premium-landing'] = __( 'Premium Version', 'yith-woocommerce-review-reminder' );
330
- }
331
-
332
- $args = array(
333
- 'create_menu_page' => true,
334
- 'parent_slug' => '',
335
- 'page_title' => __( 'Review Reminder', 'yith-woocommerce-review-reminder' ),
336
- 'menu_title' => __( 'Review Reminder', 'yith-woocommerce-review-reminder' ),
337
- 'capability' => 'manage_options',
338
- 'parent' => '',
339
- 'parent_page' => 'yit_plugin_panel',
340
- 'page' => $this->_panel_page,
341
- 'admin-tabs' => $admin_tabs,
342
- 'options-path' => YWRR_DIR . '/plugin-options'
343
- );
344
-
345
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
346
- }
347
-
348
- /**
349
- * Hides custom email settings from WooCommerce panel
350
- *
351
- * @since 1.0.0
352
- *
353
- * @param $sections
354
- *
355
- * @return array
356
- * @author Andrea Grillo
357
- */
358
- public function ywrr_hide_sections( $sections ) {
359
- foreach ( $this->_email_types as $type => $email_type ) {
360
- $class_name = strtolower( $email_type['class'] );
361
- if ( isset( $sections[$class_name] ) && $email_type['hide'] == true ) {
362
- unset( $sections[$class_name] );
363
- }
364
- }
365
-
366
- return $sections;
367
- }
368
-
369
- /**
370
- * Creates a custom post status for unsubscribe page in order to avoid visibility of page in automatic menus
371
- *
372
- * @since 1.0.0
373
- * @return void
374
- * @author Alberto Ruggiero
375
- */
376
- public function ywrr_post_status() {
377
- register_post_status( 'ywrr-unsubscribe', array(
378
- 'label' => __( 'Unsubscribe Page', 'yith-woocommerce-review-reminder' ),
379
- 'public' => true,
380
- 'exclude_from_search' => true,
381
- 'show_in_admin_all_list' => false,
382
- 'show_in_admin_status_list' => false
383
- ) );
384
- }
385
-
386
- /**
387
- * Creates the unsubscribe page
388
- *
389
- * @since 1.0.0
390
- * @return void
391
- * @author Alberto Ruggiero
392
- */
393
- public function ywrr_create_pages() {
394
-
395
- if ( !function_exists( 'wc_create_page' ) ) {
396
- return;
397
- }
398
-
399
- $pages = apply_filters( 'woocommerce_create_pages', array(
400
- 'unsubscribe' => array(
401
- 'name' => _x( 'unsubscribe', 'Page slug', 'yith-woocommerce-review-reminder' ),
402
- 'title' => _x( 'Unsubscribe', 'Page title', 'yith-woocommerce-review-reminder' ),
403
- 'content' => '[ywrr_unsubscribe]'
404
- )
405
- ) );
406
-
407
- foreach ( $pages as $key => $page ) {
408
- wc_create_page( esc_sql( $page['name'] ), 'ywrr_' . $key . '_page_id', $page['title'], $page['content'], !empty( $page['parent'] ) ? wc_get_page_id( $page['parent'] ) : '' );
409
- }
410
-
411
- $unsubscribe_page = array(
412
- 'ID' => get_option( 'ywrr_unsubscribe_page_id' ),
413
- 'post_status' => 'ywrr-unsubscribe'
414
- );
415
-
416
- wp_update_post( $unsubscribe_page );
417
- }
418
-
419
- /**
420
- * Add the YWRR_Request_Mail class to WooCommerce mail classes
421
- *
422
- * @since 1.0.0
423
- *
424
- * @param $email_classes
425
- *
426
- * @return array
427
- * @author Alberto Ruggiero
428
- */
429
- public function ywrr_custom_email( $email_classes ) {
430
-
431
- foreach ( $this->_email_types as $type => $email_type ) {
432
- $email_classes[$email_type['class']] = include( "includes/emails/{$email_type['file']}" );
433
- }
434
-
435
- return $email_classes;
436
- }
437
-
438
- /**
439
- * Notifies the inability to delete the page
440
- *
441
- * @since 1.0.0
442
- * @return void
443
- * @author Alberto Ruggiero
444
- */
445
- public function ywrr_protect_unsubscribe_page_notice() {
446
- global $post_type, $pagenow;
447
-
448
- if ( $pagenow == 'edit.php' && $post_type == 'page' && isset( $_GET['impossible'] ) ) {
449
- echo '<div id="message" class="error"><p>' . __( 'The unsubscribe page cannot be deleted', 'yith-woocommerce-review-reminder' ) . '</p></div>';
450
- }
451
- }
452
-
453
- /**
454
- * Prevent the deletion of unsubscribe page
455
- *
456
- * @since 1.0.0
457
- *
458
- * @param $post_id
459
- *
460
- * @return void
461
- * @author Alberto Ruggiero
462
- */
463
- public function ywrr_protect_unsubscribe_page( $post_id ) {
464
- if ( $post_id == get_option( 'ywrr_unsubscribe_page_id' ) ) {
465
-
466
- $query_args = array(
467
- 'post_type' => 'page',
468
- 'impossible' => '1'
469
- );
470
- $error_url = esc_url( add_query_arg( $query_args, admin_url( 'edit.php' ) ) );
471
-
472
- wp_redirect( $error_url );
473
- exit();
474
- }
475
- }
476
-
477
- /**
478
- * FRONTEND FUNCTIONS
479
- */
480
-
481
- /**
482
- * Hides unsubscribe page from menus
483
- *
484
- * @since 1.0.0
485
- *
486
- * @param $items
487
- * @param $menu
488
- * @param $args
489
- *
490
- * @return array
491
- * @author Andrea Grillo
492
- */
493
- public function ywrr_hide_unsubscribe_page( $items, $menu, $args ) {
494
-
495
- foreach ( $items as $key => $value ) {
496
- if ( 'unsubscribe' === basename( $value->url ) ) {
497
- unset( $items[$key] );
498
- }
499
- }
500
-
501
- return $items;
502
-
503
- }
504
-
505
- /**
506
- * Unsubscribe page shortcode.
507
- *
508
- * @since 1.0.0
509
- * @return string
510
- * @author Alberto Ruggiero
511
- */
512
- public function ywrr_unsubscribe() {
513
- echo '<div class ="woocommerce">';
514
-
515
- wc_get_template( 'unsubscribe.php', array(), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
516
-
517
- echo '</div>';
518
- }
519
-
520
- /**
521
- * YITH FRAMEWORK
522
- */
523
-
524
- /**
525
- * Load plugin framework
526
- *
527
- * @since 1.0.0
528
- * @return void
529
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
530
- */
531
- public function plugin_fw_loader() {
532
- if ( !defined( 'YIT_CORE_PLUGIN' ) ) {
533
- global $plugin_fw_data;
534
- if ( !empty( $plugin_fw_data ) ) {
535
- $plugin_fw_file = array_shift( $plugin_fw_data );
536
- require_once( $plugin_fw_file );
537
- }
538
- }
539
- }
540
-
541
- /**
542
- * Premium Tab Template
543
- *
544
- * Load the premium tab template on admin page
545
- *
546
- * @since 1.0.0
547
- * @return void
548
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
549
- */
550
- public function premium_tab() {
551
- $premium_tab_template = YWRR_TEMPLATE_PATH . '/admin/' . $this->_premium;
552
- if ( file_exists( $premium_tab_template ) ) {
553
- include_once( $premium_tab_template );
554
- }
555
- }
556
-
557
- /**
558
- * Action Links
559
- *
560
- * add the action links to plugin admin page
561
- *
562
- * @since 1.0.0
563
- *
564
- * @param $links | links plugin array
565
- *
566
- * @return mixed
567
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
568
- * @use plugin_action_links_{$plugin_file_name}
569
- */
570
- public function action_links( $links ) {
571
-
572
- $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-review-reminder' ) . '</a>';
573
-
574
- if ( defined( 'YWRR_FREE_INIT' ) ) {
575
- $links[] = '<a href="' . $this->_premium_landing . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-review-reminder' ) . '</a>';
576
- }
577
-
578
- return $links;
579
- }
580
-
581
- /**
582
- * plugin_row_meta
583
- *
584
- * add the action links to plugin admin page
585
- *
586
- * @since 1.0.0
587
- *
588
- * @param $plugin_meta
589
- * @param $plugin_file
590
- * @param $plugin_data
591
- * @param $status
592
- *
593
- * @return Array
594
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
595
- * @use plugin_row_meta
596
- */
597
- public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
598
- if ( ( defined( 'YWRR_INIT' ) && ( YWRR_INIT == $plugin_file ) ) ||
599
- ( defined( 'YWRR_FREE_INIT' ) && ( YWRR_FREE_INIT == $plugin_file ) )
600
- ) {
601
-
602
- $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-review-reminder' ) . '</a>';
603
- }
604
-
605
- return $plugin_meta;
606
- }
607
-
608
- /**
609
- * Get the premium landing uri
610
- *
611
- * @since 1.0.0
612
- * @return string
613
- * @author Alberto Ruggiero
614
- */
615
- public function get_premium_landing_uri() {
616
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
617
- }
618
-
619
- }
620
-
 
 
 
 
621
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YWRR_Review_Reminder' ) ) {
16
+
17
+ /**
18
+ * Implements features of YWRR plugin
19
+ *
20
+ * @class YWRR_Review_Reminder
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ */
25
+ class YWRR_Review_Reminder {
26
+
27
+ /**
28
+ * Panel object
29
+ *
30
+ * @var /Yit_Plugin_Panel object
31
+ * @since 1.0.0
32
+ * @see plugin-fw/lib/yit-plugin-panel.php
33
+ */
34
+ protected $_panel;
35
+
36
+ /**
37
+ * @var $_premium string Premium tab template file name
38
+ */
39
+ protected $_premium = 'premium.php';
40
+
41
+ /**
42
+ * @var string Premium version landing link
43
+ */
44
+ protected $_premium_landing = 'http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/';
45
+
46
+ /**
47
+ * @var string Plugin official documentation
48
+ */
49
+ protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith_woocommerce_review_reminder/';
50
+
51
+ /**
52
+ * @var string Yith WooCommerce Review Reminder panel page
53
+ */
54
+ protected $_panel_page = 'yith_ywrr_panel';
55
+
56
+ /**
57
+ * @var array
58
+ */
59
+ protected $_email_types = array();
60
+
61
+ /**
62
+ * @var array
63
+ */
64
+ var $_email_templates = array();
65
+
66
+ /**
67
+ * Constructor
68
+ *
69
+ * Initialize plugin and registers actions and filters to be used
70
+ *
71
+ * @since 1.0.0
72
+ * @return mixed
73
+ * @author Alberto Ruggiero
74
+ */
75
+ public function __construct() {
76
+
77
+ if ( !function_exists( 'WC' ) ) {
78
+ return;
79
+ }
80
+
81
+ $this->_email_types = array(
82
+ 'request' => array(
83
+ 'class' => 'YWRR_Request_Mail',
84
+ 'file' => 'class-ywrr-request-email.php',
85
+ 'hide' => false,
86
+ ),
87
+ 'unsubscribe' => array(
88
+ 'class' => 'YWRR_Unsubscribe_Mail',
89
+ 'file' => 'class-ywrr-unsubscribe-email.php',
90
+ 'hide' => true,
91
+ ),
92
+ );
93
+
94
+ // Load Plugin Framework
95
+ add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 12 );
96
+
97
+ //Add action links
98
+ add_filter( 'plugin_action_links_' . plugin_basename( YWRR_DIR . '/' . basename( YWRR_FILE ) ), array(
99
+ $this,
100
+ 'action_links'
101
+ ) );
102
+ add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
103
+
104
+ // Include required files
105
+ $this->includes();
106
+
107
+ // Add stylesheets and scripts files
108
+ add_action( 'admin_menu', array( $this, 'add_menu_page' ), 5 );
109
+ add_action( 'yith_review_reminder_premium', array( $this, 'premium_tab' ) );
110
+
111
+ if ( is_admin() ) {
112
+ add_filter( 'set-screen-option', 'YWRR_Blocklist_Table::set_options', 10, 3 );
113
+
114
+ add_action( 'woocommerce_admin_field_customtext', 'YWRR_Custom_Textarea::output' );
115
+ add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'save_ywrr_textarea' ), 10, 3 );
116
+
117
+ add_action( 'ywrr_blocklist', 'YWRR_Blocklist_Table::output' );
118
+ add_action( 'current_screen', 'YWRR_Blocklist_Table::add_options' );
119
+ add_action( 'admin_notices', array( $this, 'ywrr_protect_unsubscribe_page_notice' ) );
120
+ add_action( 'wp_trash_post', array( $this, 'ywrr_protect_unsubscribe_page' ), 10, 1 );
121
+ add_action( 'before_delete_post', array( $this, 'ywrr_protect_unsubscribe_page' ), 10, 1 );
122
+ }
123
+ else {
124
+ add_action( 'template_redirect', array( YWRR_Form_Handler(), 'unsubscribe_review_request' ) );
125
+ add_shortcode( 'ywrr_unsubscribe', array( $this, 'ywrr_unsubscribe' ) );
126
+ add_filter( 'wp_get_nav_menu_items', array( $this, 'ywrr_hide_unsubscribe_page' ), 10, 3 );
127
+ }
128
+
129
+ if ( get_option( 'ywrr_enable_plugin' ) == 'yes' ) {
130
+
131
+ add_action( 'woocommerce_order_status_completed', array( YWRR_Schedule(), 'schedule_mail' ) );
132
+ add_action( 'ywrr_daily_send_mail_job', array( YWRR_Schedule(), 'daily_schedule' ) );
133
+
134
+ }
135
+
136
+ add_action( 'init', array( $this, 'ywrr_post_status' ) );
137
+ add_action( 'init', array( $this, 'ywrr_create_pages' ) );
138
+
139
+ add_filter( 'woocommerce_email_classes', array( $this, 'ywrr_custom_email' ) );
140
+ add_filter( 'woocommerce_get_sections_email', array( $this, 'ywrr_hide_sections' ) );
141
+
142
+ add_option( 'ywrr_mail_schedule_day', 7 );
143
+ add_option( 'ywrr_mail_template', 'base' );
144
+
145
+ add_action( 'ywrr_email_header', array( $this, 'ywrr_email_header' ), 10, 2 );
146
+ add_action( 'ywrr_email_footer', array( $this, 'ywrr_email_footer' ), 10, 2 );
147
+
148
+ }
149
+
150
+ /**
151
+ * Files inclusion
152
+ *
153
+ * @since 1.0.0
154
+ * @return void
155
+ * @author Alberto Ruggiero
156
+ */
157
+ private function includes() {
158
+
159
+ include_once( 'includes/class-ywrr-emails.php' );
160
+ include_once( 'includes/class-ywrr-blocklist.php' );
161
+ include_once( 'includes/class-ywrr-schedule.php' );
162
+
163
+ if ( is_admin() ) {
164
+ include_once( 'includes/admin/class-yith-custom-table.php' );
165
+ include_once( 'templates/admin/custom-textarea.php' );
166
+ include_once( 'templates/admin/blocklist-table.php' );
167
+ }
168
+
169
+ if ( !is_admin() || defined( 'DOING_AJAX' ) ) {
170
+ include_once( 'includes/class-ywrr-form-handler.php' );
171
+ }
172
+
173
+ }
174
+
175
+ /**
176
+ * Saves custom textarea content
177
+ *
178
+ * @since 1.0.6
179
+ *
180
+ * @param $value
181
+ * @param $option
182
+ * @param $raw_value
183
+ *
184
+ * @return string
185
+ * @author Alberto ruggiero
186
+ */
187
+ public function save_ywrr_textarea( $value, $option, $raw_value ) {
188
+
189
+ if ( $option['type'] == 'customtext' ) {
190
+ $value = wp_kses_post( trim( $raw_value ) );
191
+
192
+ }
193
+
194
+ return $value;
195
+
196
+ }
197
+
198
+ /**
199
+ * Get the email header.
200
+ *
201
+ * @since 1.0.0
202
+ *
203
+ * @param $email_heading
204
+ * @param $template
205
+ *
206
+ * @return void
207
+ * @author Alberto Ruggiero
208
+ */
209
+ public function ywrr_email_header( $email_heading, $template = false ) {
210
+
211
+ if ( !$template ) {
212
+ $template = get_option( 'ywrr_mail_template' );
213
+ }
214
+
215
+ if ( array_key_exists( $template, $this->_email_templates ) ) {
216
+ $path = $this->_email_templates[$template]['path'];
217
+ $folder = $this->_email_templates[$template]['folder'];
218
+
219
+ wc_get_template( $folder . '/email-header.php', array( 'email_heading' => $email_heading ), $path, $path );
220
+
221
+ }
222
+ else {
223
+ wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading, 'mail_type' => 'yith-review-reminder' ) );
224
+
225
+ }
226
+
227
+ }
228
+
229
+ /**
230
+ * Get the email footer.
231
+ *
232
+ * @since 1.0.0
233
+ *
234
+ * @param $unsubscribe
235
+ * @param $template
236
+ *
237
+ * @return void
238
+ * @author Alberto Ruggiero
239
+ */
240
+ public function ywrr_email_footer( $unsubscribe, $template = false ) {
241
+
242
+ if ( !$template ) {
243
+ $template = get_option( 'ywrr_mail_template' );
244
+ }
245
+
246
+ if ( array_key_exists( $template, $this->_email_templates ) ) {
247
+ $path = $this->_email_templates[$template]['path'];
248
+ $folder = $this->_email_templates[$template]['folder'];
249
+
250
+ wc_get_template( $folder . '/email-footer.php', array( 'unsubscribe' => $unsubscribe ), $path, $path );
251
+
252
+ }
253
+ else {
254
+ echo '<p><a href="' . $unsubscribe . '">' . get_option( 'ywrr_mail_unsubscribe_text' ) . '</a></p>';
255
+ wc_get_template( 'emails/email-footer.php', array( 'mail_type' => 'yith-review-reminder' ) );
256
+ }
257
+
258
+ }
259
+
260
+ /**
261
+ * Set the list item for the selected template.
262
+ *
263
+ * @since 1.0.0
264
+ *
265
+ * @param $item_list
266
+ * @param $template
267
+ *
268
+ * @return string
269
+ * @author Alberto Ruggiero
270
+ */
271
+ public function ywrr_email_items_list( $item_list, $template = false ) {
272
+
273
+ if ( !$template ) {
274
+ $template = get_option( 'ywrr_mail_template' );
275
+ }
276
+
277
+ if ( array_key_exists( $template, $this->_email_templates ) ) {
278
+
279
+ $path = $this->_email_templates[$template]['path'];
280
+ $folder = $this->_email_templates[$template]['folder'];
281
+
282
+ $style = include( $path . $folder . '/email-items-list.php' );
283
+
284
+ }
285
+ elseif ( defined( 'YITH_WCET_PREMIUM' ) && get_option( 'ywrr_mail_template_enable' ) == 'yes' ) {
286
+
287
+ $style = include( YITH_WCET_TEMPLATE_PATH . '/emails/email-items-list.php' );
288
+
289
+ }
290
+ else {
291
+
292
+ $style = include( YWRR_TEMPLATE_PATH . '/emails/email-items-list.php' );
293
+
294
+ }
295
+
296
+ return $style;
297
+
298
+ }
299
+
300
+ /**
301
+ * ADMIN FUNCTIONS
302
+ */
303
+
304
+ /**
305
+ * Add a panel under YITH Plugins tab
306
+ *
307
+ * @since 1.0.0
308
+ * @return void
309
+ * @author Alberto Ruggiero
310
+ * @use /Yit_Plugin_Panel class
311
+ * @see plugin-fw/lib/yit-plugin-panel.php
312
+ */
313
+ public function add_menu_page() {
314
+ if ( !empty( $this->_panel ) ) {
315
+ return;
316
+ }
317
+
318
+ $admin_tabs = array(
319
+ 'mail' => __( 'Mail Settings', 'yith-woocommerce-review-reminder' ),
320
+ 'blocklist' => __( 'Blocklist', 'yith-woocommerce-review-reminder' )
321
+ );
322
+
323
+ if ( defined( 'YWRR_PREMIUM' ) ) {
324
+ $admin_tabs['settings'] = __( 'Request Settings', 'yith-woocommerce-review-reminder' );
325
+ $admin_tabs['mandrill'] = __( 'Mandrill Settings', 'yith-woocommerce-review-reminder' );
326
+ $admin_tabs['schedule'] = __( 'Schedule List', 'yith-woocommerce-review-reminder' );
327
+ }
328
+ else {
329
+ $admin_tabs['premium-landing'] = __( 'Premium Version', 'yith-woocommerce-review-reminder' );
330
+ }
331
+
332
+ $args = array(
333
+ 'create_menu_page' => true,
334
+ 'parent_slug' => '',
335
+ 'page_title' => __( 'Review Reminder', 'yith-woocommerce-review-reminder' ),
336
+ 'menu_title' => __( 'Review Reminder', 'yith-woocommerce-review-reminder' ),
337
+ 'capability' => 'manage_options',
338
+ 'parent' => '',
339
+ 'parent_page' => 'yit_plugin_panel',
340
+ 'page' => $this->_panel_page,
341
+ 'admin-tabs' => $admin_tabs,
342
+ 'options-path' => YWRR_DIR . '/plugin-options'
343
+ );
344
+
345
+ $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
346
+ }
347
+
348
+ /**
349
+ * Hides custom email settings from WooCommerce panel
350
+ *
351
+ * @since 1.0.0
352
+ *
353
+ * @param $sections
354
+ *
355
+ * @return array
356
+ * @author Andrea Grillo
357
+ */
358
+ public function ywrr_hide_sections( $sections ) {
359
+ foreach ( $this->_email_types as $type => $email_type ) {
360
+ $class_name = strtolower( $email_type['class'] );
361
+ if ( isset( $sections[$class_name] ) && $email_type['hide'] == true ) {
362
+ unset( $sections[$class_name] );
363
+ }
364
+ }
365
+
366
+ return $sections;
367
+ }
368
+
369
+ /**
370
+ * Creates a custom post status for unsubscribe page in order to avoid visibility of page in automatic menus
371
+ *
372
+ * @since 1.0.0
373
+ * @return void
374
+ * @author Alberto Ruggiero
375
+ */
376
+ public function ywrr_post_status() {
377
+ register_post_status( 'ywrr-unsubscribe', array(
378
+ 'label' => __( 'Unsubscribe Page', 'yith-woocommerce-review-reminder' ),
379
+ 'public' => true,
380
+ 'exclude_from_search' => true,
381
+ 'show_in_admin_all_list' => false,
382
+ 'show_in_admin_status_list' => false
383
+ ) );
384
+ }
385
+
386
+ /**
387
+ * Creates the unsubscribe page
388
+ *
389
+ * @since 1.0.0
390
+ * @return void
391
+ * @author Alberto Ruggiero
392
+ */
393
+ public function ywrr_create_pages() {
394
+
395
+ if( get_option( 'ywrr_unsubscribe_page_id' ) ) {
396
+ return;
397
+ }
398
+
399
+ if ( !function_exists( 'wc_create_page' ) ) {
400
+ return;
401
+ }
402
+
403
+ $pages = apply_filters( 'woocommerce_create_pages', array(
404
+ 'unsubscribe' => array(
405
+ 'name' => _x( 'unsubscribe', 'Page slug', 'yith-woocommerce-review-reminder' ),
406
+ 'title' => _x( 'Unsubscribe', 'Page title', 'yith-woocommerce-review-reminder' ),
407
+ 'content' => '[ywrr_unsubscribe]'
408
+ )
409
+ ) );
410
+
411
+ foreach ( $pages as $key => $page ) {
412
+ wc_create_page( esc_sql( $page['name'] ), 'ywrr_' . $key . '_page_id', $page['title'], $page['content'], !empty( $page['parent'] ) ? wc_get_page_id( $page['parent'] ) : '' );
413
+ }
414
+
415
+ $unsubscribe_page = array(
416
+ 'ID' => get_option( 'ywrr_unsubscribe_page_id' ),
417
+ 'post_status' => 'ywrr-unsubscribe'
418
+ );
419
+
420
+ wp_update_post( $unsubscribe_page );
421
+ }
422
+
423
+ /**
424
+ * Add the YWRR_Request_Mail class to WooCommerce mail classes
425
+ *
426
+ * @since 1.0.0
427
+ *
428
+ * @param $email_classes
429
+ *
430
+ * @return array
431
+ * @author Alberto Ruggiero
432
+ */
433
+ public function ywrr_custom_email( $email_classes ) {
434
+
435
+ foreach ( $this->_email_types as $type => $email_type ) {
436
+ $email_classes[$email_type['class']] = include( "includes/emails/{$email_type['file']}" );
437
+ }
438
+
439
+ return $email_classes;
440
+ }
441
+
442
+ /**
443
+ * Notifies the inability to delete the page
444
+ *
445
+ * @since 1.0.0
446
+ * @return void
447
+ * @author Alberto Ruggiero
448
+ */
449
+ public function ywrr_protect_unsubscribe_page_notice() {
450
+ global $post_type, $pagenow;
451
+
452
+ if ( $pagenow == 'edit.php' && $post_type == 'page' && isset( $_GET['impossible'] ) ) {
453
+ echo '<div id="message" class="error"><p>' . __( 'The unsubscribe page cannot be deleted', 'yith-woocommerce-review-reminder' ) . '</p></div>';
454
+ }
455
+ }
456
+
457
+ /**
458
+ * Prevent the deletion of unsubscribe page
459
+ *
460
+ * @since 1.0.0
461
+ *
462
+ * @param $post_id
463
+ *
464
+ * @return void
465
+ * @author Alberto Ruggiero
466
+ */
467
+ public function ywrr_protect_unsubscribe_page( $post_id ) {
468
+ if ( $post_id == get_option( 'ywrr_unsubscribe_page_id' ) ) {
469
+
470
+ $query_args = array(
471
+ 'post_type' => 'page',
472
+ 'impossible' => '1'
473
+ );
474
+ $error_url = esc_url( add_query_arg( $query_args, admin_url( 'edit.php' ) ) );
475
+
476
+ wp_redirect( $error_url );
477
+ exit();
478
+ }
479
+ }
480
+
481
+ /**
482
+ * FRONTEND FUNCTIONS
483
+ */
484
+
485
+ /**
486
+ * Hides unsubscribe page from menus
487
+ *
488
+ * @since 1.0.0
489
+ *
490
+ * @param $items
491
+ * @param $menu
492
+ * @param $args
493
+ *
494
+ * @return array
495
+ * @author Andrea Grillo
496
+ */
497
+ public function ywrr_hide_unsubscribe_page( $items, $menu, $args ) {
498
+
499
+ foreach ( $items as $key => $value ) {
500
+ if ( 'unsubscribe' === basename( $value->url ) ) {
501
+ unset( $items[$key] );
502
+ }
503
+ }
504
+
505
+ return $items;
506
+
507
+ }
508
+
509
+ /**
510
+ * Unsubscribe page shortcode.
511
+ *
512
+ * @since 1.0.0
513
+ * @return string
514
+ * @author Alberto Ruggiero
515
+ */
516
+ public function ywrr_unsubscribe() {
517
+ echo '<div class ="woocommerce">';
518
+
519
+ wc_get_template( 'unsubscribe.php', array(), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
520
+
521
+ echo '</div>';
522
+ }
523
+
524
+ /**
525
+ * YITH FRAMEWORK
526
+ */
527
+
528
+ /**
529
+ * Load plugin framework
530
+ *
531
+ * @since 1.0.0
532
+ * @return void
533
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
534
+ */
535
+ public function plugin_fw_loader() {
536
+ if ( !defined( 'YIT_CORE_PLUGIN' ) ) {
537
+ global $plugin_fw_data;
538
+ if ( !empty( $plugin_fw_data ) ) {
539
+ $plugin_fw_file = array_shift( $plugin_fw_data );
540
+ require_once( $plugin_fw_file );
541
+ }
542
+ }
543
+ }
544
+
545
+ /**
546
+ * Premium Tab Template
547
+ *
548
+ * Load the premium tab template on admin page
549
+ *
550
+ * @since 1.0.0
551
+ * @return void
552
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
553
+ */
554
+ public function premium_tab() {
555
+ $premium_tab_template = YWRR_TEMPLATE_PATH . '/admin/' . $this->_premium;
556
+ if ( file_exists( $premium_tab_template ) ) {
557
+ include_once( $premium_tab_template );
558
+ }
559
+ }
560
+
561
+ /**
562
+ * Action Links
563
+ *
564
+ * add the action links to plugin admin page
565
+ *
566
+ * @since 1.0.0
567
+ *
568
+ * @param $links | links plugin array
569
+ *
570
+ * @return mixed
571
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
572
+ * @use plugin_action_links_{$plugin_file_name}
573
+ */
574
+ public function action_links( $links ) {
575
+
576
+ $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-review-reminder' ) . '</a>';
577
+
578
+ if ( defined( 'YWRR_FREE_INIT' ) ) {
579
+ $links[] = '<a href="' . $this->_premium_landing . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-review-reminder' ) . '</a>';
580
+ }
581
+
582
+ return $links;
583
+ }
584
+
585
+ /**
586
+ * plugin_row_meta
587
+ *
588
+ * add the action links to plugin admin page
589
+ *
590
+ * @since 1.0.0
591
+ *
592
+ * @param $plugin_meta
593
+ * @param $plugin_file
594
+ * @param $plugin_data
595
+ * @param $status
596
+ *
597
+ * @return Array
598
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
599
+ * @use plugin_row_meta
600
+ */
601
+ public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
602
+ if ( ( defined( 'YWRR_INIT' ) && ( YWRR_INIT == $plugin_file ) ) ||
603
+ ( defined( 'YWRR_FREE_INIT' ) && ( YWRR_FREE_INIT == $plugin_file ) )
604
+ ) {
605
+
606
+ $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-review-reminder' ) . '</a>';
607
+ }
608
+
609
+ return $plugin_meta;
610
+ }
611
+
612
+ /**
613
+ * Get the premium landing uri
614
+ *
615
+ * @since 1.0.0
616
+ * @return string
617
+ * @author Alberto Ruggiero
618
+ */
619
+ public function get_premium_landing_uri() {
620
+ return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
621
+ }
622
+
623
+ }
624
+
625
  }
modules/yith-woocommerce-review-reminder/includes/admin/class-yith-custom-table.php CHANGED
@@ -1,246 +1,246 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'WP_List_Table' ) ) {
16
- require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
17
- }
18
-
19
- if ( !class_exists( 'YITH_Custom_Table' ) ) {
20
-
21
- /**
22
- * Shows a custom table
23
- *
24
- * @class YITH_Custom_Table
25
- * @package Yithemes
26
- * @since 1.0.0
27
- * @author Your Inspiration Themes
28
- * @extends WP_List_Table
29
- *
30
- */
31
- class YITH_Custom_Table extends WP_List_Table {
32
-
33
- /**
34
- * @var array $options array of options for table showing
35
- */
36
- var $options;
37
-
38
- /**
39
- * Constructor
40
- *
41
- * @param $args array|string array or string of arguments
42
- *
43
- * @since 1.0.0
44
- * @author Alberto Ruggiero
45
- * @see WP_List_Table
46
- */
47
- public function __construct( $args ) {
48
- global $status, $page;
49
-
50
- parent::__construct( $args );
51
- }
52
-
53
- /**
54
- * Get a list of columns.
55
- *
56
- * @since 1.0.0
57
- * @return array
58
- * @author Alberto Ruggiero
59
- */
60
- public function get_columns() {
61
-
62
- return $this->options['view_columns'];
63
-
64
- }
65
-
66
- /**
67
- * Default column renderer
68
- *
69
- * @since 1.0.0
70
- *
71
- * @param $item array the row
72
- * @param $column_name string the column name
73
- *
74
- * @return string
75
- * @author Alberto Ruggiero
76
- */
77
- protected function column_default( $item, $column_name ) {
78
- return $item[$column_name];
79
- }
80
-
81
- /**
82
- * Checkbox column renderer
83
- *
84
- * @since 1.0.0
85
- *
86
- * @param $item array the row
87
- *
88
- * @return string
89
- * @author Alberto Ruggiero
90
- *
91
- */
92
- protected function column_cb( $item ) {
93
-
94
- return sprintf(
95
- '<input type="checkbox" name="id[]" value="%s" />',
96
- $item[$this->options['key_column']]
97
- );
98
-
99
- }
100
-
101
- /**
102
- * Return array of bulk options
103
- *
104
- * @since 1.0.0
105
- * @return array
106
- * @author Alberto Ruggiero
107
- */
108
- protected function get_bulk_actions() {
109
- return $this->options['bulk_actions']['actions'];
110
- }
111
-
112
- /**
113
- * Return array of sortable columns
114
- *
115
- * @since 1.0.0
116
- * @return array
117
- * @author Alberto Ruggiero
118
- */
119
- protected function get_sortable_columns() {
120
-
121
- return $this->options['sortable_columns'];
122
-
123
- }
124
-
125
- /**
126
- * Processes bulk actions
127
- *
128
- * @since 1.0.0
129
- * @return void
130
- * @author Alberto Ruggiero
131
- */
132
- public function process_bulk_action() {
133
-
134
- $action = 'function_' . $this->current_action();
135
-
136
- if ( array_key_exists( $action, $this->options['bulk_actions']['functions'] ) ) {
137
-
138
- call_user_func( $this->options['bulk_actions']['functions'][$action] );
139
-
140
- }
141
-
142
- }
143
-
144
- /**
145
- * It will get rows from database and prepare them to be showed in table
146
- *
147
- * @since 1.0.0
148
- * @return void
149
- * @author Alberto Ruggiero
150
- */
151
- public function prepare_items() {
152
- global $wpdb;
153
-
154
- $select_table = $this->options['select_table'];
155
- $select_columns = implode( ',', $this->options['select_columns'] );
156
- $select_where = $this->options['select_where'] != '' ? 'WHERE ' . $this->options['select_where'] : '';
157
- $select_group = $this->options['select_group'] != '' ? 'GROUP BY ' . $this->options['select_group'] : '';
158
- $select_limit = $this->get_items_per_page( $this->options['per_page_option'], 10 );
159
-
160
- $count_table = $this->options['count_table'];
161
- $count_where = $this->options['count_where'] != '' ? 'WHERE ' . $this->options['count_where'] : '';
162
-
163
- $view_columns = $this->get_columns();
164
- $hidden_columns = $this->options['hidden_columns'];
165
- $sortable_columns = $this->get_sortable_columns();
166
-
167
- // Here we configure table headers, defined in our methods
168
- $this->_column_headers = array( $view_columns, $hidden_columns, $sortable_columns );
169
-
170
- // Process bulk action if any
171
- $this->process_bulk_action();
172
-
173
- // Will be used in pagination settings
174
- $total_items = $wpdb->get_var( "SELECT COUNT(*) FROM $count_table $count_where" );
175
-
176
- // Prepare query params, as usual current page, order by and order direction
177
- $paged = isset( $_GET['paged'] ) ? $select_limit * ( intval( $_GET['paged'] ) - 1 ) : 0;
178
- $orderby = ( isset( $_GET['orderby'] ) && in_array( $_GET['orderby'], array_keys( $this->get_sortable_columns() ) ) ) ? $_GET['orderby'] : $this->options['select_order'];
179
-
180
- $order_dir = ( $this->options['select_order_dir'] != '' ) ? $this->options['select_order_dir'] : 'asc';
181
- $order = ( isset( $_GET['order'] ) && in_array( $_GET['order'], array( 'asc', 'desc' ) ) ) ? $_GET['order'] : $order_dir;
182
-
183
- $this->items = $wpdb->get_results( $wpdb->prepare( "
184
- SELECT $select_columns
185
- FROM $select_table
186
- $select_where
187
- $select_group
188
- ORDER BY $orderby $order
189
- LIMIT %d OFFSET %d
190
- ", $select_limit, $paged ), ARRAY_A );
191
-
192
- $this->set_pagination_args( array(
193
- 'total_items' => $total_items,
194
- 'per_page' => $select_limit,
195
- 'total_pages' => ceil( $total_items / $select_limit )
196
- ) );
197
- }
198
-
199
- /**
200
- * Generates the columns for a single row of the table; overrides original class function
201
- *
202
- * @since 1.0.0
203
- *
204
- * @param $item array the row
205
- *
206
- * @return string
207
- * @author Alberto Ruggiero
208
- */
209
- protected function single_row_columns( $item ) {
210
- list( $columns, $hidden ) = $this->get_column_info();
211
-
212
- foreach ( $columns as $column_name => $column_display_name ) {
213
- $class = "class='$column_name column-$column_name'";
214
-
215
- $style = '';
216
- if ( in_array( $column_name, $hidden ) ) {
217
- $style = ' style="display:none;"';
218
- }
219
-
220
- $attributes = "$class$style";
221
-
222
- if ( 'cb' == $column_name ) {
223
- echo '<th scope="row" class="check-column">';
224
- echo $this->column_cb( $item );
225
- echo '</th>';
226
- }
227
- elseif ( method_exists( $this, 'column_' . $column_name ) ) {
228
- echo "<td $attributes>";
229
- echo call_user_func( array( $this, 'column_' . $column_name ), $item );
230
- echo "</td>";
231
- }
232
- elseif ( isset( $this->options['custom_columns']['column_' . $column_name] ) ) {
233
- echo "<td $attributes>";
234
- echo call_user_func_array( $this->options['custom_columns']['column_' . $column_name], array( $item, $this ) );
235
- echo "</td>";
236
- }
237
- else {
238
- echo "<td $attributes>";
239
- echo $this->column_default( $item, $column_name );
240
- echo "</td>";
241
- }
242
- }
243
- }
244
-
245
- }
246
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'WP_List_Table' ) ) {
16
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
17
+ }
18
+
19
+ if ( !class_exists( 'YITH_Custom_Table' ) ) {
20
+
21
+ /**
22
+ * Shows a custom table
23
+ *
24
+ * @class YITH_Custom_Table
25
+ * @package Yithemes
26
+ * @since 1.0.0
27
+ * @author Your Inspiration Themes
28
+ * @extends WP_List_Table
29
+ *
30
+ */
31
+ class YITH_Custom_Table extends WP_List_Table {
32
+
33
+ /**
34
+ * @var array $options array of options for table showing
35
+ */
36
+ var $options;
37
+
38
+ /**
39
+ * Constructor
40
+ *
41
+ * @param $args array|string array or string of arguments
42
+ *
43
+ * @since 1.0.0
44
+ * @author Alberto Ruggiero
45
+ * @see WP_List_Table
46
+ */
47
+ public function __construct( $args ) {
48
+ global $status, $page;
49
+
50
+ parent::__construct( $args );
51
+ }
52
+
53
+ /**
54
+ * Get a list of columns.
55
+ *
56
+ * @since 1.0.0
57
+ * @return array
58
+ * @author Alberto Ruggiero
59
+ */
60
+ public function get_columns() {
61
+
62
+ return $this->options['view_columns'];
63
+
64
+ }
65
+
66
+ /**
67
+ * Default column renderer
68
+ *
69
+ * @since 1.0.0
70
+ *
71
+ * @param $item array the row
72
+ * @param $column_name string the column name
73
+ *
74
+ * @return string
75
+ * @author Alberto Ruggiero
76
+ */
77
+ protected function column_default( $item, $column_name ) {
78
+ return $item[$column_name];
79
+ }
80
+
81
+ /**
82
+ * Checkbox column renderer
83
+ *
84
+ * @since 1.0.0
85
+ *
86
+ * @param $item array the row
87
+ *
88
+ * @return string
89
+ * @author Alberto Ruggiero
90
+ *
91
+ */
92
+ protected function column_cb( $item ) {
93
+
94
+ return sprintf(
95
+ '<input type="checkbox" name="id[]" value="%s" />',
96
+ $item[$this->options['key_column']]
97
+ );
98
+
99
+ }
100
+
101
+ /**
102
+ * Return array of bulk options
103
+ *
104
+ * @since 1.0.0
105
+ * @return array
106
+ * @author Alberto Ruggiero
107
+ */
108
+ protected function get_bulk_actions() {
109
+ return $this->options['bulk_actions']['actions'];
110
+ }
111
+
112
+ /**
113
+ * Return array of sortable columns
114
+ *
115
+ * @since 1.0.0
116
+ * @return array
117
+ * @author Alberto Ruggiero
118
+ */
119
+ protected function get_sortable_columns() {
120
+
121
+ return $this->options['sortable_columns'];
122
+
123
+ }
124
+
125
+ /**
126
+ * Processes bulk actions
127
+ *
128
+ * @since 1.0.0
129
+ * @return void
130
+ * @author Alberto Ruggiero
131
+ */
132
+ public function process_bulk_action() {
133
+
134
+ $action = 'function_' . $this->current_action();
135
+
136
+ if ( array_key_exists( $action, $this->options['bulk_actions']['functions'] ) ) {
137
+
138
+ call_user_func( $this->options['bulk_actions']['functions'][$action] );
139
+
140
+ }
141
+
142
+ }
143
+
144
+ /**
145
+ * It will get rows from database and prepare them to be showed in table
146
+ *
147
+ * @since 1.0.0
148
+ * @return void
149
+ * @author Alberto Ruggiero
150
+ */
151
+ public function prepare_items() {
152
+ global $wpdb;
153
+
154
+ $select_table = $this->options['select_table'];
155
+ $select_columns = implode( ',', $this->options['select_columns'] );
156
+ $select_where = $this->options['select_where'] != '' ? 'WHERE ' . $this->options['select_where'] : '';
157
+ $select_group = $this->options['select_group'] != '' ? 'GROUP BY ' . $this->options['select_group'] : '';
158
+ $select_limit = $this->get_items_per_page( $this->options['per_page_option'], 10 );
159
+
160
+ $count_table = $this->options['count_table'];
161
+ $count_where = $this->options['count_where'] != '' ? 'WHERE ' . $this->options['count_where'] : '';
162
+
163
+ $view_columns = $this->get_columns();
164
+ $hidden_columns = $this->options['hidden_columns'];
165
+ $sortable_columns = $this->get_sortable_columns();
166
+
167
+ // Here we configure table headers, defined in our methods
168
+ $this->_column_headers = array( $view_columns, $hidden_columns, $sortable_columns );
169
+
170
+ // Process bulk action if any
171
+ $this->process_bulk_action();
172
+
173
+ // Will be used in pagination settings
174
+ $total_items = $wpdb->get_var( "SELECT COUNT(*) FROM $count_table $count_where" );
175
+
176
+ // Prepare query params, as usual current page, order by and order direction
177
+ $paged = isset( $_GET['paged'] ) ? $select_limit * ( intval( $_GET['paged'] ) - 1 ) : 0;
178
+ $orderby = ( isset( $_GET['orderby'] ) && in_array( $_GET['orderby'], array_keys( $this->get_sortable_columns() ) ) ) ? $_GET['orderby'] : $this->options['select_order'];
179
+
180
+ $order_dir = ( $this->options['select_order_dir'] != '' ) ? $this->options['select_order_dir'] : 'asc';
181
+ $order = ( isset( $_GET['order'] ) && in_array( $_GET['order'], array( 'asc', 'desc' ) ) ) ? $_GET['order'] : $order_dir;
182
+
183
+ $this->items = $wpdb->get_results( $wpdb->prepare( "
184
+ SELECT $select_columns
185
+ FROM $select_table
186
+ $select_where
187
+ $select_group
188
+ ORDER BY $orderby $order
189
+ LIMIT %d OFFSET %d
190
+ ", $select_limit, $paged ), ARRAY_A );
191
+
192
+ $this->set_pagination_args( array(
193
+ 'total_items' => $total_items,
194
+ 'per_page' => $select_limit,
195
+ 'total_pages' => ceil( $total_items / $select_limit )
196
+ ) );
197
+ }
198
+
199
+ /**
200
+ * Generates the columns for a single row of the table; overrides original class function
201
+ *
202
+ * @since 1.0.0
203
+ *
204
+ * @param $item array the row
205
+ *
206
+ * @return string
207
+ * @author Alberto Ruggiero
208
+ */
209
+ protected function single_row_columns( $item ) {
210
+ list( $columns, $hidden ) = $this->get_column_info();
211
+
212
+ foreach ( $columns as $column_name => $column_display_name ) {
213
+ $class = "class='$column_name column-$column_name'";
214
+
215
+ $style = '';
216
+ if ( in_array( $column_name, $hidden ) ) {
217
+ $style = ' style="display:none;"';
218
+ }
219
+
220
+ $attributes = "$class$style";
221
+
222
+ if ( 'cb' == $column_name ) {
223
+ echo '<th scope="row" class="check-column">';
224
+ echo $this->column_cb( $item );
225
+ echo '</th>';
226
+ }
227
+ elseif ( method_exists( $this, 'column_' . $column_name ) ) {
228
+ echo "<td $attributes>";
229
+ echo call_user_func( array( $this, 'column_' . $column_name ), $item );
230
+ echo "</td>";
231
+ }
232
+ elseif ( isset( $this->options['custom_columns']['column_' . $column_name] ) ) {
233
+ echo "<td $attributes>";
234
+ echo call_user_func_array( $this->options['custom_columns']['column_' . $column_name], array( $item, $this ) );
235
+ echo "</td>";
236
+ }
237
+ else {
238
+ echo "<td $attributes>";
239
+ echo $this->column_default( $item, $column_name );
240
+ echo "</td>";
241
+ }
242
+ }
243
+ }
244
+
245
+ }
246
  }
modules/yith-woocommerce-review-reminder/includes/class-ywrr-blocklist.php CHANGED
@@ -1,136 +1,136 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
- }
14
-
15
- if ( !class_exists( 'YWRR_Blocklist' ) ) {
16
-
17
- /**
18
- * Implements blocklist functions for YWRR plugin
19
- *
20
- * @class YWRR_Blocklist
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- *
25
- */
26
- class YWRR_Blocklist {
27
-
28
- /**
29
- * Single instance of the class
30
- *
31
- * @var \YWRR_Blocklist
32
- * @since 1.0.0
33
- */
34
- protected static $instance;
35
-
36
- /**
37
- * Returns single instance of the class
38
- *
39
- * @return \YWRR_Blocklist
40
- * @since 1.0.0
41
- */
42
- public static function get_instance() {
43
-
44
- if ( is_null( self::$instance ) ) {
45
-
46
- self::$instance = new self( $_REQUEST );
47
-
48
- }
49
-
50
- return self::$instance;
51
- }
52
-
53
- /**
54
- * Constructor
55
- *
56
- * @since 1.0.0
57
- * @return mixed
58
- * @author Alberto Ruggiero
59
- */
60
- public function __construct() {
61
-
62
- }
63
-
64
- /**
65
- * Check if the customer is in blocklist table
66
- *
67
- * @since 1.0.0
68
- *
69
- * @param $customer_id int the user id
70
- * @param $customer_email string the user email
71
- *
72
- * @return bool
73
- * @author Alberto Ruggiero
74
- */
75
- public function check_blocklist( $customer_id, $customer_email ) {
76
- global $wpdb;
77
-
78
- if ( 0 == $customer_id ) {
79
- $count = $wpdb->get_var( $wpdb->prepare( "
80
- SELECT COUNT(*)
81
- FROM {$wpdb->prefix}ywrr_email_blocklist
82
- WHERE customer_email = %s
83
- ", $customer_email ) );
84
- }
85
- else {
86
- $count = $wpdb->get_var( $wpdb->prepare( "
87
- SELECT COUNT(*)
88
- FROM {$wpdb->prefix}ywrr_email_blocklist
89
- WHERE customer_id = %d
90
- ", $customer_id ) );
91
- }
92
-
93
- return ( $count >= 1 ? false : true );
94
- }
95
-
96
- /**
97
- * Add customer to blocklist table
98
- *
99
- * @since 1.0.0
100
- *
101
- * @param $customer_id int the user id
102
- * @param $customer_email string the user email
103
- *
104
- * @return void
105
- * @author Alberto Ruggiero
106
- */
107
- public function add_to_blocklist( $customer_id, $customer_email ) {
108
- global $wpdb;
109
-
110
- $wpdb->insert(
111
- $wpdb->prefix . 'ywrr_email_blocklist',
112
- array(
113
- 'customer_email' => $customer_email,
114
- 'customer_id' => $customer_id
115
- ),
116
- array(
117
- '%s',
118
- '%d'
119
- )
120
- );
121
- }
122
-
123
- }
124
-
125
- /**
126
- * Unique access to instance of YWRR_Blocklist class
127
- *
128
- * @return \YWRR_Blocklist
129
- */
130
- function YWRR_Blocklist() {
131
-
132
- return YWRR_Blocklist::get_instance();
133
-
134
- }
135
-
136
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly
13
+ }
14
+
15
+ if ( !class_exists( 'YWRR_Blocklist' ) ) {
16
+
17
+ /**
18
+ * Implements blocklist functions for YWRR plugin
19
+ *
20
+ * @class YWRR_Blocklist
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ *
25
+ */
26
+ class YWRR_Blocklist {
27
+
28
+ /**
29
+ * Single instance of the class
30
+ *
31
+ * @var \YWRR_Blocklist
32
+ * @since 1.0.0
33
+ */
34
+ protected static $instance;
35
+
36
+ /**
37
+ * Returns single instance of the class
38
+ *
39
+ * @return \YWRR_Blocklist
40
+ * @since 1.0.0
41
+ */
42
+ public static function get_instance() {
43
+
44
+ if ( is_null( self::$instance ) ) {
45
+
46
+ self::$instance = new self( $_REQUEST );
47
+
48
+ }
49
+
50
+ return self::$instance;
51
+ }
52
+
53
+ /**
54
+ * Constructor
55
+ *
56
+ * @since 1.0.0
57
+ * @return mixed
58
+ * @author Alberto Ruggiero
59
+ */
60
+ public function __construct() {
61
+
62
+ }
63
+
64
+ /**
65
+ * Check if the customer is in blocklist table
66
+ *
67
+ * @since 1.0.0
68
+ *
69
+ * @param $customer_id int the user id
70
+ * @param $customer_email string the user email
71
+ *
72
+ * @return bool
73
+ * @author Alberto Ruggiero
74
+ */
75
+ public function check_blocklist( $customer_id, $customer_email ) {
76
+ global $wpdb;
77
+
78
+ if ( 0 == $customer_id ) {
79
+ $count = $wpdb->get_var( $wpdb->prepare( "
80
+ SELECT COUNT(*)
81
+ FROM {$wpdb->prefix}ywrr_email_blocklist
82
+ WHERE customer_email = %s
83
+ ", $customer_email ) );
84
+ }
85
+ else {
86
+ $count = $wpdb->get_var( $wpdb->prepare( "
87
+ SELECT COUNT(*)
88
+ FROM {$wpdb->prefix}ywrr_email_blocklist
89
+ WHERE customer_id = %d
90
+ ", $customer_id ) );
91
+ }
92
+
93
+ return ( $count >= 1 ? false : true );
94
+ }
95
+
96
+ /**
97
+ * Add customer to blocklist table
98
+ *
99
+ * @since 1.0.0
100
+ *
101
+ * @param $customer_id int the user id
102
+ * @param $customer_email string the user email
103
+ *
104
+ * @return void
105
+ * @author Alberto Ruggiero
106
+ */
107
+ public function add_to_blocklist( $customer_id, $customer_email ) {
108
+ global $wpdb;
109
+
110
+ $wpdb->insert(
111
+ $wpdb->prefix . 'ywrr_email_blocklist',
112
+ array(
113
+ 'customer_email' => $customer_email,
114
+ 'customer_id' => $customer_id
115
+ ),
116
+ array(
117
+ '%s',
118
+ '%d'
119
+ )
120
+ );
121
+ }
122
+
123
+ }
124
+
125
+ /**
126
+ * Unique access to instance of YWRR_Blocklist class
127
+ *
128
+ * @return \YWRR_Blocklist
129
+ */
130
+ function YWRR_Blocklist() {
131
+
132
+ return YWRR_Blocklist::get_instance();
133
+
134
+ }
135
+
136
  }
modules/yith-woocommerce-review-reminder/includes/class-ywrr-emails.php CHANGED
@@ -1,160 +1,160 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YWRR_Emails' ) ) {
16
-
17
- /**
18
- * Implements email functions for YWRR plugin
19
- *
20
- * @class YWRR_Emails
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- *
25
- */
26
- class YWRR_Emails {
27
-
28
- /**
29
- * Single instance of the class
30
- *
31
- * @var \YWRR_Emails
32
- * @since 1.0.0
33
- */
34
- protected static $instance;
35
-
36
- /**
37
- * Returns single instance of the class
38
- *
39
- * @return \YWRR_Emails
40
- * @since 1.0.0
41
- */
42
- public static function get_instance() {
43
-
44
- if ( is_null( self::$instance ) ) {
45
-
46
- self::$instance = new self( $_REQUEST );
47
-
48
- }
49
-
50
- return self::$instance;
51
-
52
- }
53
-
54
- /**
55
- * Constructor
56
- *
57
- * @since 1.0.0
58
- * @return mixed
59
- * @author Alberto Ruggiero
60
- */
61
- public function __construct() {
62
-
63
- }
64
-
65
- /**
66
- * Prepares and send the review request mail
67
- *
68
- * @since 1.0.0
69
- *
70
- * @param $order_id int the order id
71
- * @param $days
72
- * @param $items_to_review
73
- * @param $stored_items
74
- *
75
- * @return void
76
- * @author Alberto Ruggiero
77
- */
78
- public function send_email( $order_id, $days, $items_to_review = array(), $stored_items = array() ) {
79
-
80
- if ( defined( 'YWRR_PREMIUM' ) ) {
81
-
82
- if ( empty( $stored_items ) ) {
83
-
84
- if ( empty( $items_to_review ) ) {
85
-
86
- $list = YWRR_Emails_Premium()->get_review_list( $order_id );
87
-
88
- }
89
- else {
90
-
91
- $list = YWRR_Emails_Premium()->get_review_list_forced( $items_to_review, $order_id );
92
-
93
- }
94
- }
95
- else {
96
-
97
- $list = $stored_items;
98
-
99
- }
100
-
101
- }
102
- else {
103
-
104
- $list = $this->get_review_list( $order_id );
105
-
106
- }
107
-
108
-
109
- $wc_email = WC_Emails::instance();
110
- $email = $wc_email->emails['YWRR_Request_Mail'];
111
-
112
- $email->trigger( $order_id, $list, $days );
113
-
114
- }
115
-
116
- /**
117
- * Prepares the list of items to review from stored options
118
- *
119
- * @since 1.0.0
120
- *
121
- * @param $order_id int the order id
122
- *
123
- * @return array
124
- * @author Alberto Ruggiero
125
- */
126
- public function get_review_list( $order_id ) {
127
- global $wpdb;
128
-
129
- $items = array();
130
-
131
- $line_items = $wpdb->get_results( $wpdb->prepare( "
132
- SELECT a.order_item_name,
133
- MAX(CASE WHEN b.meta_key = '_product_id' THEN b.meta_value ELSE NULL END) AS product_id
134
- FROM {$wpdb->prefix}woocommerce_order_items a INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta b ON a.order_item_id= b.order_item_id
135
- WHERE a.order_id = %d AND a.order_item_type = 'line_item'
136
- GROUP BY a.order_item_name
137
- ORDER BY a.order_item_id ASC
138
- ", $order_id ) );
139
-
140
-
141
- foreach ( $line_items as $item ) {
142
- $items[$item->product_id]['name'] = $item->order_item_name;
143
- $items[$item->product_id]['id'] = $item->product_id;
144
- }
145
-
146
- return $items;
147
- }
148
-
149
- }
150
-
151
- /**
152
- * Unique access to instance of YWRR_Emails class
153
- *
154
- * @return \YWRR_Emails
155
- */
156
- function YWRR_Emails() {
157
- return YWRR_Emails::get_instance();
158
- }
159
-
160
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YWRR_Emails' ) ) {
16
+
17
+ /**
18
+ * Implements email functions for YWRR plugin
19
+ *
20
+ * @class YWRR_Emails
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ *
25
+ */
26
+ class YWRR_Emails {
27
+
28
+ /**
29
+ * Single instance of the class
30
+ *
31
+ * @var \YWRR_Emails
32
+ * @since 1.0.0
33
+ */
34
+ protected static $instance;
35
+
36
+ /**
37
+ * Returns single instance of the class
38
+ *
39
+ * @return \YWRR_Emails
40
+ * @since 1.0.0
41
+ */
42
+ public static function get_instance() {
43
+
44
+ if ( is_null( self::$instance ) ) {
45
+
46
+ self::$instance = new self( $_REQUEST );
47
+
48
+ }
49
+
50
+ return self::$instance;
51
+
52
+ }
53
+
54
+ /**
55
+ * Constructor
56
+ *
57
+ * @since 1.0.0
58
+ * @return mixed
59
+ * @author Alberto Ruggiero
60
+ */
61
+ public function __construct() {
62
+
63
+ }
64
+
65
+ /**
66
+ * Prepares and send the review request mail
67
+ *
68
+ * @since 1.0.0
69
+ *
70
+ * @param $order_id int the order id
71
+ * @param $days
72
+ * @param $items_to_review
73
+ * @param $stored_items
74
+ *
75
+ * @return void
76
+ * @author Alberto Ruggiero
77
+ */
78
+ public function send_email( $order_id, $days, $items_to_review = array(), $stored_items = array() ) {
79
+
80
+ if ( defined( 'YWRR_PREMIUM' ) ) {
81
+
82
+ if ( empty( $stored_items ) ) {
83
+
84
+ if ( empty( $items_to_review ) ) {
85
+
86
+ $list = YWRR_Emails_Premium()->get_review_list( $order_id );
87
+
88
+ }
89
+ else {
90
+
91
+ $list = YWRR_Emails_Premium()->get_review_list_forced( $items_to_review, $order_id );
92
+
93
+ }
94
+ }
95
+ else {
96
+
97
+ $list = $stored_items;
98
+
99
+ }
100
+
101
+ }
102
+ else {
103
+
104
+ $list = $this->get_review_list( $order_id );
105
+
106
+ }
107
+
108
+
109
+ $wc_email = WC_Emails::instance();
110
+ $email = $wc_email->emails['YWRR_Request_Mail'];
111
+
112
+ $email->trigger( $order_id, $list, $days );
113
+
114
+ }
115
+
116
+ /**
117
+ * Prepares the list of items to review from stored options
118
+ *
119
+ * @since 1.0.0
120
+ *
121
+ * @param $order_id int the order id
122
+ *
123
+ * @return array
124
+ * @author Alberto Ruggiero
125
+ */
126
+ public function get_review_list( $order_id ) {
127
+ global $wpdb;
128
+
129
+ $items = array();
130
+
131
+ $line_items = $wpdb->get_results( $wpdb->prepare( "
132
+ SELECT a.order_item_name,
133
+ MAX(CASE WHEN b.meta_key = '_product_id' THEN b.meta_value ELSE NULL END) AS product_id
134
+ FROM {$wpdb->prefix}woocommerce_order_items a INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta b ON a.order_item_id= b.order_item_id
135
+ WHERE a.order_id = %d AND a.order_item_type = 'line_item'
136
+ GROUP BY a.order_item_name
137
+ ORDER BY a.order_item_id ASC
138
+ ", $order_id ) );
139
+
140
+
141
+ foreach ( $line_items as $item ) {
142
+ $items[$item->product_id]['name'] = $item->order_item_name;
143
+ $items[$item->product_id]['id'] = $item->product_id;
144
+ }
145
+
146
+ return $items;
147
+ }
148
+
149
+ }
150
+
151
+ /**
152
+ * Unique access to instance of YWRR_Emails class
153
+ *
154
+ * @return \YWRR_Emails
155
+ */
156
+ function YWRR_Emails() {
157
+ return YWRR_Emails::get_instance();
158
+ }
159
+
160
  }
modules/yith-woocommerce-review-reminder/includes/class-ywrr-form-handler.php CHANGED
@@ -1,115 +1,115 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YWRR_Form_Handler' ) ) {
16
-
17
- /**
18
- * Handle frontend forms
19
- *
20
- * @class YWRR_Form_Handler
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- *
25
- */
26
- class YWRR_Form_Handler {
27
-
28
- /**
29
- * Single instance of the class
30
- *
31
- * @var \YWRR_Form_Handler
32
- * @since 1.0.0
33
- */
34
- protected static $instance;
35
-
36
- /**
37
- * Returns single instance of the class
38
- *
39
- * @return \YWRR_Form_Handler
40
- * @since 1.0.0
41
- */
42
- public static function get_instance() {
43
-
44
- if ( is_null( self::$instance ) ) {
45
-
46
- self::$instance = new self( $_REQUEST );
47
-
48
- }
49
-
50
- return self::$instance;
51
- }
52
-
53
- /**
54
- * Constructor
55
- *
56
- * @since 1.0.0
57
- * @return mixed
58
- * @author Alberto Ruggiero
59
- */
60
- public function __construct() {
61
-
62
- }
63
-
64
- /**
65
- * Handles the unsubscribe form
66
- *
67
- * @since 1.0.0
68
- * @return void
69
- * @author Alberto Ruggiero
70
- */
71
- public function unsubscribe_review_request() {
72
-
73
- if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
74
- return;
75
- }
76
-
77
- if ( empty( $_POST['action'] ) || 'unsubscribe_review_request' !== $_POST['action'] || empty( $_POST['_wpnonce'] ) || !wp_verify_nonce( $_POST['_wpnonce'], 'unsubscribe_review_request' ) ) {
78
- return;
79
- }
80
-
81
- $customer_email = !empty( $_POST['account_email'] ) ? sanitize_email( $_POST['account_email'] ) : '';
82
-
83
- if ( empty( $customer_email ) || !is_email( $customer_email ) ) {
84
- wc_add_notice( __( 'Please provide a valid email address.', 'yith-woocommerce-review-reminder' ), 'error' );
85
- }
86
- elseif ( $customer_email !== urldecode( base64_decode( $_GET['email'] ) ) ) {
87
- wc_add_notice( __( 'Please retype the email address as provided.', 'yith-woocommerce-review-reminder' ), 'error' );
88
- }
89
-
90
- if ( wc_notice_count( 'error' ) === 0 ) {
91
- $wc_email = WC_Emails::instance();
92
- $email = $wc_email->emails['YWRR_Unsubscribe_Mail'];
93
-
94
- $email->trigger( $customer_email );
95
-
96
- wc_add_notice( __( 'An email has been sent with your request', 'yith-woocommerce-review-reminder' ) );
97
- wp_safe_redirect( get_permalink( get_option( 'ywrr_unsubscribe_page_id' ) ) );
98
- exit;
99
- }
100
- }
101
-
102
- }
103
-
104
- /**
105
- * Unique access to instance of YWRR_Form_Handler class
106
- *
107
- * @return \YWRR_Form_Handler
108
- */
109
- function YWRR_Form_Handler() {
110
-
111
- return YWRR_Form_Handler::get_instance();
112
-
113
- }
114
-
115
- }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YWRR_Form_Handler' ) ) {
16
+
17
+ /**
18
+ * Handle frontend forms
19
+ *
20
+ * @class YWRR_Form_Handler
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ *
25
+ */
26
+ class YWRR_Form_Handler {
27
+
28
+ /**
29
+ * Single instance of the class
30
+ *
31
+ * @var \YWRR_Form_Handler
32
+ * @since 1.0.0
33
+ */
34
+ protected static $instance;
35
+
36
+ /**
37
+ * Returns single instance of the class
38
+ *
39
+ * @return \YWRR_Form_Handler
40
+ * @since 1.0.0
41
+ */
42
+ public static function get_instance() {
43
+
44
+ if ( is_null( self::$instance ) ) {
45
+
46
+ self::$instance = new self( $_REQUEST );
47
+
48
+ }
49
+
50
+ return self::$instance;
51
+ }
52
+
53
+ /**
54
+ * Constructor
55
+ *
56
+ * @since 1.0.0
57
+ * @return mixed
58
+ * @author Alberto Ruggiero
59
+ */
60
+ public function __construct() {
61
+
62
+ }
63
+
64
+ /**
65
+ * Handles the unsubscribe form
66
+ *
67
+ * @since 1.0.0
68
+ * @return void
69
+ * @author Alberto Ruggiero
70
+ */
71
+ public function unsubscribe_review_request() {
72
+
73
+ if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) {
74
+ return;
75
+ }
76
+
77
+ if ( empty( $_POST['action'] ) || 'unsubscribe_review_request' !== $_POST['action'] || empty( $_POST['_wpnonce'] ) || !wp_verify_nonce( $_POST['_wpnonce'], 'unsubscribe_review_request' ) ) {
78
+ return;
79
+ }
80
+
81
+ $customer_email = !empty( $_POST['account_email'] ) ? sanitize_email( $_POST['account_email'] ) : '';
82
+
83
+ if ( empty( $customer_email ) || !is_email( $customer_email ) ) {
84
+ wc_add_notice( __( 'Please provide a valid email address.', 'yith-woocommerce-review-reminder' ), 'error' );
85
+ }
86
+ elseif ( $customer_email !== urldecode( base64_decode( $_GET['email'] ) ) ) {
87
+ wc_add_notice( __( 'Please retype the email address as provided.', 'yith-woocommerce-review-reminder' ), 'error' );
88
+ }
89
+
90
+ if ( wc_notice_count( 'error' ) === 0 ) {
91
+ $wc_email = WC_Emails::instance();
92
+ $email = $wc_email->emails['YWRR_Unsubscribe_Mail'];
93
+
94
+ $email->trigger( $customer_email );
95
+
96
+ wc_add_notice( __( 'An email has been sent with your request', 'yith-woocommerce-review-reminder' ) );
97
+ wp_safe_redirect( get_permalink( get_option( 'ywrr_unsubscribe_page_id' ) ) );
98
+ exit;
99
+ }
100
+ }
101
+
102
+ }
103
+
104
+ /**
105
+ * Unique access to instance of YWRR_Form_Handler class
106
+ *
107
+ * @return \YWRR_Form_Handler
108
+ */
109
+ function YWRR_Form_Handler() {
110
+
111
+ return YWRR_Form_Handler::get_instance();
112
+
113
+ }
114
+
115
+ }
modules/yith-woocommerce-review-reminder/includes/class-ywrr-schedule.php CHANGED
@@ -1,195 +1,195 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
- }
14
-
15
- if ( !class_exists( 'YWRR_Schedule' ) ) {
16
-
17
- /**
18
- * Implements scheduling functions for YWRR plugin
19
- *
20
- * @class YWRR_Schedule
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- *
25
- */
26
- class YWRR_Schedule {
27
-
28
- /**
29
- * Single instance of the class
30
- *
31
- * @var \YWRR_Schedule
32
- * @since 1.0.0
33
- */
34
- protected static $instance;
35
-
36
- /**
37
- * Returns single instance of the class
38
- *
39
- * @return \YWRR_Schedule
40
- * @since 1.0.0
41
- */
42
- public static function get_instance() {
43
-
44
- if ( is_null( self::$instance ) ) {
45
-
46
- self::$instance = new self( $_REQUEST );
47
-
48
- }
49
-
50
- return self::$instance;
51
-
52
- }
53
-
54
- /**
55
- * Constructor
56
- *
57
- * @since 1.0.0
58
- * @return mixed
59
- * @author Alberto Ruggiero
60
- */
61
- public function __construct() {
62
-
63
- }
64
-
65
- /**
66
- * Create a schedule record
67
- *
68
- * @since 1.0.0
69
- *
70
- * @param $order_id int the order id
71
- * @param $list
72
- *
73
- * @return void
74
- * @author Alberto Ruggiero
75
- */
76
- public function schedule_mail( $order_id, $list = '' ) {
77
- if ( $this->check_exists_schedule( $order_id ) == 0 ) {
78
- global $wpdb;
79
-
80
- $order = wc_get_order( $order_id );
81
- $scheduled_date = date( 'Y-m-d', strtotime( current_time( 'mysql' ) . ' + ' . get_option( 'ywrr_mail_schedule_day' ) . ' days' ) );
82
-
83
- $wpdb->insert(
84
- $wpdb->prefix . 'ywrr_email_schedule',
85
- array(
86
- 'order_id' => $order_id,
87
- 'mail_status' => 'pending',
88
- 'scheduled_date' => $scheduled_date,
89
- 'order_date' => $order->modified_date,
90
- 'request_items' => maybe_serialize( $list )
91
- ),
92
- array(
93
- '%d',
94
- '%s',
95
- '%s',
96
- '%s',
97
- '%s'
98
- )
99
- );
100
- }
101
- }
102
-
103
- /**
104
- * Checks if order has a scheduled email
105
- *
106
- * @since 1.0.0
107
- *
108
- * @param $order_id int the order id
109
- *
110
- * @return int
111
- * @author Alberto Ruggiero
112
- */
113
- public function check_exists_schedule( $order_id ) {
114
- global $wpdb;
115
-
116
- $count = $wpdb->get_var( $wpdb->prepare( "
117
- SELECT COUNT(*)
118
- FROM {$wpdb->prefix}ywrr_email_schedule
119
- WHERE order_id = %d
120
- ", $order_id ) );
121
-
122
- return $count;
123
- }
124
-
125
- /**
126
- * Changes email schedule status
127
- *
128
- * @since 1.0.0
129
- *
130
- * @param $order_id int the order id
131
- * @param $status string the status of scheduling
132
- *
133
- * @return void
134
- * @author Alberto Ruggiero
135
- */
136
- public function change_schedule_status( $order_id, $status = 'cancelled' ) {
137
- global $wpdb;
138
-
139
- $wpdb->update(
140
- $wpdb->prefix . 'ywrr_email_schedule',
141
- array(
142
- 'mail_status' => $status,
143
- 'request_items' => ''
144
- ),
145
- array( 'order_id' => $order_id ),
146
- array(
147
- '%s'
148
- ),
149
- array( '%d' )
150
- );
151
- }
152
-
153
- /**
154
- * Handles the daily mail sending
155
- *
156
- * @since 1.0.0
157
- * @return void
158
- * @author Alberto Ruggiero
159
- */
160
- public function daily_schedule() {
161
- global $wpdb;
162
-
163
- $orders = $wpdb->get_results( $wpdb->prepare( "
164
- SELECT order_id,
165
- order_date,
166
- request_items
167
- FROM {$wpdb->prefix}ywrr_email_schedule
168
- WHERE mail_status = 'pending' AND scheduled_date <= %s
169
- ", current_time( 'mysql' ) ) );
170
-
171
- foreach ( $orders as $item ) {
172
- $list = maybe_unserialize( $item->request_items );
173
-
174
- $today = new DateTime( current_time( 'mysql' ) );
175
- $pay_date = new DateTime( $item->order_date );
176
- $days = $pay_date->diff( $today );
177
-
178
- YWRR_Emails()->send_email( $item->order_id, $days->days, array(), $list );
179
- $this->change_schedule_status( $item->order_id, 'sent' );
180
- }
181
-
182
- }
183
-
184
- }
185
-
186
- /**
187
- * Unique access to instance of YWRR_Schedule class
188
- *
189
- * @return \YWRR_Schedule
190
- */
191
- function YWRR_Schedule() {
192
- return YWRR_Schedule::get_instance();
193
- }
194
-
195
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly
13
+ }
14
+
15
+ if ( !class_exists( 'YWRR_Schedule' ) ) {
16
+
17
+ /**
18
+ * Implements scheduling functions for YWRR plugin
19
+ *
20
+ * @class YWRR_Schedule
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ *
25
+ */
26
+ class YWRR_Schedule {
27
+
28
+ /**
29
+ * Single instance of the class
30
+ *
31
+ * @var \YWRR_Schedule
32
+ * @since 1.0.0
33
+ */
34
+ protected static $instance;
35
+
36
+ /**
37
+ * Returns single instance of the class
38
+ *
39
+ * @return \YWRR_Schedule
40
+ * @since 1.0.0
41
+ */
42
+ public static function get_instance() {
43
+
44
+ if ( is_null( self::$instance ) ) {
45
+
46
+ self::$instance = new self( $_REQUEST );
47
+
48
+ }
49
+
50
+ return self::$instance;
51
+
52
+ }
53
+
54
+ /**
55
+ * Constructor
56
+ *
57
+ * @since 1.0.0
58
+ * @return mixed
59
+ * @author Alberto Ruggiero
60
+ */
61
+ public function __construct() {
62
+
63
+ }
64
+
65
+ /**
66
+ * Create a schedule record
67
+ *
68
+ * @since 1.0.0
69
+ *
70
+ * @param $order_id int the order id
71
+ * @param $list
72
+ *
73
+ * @return void
74
+ * @author Alberto Ruggiero
75
+ */
76
+ public function schedule_mail( $order_id, $list = '' ) {
77
+ if ( $this->check_exists_schedule( $order_id ) == 0 ) {
78
+ global $wpdb;
79
+
80
+ $order = wc_get_order( $order_id );
81
+ $scheduled_date = date( 'Y-m-d', strtotime( current_time( 'mysql' ) . ' + ' . get_option( 'ywrr_mail_schedule_day' ) . ' days' ) );
82
+
83
+ $wpdb->insert(
84
+ $wpdb->prefix . 'ywrr_email_schedule',
85
+ array(
86
+ 'order_id' => $order_id,
87
+ 'mail_status' => 'pending',
88
+ 'scheduled_date' => $scheduled_date,
89
+ 'order_date' => $order->modified_date,
90
+ 'request_items' => maybe_serialize( $list )
91
+ ),
92
+ array(
93
+ '%d',
94
+ '%s',
95
+ '%s',
96
+ '%s',
97
+ '%s'
98
+ )
99
+ );
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Checks if order has a scheduled email
105
+ *
106
+ * @since 1.0.0
107
+ *
108
+ * @param $order_id int the order id
109
+ *
110
+ * @return int
111
+ * @author Alberto Ruggiero
112
+ */
113
+ public function check_exists_schedule( $order_id ) {
114
+ global $wpdb;
115
+
116
+ $count = $wpdb->get_var( $wpdb->prepare( "
117
+ SELECT COUNT(*)
118
+ FROM {$wpdb->prefix}ywrr_email_schedule
119
+ WHERE order_id = %d
120
+ ", $order_id ) );
121
+
122
+ return $count;
123
+ }
124
+
125
+ /**
126
+ * Changes email schedule status
127
+ *
128
+ * @since 1.0.0
129
+ *
130
+ * @param $order_id int the order id
131
+ * @param $status string the status of scheduling
132
+ *
133
+ * @return void
134
+ * @author Alberto Ruggiero
135
+ */
136
+ public function change_schedule_status( $order_id, $status = 'cancelled' ) {
137
+ global $wpdb;
138
+
139
+ $wpdb->update(
140
+ $wpdb->prefix . 'ywrr_email_schedule',
141
+ array(
142
+ 'mail_status' => $status,
143
+ 'request_items' => ''
144
+ ),
145
+ array( 'order_id' => $order_id ),
146
+ array(
147
+ '%s'
148
+ ),
149
+ array( '%d' )
150
+ );
151
+ }
152
+
153
+ /**
154
+ * Handles the daily mail sending
155
+ *
156
+ * @since 1.0.0
157
+ * @return void
158
+ * @author Alberto Ruggiero
159
+ */
160
+ public function daily_schedule() {
161
+ global $wpdb;
162
+
163
+ $orders = $wpdb->get_results( $wpdb->prepare( "
164
+ SELECT order_id,
165
+ order_date,
166
+ request_items
167
+ FROM {$wpdb->prefix}ywrr_email_schedule
168
+ WHERE mail_status = 'pending' AND scheduled_date <= %s
169
+ ", current_time( 'mysql' ) ) );
170
+
171
+ foreach ( $orders as $item ) {
172
+ $list = maybe_unserialize( $item->request_items );
173
+
174
+ $today = new DateTime( current_time( 'mysql' ) );
175
+ $pay_date = new DateTime( $item->order_date );
176
+ $days = $pay_date->diff( $today );
177
+
178
+ YWRR_Emails()->send_email( $item->order_id, $days->days, array(), $list );
179
+ $this->change_schedule_status( $item->order_id, 'sent' );
180
+ }
181
+
182
+ }
183
+
184
+ }
185
+
186
+ /**
187
+ * Unique access to instance of YWRR_Schedule class
188
+ *
189
+ * @return \YWRR_Schedule
190
+ */
191
+ function YWRR_Schedule() {
192
+ return YWRR_Schedule::get_instance();
193
+ }
194
+
195
  }
modules/yith-woocommerce-review-reminder/includes/emails/class-ywrr-request-email.php CHANGED
@@ -1,236 +1,236 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YWRR_Request_Mail' ) ) {
16
-
17
- /**
18
- * Implements Request Mail for YWRR plugin
19
- *
20
- * @class YWRR_Request_Mail
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- * @extends WC_Email
25
- *
26
- */
27
- class YWRR_Request_Mail extends WC_Email {
28
-
29
- /**
30
- * @var int $days_ago number of days after order completion
31
- */
32
- var $days_ago;
33
-
34
- /**
35
- * @var array $item_list list of item to review
36
- */
37
- var $item_list;
38
-
39
- /**
40
- * @var string $review_list processed list of items in HTML or Plain mode
41
- */
42
- var $review_list;
43
-
44
- /**
45
- * @var int $template the template of the email
46
- */
47
- var $template_type;
48
-
49
- /**
50
- * Constructor
51
- *
52
- * Initialize email type and set templates paths
53
- *
54
- * @since 1.0.0
55
- * @author Alberto Ruggiero
56
- */
57
- public function __construct() {
58
-
59
- $this->title = __( 'Review reminder', 'yith-woocommerce-review-reminder' );
60
- $this->template_html = 'emails/review-request.php';
61
- $this->template_plain = 'emails/plain/review-request.php';
62
-
63
- parent::__construct();
64
- }
65
-
66
- /**
67
- * Trigger email send
68
- *
69
- * @since 1.0.0
70
- *
71
- * @param $order_id int the order id
72
- * @param $item_list array the list of items to review
73
- * @param $days_ago int number of days after order completion
74
- * @param $test_email
75
- *
76
- * @return void
77
- * @author Alberto Ruggiero
78
- */
79
- public function trigger( $order_id, $item_list, $days_ago, $test_email = '', $template = false ) {
80
-
81
- $this->email_type = get_option( 'ywrr_mail_type' );
82
- $this->heading = get_option( 'ywrr_mail_subject' );
83
- $this->subject = get_option( 'ywrr_mail_subject' );
84
- $this->days_ago = $days_ago;
85
- $this->item_list = $item_list;
86
- $this->template_type = $template;
87
-
88
- $this->find['site-title'] = '{site_title}';
89
- $this->replace['site-title'] = $this->get_blogname();
90
-
91
- if ( $order_id ) {
92
-
93
- $this->object = wc_get_order( $order_id );
94
- $this->recipient = $this->object->billing_email;
95
-
96
- }
97
- else {
98
-
99
- $this->object = 0;
100
- $this->recipient = $test_email;
101
-
102
- }
103
-
104
- if ( !$this->get_recipient() ) {
105
- return;
106
- }
107
-
108
- $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), "" );
109
- }
110
-
111
- /**
112
- * Send the email.
113
- *
114
- * @since 1.0.3
115
- *
116
- * @param string $to
117
- * @param string $subject
118
- * @param string $message
119
- * @param string $headers
120
- * @param string $attachments
121
- *
122
- * @return bool
123
- * @author Alberto Ruggiero
124
- */
125
- public function send( $to, $subject, $message, $headers, $attachments ) {
126
-
127
- add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
128
- add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
129
- add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
130
-
131
- $message = apply_filters( 'woocommerce_mail_content', $this->style_inline( $message ) );
132
-
133
- if ( defined( 'YWRR_PREMIUM' ) && get_option( 'ywrr_mandrill_enable' ) == 'yes' ) {
134
-
135
- $return = YWRR_Mandrill_Premium()->send( $to, $subject, $message, $headers, $attachments );
136
-
137
- }
138
- else {
139
-
140
- $return = wp_mail( $to, $subject, $message, $headers, $attachments );
141
-
142
- }
143
-
144
- remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
145
- remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
146
- remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
147
-
148
- return $return;
149
-
150
- }
151
-
152
- /**
153
- * Get HTML content
154
- *
155
- * @since 1.0.0
156
- * @return string
157
- * @author Alberto Ruggiero
158
- */
159
- function get_content_html() {
160
- ob_start();
161
- wc_get_template( $this->template_html, array(
162
- 'order' => $this->object,
163
- 'email_heading' => $this->get_heading(),
164
- 'days_ago' => $this->days_ago,
165
- 'item_list' => $this->item_list,
166
- 'review_list' => $this->review_list,
167
- 'template' => $this->template_type,
168
- 'sent_to_admin' => false,
169
- 'plain_text' => false
170
- ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
171
- return ob_get_clean();
172
- }
173
-
174
- /**
175
- * Get Plain content
176
- *
177
- * @since 1.0.0
178
- * @return string
179
- * @author Alberto Ruggiero
180
- */
181
- function get_content_plain() {
182
- ob_start();
183
- wc_get_template( $this->template_plain, array(
184
- 'order' => $this->object,
185
- 'email_heading' => $this->get_heading(),
186
- 'days_ago' => $this->days_ago,
187
- 'item_list' => $this->item_list,
188
- 'review_list' => $this->review_list,
189
- 'sent_to_admin' => false,
190
- 'plain_text' => true
191
- ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
192
- return ob_get_clean();
193
- }
194
-
195
- /**
196
- * Admin Panel Options Processing - Saves the options to the DB
197
- *
198
- * @since 1.0.0
199
- * @return boolean|null
200
- * @author Alberto Ruggiero
201
- */
202
- function process_admin_options() {
203
- woocommerce_update_options( $this->form_fields['mail'] );
204
- }
205
-
206
- /**
207
- * Setup email settings screen.
208
- *
209
- * @since 1.0.0
210
- * @return string
211
- * @author Alberto Ruggiero
212
- */
213
- public function admin_options() {
214
- ?>
215
- <table class="form-table">
216
- <?php woocommerce_admin_fields( $this->form_fields['mail'] ); ?>
217
- </table>
218
- <?php
219
-
220
- }
221
-
222
- /**
223
- * Initialise Settings Form Fields
224
- *
225
- * @since 1.0.0
226
- * @return void
227
- * @author Alberto Ruggiero
228
- */
229
- function init_form_fields() {
230
- $this->form_fields = include( YWRR_DIR . '/plugin-options/mail-options.php' );
231
- }
232
- }
233
-
234
- }
235
-
236
  return new YWRR_Request_Mail();
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YWRR_Request_Mail' ) ) {
16
+
17
+ /**
18
+ * Implements Request Mail for YWRR plugin
19
+ *
20
+ * @class YWRR_Request_Mail
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ * @extends WC_Email
25
+ *
26
+ */
27
+ class YWRR_Request_Mail extends WC_Email {
28
+
29
+ /**
30
+ * @var int $days_ago number of days after order completion
31
+ */
32
+ var $days_ago;
33
+
34
+ /**
35
+ * @var array $item_list list of item to review
36
+ */
37
+ var $item_list;
38
+
39
+ /**
40
+ * @var string $review_list processed list of items in HTML or Plain mode
41
+ */
42
+ var $review_list;
43
+
44
+ /**
45
+ * @var int $template the template of the email
46
+ */
47
+ var $template_type;
48
+
49
+ /**
50
+ * Constructor
51
+ *
52
+ * Initialize email type and set templates paths
53
+ *
54
+ * @since 1.0.0
55
+ * @author Alberto Ruggiero
56
+ */
57
+ public function __construct() {
58
+
59
+ $this->title = __( 'Review reminder', 'yith-woocommerce-review-reminder' );
60
+ $this->template_html = 'emails/review-request.php';
61
+ $this->template_plain = 'emails/plain/review-request.php';
62
+
63
+ parent::__construct();
64
+ }
65
+
66
+ /**
67
+ * Trigger email send
68
+ *
69
+ * @since 1.0.0
70
+ *
71
+ * @param $order_id int the order id
72
+ * @param $item_list array the list of items to review
73
+ * @param $days_ago int number of days after order completion
74
+ * @param $test_email
75
+ *
76
+ * @return void
77
+ * @author Alberto Ruggiero
78
+ */
79
+ public function trigger( $order_id, $item_list, $days_ago, $test_email = '', $template = false ) {
80
+
81
+ $this->email_type = get_option( 'ywrr_mail_type' );
82
+ $this->heading = get_option( 'ywrr_mail_subject' );
83
+ $this->subject = get_option( 'ywrr_mail_subject' );
84
+ $this->days_ago = $days_ago;
85
+ $this->item_list = $item_list;
86
+ $this->template_type = $template;
87
+
88
+ $this->find['site-title'] = '{site_title}';
89
+ $this->replace['site-title'] = $this->get_blogname();
90
+
91
+ if ( $order_id ) {
92
+
93
+ $this->object = wc_get_order( $order_id );
94
+ $this->recipient = $this->object->billing_email;
95
+
96
+ }
97
+ else {
98
+
99
+ $this->object = 0;
100
+ $this->recipient = $test_email;
101
+
102
+ }
103
+
104
+ if ( !$this->get_recipient() ) {
105
+ return;
106
+ }
107
+
108
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), "" );
109
+ }
110
+
111
+ /**
112
+ * Send the email.
113
+ *
114
+ * @since 1.0.3
115
+ *
116
+ * @param string $to
117
+ * @param string $subject
118
+ * @param string $message
119
+ * @param string $headers
120
+ * @param string $attachments
121
+ *
122
+ * @return bool
123
+ * @author Alberto Ruggiero
124
+ */
125
+ public function send( $to, $subject, $message, $headers, $attachments ) {
126
+
127
+ add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
128
+ add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
129
+ add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
130
+
131
+ $message = apply_filters( 'woocommerce_mail_content', $this->style_inline( $message ) );
132
+
133
+ if ( defined( 'YWRR_PREMIUM' ) && get_option( 'ywrr_mandrill_enable' ) == 'yes' ) {
134
+
135
+ $return = YWRR_Mandrill_Premium()->send( $to, $subject, $message, $headers, $attachments );
136
+
137
+ }
138
+ else {
139
+
140
+ $return = wp_mail( $to, $subject, $message, $headers, $attachments );
141
+
142
+ }
143
+
144
+ remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
145
+ remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
146
+ remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
147
+
148
+ return $return;
149
+
150
+ }
151
+
152
+ /**
153
+ * Get HTML content
154
+ *
155
+ * @since 1.0.0
156
+ * @return string
157
+ * @author Alberto Ruggiero
158
+ */
159
+ function get_content_html() {
160
+ ob_start();
161
+ wc_get_template( $this->template_html, array(
162
+ 'order' => $this->object,
163
+ 'email_heading' => $this->get_heading(),
164
+ 'days_ago' => $this->days_ago,
165
+ 'item_list' => $this->item_list,
166
+ 'review_list' => $this->review_list,
167
+ 'template' => $this->template_type,
168
+ 'sent_to_admin' => false,
169
+ 'plain_text' => false
170
+ ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
171
+ return ob_get_clean();
172
+ }
173
+
174
+ /**
175
+ * Get Plain content
176
+ *
177
+ * @since 1.0.0
178
+ * @return string
179
+ * @author Alberto Ruggiero
180
+ */
181
+ function get_content_plain() {
182
+ ob_start();
183
+ wc_get_template( $this->template_plain, array(
184
+ 'order' => $this->object,
185
+ 'email_heading' => $this->get_heading(),
186
+ 'days_ago' => $this->days_ago,
187
+ 'item_list' => $this->item_list,
188
+ 'review_list' => $this->review_list,
189
+ 'sent_to_admin' => false,
190
+ 'plain_text' => true
191
+ ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
192
+ return ob_get_clean();
193
+ }
194
+
195
+ /**
196
+ * Admin Panel Options Processing - Saves the options to the DB
197
+ *
198
+ * @since 1.0.0
199
+ * @return boolean|null
200
+ * @author Alberto Ruggiero
201
+ */
202
+ function process_admin_options() {
203
+ woocommerce_update_options( $this->form_fields['mail'] );
204
+ }
205
+
206
+ /**
207
+ * Setup email settings screen.
208
+ *
209
+ * @since 1.0.0
210
+ * @return string
211
+ * @author Alberto Ruggiero
212
+ */
213
+ public function admin_options() {
214
+ ?>
215
+ <table class="form-table">
216
+ <?php woocommerce_admin_fields( $this->form_fields['mail'] ); ?>
217
+ </table>
218
+ <?php
219
+
220
+ }
221
+
222
+ /**
223
+ * Initialise Settings Form Fields
224
+ *
225
+ * @since 1.0.0
226
+ * @return void
227
+ * @author Alberto Ruggiero
228
+ */
229
+ function init_form_fields() {
230
+ $this->form_fields = include( YWRR_DIR . '/plugin-options/mail-options.php' );
231
+ }
232
+ }
233
+
234
+ }
235
+
236
  return new YWRR_Request_Mail();
modules/yith-woocommerce-review-reminder/includes/emails/class-ywrr-unsubscribe-email.php CHANGED
@@ -1,128 +1,128 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- if ( !class_exists( 'YWRR_Unsubscribe_Mail' ) ) {
16
-
17
- /**
18
- * Implements Unsubscribe Mail for YWRR plugin
19
- *
20
- * @class YWRR_Unsubscribe_Mail
21
- * @package Yithemes
22
- * @since 1.0.0
23
- * @author Your Inspiration Themes
24
- * @extends WC_Email
25
- *
26
- */
27
- class YWRR_Unsubscribe_Mail extends WC_Email {
28
-
29
- /**
30
- * @var string $customer_mail email of the customer that wants to unsubscribe
31
- */
32
- var $customer_mail;
33
-
34
- /**
35
- * Constructor
36
- *
37
- * Initialize email type and set templates paths
38
- *
39
- * @since 1.0.0
40
- * @author Alberto Ruggiero
41
- */
42
- public function __construct() {
43
-
44
- $this->template_html = 'emails/unsubscribe-request.php';
45
- $this->template_plain = 'emails/plain/unsubscribe-request.php';
46
-
47
- parent::__construct();
48
-
49
- // Other settings
50
- $this->recipient = $this->get_option( 'recipient' );
51
-
52
- if ( !$this->recipient ) {
53
- $this->recipient = get_option( 'admin_email' );
54
- }
55
-
56
- }
57
-
58
- /**
59
- * Trigger email send
60
- *
61
- * @since 1.0.0
62
- *
63
- * @param $customer_mail string email of the customer that wants to unsubscribe
64
- *
65
- * @return void
66
- * @author Alberto Ruggiero
67
- */
68
- public function trigger( $customer_mail ) {
69
-
70
- if ( $customer_mail ) {
71
- $this->email_type = get_option( 'ywrr_mail_type' );
72
- $this->heading = __( 'Unsubscribe Request', 'yith-woocommerce-review-reminder' );
73
- $this->subject = __( 'Unsubscribe Request', 'yith-woocommerce-review-reminder' );
74
-
75
- $this->customer_mail = $customer_mail;
76
-
77
- $this->find['site-title'] = '{site_title}';
78
- $this->replace['site-title'] = $this->get_blogname();
79
- }
80
-
81
- if ( !$this->get_recipient() ) {
82
- return;
83
- }
84
-
85
- $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), "" );
86
- }
87
-
88
- /**
89
- * Get HTML content
90
- *
91
- * @since 1.0.0
92
- * @return string
93
- * @author Alberto Ruggiero
94
- */
95
- function get_content_html() {
96
- ob_start();
97
- wc_get_template( $this->template_html, array(
98
- 'email_heading' => $this->get_heading(),
99
- 'customer_mail' => $this->customer_mail,
100
- 'sent_to_admin' => true,
101
- 'plain_text' => false
102
- ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
103
- return ob_get_clean();
104
- }
105
-
106
- /**
107
- * Get Plain content
108
- *
109
- * @since 1.0.0
110
- * @return string
111
- * @author Alberto Ruggiero
112
- */
113
- function get_content_plain() {
114
- ob_start();
115
- wc_get_template( $this->template_plain, array(
116
- 'email_heading' => $this->get_heading(),
117
- 'customer_mail' => $this->customer_mail,
118
- 'sent_to_admin' => true,
119
- 'plain_text' => true
120
- ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
121
- return ob_get_clean();
122
- }
123
-
124
- }
125
-
126
- }
127
-
128
  return new YWRR_Unsubscribe_Mail();
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ if ( !class_exists( 'YWRR_Unsubscribe_Mail' ) ) {
16
+
17
+ /**
18
+ * Implements Unsubscribe Mail for YWRR plugin
19
+ *
20
+ * @class YWRR_Unsubscribe_Mail
21
+ * @package Yithemes
22
+ * @since 1.0.0
23
+ * @author Your Inspiration Themes
24
+ * @extends WC_Email
25
+ *
26
+ */
27
+ class YWRR_Unsubscribe_Mail extends WC_Email {
28
+
29
+ /**
30
+ * @var string $customer_mail email of the customer that wants to unsubscribe
31
+ */
32
+ var $customer_mail;
33
+
34
+ /**
35
+ * Constructor
36
+ *
37
+ * Initialize email type and set templates paths
38
+ *
39
+ * @since 1.0.0
40
+ * @author Alberto Ruggiero
41
+ */
42
+ public function __construct() {
43
+
44
+ $this->template_html = 'emails/unsubscribe-request.php';
45
+ $this->template_plain = 'emails/plain/unsubscribe-request.php';
46
+
47
+ parent::__construct();
48
+
49
+ // Other settings
50
+ $this->recipient = $this->get_option( 'recipient' );
51
+
52
+ if ( !$this->recipient ) {
53
+ $this->recipient = get_option( 'admin_email' );
54
+ }
55
+
56
+ }
57
+
58
+ /**
59
+ * Trigger email send
60
+ *
61
+ * @since 1.0.0
62
+ *
63
+ * @param $customer_mail string email of the customer that wants to unsubscribe
64
+ *
65
+ * @return void
66
+ * @author Alberto Ruggiero
67
+ */
68
+ public function trigger( $customer_mail ) {
69
+
70
+ if ( $customer_mail ) {
71
+ $this->email_type = get_option( 'ywrr_mail_type' );
72
+ $this->heading = __( 'Unsubscribe Request', 'yith-woocommerce-review-reminder' );
73
+ $this->subject = __( 'Unsubscribe Request', 'yith-woocommerce-review-reminder' );
74
+
75
+ $this->customer_mail = $customer_mail;
76
+
77
+ $this->find['site-title'] = '{site_title}';
78
+ $this->replace['site-title'] = $this->get_blogname();
79
+ }
80
+
81
+ if ( !$this->get_recipient() ) {
82
+ return;
83
+ }
84
+
85
+ $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), "" );
86
+ }
87
+
88
+ /**
89
+ * Get HTML content
90
+ *
91
+ * @since 1.0.0
92
+ * @return string
93
+ * @author Alberto Ruggiero
94
+ */
95
+ function get_content_html() {
96
+ ob_start();
97
+ wc_get_template( $this->template_html, array(
98
+ 'email_heading' => $this->get_heading(),
99
+ 'customer_mail' => $this->customer_mail,
100
+ 'sent_to_admin' => true,
101
+ 'plain_text' => false
102
+ ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
103
+ return ob_get_clean();
104
+ }
105
+
106
+ /**
107
+ * Get Plain content
108
+ *
109
+ * @since 1.0.0
110
+ * @return string
111
+ * @author Alberto Ruggiero
112
+ */
113
+ function get_content_plain() {
114
+ ob_start();
115
+ wc_get_template( $this->template_plain, array(
116
+ 'email_heading' => $this->get_heading(),
117
+ 'customer_mail' => $this->customer_mail,
118
+ 'sent_to_admin' => true,
119
+ 'plain_text' => true
120
+ ), YWRR_TEMPLATE_PATH, YWRR_TEMPLATE_PATH );
121
+ return ob_get_clean();
122
+ }
123
+
124
+ }
125
+
126
+ }
127
+
128
  return new YWRR_Unsubscribe_Mail();
modules/yith-woocommerce-review-reminder/init.php CHANGED
@@ -1,183 +1,183 @@
1
- <?php
2
- /*
3
- Plugin Name: YITH WooCommerce Review Reminder
4
- Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder
5
- Description: Send a review reminder to the customers over WooCommerce.
6
- Author: Yithemes
7
- Text Domain: yith-woocommerce-review-reminder
8
- Version: 1.1.1
9
- Author URI: http://yithemes.com/
10
- */
11
-
12
- if ( !defined( 'ABSPATH' ) ) {
13
- exit;
14
- } // Exit if accessed directly
15
-
16
- if ( !function_exists( 'is_plugin_active' ) ) {
17
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18
- }
19
-
20
- function ywrr_install_woocommerce_admin_notice() {
21
- ?>
22
- <div class="error">
23
- <p><?php _e( 'YITH WooCommerce Review Reminder is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-review-reminder' ); ?></p>
24
- </div>
25
- <?php
26
- }
27
-
28
- function ywrr_install_free_admin_notice() {
29
- ?>
30
- <div class="error">
31
- <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Review Reminder while you are using the premium one.', 'yith-woocommerce-review-reminder' ); ?></p>
32
- </div>
33
- <?php
34
- }
35
-
36
- if ( !defined( 'YWRR_VERSION' ) ) {
37
- define( 'YWRR_VERSION', '1.1.1' );
38
- }
39
-
40
- if ( !defined( 'YWRR_FREE_INIT' ) ) {
41
- define( 'YWRR_FREE_INIT', plugin_basename( __FILE__ ) );
42
- }
43
-
44
- if ( !defined( 'YWRR_FILE' ) ) {
45
- define( 'YWRR_FILE', __FILE__ );
46
- }
47
-
48
- if ( !defined( 'YWRR_DIR' ) ) {
49
- define( 'YWRR_DIR', plugin_dir_path( __FILE__ ) );
50
- }
51
-
52
- if ( !defined( 'YWRR_URL' ) ) {
53
- define( 'YWRR_URL', plugins_url( '/', __FILE__ ) );
54
- }
55
-
56
- if ( !defined( 'YWRR_ASSETS_URL' ) ) {
57
- define( 'YWRR_ASSETS_URL', YWRR_URL . 'assets/' );
58
- }
59
-
60
- if ( !defined( 'YWRR_TEMPLATE_PATH' ) ) {
61
- define( 'YWRR_TEMPLATE_PATH', YWRR_DIR . 'templates/' );
62
- }
63
-
64
- function ywrr_init() {
65
-
66
- /* Load YWRR text domain */
67
- load_plugin_textdomain( 'yith-woocommerce-review-reminder', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
-
69
- global $YWRR_Review_Reminder;
70
- $YWRR_Review_Reminder = new YWRR_Review_Reminder();
71
- }
72
-
73
- add_action( 'ywrr_init', 'ywrr_init' );
74
-
75
- function ywrr_install() {
76
-
77
- require_once( YWRR_DIR . 'class.yith-woocommerce-review-reminder.php' );
78
-
79
- if ( !function_exists( 'WC' ) ) {
80
- add_action( 'admin_notices', 'ywrr_install_woocommerce_admin_notice' );
81
- }
82
- elseif ( defined( 'YWRR_PREMIUM' ) ) {
83
- add_action( 'admin_notices', 'ywrr_install_free_admin_notice' );
84
- deactivate_plugins( plugin_basename( __FILE__ ) );
85
- }
86
- else {
87
- do_action( 'ywrr_init' );
88
- }
89
- }
90
-
91
- add_action( 'plugins_loaded', 'ywrr_install', 11 );
92
-
93
- /**
94
- * Init default plugin settings
95
- */
96
- if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
97
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
98
- }
99
-
100
-
101
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
102
- register_activation_hook( __FILE__, 'ywrr_create_tables' );
103
- register_activation_hook( __FILE__, 'ywrr_create_schedule_job' );
104
- register_deactivation_hook( __FILE__, 'ywrr_create_unschedule_job' );
105
-
106
- if ( !function_exists( 'ywrr_create_tables' ) ) {
107
-
108
- /**
109
- * Creates database table for blocklist e scheduling
110
- *
111
- * @since 1.0.0
112
- * @return void
113
- * @author Alberto Ruggiero
114
- */
115
- function ywrr_create_tables() {
116
- global $wpdb;
117
-
118
- $wpdb->hide_errors();
119
-
120
- $collate = '';
121
-
122
- if ( $wpdb->has_cap( 'collation' ) ) {
123
- if ( !empty( $wpdb->charset ) ) {
124
- $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
125
- }
126
- if ( !empty( $wpdb->collate ) ) {
127
- $collate .= " COLLATE $wpdb->collate";
128
- }
129
- }
130
-
131
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
132
-
133
- $ywrr_tables = "
134
- CREATE TABLE {$wpdb->prefix}ywrr_email_blocklist (
135
- id int NOT NULL AUTO_INCREMENT,
136
- customer_email longtext NOT NULL,
137
- customer_id bigint(20) NOT NULL DEFAULT 0,
138
- PRIMARY KEY (id)
139
- ) $collate;
140
- CREATE TABLE {$wpdb->prefix}ywrr_email_schedule (
141
- id int NOT NULL AUTO_INCREMENT,
142
- order_id bigint(20) NOT NULL,
143
- order_date date NOT NULL DEFAULT '0000-00-00',
144
- scheduled_date date NOT NULL DEFAULT '0000-00-00',
145
- request_items longtext NOT NULL DEFAULT '',
146
- mail_status varchar(15) NOT NULL DEFAULT 'pending',
147
- PRIMARY KEY (id)
148
- ) $collate;
149
- ";
150
-
151
- dbDelta( $ywrr_tables );
152
- }
153
- }
154
-
155
- if ( !function_exists( 'ywrr_create_schedule_job' ) ) {
156
-
157
- /**
158
- * Creates a cron job to handle daily mail send
159
- *
160
- * @since 1.0.0
161
- * @return void
162
- * @author Alberto Ruggiero
163
- */
164
- function ywrr_create_schedule_job() {
165
- wp_schedule_event( time(), 'daily', 'ywrr_daily_send_mail_job' );
166
- }
167
-
168
- }
169
-
170
- if ( !function_exists( 'ywrr_create_unschedule_job' ) ) {
171
-
172
- /**
173
- * Removes cron job
174
- *
175
- * @since 1.0.0
176
- * @return void
177
- * @author Alberto Ruggiero
178
- */
179
- function ywrr_create_unschedule_job() {
180
- wp_clear_scheduled_hook( 'ywrr_daily_send_mail_job' );
181
- }
182
-
183
  }
1
+ <?php
2
+ /*
3
+ Plugin Name: YITH WooCommerce Review Reminder
4
+ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder
5
+ Description: Send a review reminder to the customers over WooCommerce.
6
+ Author: Yithemes
7
+ Text Domain: yith-woocommerce-review-reminder
8
+ Version: 1.1.2
9
+ Author URI: http://yithemes.com/
10
+ */
11
+
12
+ if ( !defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ } // Exit if accessed directly
15
+
16
+ if ( !function_exists( 'is_plugin_active' ) ) {
17
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
18
+ }
19
+
20
+ function ywrr_install_woocommerce_admin_notice() {
21
+ ?>
22
+ <div class="error">
23
+ <p><?php _e( 'YITH WooCommerce Review Reminder is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-review-reminder' ); ?></p>
24
+ </div>
25
+ <?php
26
+ }
27
+
28
+ function ywrr_install_free_admin_notice() {
29
+ ?>
30
+ <div class="error">
31
+ <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Review Reminder while you are using the premium one.', 'yith-woocommerce-review-reminder' ); ?></p>
32
+ </div>
33
+ <?php
34
+ }
35
+
36
+ if ( !defined( 'YWRR_VERSION' ) ) {
37
+ define( 'YWRR_VERSION', '1.1.2' );
38
+ }
39
+
40
+ if ( !defined( 'YWRR_FREE_INIT' ) ) {
41
+ define( 'YWRR_FREE_INIT', plugin_basename( __FILE__ ) );
42
+ }
43
+
44
+ if ( !defined( 'YWRR_FILE' ) ) {
45
+ define( 'YWRR_FILE', __FILE__ );
46
+ }
47
+
48
+ if ( !defined( 'YWRR_DIR' ) ) {
49
+ define( 'YWRR_DIR', plugin_dir_path( __FILE__ ) );
50
+ }
51
+
52
+ if ( !defined( 'YWRR_URL' ) ) {
53
+ define( 'YWRR_URL', plugins_url( '/', __FILE__ ) );
54
+ }
55
+
56
+ if ( !defined( 'YWRR_ASSETS_URL' ) ) {
57
+ define( 'YWRR_ASSETS_URL', YWRR_URL . 'assets/' );
58
+ }
59
+
60
+ if ( !defined( 'YWRR_TEMPLATE_PATH' ) ) {
61
+ define( 'YWRR_TEMPLATE_PATH', YWRR_DIR . 'templates/' );
62
+ }
63
+
64
+ function ywrr_init() {
65
+
66
+ /* Load YWRR text domain */
67
+ load_plugin_textdomain( 'yith-woocommerce-review-reminder', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
+
69
+ global $YWRR_Review_Reminder;
70
+ $YWRR_Review_Reminder = new YWRR_Review_Reminder();
71
+ }
72
+
73
+ add_action( 'ywrr_init', 'ywrr_init' );
74
+
75
+ function ywrr_install() {
76
+
77
+ require_once( YWRR_DIR . 'class.yith-woocommerce-review-reminder.php' );
78
+
79
+ if ( !function_exists( 'WC' ) ) {
80
+ add_action( 'admin_notices', 'ywrr_install_woocommerce_admin_notice' );
81
+ }
82
+ elseif ( defined( 'YWRR_PREMIUM' ) ) {
83
+ add_action( 'admin_notices', 'ywrr_install_free_admin_notice' );
84
+ deactivate_plugins( plugin_basename( __FILE__ ) );
85
+ }
86
+ else {
87
+ do_action( 'ywrr_init' );
88
+ }
89
+ }
90
+
91
+ add_action( 'plugins_loaded', 'ywrr_install', 11 );
92
+
93
+ /**
94
+ * Init default plugin settings
95
+ */
96
+ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
97
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
98
+ }
99
+
100
+
101
+ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
102
+ register_activation_hook( __FILE__, 'ywrr_create_tables' );
103
+ register_activation_hook( __FILE__, 'ywrr_create_schedule_job' );
104
+ register_deactivation_hook( __FILE__, 'ywrr_create_unschedule_job' );
105
+
106
+ if ( !function_exists( 'ywrr_create_tables' ) ) {
107
+
108
+ /**
109
+ * Creates database table for blocklist e scheduling
110
+ *
111
+ * @since 1.0.0
112
+ * @return void
113
+ * @author Alberto Ruggiero
114
+ */
115
+ function ywrr_create_tables() {
116
+ global $wpdb;
117
+
118
+ $wpdb->hide_errors();
119
+
120
+ $collate = '';
121
+
122
+ if ( $wpdb->has_cap( 'collation' ) ) {
123
+ if ( !empty( $wpdb->charset ) ) {
124
+ $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
125
+ }
126
+ if ( !empty( $wpdb->collate ) ) {
127
+ $collate .= " COLLATE $wpdb->collate";
128
+ }
129
+ }
130
+
131
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
132
+
133
+ $ywrr_tables = "
134
+ CREATE TABLE {$wpdb->prefix}ywrr_email_blocklist (
135
+ id int NOT NULL AUTO_INCREMENT,
136
+ customer_email longtext NOT NULL,
137
+ customer_id bigint(20) NOT NULL DEFAULT 0,
138
+ PRIMARY KEY (id)
139
+ ) $collate;
140
+ CREATE TABLE {$wpdb->prefix}ywrr_email_schedule (
141
+ id int NOT NULL AUTO_INCREMENT,
142
+ order_id bigint(20) NOT NULL,
143
+ order_date date NOT NULL DEFAULT '0000-00-00',
144
+ scheduled_date date NOT NULL DEFAULT '0000-00-00',
145
+ request_items longtext NOT NULL DEFAULT '',
146
+ mail_status varchar(15) NOT NULL DEFAULT 'pending',
147
+ PRIMARY KEY (id)
148
+ ) $collate;
149
+ ";
150
+
151
+ dbDelta( $ywrr_tables );
152
+ }
153
+ }
154
+
155
+ if ( !function_exists( 'ywrr_create_schedule_job' ) ) {
156
+
157
+ /**
158
+ * Creates a cron job to handle daily mail send
159
+ *
160
+ * @since 1.0.0
161
+ * @return void
162
+ * @author Alberto Ruggiero
163
+ */
164
+ function ywrr_create_schedule_job() {
165
+ wp_schedule_event( time(), 'daily', 'ywrr_daily_send_mail_job' );
166
+ }
167
+
168
+ }
169
+
170
+ if ( !function_exists( 'ywrr_create_unschedule_job' ) ) {
171
+
172
+ /**
173
+ * Removes cron job
174
+ *
175
+ * @since 1.0.0
176
+ * @return void
177
+ * @author Alberto Ruggiero
178
+ */
179
+ function ywrr_create_unschedule_job() {
180
+ wp_clear_scheduled_hook( 'ywrr_daily_send_mail_job' );
181
+ }
182
+
183
  }
modules/yith-woocommerce-review-reminder/plugin-options/blocklist-options.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- return array(
16
- 'blocklist' => array(
17
- 'review_reminder_blocklist_unsubscribed_users' => array(
18
- 'type' => 'custom_tab',
19
- 'action' => 'ywrr_blocklist'
20
- )
21
- )
22
  );
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ return array(
16
+ 'blocklist' => array(
17
+ 'review_reminder_blocklist_unsubscribed_users' => array(
18
+ 'type' => 'custom_tab',
19
+ 'action' => 'ywrr_blocklist'
20
+ )
21
+ )
22
  );
modules/yith-woocommerce-review-reminder/plugin-options/mail-options.php CHANGED
@@ -1,177 +1,177 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- global $YWRR_Review_Reminder;
16
-
17
- $custom_template = !defined( 'YWRR_PREMIUM' ) ? '' : array(
18
- 'name' => __( 'Mail template', 'yith-woocommerce-review-reminder' ),
19
- 'type' => 'custom-select',
20
- 'desc' => '',
21
- 'options' => array(
22
- 'base' => __( 'Woocommerce Template', 'yith-woocommerce-review-reminder' ),
23
- 'premium-1' => __( 'Template 1', 'yith-woocommerce-review-reminder' ),
24
- 'premium-2' => __( 'Template 2', 'yith-woocommerce-review-reminder' ),
25
- 'premium-3' => __( 'Template 3', 'yith-woocommerce-review-reminder' ),
26
- ),
27
- 'default' => 'base',
28
- 'id' => 'ywrr_mail_template'
29
- );
30
-
31
- $item_link = !defined( 'YWRR_PREMIUM' ) ? '' : array(
32
- 'name' => __( 'Set Destination', 'yith-woocommerce-review-reminder' ),
33
- 'type' => 'select',
34
- 'desc' => __( 'Set the destination you want to show in the email', 'yith-woocommerce-review-reminder' ),
35
- 'options' => array(
36
- 'product' => __( 'Product page', 'yith-woocommerce-review-reminder' ),
37
- 'review' => __( 'Default WooCommerce Reviews Tab', 'yith-woocommerce-review-reminder' ),
38
- 'custom' => __( 'Custom Anchor', 'yith-woocommerce-review-reminder' ),
39
- ),
40
- 'default' => 'product',
41
- 'id' => 'ywrr_mail_item_link'
42
- );
43
-
44
- $item_link_hash = !defined( 'YWRR_PREMIUM' ) ? '' : array(
45
- 'name' => __( 'Set Custom Anchor', 'yith-woocommerce-review-reminder' ),
46
- 'type' => 'text',
47
- 'desc' => '',
48
- 'id' => 'ywrr_mail_item_link_hash',
49
- );
50
-
51
- $email_templates_enable = ( defined( 'YWRR_PREMIUM' ) && defined( 'YITH_WCET_PREMIUM' ) ) ? array(
52
- 'name' => __( 'Use YITH WooCommerce Email Templates', 'yith-woocommerce-review-reminder' ),
53
- 'type' => 'checkbox',
54
- 'desc' => '',
55
- 'id' => 'ywrr_mail_template_enable',
56
- 'default' => 'no',
57
- ) : '';
58
-
59
- $videobox = defined( 'YWRR_PREMIUM' ) ? '' : array(
60
- 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-review-reminder' ),
61
- 'type' => 'videobox',
62
- 'default' => array(
63
- 'plugin_name' => __( 'YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder' ),
64
- 'title_first_column' => __( 'Discover the Advanced Features', 'yith-woocommerce-review-reminder' ),
65
- 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Review Reminder to benefit from all features!', 'yith-woocommerce-review-reminder' ),
66
- 'video' => array(
67
- 'video_id' => '118824650',
68
- 'video_image_url' => YWRR_ASSETS_URL . '/images/yith-woocommerce-review-reminder.jpg',
69
- 'video_description' => __( 'YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder' ),
70
- ),
71
- 'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-review-reminder' ),
72
- 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-review-reminder' ),
73
- 'button' => array(
74
- 'href' => $YWRR_Review_Reminder->get_premium_landing_uri(),
75
- 'title' => 'Get Support and Pro Features'
76
- )
77
- ),
78
- 'id' => 'ywrr_general_videobox'
79
- );
80
-
81
- $placeholder_desc = '<b>{customer_name}</b> ' . __( 'Replaced with the customer\'s name', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
82
- $placeholder_desc .= '<b>{customer_email}</b> ' . __( 'Replaced with the customer\'s email', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
83
- $placeholder_desc .= '<b>{site_title}</b> ' . __( 'Replaced with the site title', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
84
- $placeholder_desc .= '<b>{order_id}</b> ' . __( 'Replaced with the order ID', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
85
- $placeholder_desc .= '<b>{order_date}</b> ' . __( 'Replaced with the date and time of the order', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
86
- $placeholder_desc .= '<b>{order_date_completed}</b> ' . __( 'Replaced with the date the order was marked completed', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
87
- $placeholder_desc .= '<b>{order_list}</b> ' . __( 'Replaced with a list of products purchased but not reviewed (Do not forget it!!!)', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
88
- $placeholder_desc .= '<b>{days_ago}</b> ' . __( 'Replaced with the days ago the order was made', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
89
-
90
- return array(
91
- 'mail' => array(
92
- 'section_general_settings_videobox' => $videobox,
93
-
94
- 'review_reminder_general_title' => array(
95
- 'name' => __( 'General Settings', 'yith-woocommerce-review-reminder' ),
96
- 'type' => 'title',
97
- 'desc' => '',
98
- ),
99
- 'review_reminder_general_enable_plugin' => array(
100
- 'name' => __( 'Enable YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder' ),
101
- 'type' => 'checkbox',
102
- 'desc' => '',
103
- 'id' => 'ywrr_enable_plugin',
104
- 'default' => 'yes',
105
- ),
106
- 'review_reminder_general_end' => array(
107
- 'type' => 'sectionend',
108
- ),
109
- 'review_reminder_mail_section_title' => array(
110
- 'name' => __( 'Mail Settings', 'yith-woocommerce-review-reminder' ),
111
- 'type' => 'title',
112
- 'desc' => '',
113
- ),
114
- 'review_reminder_mail_type' => array(
115
- 'name' => __( 'Email type', 'yith-woocommerce-review-reminder' ),
116
- 'type' => 'select',
117
- 'desc' => __( 'Choose which format of email to send.', 'yith-woocommerce-review-reminder' ),
118
- 'options' => array(
119
- 'html' => __( 'HTML', 'yith-woocommerce-review-reminder' ),
120
- 'plain' => __( 'Plain text', 'yith-woocommerce-review-reminder' )
121
- ),
122
- 'default' => 'html',
123
- 'id' => 'ywrr_mail_type'
124
- ),
125
- 'review_reminder_mail_subject' => array(
126
- 'name' => __( 'Email subject', 'yith-woocommerce-review-reminder' ),
127
- 'type' => 'text',
128
- 'desc' => '',
129
- 'id' => 'ywrr_mail_subject',
130
- 'default' => __( '[{site_title}] Review recently purchased products', 'yith-woocommerce-review-reminder' ),
131
- 'css' => 'width: 400px;',
132
- 'custom_attributes' => array(
133
- 'required' => 'required'
134
- )
135
- ),
136
- 'review_reminder_mail_body' => array(
137
- 'name' => __( 'Email content', 'yith-woocommerce-review-reminder' ),
138
- 'type' => 'customtext',
139
- 'desc' => $placeholder_desc,
140
- 'id' => 'ywrr_mail_body',
141
- 'default' => __( 'Hello {customer_name},
142
- Thank you for purchasing items from the {site_title} shop!
143
- We would love if you could help us and other customers by reviewing the products you recently purchased.
144
- It only takes a minute and it would really help others by giving them an idea of your experience.
145
- Click the link below for each product and review the product under the \'Reviews\' tab.
146
-
147
- {order_list}
148
-
149
- Much appreciated,
150
-
151
- {site_title}.', 'yith-woocommerce-review-reminder' ),
152
- 'css' => 'width: 100%; height:300px; resize: none;',
153
- 'custom_attributes' => array(
154
- 'required' => 'required'
155
- )
156
- ),
157
- 'review_reminder_mail_item_link' => $item_link,
158
- 'review_reminder_mail_item_link_hash' => $item_link_hash,
159
- 'review_reminder_mail_template_enable' => $email_templates_enable,
160
- 'review_reminder_mail_template' => $custom_template,
161
- 'review_reminder_mail_unsubscribe_text' => array(
162
- 'name' => __( 'Review unsubscription text', 'yith-woocommerce-review-reminder' ),
163
- 'type' => 'text',
164
- 'desc' => '',
165
- 'id' => 'ywrr_mail_unsubscribe_text',
166
- 'default' => __( 'Unsubscribe from review emails', 'yith-woocommerce-review-reminder' ),
167
- 'css' => 'width: 400px;',
168
- 'custom_attributes' => array(
169
- 'required' => 'required'
170
- )
171
- ),
172
- 'review_reminder_mail_section_end' => array(
173
- 'type' => 'sectionend',
174
- )
175
- )
176
-
177
  );
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ global $YWRR_Review_Reminder;
16
+
17
+ $custom_template = !defined( 'YWRR_PREMIUM' ) ? '' : array(
18
+ 'name' => __( 'Mail template', 'yith-woocommerce-review-reminder' ),
19
+ 'type' => 'custom-select',
20
+ 'desc' => '',
21
+ 'options' => array(
22
+ 'base' => __( 'Woocommerce Template', 'yith-woocommerce-review-reminder' ),
23
+ 'premium-1' => __( 'Template 1', 'yith-woocommerce-review-reminder' ),
24
+ 'premium-2' => __( 'Template 2', 'yith-woocommerce-review-reminder' ),
25
+ 'premium-3' => __( 'Template 3', 'yith-woocommerce-review-reminder' ),
26
+ ),
27
+ 'default' => 'base',
28
+ 'id' => 'ywrr_mail_template'
29
+ );
30
+
31
+ $item_link = !defined( 'YWRR_PREMIUM' ) ? '' : array(
32
+ 'name' => __( 'Set Destination', 'yith-woocommerce-review-reminder' ),
33
+ 'type' => 'select',
34
+ 'desc' => __( 'Set the destination you want to show in the email', 'yith-woocommerce-review-reminder' ),
35
+ 'options' => array(
36
+ 'product' => __( 'Product page', 'yith-woocommerce-review-reminder' ),
37
+ 'review' => __( 'Default WooCommerce Reviews Tab', 'yith-woocommerce-review-reminder' ),
38
+ 'custom' => __( 'Custom Anchor', 'yith-woocommerce-review-reminder' ),
39
+ ),
40
+ 'default' => 'product',
41
+ 'id' => 'ywrr_mail_item_link'
42
+ );
43
+
44
+ $item_link_hash = !defined( 'YWRR_PREMIUM' ) ? '' : array(
45
+ 'name' => __( 'Set Custom Anchor', 'yith-woocommerce-review-reminder' ),
46
+ 'type' => 'text',
47
+ 'desc' => '',
48
+ 'id' => 'ywrr_mail_item_link_hash',
49
+ );
50
+
51
+ $email_templates_enable = ( defined( 'YWRR_PREMIUM' ) && defined( 'YITH_WCET_PREMIUM' ) ) ? array(
52
+ 'name' => __( 'Use YITH WooCommerce Email Templates', 'yith-woocommerce-review-reminder' ),
53
+ 'type' => 'checkbox',
54
+ 'desc' => '',
55
+ 'id' => 'ywrr_mail_template_enable',
56
+ 'default' => 'no',
57
+ ) : '';
58
+
59
+ $videobox = defined( 'YWRR_PREMIUM' ) ? '' : array(
60
+ 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-review-reminder' ),
61
+ 'type' => 'videobox',
62
+ 'default' => array(
63
+ 'plugin_name' => __( 'YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder' ),
64
+ 'title_first_column' => __( 'Discover the Advanced Features', 'yith-woocommerce-review-reminder' ),
65
+ 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Review Reminder to benefit from all features!', 'yith-woocommerce-review-reminder' ),
66
+ 'video' => array(
67
+ 'video_id' => '118824650',
68
+ 'video_image_url' => YWRR_ASSETS_URL . '/images/yith-woocommerce-review-reminder.jpg',
69
+ 'video_description' => __( 'YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder' ),
70
+ ),
71
+ 'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-review-reminder' ),
72
+ 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-review-reminder' ),
73
+ 'button' => array(
74
+ 'href' => $YWRR_Review_Reminder->get_premium_landing_uri(),
75
+ 'title' => 'Get Support and Pro Features'
76
+ )
77
+ ),
78
+ 'id' => 'ywrr_general_videobox'
79
+ );
80
+
81
+ $placeholder_desc = '<b>{customer_name}</b> ' . __( 'Replaced with the customer\'s name', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
82
+ $placeholder_desc .= '<b>{customer_email}</b> ' . __( 'Replaced with the customer\'s email', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
83
+ $placeholder_desc .= '<b>{site_title}</b> ' . __( 'Replaced with the site title', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
84
+ $placeholder_desc .= '<b>{order_id}</b> ' . __( 'Replaced with the order ID', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
85
+ $placeholder_desc .= '<b>{order_date}</b> ' . __( 'Replaced with the date and time of the order', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
86
+ $placeholder_desc .= '<b>{order_date_completed}</b> ' . __( 'Replaced with the date the order was marked completed', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
87
+ $placeholder_desc .= '<b>{order_list}</b> ' . __( 'Replaced with a list of products purchased but not reviewed (Do not forget it!!!)', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
88
+ $placeholder_desc .= '<b>{days_ago}</b> ' . __( 'Replaced with the days ago the order was made', 'yith-woocommerce-review-reminder' ) . '<br /><br />';
89
+
90
+ return array(
91
+ 'mail' => array(
92
+ 'section_general_settings_videobox' => $videobox,
93
+
94
+ 'review_reminder_general_title' => array(
95
+ 'name' => __( 'General Settings', 'yith-woocommerce-review-reminder' ),
96
+ 'type' => 'title',
97
+ 'desc' => '',
98
+ ),
99
+ 'review_reminder_general_enable_plugin' => array(
100
+ 'name' => __( 'Enable YITH WooCommerce Review Reminder', 'yith-woocommerce-review-reminder' ),
101
+ 'type' => 'checkbox',
102
+ 'desc' => '',
103
+ 'id' => 'ywrr_enable_plugin',
104
+ 'default' => 'yes',
105
+ ),
106
+ 'review_reminder_general_end' => array(
107
+ 'type' => 'sectionend',
108
+ ),
109
+ 'review_reminder_mail_section_title' => array(
110
+ 'name' => __( 'Mail Settings', 'yith-woocommerce-review-reminder' ),
111
+ 'type' => 'title',
112
+ 'desc' => '',
113
+ ),
114
+ 'review_reminder_mail_type' => array(
115
+ 'name' => __( 'Email type', 'yith-woocommerce-review-reminder' ),
116
+ 'type' => 'select',
117
+ 'desc' => __( 'Choose which format of email to send.', 'yith-woocommerce-review-reminder' ),
118
+ 'options' => array(
119
+ 'html' => __( 'HTML', 'yith-woocommerce-review-reminder' ),
120
+ 'plain' => __( 'Plain text', 'yith-woocommerce-review-reminder' )
121
+ ),
122
+ 'default' => 'html',
123
+ 'id' => 'ywrr_mail_type'
124
+ ),
125
+ 'review_reminder_mail_subject' => array(
126
+ 'name' => __( 'Email subject', 'yith-woocommerce-review-reminder' ),
127
+ 'type' => 'text',
128
+ 'desc' => '',
129
+ 'id' => 'ywrr_mail_subject',
130
+ 'default' => __( '[{site_title}] Review recently purchased products', 'yith-woocommerce-review-reminder' ),
131
+ 'css' => 'width: 400px;',
132
+ 'custom_attributes' => array(
133
+ 'required' => 'required'
134
+ )
135
+ ),
136
+ 'review_reminder_mail_body' => array(
137
+ 'name' => __( 'Email content', 'yith-woocommerce-review-reminder' ),
138
+ 'type' => 'customtext',
139
+ 'desc' => $placeholder_desc,
140
+ 'id' => 'ywrr_mail_body',
141
+ 'default' => __( 'Hello {customer_name},
142
+ Thank you for purchasing items from the {site_title} shop!
143
+ We would love if you could help us and other customers by reviewing the products you recently purchased.
144
+ It only takes a minute and it would really help others by giving them an idea of your experience.
145
+ Click the link below for each product and review the product under the \'Reviews\' tab.
146
+
147
+ {order_list}
148
+
149
+ Much appreciated,
150
+
151
+ {site_title}.', 'yith-woocommerce-review-reminder' ),
152
+ 'css' => 'width: 100%; height:300px; resize: none;',
153
+ 'custom_attributes' => array(
154
+ 'required' => 'required'
155
+ )
156
+ ),
157
+ 'review_reminder_mail_item_link' => $item_link,
158
+ 'review_reminder_mail_item_link_hash' => $item_link_hash,
159
+ 'review_reminder_mail_template_enable' => $email_templates_enable,
160
+ 'review_reminder_mail_template' => $custom_template,
161
+ 'review_reminder_mail_unsubscribe_text' => array(
162
+ 'name' => __( 'Review unsubscription text', 'yith-woocommerce-review-reminder' ),
163
+ 'type' => 'text',
164
+ 'desc' => '',
165
+ 'id' => 'ywrr_mail_unsubscribe_text',
166
+ 'default' => __( 'Unsubscribe from review emails', 'yith-woocommerce-review-reminder' ),
167
+ 'css' => 'width: 400px;',
168
+ 'custom_attributes' => array(
169
+ 'required' => 'required'
170
+ )
171
+ ),
172
+ 'review_reminder_mail_section_end' => array(
173
+ 'type' => 'sectionend',
174
+ )
175
+ )
176
+
177
  );
modules/yith-woocommerce-review-reminder/plugin-options/premium-landing-options.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
-
16
- return array(
17
- 'premium-landing' => array(
18
- 'home' => array(
19
- 'type' => 'custom_tab',
20
- 'action' => 'yith_review_reminder_premium'
21
- )
22
- )
23
  );
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+
16
+ return array(
17
+ 'premium-landing' => array(
18
+ 'home' => array(
19
+ 'type' => 'custom_tab',
20
+ 'action' => 'yith_review_reminder_premium'
21
+ )
22
+ )
23
  );
modules/yith-woocommerce-review-reminder/templates/admin/blocklist-table.php CHANGED
@@ -1,256 +1,256 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- /**
16
- * Displays the blocklist table in YWRR plugin admin tab
17
- *
18
- * @class YWRR_Blocklist_Table
19
- * @package Yithemes
20
- * @since 1.0.0
21
- * @author Your Inspiration Themes
22
- *
23
- */
24
- class YWRR_Blocklist_Table {
25
-
26
- /**
27
- * Outputs the blocklist template with insert form in plugin options panel
28
- *
29
- * @since 1.0.0
30
- * @return void
31
- * @author Alberto Ruggiero
32
- */
33
- public static function output() {
34
-
35
- global $wpdb;
36
-
37
- $table = new YITH_Custom_Table( array(
38
- 'singular' => __( 'customer', 'yith-woocommerce-review-reminder' ),
39
- 'plural' => __( 'customers', 'yith-woocommerce-review-reminder' )
40
- ) );
41
-
42
- $table->options = array(
43
- 'select_table' => $wpdb->prefix . 'ywrr_email_blocklist a LEFT JOIN ' . $wpdb->prefix . 'usermeta b ON a.customer_id = b.user_id',
44
- 'select_columns' => array(
45
- 'a.id',
46
- 'a.customer_id',
47
- 'a.customer_email',
48
- 'MAX(CASE WHEN b.meta_key = "first_name" THEN b.meta_value ELSE NULL END) AS first_name',
49
- 'MAX(CASE WHEN b.meta_key = "last_name" THEN b.meta_value ELSE NULL END) AS last_name',
50
- 'MAX(CASE WHEN b.meta_key = "nickname" THEN b.meta_value ELSE NULL END) AS nickname',
51
- ),
52
- 'select_where' => '',
53
- 'select_group' => 'a.customer_email',
54
- 'select_order' => 'a.customer_id',
55
- 'select_order_dir' => 'ASC',
56
- 'per_page_option' => 'user_per_page',
57
- 'count_table' => $wpdb->prefix . 'ywrr_email_blocklist',
58
- 'count_where' => '',
59
- 'key_column' => 'id',
60
- 'view_columns' => array(
61
- 'cb' => '<input type="checkbox" />',
62
- 'name' => __( 'Customer', 'yith-woocommerce-review-reminder' ),
63
- 'customer_email' => __( 'Email', 'yith-woocommerce-review-reminder' )
64
- ),
65
- 'hidden_columns' => array(),
66
- 'sortable_columns' => array(
67
- 'name' => array( 'name', true ),
68
- 'customer_email' => array( 'customer_email', false )
69
- ),
70
- 'custom_columns' => array(
71
- 'column_name' => function ( $item, $me ) {
72
- switch ( $item['customer_id'] ) {
73
- case 0:
74
- $customer_name = __( 'Unregistered User', 'yith-woocommerce-review-reminder' );
75
- break;
76
- default:
77
-
78
- $query_args = array(
79
- 'user_id' => $item['customer_id'],
80
- );
81
- $edit_url = esc_url( add_query_arg( $query_args, admin_url( 'user-edit.php' ) ) );
82
-
83
- $customer_name = '<a href="' . $edit_url . '">' . ( ( $item['first_name'] . ' ' . $item['last_name'] == ' ' ) ? $item['nickname'] : $item['first_name'] . ' ' . $item['last_name'] ) . '</a>';
84
- }
85
-
86
- $query_args = array(
87
- 'page' => $_GET['page'],
88
- 'tab' => $_GET['tab'],
89
- 'action' => 'delete',
90
- 'id' => $item['id']
91
- );
92
- $delete_url = esc_url( add_query_arg( $query_args, admin_url( 'admin.php' ) ) );
93
-
94
- $actions = array(
95
- 'delete' => '<a href="' . $delete_url . '">' . __( 'Delete', 'yith-woocommerce-review-reminder' ) . '</a>',
96
- );
97
-
98
- return sprintf( '%s %s', '<strong>' . $customer_name . '</strong>', $me->row_actions( $actions ) );
99
- }
100
- ),
101
- 'bulk_actions' => array(
102
- 'actions' => array(
103
- 'delete' => __( 'Delete', 'yith-woocommerce-review-reminder' ),
104
- ),
105
- 'functions' => array(
106
- 'function_delete' => function () {
107
- global $wpdb;
108
-
109
- $ids = isset( $_GET['id'] ) ? $_GET['id'] : array();
110
- if ( is_array( $ids ) ) {
111
- $ids = implode( ',', $ids );
112
- }
113
-
114
- if ( !empty( $ids ) ) {
115
- $wpdb->query( "DELETE FROM {$wpdb->prefix}ywrr_email_blocklist WHERE id IN ( $ids )" );
116
- }
117
- },
118
- )
119
- ),
120
- );
121
-
122
- $table->prepare_items();
123
-
124
- $message = '';
125
- $notice = '';
126
-
127
- $query_args = array(
128
- 'page' => $_GET['page'],
129
- 'tab' => $_GET['tab']
130
- );
131
- $blocklist_url = esc_url( add_query_arg( $query_args, admin_url( 'admin.php' ) ) );
132
-
133
- if ( 'delete' === $table->current_action() ) {
134
- $message = sprintf( __( 'Items deleted: %d', 'yith-woocommerce-review-reminder' ), count( $_GET['id'] ) );
135
- }
136
-
137
- if ( !empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], basename( __FILE__ ) ) ) {
138
-
139
- $user = get_user_by( 'email', $_POST['email'] );
140
-
141
- $customer_id = ( $user == null ? 0 : $user->ID );
142
- $customer_email = $_POST['email'];
143
-
144
- if ( true == YWRR_Blocklist()->check_blocklist( $customer_id, $customer_email ) ) {
145
-
146
- try {
147
- YWRR_Blocklist()->add_to_blocklist( $customer_id, $customer_email );
148
- $message = sprintf( __( 'User %s added successfully', 'yith-woocommerce-review-reminder' ), '<b>' . $customer_email . '</b>' );
149
- } catch ( Exception $e ) {
150
- $notice = __( 'An error has occurred', 'yith-woocommerce-review-reminder' );
151
- }
152
- }
153
- else {
154
- $notice = sprintf( __( 'User %s already unsubscribed', 'yith-woocommerce-review-reminder' ), '<b>' . $customer_email . '</b>' );
155
- }
156
- }
157
-
158
- ?>
159
- <div class="wrap">
160
- <h2>
161
- <?php _e( 'Blocklist', 'yith-woocommerce-review-reminder' );
162
- if ( empty( $_GET['action'] ) || 'addnew' !== $_GET['action'] ) : ?>
163
- <?php $query_args = array(
164
- 'page' => $_GET['page'],
165
- 'tab' => $_GET['tab'],
166
- 'action' => 'addnew'
167
- );
168
- $add_form_url = esc_url( add_query_arg( $query_args, admin_url( 'admin.php' ) ) );
169
- ?>
170
- <a class="add-new-h2" href="<?php echo $add_form_url ?>"><?php _e( 'Add New', 'yith-woocommerce-review-reminder' ); ?></a>
171
- <?php endif; ?>
172
- </h2>
173
- <?php
174
-
175
- if ( !empty( $notice ) ) : ?>
176
- <div id="notice" class="error below-h2"><p><?php echo $notice; ?></p></div>
177
- <?php endif;
178
-
179
- if ( !empty( $message ) ) : ?>
180
- <div id="message" class="updated below-h2"><p><?php echo $message; ?></p></div>
181
- <?php endif;
182
-
183
- if ( !empty( $_GET['action'] ) && 'addnew' == $_GET['action'] ) : ?>
184
- <form id="form" method="POST">
185
- <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( basename( __FILE__ ) ) ?>" />
186
- <table class="form-table" style="width: auto">
187
- <tbody>
188
- <tr valign="top" class="titledesc">
189
- <th scope="row">
190
- <label for="email"><?php _e( 'Add E-Mail to blocklist', 'yith-woocommerce-review-reminder' ); ?></label>
191
- </th>
192
- <td class="forminp forminp-email">
193
- <input id="email" name="email" type="email" required>
194
- </td>
195
- <td>
196
- <input type="submit" value="<?php _e( 'Add E-mail', 'yith-woocommerce-review-reminder' ) ?>" id="submit" class="button-primary" name="submit">
197
- <a class="button-secondary" href="<?php echo $blocklist_url ?>"><?php _e( 'Return to blocklist', 'yith-woocommerce-review-reminder' ) ?></a>
198
- </td>
199
- </tr>
200
- </tbody>
201
- </table>
202
- </form>
203
- <?php else : ?>
204
- <form id="custom-table" method="GET" action="<?php echo $blocklist_url; ?>">
205
- <input type="hidden" name="page" value="<?php echo $_GET['page']; ?>" />
206
- <input type="hidden" name="tab" value="<?php echo $_GET['tab'] ?>" />
207
-
208
- <?php $table->display(); ?>
209
- </form>
210
- <?php endif; ?>
211
- </div>
212
- <?php
213
- }
214
-
215
- /**
216
- * Add screen options for blocklist table template
217
- *
218
- * @since 1.0.0
219
- * @return void
220
- * @author Alberto Ruggiero
221
- */
222
- public static function add_options() {
223
- if ( 'yit-plugins_page_yith_ywrr_panel' == get_current_screen()->id && ( isset( $_GET['tab'] ) && $_GET['tab'] == 'blocklist' ) && ( !isset( $_GET['action'] ) || $_GET['action'] != 'addnew' ) ) {
224
-
225
- $option = 'per_page';
226
-
227
- $args = array(
228
- 'label' => __( 'Customers', 'yith-woocommerce-review-reminder' ),
229
- 'default' => 10,
230
- 'option' => 'user_per_page'
231
- );
232
-
233
- add_screen_option( $option, $args );
234
-
235
- }
236
- }
237
-
238
- /**
239
- * Set screen options for blocklist table template
240
- *
241
- * @since 1.0.0
242
- *
243
- * @param $status
244
- * @param $option
245
- * @param $value
246
- *
247
- * @return mixed
248
- * @author Alberto Ruggiero
249
- */
250
- public static function set_options( $status, $option, $value ) {
251
-
252
- return ( 'user_per_page' == $option ) ? $value : $status;
253
-
254
- }
255
-
256
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ /**
16
+ * Displays the blocklist table in YWRR plugin admin tab
17
+ *
18
+ * @class YWRR_Blocklist_Table
19
+ * @package Yithemes
20
+ * @since 1.0.0
21
+ * @author Your Inspiration Themes
22
+ *
23
+ */
24
+ class YWRR_Blocklist_Table {
25
+
26
+ /**
27
+ * Outputs the blocklist template with insert form in plugin options panel
28
+ *
29
+ * @since 1.0.0
30
+ * @return void
31
+ * @author Alberto Ruggiero
32
+ */
33
+ public static function output() {
34
+
35
+ global $wpdb;
36
+
37
+ $table = new YITH_Custom_Table( array(
38
+ 'singular' => __( 'customer', 'yith-woocommerce-review-reminder' ),
39
+ 'plural' => __( 'customers', 'yith-woocommerce-review-reminder' )
40
+ ) );
41
+
42
+ $table->options = array(
43
+ 'select_table' => $wpdb->prefix . 'ywrr_email_blocklist a LEFT JOIN ' . $wpdb->prefix . 'usermeta b ON a.customer_id = b.user_id',
44
+ 'select_columns' => array(
45
+ 'a.id',
46
+ 'a.customer_id',
47
+ 'a.customer_email',
48
+ 'MAX(CASE WHEN b.meta_key = "first_name" THEN b.meta_value ELSE NULL END) AS first_name',
49
+ 'MAX(CASE WHEN b.meta_key = "last_name" THEN b.meta_value ELSE NULL END) AS last_name',
50
+ 'MAX(CASE WHEN b.meta_key = "nickname" THEN b.meta_value ELSE NULL END) AS nickname',
51
+ ),
52
+ 'select_where' => '',
53
+ 'select_group' => 'a.customer_email',
54
+ 'select_order' => 'a.customer_id',
55
+ 'select_order_dir' => 'ASC',
56
+ 'per_page_option' => 'user_per_page',
57
+ 'count_table' => $wpdb->prefix . 'ywrr_email_blocklist',
58
+ 'count_where' => '',
59
+ 'key_column' => 'id',
60
+ 'view_columns' => array(
61
+ 'cb' => '<input type="checkbox" />',
62
+ 'name' => __( 'Customer', 'yith-woocommerce-review-reminder' ),
63
+ 'customer_email' => __( 'Email', 'yith-woocommerce-review-reminder' )
64
+ ),
65
+ 'hidden_columns' => array(),
66
+ 'sortable_columns' => array(
67
+ 'name' => array( 'name', true ),
68
+ 'customer_email' => array( 'customer_email', false )
69
+ ),
70
+ 'custom_columns' => array(
71
+ 'column_name' => function ( $item, $me ) {
72
+ switch ( $item['customer_id'] ) {
73
+ case 0:
74
+ $customer_name = __( 'Unregistered User', 'yith-woocommerce-review-reminder' );
75
+ break;
76
+ default:
77
+
78
+ $query_args = array(
79
+ 'user_id' => $item['customer_id'],
80
+ );
81
+ $edit_url = esc_url( add_query_arg( $query_args, admin_url( 'user-edit.php' ) ) );
82
+
83
+ $customer_name = '<a href="' . $edit_url . '">' . ( ( $item['first_name'] . ' ' . $item['last_name'] == ' ' ) ? $item['nickname'] : $item['first_name'] . ' ' . $item['last_name'] ) . '</a>';
84
+ }
85
+
86
+ $query_args = array(
87
+ 'page' => $_GET['page'],
88
+ 'tab' => $_GET['tab'],
89
+ 'action' => 'delete',
90
+ 'id' => $item['id']
91
+ );
92
+ $delete_url = esc_url( add_query_arg( $query_args, admin_url( 'admin.php' ) ) );
93
+
94
+ $actions = array(
95
+ 'delete' => '<a href="' . $delete_url . '">' . __( 'Delete', 'yith-woocommerce-review-reminder' ) . '</a>',
96
+ );
97
+
98
+ return sprintf( '%s %s', '<strong>' . $customer_name . '</strong>', $me->row_actions( $actions ) );
99
+ }
100
+ ),
101
+ 'bulk_actions' => array(
102
+ 'actions' => array(
103
+ 'delete' => __( 'Delete', 'yith-woocommerce-review-reminder' ),
104
+ ),
105
+ 'functions' => array(
106
+ 'function_delete' => function () {
107
+ global $wpdb;
108
+
109
+ $ids = isset( $_GET['id'] ) ? $_GET['id'] : array();
110
+ if ( is_array( $ids ) ) {
111
+ $ids = implode( ',', $ids );
112
+ }
113
+
114
+ if ( !empty( $ids ) ) {
115
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}ywrr_email_blocklist WHERE id IN ( $ids )" );
116
+ }
117
+ },
118
+ )
119
+ ),
120
+ );
121
+
122
+ $table->prepare_items();
123
+
124
+ $message = '';
125
+ $notice = '';
126
+
127
+ $query_args = array(
128
+ 'page' => $_GET['page'],
129
+ 'tab' => $_GET['tab']
130
+ );
131
+ $blocklist_url = esc_url( add_query_arg( $query_args, admin_url( 'admin.php' ) ) );
132
+
133
+ if ( 'delete' === $table->current_action() ) {
134
+ $message = sprintf( __( 'Items deleted: %d', 'yith-woocommerce-review-reminder' ), count( $_GET['id'] ) );
135
+ }
136
+
137
+ if ( !empty( $_POST['nonce'] ) && wp_verify_nonce( $_POST['nonce'], basename( __FILE__ ) ) ) {
138
+
139
+ $user = get_user_by( 'email', $_POST['email'] );
140
+
141
+ $customer_id = ( $user == null ? 0 : $user->ID );
142
+ $customer_email = $_POST['email'];
143
+
144
+ if ( true == YWRR_Blocklist()->check_blocklist( $customer_id, $customer_email ) ) {
145
+
146
+ try {
147
+ YWRR_Blocklist()->add_to_blocklist( $customer_id, $customer_email );
148
+ $message = sprintf( __( 'User %s added successfully', 'yith-woocommerce-review-reminder' ), '<b>' . $customer_email . '</b>' );
149
+ } catch ( Exception $e ) {
150
+ $notice = __( 'An error has occurred', 'yith-woocommerce-review-reminder' );
151
+ }
152
+ }
153
+ else {
154
+ $notice = sprintf( __( 'User %s already unsubscribed', 'yith-woocommerce-review-reminder' ), '<b>' . $customer_email . '</b>' );
155
+ }
156
+ }
157
+
158
+ ?>
159
+ <div class="wrap">
160
+ <h2>
161
+ <?php _e( 'Blocklist', 'yith-woocommerce-review-reminder' );
162
+ if ( empty( $_GET['action'] ) || 'addnew' !== $_GET['action'] ) : ?>
163
+ <?php $query_args = array(
164
+ 'page' => $_GET['page'],
165
+ 'tab' => $_GET['tab'],
166
+ 'action' => 'addnew'
167
+ );
168
+ $add_form_url = esc_url( add_query_arg( $query_args, admin_url( 'admin.php' ) ) );
169
+ ?>
170
+ <a class="add-new-h2" href="<?php echo $add_form_url ?>"><?php _e( 'Add New', 'yith-woocommerce-review-reminder' ); ?></a>
171
+ <?php endif; ?>
172
+ </h2>
173
+ <?php
174
+
175
+ if ( !empty( $notice ) ) : ?>
176
+ <div id="notice" class="error below-h2"><p><?php echo $notice; ?></p></div>
177
+ <?php endif;
178
+
179
+ if ( !empty( $message ) ) : ?>
180
+ <div id="message" class="updated below-h2"><p><?php echo $message; ?></p></div>
181
+ <?php endif;
182
+
183
+ if ( !empty( $_GET['action'] ) && 'addnew' == $_GET['action'] ) : ?>
184
+ <form id="form" method="POST">
185
+ <input type="hidden" name="nonce" value="<?php echo wp_create_nonce( basename( __FILE__ ) ) ?>" />
186
+ <table class="form-table" style="width: auto">
187
+ <tbody>
188
+ <tr valign="top" class="titledesc">
189
+ <th scope="row">
190
+ <label for="email"><?php _e( 'Add E-Mail to blocklist', 'yith-woocommerce-review-reminder' ); ?></label>
191
+ </th>
192
+ <td class="forminp forminp-email">
193
+ <input id="email" name="email" type="email" required>
194
+ </td>
195
+ <td>
196
+ <input type="submit" value="<?php _e( 'Add E-mail', 'yith-woocommerce-review-reminder' ) ?>" id="submit" class="button-primary" name="submit">
197
+ <a class="button-secondary" href="<?php echo $blocklist_url ?>"><?php _e( 'Return to blocklist', 'yith-woocommerce-review-reminder' ) ?></a>
198
+ </td>
199
+ </tr>
200
+ </tbody>
201
+ </table>
202
+ </form>
203
+ <?php else : ?>
204
+ <form id="custom-table" method="GET" action="<?php echo $blocklist_url; ?>">
205
+ <input type="hidden" name="page" value="<?php echo $_GET['page']; ?>" />
206
+ <input type="hidden" name="tab" value="<?php echo $_GET['tab'] ?>" />
207
+
208
+ <?php $table->display(); ?>
209
+ </form>
210
+ <?php endif; ?>
211
+ </div>
212
+ <?php
213
+ }
214
+
215
+ /**
216
+ * Add screen options for blocklist table template
217
+ *
218
+ * @since 1.0.0
219
+ * @return void
220
+ * @author Alberto Ruggiero
221
+ */
222
+ public static function add_options() {
223
+ if ( 'yit-plugins_page_yith_ywrr_panel' == get_current_screen()->id && ( isset( $_GET['tab'] ) && $_GET['tab'] == 'blocklist' ) && ( !isset( $_GET['action'] ) || $_GET['action'] != 'addnew' ) ) {
224
+
225
+ $option = 'per_page';
226
+
227
+ $args = array(
228
+ 'label' => __( 'Customers', 'yith-woocommerce-review-reminder' ),
229
+ 'default' => 10,
230
+ 'option' => 'user_per_page'
231
+ );
232
+
233
+ add_screen_option( $option, $args );
234
+
235
+ }
236
+ }
237
+
238
+ /**
239
+ * Set screen options for blocklist table template
240
+ *
241
+ * @since 1.0.0
242
+ *
243
+ * @param $status
244
+ * @param $option
245
+ * @param $value
246
+ *
247
+ * @return mixed
248
+ * @author Alberto Ruggiero
249
+ */
250
+ public static function set_options( $status, $option, $value ) {
251
+
252
+ return ( 'user_per_page' == $option ) ? $value : $status;
253
+
254
+ }
255
+
256
  }
modules/yith-woocommerce-review-reminder/templates/admin/custom-textarea.php CHANGED
@@ -1,65 +1,65 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- /**
16
- * Implements a custom textarea in YWRR plugin admin tab
17
- *
18
- * @class YWRR_Custom_Textarea
19
- * @package Yithemes
20
- * @since 1.0.0
21
- * @author Your Inspiration Themes
22
- *
23
- */
24
- class YWRR_Custom_Textarea {
25
-
26
- /**
27
- * Outputs a custom textarea template in plugin options panel
28
- *
29
- * @since 1.0.0
30
- * @return void
31
- * @author Alberto Ruggiero
32
- */
33
- public static function output( $option ) {
34
-
35
- $custom_attributes = array();
36
-
37
- if ( !empty( $option['custom_attributes'] ) && is_array( $option['custom_attributes'] ) ) {
38
- foreach ( $option['custom_attributes'] as $attribute => $attribute_value ) {
39
- $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
40
- }
41
- }
42
-
43
- $option_value = WC_Admin_Settings::get_option( $option['id'], $option['default'] );
44
-
45
- ?>
46
- <tr valign="top">
47
- <th scope="row" class="titledesc">
48
- <label for="<?php echo esc_attr( $option['id'] ); ?>"><?php echo esc_html( $option['title'] ); ?></label>
49
- </th>
50
- <td class="forminp forminp-<?php echo sanitize_title( $option['type'] ) ?>">
51
-
52
- <textarea
53
- name="<?php echo esc_attr( $option['id'] ); ?>"
54
- id="<?php echo esc_attr( $option['id'] ); ?>"
55
- style="<?php echo esc_attr( $option['css'] ); ?>"
56
- class="<?php echo esc_attr( $option['class'] ); ?>"
57
- <?php echo implode( ' ', $custom_attributes ); ?>
58
- ><?php echo esc_textarea( $option_value ); ?></textarea><br /><br />
59
- <span class="description"><?php echo $option['desc']; ?></span>
60
- </td>
61
- </tr>
62
- <?php
63
- }
64
-
65
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ /**
16
+ * Implements a custom textarea in YWRR plugin admin tab
17
+ *
18
+ * @class YWRR_Custom_Textarea
19
+ * @package Yithemes
20
+ * @since 1.0.0
21
+ * @author Your Inspiration Themes
22
+ *
23
+ */
24
+ class YWRR_Custom_Textarea {
25
+
26
+ /**
27
+ * Outputs a custom textarea template in plugin options panel
28
+ *
29
+ * @since 1.0.0
30
+ * @return void
31
+ * @author Alberto Ruggiero
32
+ */
33
+ public static function output( $option ) {
34
+
35
+ $custom_attributes = array();
36
+
37
+ if ( !empty( $option['custom_attributes'] ) && is_array( $option['custom_attributes'] ) ) {
38
+ foreach ( $option['custom_attributes'] as $attribute => $attribute_value ) {
39
+ $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
40
+ }
41
+ }
42
+
43
+ $option_value = WC_Admin_Settings::get_option( $option['id'], $option['default'] );
44
+
45
+ ?>
46
+ <tr valign="top">
47
+ <th scope="row" class="titledesc">
48
+ <label for="<?php echo esc_attr( $option['id'] ); ?>"><?php echo esc_html( $option['title'] ); ?></label>
49
+ </th>
50
+ <td class="forminp forminp-<?php echo sanitize_title( $option['type'] ) ?>">
51
+
52
+ <textarea
53
+ name="<?php echo esc_attr( $option['id'] ); ?>"
54
+ id="<?php echo esc_attr( $option['id'] ); ?>"
55
+ style="<?php echo esc_attr( $option['css'] ); ?>"
56
+ class="<?php echo esc_attr( $option['class'] ); ?>"
57
+ <?php echo implode( ' ', $custom_attributes ); ?>
58
+ ><?php echo esc_textarea( $option_value ); ?></textarea><br /><br />
59
+ <span class="description"><?php echo $option['desc']; ?></span>
60
+ </td>
61
+ </tr>
62
+ <?php
63
+ }
64
+
65
  }
modules/yith-woocommerce-review-reminder/templates/admin/premium.php CHANGED
@@ -1,341 +1,341 @@
1
- <style>
2
- .section {
3
- margin-left: -20px;
4
- margin-right: -20px;
5
- font-family: "Raleway", san-serif;
6
- }
7
-
8
- .section h1 {
9
- text-align: center;
10
- text-transform: uppercase;
11
- color: #808a97;
12
- font-size: 35px;
13
- font-weight: 700;
14
- line-height: normal;
15
- display: inline-block;
16
- width: 100%;
17
- margin: 50px 0 0;
18
- }
19
-
20
- .section:nth-child(even) {
21
- background-color: #fff;
22
- }
23
-
24
- .section:nth-child(odd) {
25
- background-color: #f1f1f1;
26
- }
27
-
28
- .section .section-title img {
29
- display: table-cell;
30
- vertical-align: middle;
31
- width: auto;
32
- margin-right: 15px;
33
- }
34
-
35
- .section h2,
36
- .section h3 {
37
- display: inline-block;
38
- vertical-align: middle;
39
- padding: 0;
40
- font-size: 24px;
41
- font-weight: 700;
42
- color: #808a97;
43
- text-transform: uppercase;
44
- }
45
-
46
- .section .section-title h2 {
47
- display: table-cell;
48
- vertical-align: middle;
49
- }
50
-
51
- .section-title {
52
- display: table;
53
- }
54
-
55
- .section h3 {
56
- font-size: 14px;
57
- line-height: 28px;
58
- margin-bottom: 0;
59
- display: block;
60
- }
61
-
62
- .section p {
63
- font-size: 13px;
64
- margin: 25px 0;
65
- }
66
-
67
- .section ul li {
68
- margin-bottom: 4px;
69
- }
70
-
71
- .landing-container {
72
- max-width: 750px;
73
- margin-left: auto;
74
- margin-right: auto;
75
- padding: 50px 0 30px;
76
- }
77
-
78
- .landing-container:after {
79
- display: block;
80
- clear: both;
81
- content: '';
82
- }
83
-
84
- .landing-container .col-1,
85
- .landing-container .col-2 {
86
- float: left;
87
- box-sizing: border-box;
88
- padding: 0 15px;
89
- }
90
-
91
- .landing-container .col-1 img {
92
- width: 100%;
93
- }
94
-
95
- .landing-container .col-1 {
96
- width: 55%;
97
- }
98
-
99
- .landing-container .col-2 {
100
- width: 45%;
101
- }
102
-
103
- .premium-cta {
104
- background-color: #808a97;
105
- color: #fff;
106
- border-radius: 6px;
107
- padding: 20px 15px;
108
- }
109
-
110
- .premium-cta:after {
111
- content: '';
112
- display: block;
113
- clear: both;
114
- }
115
-
116
- .premium-cta p {
117
- margin: 7px 0;
118
- font-size: 14px;
119
- font-weight: 500;
120
- display: inline-block;
121
- width: 60%;
122
- }
123
-
124
- .premium-cta a.button {
125
- border-radius: 6px;
126
- height: 60px;
127
- float: right;
128
- background: url(<?php echo YWRR_ASSETS_URL?>/images/upgrade.png) #ff643f no-repeat 13px 13px;
129
- border-color: #ff643f;
130
- box-shadow: none;
131
- outline: none;
132
- color: #fff;
133
- position: relative;
134
- padding: 9px 50px 9px 70px;
135
- }
136
-
137
- .premium-cta a.button:hover,
138
- .premium-cta a.button:active,
139
- .premium-cta a.button:focus {
140
- color: #fff;
141
- background: url(<?php echo YWRR_ASSETS_URL?>/images/upgrade.png) #971d00 no-repeat 13px 13px;
142
- border-color: #971d00;
143
- box-shadow: none;
144
- outline: none;
145
- }
146
-
147
- .premium-cta a.button:focus {
148
- top: 1px;
149
- }
150
-
151
- .premium-cta a.button span {
152
- line-height: 13px;
153
- }
154
-
155
- .premium-cta a.button .highlight {
156
- display: block;
157
- font-size: 20px;
158
- font-weight: 700;
159
- line-height: 20px;
160
- }
161
-
162
- .premium-cta .highlight {
163
- text-transform: uppercase;
164
- background: none;
165
- font-weight: 800;
166
- color: #fff;
167
- }
168
-
169
- @media (max-width: 768px) {
170
- .section {
171
- margin: 0
172
- }
173
-
174
- .premium-cta p {
175
- width: 100%;
176
- }
177
-
178
- .premium-cta {
179
- text-align: center;
180
- }
181
-
182
- .premium-cta a.button {
183
- float: none;
184
- }
185
- }
186
-
187
- @media (max-width: 480px) {
188
- .wrap {
189
- margin-right: 0;
190
- }
191
-
192
- .section {
193
- margin: 0;
194
- }
195
-
196
- .landing-container .col-1,
197
- .landing-container .col-2 {
198
- width: 100%;
199
- padding: 0 15px;
200
- }
201
-
202
- .section-odd .col-1 {
203
- float: left;
204
- margin-right: -100%;
205
- }
206
-
207
- .section-odd .col-2 {
208
- float: right;
209
- margin-top: 65%;
210
- }
211
- }
212
-
213
- @media (max-width: 320px) {
214
- .premium-cta a.button {
215
- padding: 9px 20px 9px 70px;
216
- }
217
-
218
- .section .section-title img {
219
- display: none;
220
- }
221
- }
222
- </style>
223
- <div class="landing">
224
- <div class="section section-cta section-odd">
225
- <div class="landing-container">
226
- <div class="premium-cta">
227
- <p>
228
- <?php echo sprintf(__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Review Reminder%2$s to benefit from all features!','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>');?>
229
- </p>
230
- <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
231
- <?php echo sprintf(__('%1$sUPGRADE%2$s %3$sto the premium%2$s','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>','<span>');?>
232
- </a>
233
- </div>
234
- </div>
235
- </div>
236
- <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
237
- <h1><?php _e('Premium Features','yith-woocommerce-review-reminder');?></h1>
238
-
239
- <div class="landing-container">
240
- <div class="col-1">
241
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/01.png" alt="<?php _e('SELECTION TO REVIEW','yith-woocommerce-review-reminder');?>" />
242
- </div>
243
- <div class="col-2">
244
- <div class="section-title">
245
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/01-icon.png" alt=icon-01 />
246
-
247
- <h2><?php _e('SELECTION OF THE PRODUCTS TO REVIEW','yith-woocommerce-review-reminder');?></h2>
248
- </div>
249
- <p><?php echo sprintf (__('%1$sChoose to ask users%2$s the review of every purchased product, or only a part of them.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
250
- </div>
251
- </div>
252
- </div>
253
- <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/02-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
254
- <div class="landing-container">
255
- <div class="col-2">
256
- <div class="section-title">
257
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/02-icon.png" alt="icon-02" />
258
-
259
- <h2><?php _e('DEADLINE FOR EMAIL DISPATCHING','yith-woocommerce-review-reminder');?></h2>
260
- </div>
261
- <p><?php echo sprintf (__('Set %1$show many days have to pass%2$s before sending the email to request a review, after the order has been marked as "Completed".','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
262
- </div>
263
- <div class="col-1">
264
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/02.png" alt="<?php _e('DEADLINE','yith-woocommerce-review-reminder');?>" />
265
- </div>
266
- </div>
267
- </div>
268
- <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/03-bg.png) no-repeat #fff; background-position: 85% 100%">
269
- <div class="landing-container">
270
- <div class="col-1">
271
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/03.png" alt="<?php _e('BLOCKLIST','yith-woocommerce-review-reminder');?>" />
272
- </div>
273
- <div class="col-2">
274
- <div class="section-title">
275
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/03-icon.png" alt="icon-03" />
276
-
277
- <h2><?php _e('BLOCKLIST','yith-woocommerce-review-reminder');?></h2>
278
- </div>
279
- <p><?php echo sprintf (__('%1$sAdd to the blocklist%2$s all the users emails that don\'t want to review any product of your e-commerce.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
280
- </div>
281
- </div>
282
- </div>
283
- <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/04-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
284
- <div class="landing-container">
285
- <div class="col-2">
286
- <div class="section-title">
287
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/04-icon.png" alt="icon-04" />
288
-
289
- <h2><?php _e('EMAIL TEMPLATE','yith-woocommerce-review-reminder');?></h2>
290
- </div>
291
- <p><?php echo sprintf (__('Select the %1$slayout you want%2$s for your email choosing among the four possibilities we offer you.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
292
- </div>
293
- <div class="col-1">
294
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/04.png" alt="<?php _e('EMAIL TEMPLATE','yith-woocommerce-review-reminder');?>" />
295
- </div>
296
- </div>
297
- </div>
298
- <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/05-bg.png) no-repeat #fff; background-position: 85% 75%">
299
- <div class="landing-container">
300
- <div class="col-1">
301
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/05.png" alt="<?php _e('MANDRILL','yith-woocommerce-review-reminder');?>" />
302
- </div>
303
- <div class="col-2">
304
- <div class="section-title">
305
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/05-icon.png" alt=icon-05 />
306
-
307
- <h2><?php _e('USE MANDRILL TO MANAGE YOUR EMAILS','yith-woocommerce-review-reminder');?></h2>
308
- </div>
309
- <p><?php echo sprintf (__('%1$sMake creation of custom%2$s reminders automatic in a few clicks.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
310
- </div>
311
- </div>
312
- </div>
313
- <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/06-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
314
- <div class="landing-container">
315
- <div class="col-2">
316
- <div class="section-title">
317
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/06-icon.png" alt="icon-06" />
318
-
319
- <h2><?php _e('SCHEDULE LIST','yith-woocommerce-review-reminder');?></h2>
320
- </div>
321
- <p><?php echo sprintf (__('See all reminders you have scheduled %1$s(past and present)%2$s in one tab only and delete them from this page without having to move anywhere else.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
322
- </div>
323
- <div class="col-1">
324
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/06.png" alt="<?php _e('SCHEDULE LIST','yith-woocommerce-review-reminder');?>" />
325
- </div>
326
- </div>
327
- </div>
328
- <div class="section section-cta section-odd">
329
- <div class="landing-container">
330
- <div class="premium-cta">
331
- <p>
332
- <?php echo sprintf (__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Review Reminder%2$s to benefit from all features!','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>');?>
333
- </p>
334
- <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
335
- <?php echo sprintf (__('%1$sUPGRADE%2$s %3$sto the premium version%2$s','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>','<span>');?>
336
- </a>
337
- </div>
338
- </div>
339
- </div>
340
-
341
  </div>
1
+ <style>
2
+ .section {
3
+ margin-left: -20px;
4
+ margin-right: -20px;
5
+ font-family: "Raleway", san-serif;
6
+ }
7
+
8
+ .section h1 {
9
+ text-align: center;
10
+ text-transform: uppercase;
11
+ color: #808a97;
12
+ font-size: 35px;
13
+ font-weight: 700;
14
+ line-height: normal;
15
+ display: inline-block;
16
+ width: 100%;
17
+ margin: 50px 0 0;
18
+ }
19
+
20
+ .section:nth-child(even) {
21
+ background-color: #fff;
22
+ }
23
+
24
+ .section:nth-child(odd) {
25
+ background-color: #f1f1f1;
26
+ }
27
+
28
+ .section .section-title img {
29
+ display: table-cell;
30
+ vertical-align: middle;
31
+ width: auto;
32
+ margin-right: 15px;
33
+ }
34
+
35
+ .section h2,
36
+ .section h3 {
37
+ display: inline-block;
38
+ vertical-align: middle;
39
+ padding: 0;
40
+ font-size: 24px;
41
+ font-weight: 700;
42
+ color: #808a97;
43
+ text-transform: uppercase;
44
+ }
45
+
46
+ .section .section-title h2 {
47
+ display: table-cell;
48
+ vertical-align: middle;
49
+ }
50
+
51
+ .section-title {
52
+ display: table;
53
+ }
54
+
55
+ .section h3 {
56
+ font-size: 14px;
57
+ line-height: 28px;
58
+ margin-bottom: 0;
59
+ display: block;
60
+ }
61
+
62
+ .section p {
63
+ font-size: 13px;
64
+ margin: 25px 0;
65
+ }
66
+
67
+ .section ul li {
68
+ margin-bottom: 4px;
69
+ }
70
+
71
+ .landing-container {
72
+ max-width: 750px;
73
+ margin-left: auto;
74
+ margin-right: auto;
75
+ padding: 50px 0 30px;
76
+ }
77
+
78
+ .landing-container:after {
79
+ display: block;
80
+ clear: both;
81
+ content: '';
82
+ }
83
+
84
+ .landing-container .col-1,
85
+ .landing-container .col-2 {
86
+ float: left;
87
+ box-sizing: border-box;
88
+ padding: 0 15px;
89
+ }
90
+
91
+ .landing-container .col-1 img {
92
+ width: 100%;
93
+ }
94
+
95
+ .landing-container .col-1 {
96
+ width: 55%;
97
+ }
98
+
99
+ .landing-container .col-2 {
100
+ width: 45%;
101
+ }
102
+
103
+ .premium-cta {
104
+ background-color: #808a97;
105
+ color: #fff;
106
+ border-radius: 6px;
107
+ padding: 20px 15px;
108
+ }
109
+
110
+ .premium-cta:after {
111
+ content: '';
112
+ display: block;
113
+ clear: both;
114
+ }
115
+
116
+ .premium-cta p {
117
+ margin: 7px 0;
118
+ font-size: 14px;
119
+ font-weight: 500;
120
+ display: inline-block;
121
+ width: 60%;
122
+ }
123
+
124
+ .premium-cta a.button {
125
+ border-radius: 6px;
126
+ height: 60px;
127
+ float: right;
128
+ background: url(<?php echo YWRR_ASSETS_URL?>/images/upgrade.png) #ff643f no-repeat 13px 13px;
129
+ border-color: #ff643f;
130
+ box-shadow: none;
131
+ outline: none;
132
+ color: #fff;
133
+ position: relative;
134
+ padding: 9px 50px 9px 70px;
135
+ }
136
+
137
+ .premium-cta a.button:hover,
138
+ .premium-cta a.button:active,
139
+ .premium-cta a.button:focus {
140
+ color: #fff;
141
+ background: url(<?php echo YWRR_ASSETS_URL?>/images/upgrade.png) #971d00 no-repeat 13px 13px;
142
+ border-color: #971d00;
143
+ box-shadow: none;
144
+ outline: none;
145
+ }
146
+
147
+ .premium-cta a.button:focus {
148
+ top: 1px;
149
+ }
150
+
151
+ .premium-cta a.button span {
152
+ line-height: 13px;
153
+ }
154
+
155
+ .premium-cta a.button .highlight {
156
+ display: block;
157
+ font-size: 20px;
158
+ font-weight: 700;
159
+ line-height: 20px;
160
+ }
161
+
162
+ .premium-cta .highlight {
163
+ text-transform: uppercase;
164
+ background: none;
165
+ font-weight: 800;
166
+ color: #fff;
167
+ }
168
+
169
+ @media (max-width: 768px) {
170
+ .section {
171
+ margin: 0
172
+ }
173
+
174
+ .premium-cta p {
175
+ width: 100%;
176
+ }
177
+
178
+ .premium-cta {
179
+ text-align: center;
180
+ }
181
+
182
+ .premium-cta a.button {
183
+ float: none;
184
+ }
185
+ }
186
+
187
+ @media (max-width: 480px) {
188
+ .wrap {
189
+ margin-right: 0;
190
+ }
191
+
192
+ .section {
193
+ margin: 0;
194
+ }
195
+
196
+ .landing-container .col-1,
197
+ .landing-container .col-2 {
198
+ width: 100%;
199
+ padding: 0 15px;
200
+ }
201
+
202
+ .section-odd .col-1 {
203
+ float: left;
204
+ margin-right: -100%;
205
+ }
206
+
207
+ .section-odd .col-2 {
208
+ float: right;
209
+ margin-top: 65%;
210
+ }
211
+ }
212
+
213
+ @media (max-width: 320px) {
214
+ .premium-cta a.button {
215
+ padding: 9px 20px 9px 70px;
216
+ }
217
+
218
+ .section .section-title img {
219
+ display: none;
220
+ }
221
+ }
222
+ </style>
223
+ <div class="landing">
224
+ <div class="section section-cta section-odd">
225
+ <div class="landing-container">
226
+ <div class="premium-cta">
227
+ <p>
228
+ <?php echo sprintf(__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Review Reminder%2$s to benefit from all features!','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>');?>
229
+ </p>
230
+ <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
231
+ <?php echo sprintf(__('%1$sUPGRADE%2$s %3$sto the premium%2$s','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>','<span>');?>
232
+ </a>
233
+ </div>
234
+ </div>
235
+ </div>
236
+ <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
237
+ <h1><?php _e('Premium Features','yith-woocommerce-review-reminder');?></h1>
238
+
239
+ <div class="landing-container">
240
+ <div class="col-1">
241
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/01.png" alt="<?php _e('SELECTION TO REVIEW','yith-woocommerce-review-reminder');?>" />
242
+ </div>
243
+ <div class="col-2">
244
+ <div class="section-title">
245
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/01-icon.png" alt=icon-01 />
246
+
247
+ <h2><?php _e('SELECTION OF THE PRODUCTS TO REVIEW','yith-woocommerce-review-reminder');?></h2>
248
+ </div>
249
+ <p><?php echo sprintf (__('%1$sChoose to ask users%2$s the review of every purchased product, or only a part of them.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/02-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
254
+ <div class="landing-container">
255
+ <div class="col-2">
256
+ <div class="section-title">
257
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/02-icon.png" alt="icon-02" />
258
+
259
+ <h2><?php _e('DEADLINE FOR EMAIL DISPATCHING','yith-woocommerce-review-reminder');?></h2>
260
+ </div>
261
+ <p><?php echo sprintf (__('Set %1$show many days have to pass%2$s before sending the email to request a review, after the order has been marked as "Completed".','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
262
+ </div>
263
+ <div class="col-1">
264
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/02.png" alt="<?php _e('DEADLINE','yith-woocommerce-review-reminder');?>" />
265
+ </div>
266
+ </div>
267
+ </div>
268
+ <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/03-bg.png) no-repeat #fff; background-position: 85% 100%">
269
+ <div class="landing-container">
270
+ <div class="col-1">
271
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/03.png" alt="<?php _e('BLOCKLIST','yith-woocommerce-review-reminder');?>" />
272
+ </div>
273
+ <div class="col-2">
274
+ <div class="section-title">
275
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/03-icon.png" alt="icon-03" />
276
+
277
+ <h2><?php _e('BLOCKLIST','yith-woocommerce-review-reminder');?></h2>
278
+ </div>
279
+ <p><?php echo sprintf (__('%1$sAdd to the blocklist%2$s all the users emails that don\'t want to review any product of your e-commerce.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
280
+ </div>
281
+ </div>
282
+ </div>
283
+ <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/04-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
284
+ <div class="landing-container">
285
+ <div class="col-2">
286
+ <div class="section-title">
287
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/04-icon.png" alt="icon-04" />
288
+
289
+ <h2><?php _e('EMAIL TEMPLATE','yith-woocommerce-review-reminder');?></h2>
290
+ </div>
291
+ <p><?php echo sprintf (__('Select the %1$slayout you want%2$s for your email choosing among the four possibilities we offer you.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
292
+ </div>
293
+ <div class="col-1">
294
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/04.png" alt="<?php _e('EMAIL TEMPLATE','yith-woocommerce-review-reminder');?>" />
295
+ </div>
296
+ </div>
297
+ </div>
298
+ <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/05-bg.png) no-repeat #fff; background-position: 85% 75%">
299
+ <div class="landing-container">
300
+ <div class="col-1">
301
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/05.png" alt="<?php _e('MANDRILL','yith-woocommerce-review-reminder');?>" />
302
+ </div>
303
+ <div class="col-2">
304
+ <div class="section-title">
305
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/05-icon.png" alt=icon-05 />
306
+
307
+ <h2><?php _e('USE MANDRILL TO MANAGE YOUR EMAILS','yith-woocommerce-review-reminder');?></h2>
308
+ </div>
309
+ <p><?php echo sprintf (__('%1$sMake creation of custom%2$s reminders automatic in a few clicks.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/06-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
314
+ <div class="landing-container">
315
+ <div class="col-2">
316
+ <div class="section-title">
317
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/06-icon.png" alt="icon-06" />
318
+
319
+ <h2><?php _e('SCHEDULE LIST','yith-woocommerce-review-reminder');?></h2>
320
+ </div>
321
+ <p><?php echo sprintf (__('See all reminders you have scheduled %1$s(past and present)%2$s in one tab only and delete them from this page without having to move anywhere else.','yith-woocommerce-review-reminder'),'<b>','</b>');?></p>
322
+ </div>
323
+ <div class="col-1">
324
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/06.png" alt="<?php _e('SCHEDULE LIST','yith-woocommerce-review-reminder');?>" />
325
+ </div>
326
+ </div>
327
+ </div>
328
+ <div class="section section-cta section-odd">
329
+ <div class="landing-container">
330
+ <div class="premium-cta">
331
+ <p>
332
+ <?php echo sprintf (__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Review Reminder%2$s to benefit from all features!','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>');?>
333
+ </p>
334
+ <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
335
+ <?php echo sprintf (__('%1$sUPGRADE%2$s %3$sto the premium version%2$s','yith-woocommerce-review-reminder'),'<span class="highlight">','</span>','<span>');?>
336
+ </a>
337
+ </div>
338
+ </div>
339
+ </div>
340
+
341
  </div>
modules/yith-woocommerce-review-reminder/templates/emails/email-items-list.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- $review_list = '';
16
-
17
-
18
- foreach ( $item_list as $item ) {
19
- $product_link = apply_filters( 'ywrr_product_permalink', get_permalink( $item['id'] ) );
20
-
21
- $review_list .= '<li><a href="' . $product_link . '">' . $item['name'] . '</a></li>';
22
- }
23
-
24
  return '<ul>' . $review_list . '</ul>';
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( !defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ $review_list = '';
16
+
17
+
18
+ foreach ( $item_list as $item ) {
19
+ $product_link = apply_filters( 'ywrr_product_permalink', get_permalink( $item['id'] ) );
20
+
21
+ $review_list .= '<li><a href="' . $product_link . '">' . $item['name'] . '</a></li>';
22
+ }
23
+
24
  return '<ul>' . $review_list . '</ul>';
modules/yith-woocommerce-review-reminder/templates/unsubscribe.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- /**
3
- * This file belongs to the YIT Plugin Framework.
4
- *
5
- * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
- * that is bundled with this package in the file LICENSE.txt.
7
- * It is also available through the world-wide-web at this URL:
8
- * http://www.gnu.org/licenses/gpl-3.0.txt
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- } // Exit if accessed directly
14
-
15
- /**
16
- * Unsubscribe page shortcode template
17
- *
18
- * @package Yithemes
19
- * @since 1.0.0
20
- * @author Your Inspiration Themes
21
- */
22
-
23
- wc_print_notices();
24
-
25
- if( isset( $_GET[ 'email' ] )) {
26
- ?>
27
- <p><?php printf( __( 'If you don\'t want to receive any more review reminders, please retype your email address: %s', 'yith-woocommerce-review-reminder' ), '<b>' . urldecode( base64_decode( $_GET[ 'email' ] ) ) . '</b>' ) ?></p>
28
- <form method="post" action="">
29
- <p class="form-row form-row-wide">
30
- <label for="account_email"><?php _e( 'Email address', 'yith-woocommerce-review-reminder' ); ?> <span class="required">*</span></label>
31
- <input type="email" class="input-text" name="account_email" id="account_email"/>
32
- </p>
33
- <p>
34
- <?php wp_nonce_field( 'unsubscribe_review_request' ); ?>
35
- <input type="submit" class="button" name="unsubscribe_review_request" value="<?php _e( 'Unsubscribe', 'yith-woocommerce-review-reminder' ); ?>"/>
36
- <input type="hidden" name="account_id" value="<?php echo urldecode( base64_decode( $_GET[ 'id' ] ) ); ?>"/>
37
- <input type="hidden" name="action" value="unsubscribe_review_request"/>
38
- </p>
39
- </form>
40
- <?php
41
- } else {
42
- ?>
43
- <p class="return-to-shop"><a class="button wc-backward" href="<?php echo get_home_url(); ?>"><?php _e( 'Return To Home Page', 'yith-woocommerce-review-reminder' ) ?></a></p>
44
- <?php
45
  }
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ } // Exit if accessed directly
14
+
15
+ /**
16
+ * Unsubscribe page shortcode template
17
+ *
18
+ * @package Yithemes
19
+ * @since 1.0.0
20
+ * @author Your Inspiration Themes
21
+ */
22
+
23
+ wc_print_notices();
24
+
25
+ if( isset( $_GET[ 'email' ] )) {
26
+ ?>
27
+ <p><?php printf( __( 'If you don\'t want to receive any more review reminders, please retype your email address: %s', 'yith-woocommerce-review-reminder' ), '<b>' . urldecode( base64_decode( $_GET[ 'email' ] ) ) . '</b>' ) ?></p>
28
+ <form method="post" action="">
29
+ <p class="form-row form-row-wide">
30
+ <label for="account_email"><?php _e( 'Email address', 'yith-woocommerce-review-reminder' ); ?> <span class="required">*</span></label>
31
+ <input type="email" class="input-text" name="account_email" id="account_email"/>
32
+ </p>
33
+ <p>
34
+ <?php wp_nonce_field( 'unsubscribe_review_request' ); ?>
35
+ <input type="submit" class="button" name="unsubscribe_review_request" value="<?php _e( 'Unsubscribe', 'yith-woocommerce-review-reminder' ); ?>"/>
36
+ <input type="hidden" name="account_id" value="<?php echo urldecode( base64_decode( $_GET[ 'id' ] ) ); ?>"/>
37
+ <input type="hidden" name="action" value="unsubscribe_review_request"/>
38
+ </p>
39
+ </form>
40
+ <?php
41
+ } else {
42
+ ?>
43
+ <p class="return-to-shop"><a class="button wc-backward" href="<?php echo get_home_url(); ?>"><?php _e( 'Return To Home Page', 'yith-woocommerce-review-reminder' ) ?></a></p>
44
+ <?php
45
  }
modules/yith-woocommerce-stripe/includes/class-yith-stripe-gateway.php CHANGED
@@ -345,8 +345,8 @@ if ( ! class_exists( 'YITH_WCStripe_Gateway' ) ) {
345
  $this->init_stripe_sdk();
346
 
347
  $params = array(
348
- 'amount' => $this->get_amount( $order->order_total ), // Amount in cents!
349
- 'currency' => strtoupper( get_woocommerce_currency() ),
350
  'source' => $this->token,
351
  'description' => sprintf( __( '%s - Order %s', 'yith-stripe' ), esc_html( get_bloginfo( 'name' ) ), $order->get_order_number() ),
352
  'metadata' => array(
@@ -392,8 +392,8 @@ if ( ! class_exists( 'YITH_WCStripe_Gateway' ) ) {
392
  protected function get_hosted_payments_args( $order ) {
393
  $args = apply_filters( 'woocommerce_stripe_hosted_args', array(
394
  'key' => $this->public_key,
395
- 'amount' => $this->get_amount( $order->order_total),
396
- 'currency' => strtoupper( get_woocommerce_currency() ),
397
  'name' => esc_html( get_bloginfo( 'name' ) ),
398
  'description' => sprintf( __( 'Order #%s', 'yith-stripe' ), $order->get_order_number() ),
399
  'zip-code' => $order->billing_postcode,
@@ -433,7 +433,7 @@ if ( ! class_exists( 'YITH_WCStripe_Gateway' ) ) {
433
  <input type="hidden" name="amount" value="<?php echo $this->get_order_total() ?>" />
434
  <input type="hidden" name="signature" value="<?php echo strtoupper( md5( $this->get_order_total() . $order_id . $this->private_key ) ) ?>" />
435
  </form>
436
- <?php
437
  }
438
 
439
  /**
@@ -447,22 +447,34 @@ if ( ! class_exists( 'YITH_WCStripe_Gateway' ) ) {
447
  @ob_clean();
448
  header( 'HTTP/1.1 200 OK' );
449
 
450
- if ( isset( $_REQUEST['reference'] ) && isset( $_REQUEST['signature'] ) && isset( $_REQUEST['stripeToken'] ) ) {
451
- $signature = strtoupper( md5( $_REQUEST['amount'] . $_REQUEST['reference'] . $this->private_key ) );
452
- $order_id = absint( $_REQUEST['reference'] );
453
- $order = wc_get_order( $order_id );
 
454
 
455
- if ( $signature === $_REQUEST['signature'] ) {
456
- $this->token = $_REQUEST['stripeToken'];
457
- $response = $this->pay( $order );
458
 
459
- if ( $response['result'] == 'fail' ) {
460
- $order->update_status( 'failed', __( 'Payment was declined by Stripe.', 'yith-stripe' ) . ' ' . $response['error'] );
461
- }
462
 
463
- wp_redirect( $this->get_return_url( $order ) );
464
- exit();
 
465
  }
 
 
 
 
 
 
 
 
 
 
466
  }
467
 
468
  wp_redirect( get_permalink( wc_get_page_id( 'cart' ) ) );
345
  $this->init_stripe_sdk();
346
 
347
  $params = array(
348
+ 'amount' => $this->get_amount( $order->order_total, $order->get_order_currency() ), // Amount in cents!
349
+ 'currency' => strtolower( $order->get_order_currency() ? $order->get_order_currency() : get_woocommerce_currency() ),
350
  'source' => $this->token,
351
  'description' => sprintf( __( '%s - Order %s', 'yith-stripe' ), esc_html( get_bloginfo( 'name' ) ), $order->get_order_number() ),
352
  'metadata' => array(
392
  protected function get_hosted_payments_args( $order ) {
393
  $args = apply_filters( 'woocommerce_stripe_hosted_args', array(
394
  'key' => $this->public_key,
395
+ 'amount' => $this->get_amount( $order->order_total, $order->get_order_currency() ),
396
+ 'currency' => strtolower( $order->get_order_currency() ? $order->get_order_currency() : get_woocommerce_currency() ),
397
  'name' => esc_html( get_bloginfo( 'name' ) ),
398
  'description' => sprintf( __( 'Order #%s', 'yith-stripe' ), $order->get_order_number() ),
399
  'zip-code' => $order->billing_postcode,
433
  <input type="hidden" name="amount" value="<?php echo $this->get_order_total() ?>" />
434
  <input type="hidden" name="signature" value="<?php echo strtoupper( md5( $this->get_order_total() . $order_id . $this->private_key ) ) ?>" />
435
  </form>
436
+ <?php
437
  }
438
 
439
  /**
447
  @ob_clean();
448
  header( 'HTTP/1.1 200 OK' );
449
 
450
+ try {
451
+ if ( isset( $_REQUEST['reference'] ) && isset( $_REQUEST['signature'] ) && isset( $_REQUEST['stripeToken'] ) ) {
452
+ $signature = strtoupper( md5( $_REQUEST['amount'] . $_REQUEST['reference'] . $this->private_key ) );
453
+ $order_id = absint( $_REQUEST['reference'] );
454
+ $order = wc_get_order( $order_id );
455
 
456
+ if ( $signature === $_REQUEST['signature'] ) {
457
+ $this->token = $_REQUEST['stripeToken'];
458
+ $response = $this->pay( $order );
459
 
460
+ if ( $response['result'] == 'fail' ) {
461
+ $order->update_status( 'failed', __( 'Payment was declined by Stripe.', 'yith-stripe' ) . ' ' . $response['error'] );
462
+ }
463
 
464
+ wp_redirect( $this->get_return_url( $order ) );
465
+ exit();
466
+ }
467
  }
468
+
469
+ } catch ( Error\Card $e ) {
470
+ $body = $e->getJsonBody();
471
+ $err = $body['error'];
472
+ $message = isset( $this->errors[ $err['code'] ] ) ? $this->errors[ $err['code'] ] : $err['message'];
473
+
474
+ wc_add_notice( $message, 'error' );
475
+ wp_redirect( get_permalink( wc_get_page_id( 'checkout' ) ) );
476
+ exit();
477
+
478
  }
479
 
480
  wp_redirect( get_permalink( wc_get_page_id( 'cart' ) ) );
modules/yith-woocommerce-stripe/includes/class-yith-stripe.php CHANGED
@@ -73,8 +73,12 @@ if( ! class_exists( 'YITH_WCStripe' ) ){
73
  */
74
  public function plugin_fw_loader() {
75
  if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
76
- require_once( YITH_WCSTRIPE_DIR . '/plugin-fw/yit-plugin.php' );
77
- }
 
 
 
 
78
  }
79
 
80
  /**
@@ -84,7 +88,7 @@ if( ! class_exists( 'YITH_WCStripe' ) ){
84
  * @since 1.0.0
85
  */
86
  public function __construct() {
87
- add_action( 'after_setup_theme', array( $this, 'plugin_fw_loader' ), 1 );
88
 
89
  // includes
90
  include_once( 'class-yith-stripe-gateway.php' );
73
  */
74
  public function plugin_fw_loader() {
75
  if ( ! defined( 'YIT_CORE_PLUGIN' ) ) {
76
+ global $plugin_fw_data;
77
+ if( ! empty( $plugin_fw_data ) ){
78
+ $plugin_fw_file = array_shift( $plugin_fw_data );
79
+ require_once( $plugin_fw_file );
80
+ }
81
+ }
82
  }
83
 
84
  /**
88
  * @since 1.0.0
89
  */
90
  public function __construct() {
91
+ add_action( 'plugins_loaded', array( $this, 'plugin_fw_loader' ), 15 );
92
 
93
  // includes
94
  include_once( 'class-yith-stripe-gateway.php' );
modules/yith-woocommerce-stripe/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Stripe
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-stripe/
5
  * Description: Allows you to add Stripe gateway payment to WooCommerce
6
- * Version: 1.2.0
7
  * Author: YIThemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-stripe
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Stripe
14
- * @version 1.1.0
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -78,7 +78,7 @@ if ( ! defined( 'YITH_WCSTRIPE' ) ) {
78
  if ( defined( 'YITH_WCSTRIPE_VERSION' ) ) {
79
  return;
80
  }else{
81
- define( 'YITH_WCSTRIPE_VERSION', '1.2.0' );
82
  }
83
 
84
  if ( ! defined( 'YITH_WCSTRIPE_FILE' ) ) {
3
  * Plugin Name: YITH WooCommerce Stripe
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-stripe/
5
  * Description: Allows you to add Stripe gateway payment to WooCommerce
6
+ * Version: 1.2.3
7
  * Author: YIThemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-stripe
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Stripe
14
+ * @version 1.2.3
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
78
  if ( defined( 'YITH_WCSTRIPE_VERSION' ) ) {
79
  return;
80
  }else{
81
+ define( 'YITH_WCSTRIPE_VERSION', '1.2.3' );
82
  }
83
 
84
  if ( ! defined( 'YITH_WCSTRIPE_FILE' ) ) {
modules/yith-woocommerce-tab-manager/includes/class.yith-woocommerce-tab-manager.php CHANGED
@@ -176,17 +176,17 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
176
  }
177
 
178
  $admin_tabs = array(
179
- 'settings' => __( 'Settings', 'yith_wc_tab_manager' ),
180
  );
181
 
182
  if( !defined( 'YWTM_PREMIUM' ) )
183
- $admin_tabs['premium-landing'] = __( 'Premium Version', 'yith_wc_tab_manager' );
184
 
185
  $args = array(
186
  'create_menu_page' => true,
187
  'parent_slug' => '',
188
- 'page_title' => __( 'Tab Manager', 'yith_wc_tab_manager' ),
189
- 'menu_title' => __( 'Tab Manager', 'yith_wc_tab_manager' ),
190
  'capability' => 'manage_options',
191
  'parent' => '',
192
  'parent_page' => 'yit_plugin_panel',
@@ -229,10 +229,10 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
229
  */
230
  public function action_links( $links ) {
231
 
232
- $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith_wc_tab_manager' ) . '</a>';
233
 
234
  if ( defined( 'YWTM_FREE_INIT' ) ) {
235
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith_wc_tab_manager' ) . '</a>';
236
  }
237
 
238
  return $links;
@@ -246,8 +246,8 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
246
  */
247
  public function enqueue_admin_style()
248
  {
249
- wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array() );
250
- wp_enqueue_style( 'yit-tab-style', YWTM_ASSETS_URL . 'css/yith-tab-manager-admin.css' );
251
  }
252
 
253
  /**
@@ -270,7 +270,7 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
270
  ( defined( 'YWTM_FREE_INIT' ) && ( YWTM_FREE_INIT == $plugin_file ) )
271
  ) {
272
 
273
- $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith_wc_tab_manager' ) . '</a>';
274
  }
275
 
276
  return $plugin_meta;
@@ -289,8 +289,8 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
289
 
290
 
291
  $args = apply_filters('yith_wctm_post_type',array(
292
- 'label' => __('ywtm_tab', 'yith_wc_tab_manager'),
293
- 'description' => __('Yith Tab Manager Description', 'yith_wc_tab_manager'),
294
  'labels' => $this->get_tab_taxonomy_label(),
295
  'supports' => array('title'),
296
  'hierarchical' => true,
@@ -329,19 +329,19 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
329
  protected function get_tab_taxonomy_label( $arg = '' ) {
330
 
331
  $label = apply_filters( 'yith_tab_manager_taxonomy_label', array(
332
- 'name' => _x('YITH WooCommerce Tab Manager', 'Post Type General Name', 'yith_wc_tab_manager'),
333
- 'singular_name' => _x('Tab', 'Post Type Singular Name', 'yith_wc_tab_manager'),
334
- 'menu_name' => __('Tab Manager', 'yith_wc_tab_manager'),
335
- 'parent_item_colon' => __('Parent Item:', 'yith_wc_tab_manager'),
336
- 'all_items' => __('All Tabs', 'yith_wc_tab_manager'),
337
- 'view_item' => __('View Tabs', 'yith_wc_tab_manager'),
338
- 'add_new_item' => __('Add New Tab', 'yith_wc_tab_manager'),
339
- 'add_new' => __('Add New Tab', 'yith_wc_tab_manager'),
340
- 'edit_item' => __('Edit Tab', 'yith_wc_tab_manager'),
341
- 'update_item' => __('Update Tab', 'yith_wc_tab_manager'),
342
- 'search_items' => __('Search Tab', 'yith_wc_tab_manager'),
343
- 'not_found' => __('Not found', 'yith_wc_tab_manager'),
344
- 'not_found_in_trash' => __('Not found in Trash', 'yith_wc_tab_manager'),
345
  )
346
  );
347
  return ! empty( $arg ) ? $label[ $arg ] : $label;
@@ -361,16 +361,16 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
361
  $messages[$this->post_type_name] = array (
362
 
363
  0 => '',
364
- 1 => __($singular_name.' updated','yith_wc_tab_manager'),
365
- 2 => __('Custom field updated', 'yith_wc_tab_manager'),
366
- 3 => __('Custom field deleted', 'yith_wc_tab_manager'),
367
- 4 => __($singular_name.' updated', 'yith_wc_tab_manager'),
368
- 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Tab restored to version %s', 'yith_wc_tab_manager' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
369
- 6 => __($singular_name.' published', 'yith_wc_tab_manager'),
370
- 7 => __($singular_name.' saved', 'yith_wc_tab_manager'),
371
- 8 => __($singular_name.' submitted', 'yith_wc_tab_manager'),
372
- 9 => __($singular_name.' ', 'yith_wc_tab_manager'),
373
- 10 => __($singular_name.' draft updated', 'yith_wc_tab_manager')
374
  );
375
 
376
 
@@ -448,7 +448,7 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
448
  foreach ($yith_tabs as $tab ){
449
 
450
  $tabs[$tab["id"]] = array(
451
- 'title' => __( $tab['title'], 'yith_wc_tab_manager' ),
452
  'priority' => $tab['priority']+$priority,
453
  'callback' => array ( $this, 'put_content_tabs' )
454
  );
@@ -491,10 +491,10 @@ if ( !class_exists( 'YITH_WC_Tab_Manager' ) ) {
491
 
492
  $columns = apply_filters('yith_add_column_tab', array(
493
  'cb' => '<input type="checkbox" />',
494
- 'title' => __('Title', 'yith_wc_tab_manager'),
495
- 'is_show' => __('Is Visible', 'yith_wc_tab_manager'),
496
- 'tab_position' => __('Tab Position', 'yith_wc_tab_manager'),
497
- 'date' => __('Date', 'yith_wc_tab_manager'),
498
  )
499
  ) ;
500
 
176
  }
177
 
178
  $admin_tabs = array(
179
+ 'settings' => __( 'Settings', 'yith-woocommerce-tab-manager' ),
180
  );
181
 
182
  if( !defined( 'YWTM_PREMIUM' ) )
183
+ $admin_tabs['premium-landing'] = __( 'Premium Version', 'yith-woocommerce-tab-manager' );
184
 
185
  $args = array(
186
  'create_menu_page' => true,
187
  'parent_slug' => '',
188
+ 'page_title' => __( 'Tab Manager', 'yith-woocommerce-tab-manager' ),
189
+ 'menu_title' => __( 'Tab Manager', 'yith-woocommerce-tab-manager' ),
190
  'capability' => 'manage_options',
191
  'parent' => '',
192
  'parent_page' => 'yit_plugin_panel',
229
  */
230
  public function action_links( $links ) {
231
 
232
+ $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-tab-manager' ) . '</a>';
233
 
234
  if ( defined( 'YWTM_FREE_INIT' ) ) {
235
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-tab-manager' ) . '</a>';
236
  }
237
 
238
  return $links;
246
  */
247
  public function enqueue_admin_style()
248
  {
249
+ wp_enqueue_style( 'woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), YWTM_VERSION );
250
+ wp_enqueue_style( 'yit-tab-style', YWTM_ASSETS_URL . 'css/yith-tab-manager-admin.css', array(), YWTM_VERSION );
251
  }
252
 
253
  /**
270
  ( defined( 'YWTM_FREE_INIT' ) && ( YWTM_FREE_INIT == $plugin_file ) )
271
  ) {
272
 
273
+ $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-tab-manager' ) . '</a>';
274
  }
275
 
276
  return $plugin_meta;
289
 
290
 
291
  $args = apply_filters('yith_wctm_post_type',array(
292
+ 'label' => __('ywtm_tab', 'yith-woocommerce-tab-manager'),
293
+ 'description' => __('Yith Tab Manager Description', 'yith-woocommerce-tab-manager'),
294
  'labels' => $this->get_tab_taxonomy_label(),
295
  'supports' => array('title'),
296
  'hierarchical' => true,
329
  protected function get_tab_taxonomy_label( $arg = '' ) {
330
 
331
  $label = apply_filters( 'yith_tab_manager_taxonomy_label', array(
332
+ 'name' => _x('YITH WooCommerce Tab Manager', 'Post Type General Name', 'yith-woocommerce-tab-manager'),
333
+ 'singular_name' => _x('Tab', 'Post Type Singular Name', 'yith-woocommerce-tab-manager'),
334
+ 'menu_name' => __('Tab Manager', 'yith-woocommerce-tab-manager'),
335
+ 'parent_item_colon' => __('Parent Item:', 'yith-woocommerce-tab-manager'),
336
+ 'all_items' => __('All Tabs', 'yith-woocommerce-tab-manager'),
337
+ 'view_item' => __('View Tabs', 'yith-woocommerce-tab-manager'),
338
+ 'add_new_item' => __('Add New Tab', 'yith-woocommerce-tab-manager'),
339
+ 'add_new' => __('Add New Tab', 'yith-woocommerce-tab-manager'),
340
+ 'edit_item' => __('Edit Tab', 'yith-woocommerce-tab-manager'),
341
+ 'update_item' => __('Update Tab', 'yith-woocommerce-tab-manager'),
342
+ 'search_items' => __('Search Tab', 'yith-woocommerce-tab-manager'),
343
+ 'not_found' => __('Not found', 'yith-woocommerce-tab-manager'),
344
+ 'not_found_in_trash' => __('Not found in Trash', 'yith-woocommerce-tab-manager'),
345
  )
346
  );
347
  return ! empty( $arg ) ? $label[ $arg ] : $label;
361
  $messages[$this->post_type_name] = array (
362
 
363
  0 => '',
364
+ 1 => __($singular_name.' updated','yith-woocommerce-tab-manager'),
365
+ 2 => __('Custom field updated', 'yith-woocommerce-tab-manager'),
366
+ 3 => __('Custom field deleted', 'yith-woocommerce-tab-manager'),
367
+ 4 => __($singular_name.' updated', 'yith-woocommerce-tab-manager'),
368
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Tab restored to version %s', 'yith-woocommerce-tab-manager' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
369
+ 6 => __($singular_name.' published', 'yith-woocommerce-tab-manager'),
370
+ 7 => __($singular_name.' saved', 'yith-woocommerce-tab-manager'),
371
+ 8 => __($singular_name.' submitted', 'yith-woocommerce-tab-manager'),
372
+ 9 => __($singular_name.' ', 'yith-woocommerce-tab-manager'),
373
+ 10 => __($singular_name.' draft updated', 'yith-woocommerce-tab-manager')
374
  );
375
 
376
 
448
  foreach ($yith_tabs as $tab ){
449
 
450
  $tabs[$tab["id"]] = array(
451
+ 'title' => __( $tab['title'], 'yith-woocommerce-tab-manager' ),
452
  'priority' => $tab['priority']+$priority,
453
  'callback' => array ( $this, 'put_content_tabs' )
454
  );
491
 
492
  $columns = apply_filters('yith_add_column_tab', array(
493
  'cb' => '<input type="checkbox" />',
494
+ 'title' => __('Title', 'yith-woocommerce-tab-manager'),
495
+ 'is_show' => __('Is Visible', 'yith-woocommerce-tab-manager'),
496
+ 'tab_position' => __('Tab Position', 'yith-woocommerce-tab-manager'),
497
+ 'date' => __('Date', 'yith-woocommerce-tab-manager'),
498
  )
499
  ) ;
500
 
modules/yith-woocommerce-tab-manager/includes/metabox/tab-metabox.php CHANGED
@@ -7,28 +7,28 @@
7
  */
8
 
9
  $args = array (
10
- 'label' => __( 'Tab Settings', 'yith_wc_tab_manager' ),
11
  'pages' => 'ywtm_tab', //or array( 'post-type1', 'post-type2')
12
  'context' => 'normal', //('normal', 'advanced', or 'side')
13
  'priority' => 'default',
14
  'tabs' => array(
15
  'settings' => array(
16
- 'label' => __( 'Settings', 'yith_wc_tab_manager' ),
17
  'fields' => apply_filters( 'ywtm_options_metabox', array(
18
  'ywtm_text_tab' => array (
19
- 'label' => __('Content Tab', 'yith_wc_tab_manager'),
20
  'desc' => '',
21
  'type' => 'textarea',
22
  ),
23
  'ywtm_show_tab' => array(
24
- 'label' => __( 'Enable Tab', 'yith_wc_tab_manager' ),
25
- 'desc' => __('Show Tab in frontend', 'yith_wc_tab_manager'),
26
  'type' => 'checkbox',
27
  'std' => 1 ),
28
 
29
  'ywtm_order_tab' => array(
30
- 'label' => __( 'Tab Priority', 'yith_wc_tab_manager' ),
31
- 'desc' => __('The plugin tabs are displayed after the WooCommerce Tabs', 'yith_wc_tab_manager'),
32
  'type' => 'number',
33
  'std' => 1,
34
  'min' => 1,
7
  */
8
 
9
  $args = array (
10
+ 'label' => __( 'Tab Settings', 'yith-woocommerce-tab-manager' ),
11
  'pages' => 'ywtm_tab', //or array( 'post-type1', 'post-type2')
12
  'context' => 'normal', //('normal', 'advanced', or 'side')
13
  'priority' => 'default',
14
  'tabs' => array(
15
  'settings' => array(
16
+ 'label' => __( 'Settings', 'yith-woocommerce-tab-manager' ),
17
  'fields' => apply_filters( 'ywtm_options_metabox', array(
18
  'ywtm_text_tab' => array (
19
+ 'label' => __('Content Tab', 'yith-woocommerce-tab-manager'),
20
  'desc' => '',
21
  'type' => 'textarea',
22
  ),
23
  'ywtm_show_tab' => array(
24
+ 'label' => __( 'Enable Tab', 'yith-woocommerce-tab-manager' ),
25
+ 'desc' => __('Show Tab in frontend', 'yith-woocommerce-tab-manager'),
26
  'type' => 'checkbox',
27
  'std' => 1 ),
28
 
29
  'ywtm_order_tab' => array(
30
+ 'label' => __( 'Tab Priority', 'yith-woocommerce-tab-manager' ),
31
+ 'desc' => __('The plugin tabs are displayed after the WooCommerce Tabs', 'yith-woocommerce-tab-manager'),
32
  'type' => 'number',
33
  'std' => 1,
34
  'min' => 1,
modules/yith-woocommerce-tab-manager/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Tab Manager
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-tab-manager/
5
  * Description: YITH WooCommerce Tab Manager allows you to add Tab to products.
6
- * Version: 1.0.6
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_tab_manager
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Tab Manager
14
- * @version 1.0.6
15
  */
16
 
17
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
@@ -44,7 +44,7 @@ if ( !function_exists( 'WC' ) ) {
44
  function yith_ywtm_install_woocommerce_admin_notice() {
45
  ?>
46
  <div class="error">
47
- <p><?php _e( 'YITH WooCommerce Tab Manager is enabled but not effective. It requires WooCommerce in order to work.', 'yith_wc_tab_manager' ); ?></p>
48
  </div>
49
  <?php
50
  }
@@ -53,7 +53,7 @@ if ( !function_exists( 'WC' ) ) {
53
  function yith_ywtm_install_free_admin_notice() {
54
  ?>
55
  <div class="error">
56
- <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Tab Manager while you are using the premium one.', 'yith_wc_tab_manager' ); ?></p>
57
  </div>
58
  <?php
59
  }
@@ -65,7 +65,7 @@ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
65
 
66
 
67
  if ( !defined( 'YWTM_VERSION' ) ) {
68
- define( 'YWTM_VERSION', '1.0.6' );
69
  }
70
 
71
  if ( !defined( 'YWTM_FREE_INIT' ) ) {
@@ -106,7 +106,7 @@ if ( ! function_exists( 'YITH_Tab_Manager_Init' ) ) {
106
  function YITH_Tab_Manager_Init() {
107
 
108
  /* Load YWTM text domain */
109
- load_plugin_textdomain( 'yith_wc_tab_manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
110
 
111
  // Load required classes and functions
112
  require_once( YWTM_INC .'functions.yith-tab-manager.php' );
3
  * Plugin Name: YITH WooCommerce Tab Manager
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-tab-manager/
5
  * Description: YITH WooCommerce Tab Manager allows you to add Tab to products.
6
+ * Version: 1.1.0
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_tab_manager
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Tab Manager
14
+ * @version 1.1.0
15
  */
16
 
17
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
44
  function yith_ywtm_install_woocommerce_admin_notice() {
45
  ?>
46
  <div class="error">
47
+ <p><?php _e( 'YITH WooCommerce Tab Manager is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-tab-manager' ); ?></p>
48
  </div>
49
  <?php
50
  }
53
  function yith_ywtm_install_free_admin_notice() {
54
  ?>
55
  <div class="error">
56
+ <p><?php _e( 'You can\'t activate the free version of YITH WooCommerce Tab Manager while you are using the premium one.', 'yith-woocommerce-tab-manager' ); ?></p>
57
  </div>
58
  <?php
59
  }
65
 
66
 
67
  if ( !defined( 'YWTM_VERSION' ) ) {
68
+ define( 'YWTM_VERSION', '1.1.0' );
69
  }
70
 
71
  if ( !defined( 'YWTM_FREE_INIT' ) ) {
106
  function YITH_Tab_Manager_Init() {
107
 
108
  /* Load YWTM text domain */
109
+ load_plugin_textdomain( 'yith-woocommerce-tab-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
110
 
111
  // Load required classes and functions
112
  require_once( YWTM_INC .'functions.yith-tab-manager.php' );
modules/yith-woocommerce-tab-manager/languages/yith-woocommerce-tab-manager.pot ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: YITH WooCommerce Tab Manager\n"
4
+ "POT-Creation-Date: 2015-11-10 16:35+0100\n"
5
+ "PO-Revision-Date: 2015-11-10 16:35+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
+ "Language: en\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.11\n"
13
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;__ngettext:1,2;_n_noop:1,2;_c,_nc:4c,1,2;"
16
+ "_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+ "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
20
+
21
+ #: ../includes/class.yith-woocommerce-tab-manager.php:179
22
+ #: ../includes/class.yith-woocommerce-tab-manager.php:232
23
+ #: ../includes/metabox/tab-metabox.php:16
24
+ msgid "Settings"
25
+ msgstr ""
26
+
27
+ #: ../includes/class.yith-woocommerce-tab-manager.php:183
28
+ #: ../includes/class.yith-woocommerce-tab-manager.php:235
29
+ msgid "Premium Version"
30
+ msgstr ""
31
+
32
+ #: ../includes/class.yith-woocommerce-tab-manager.php:188
33
+ #: ../includes/class.yith-woocommerce-tab-manager.php:189
34
+ #: ../includes/class.yith-woocommerce-tab-manager.php:334
35
+ msgid "Tab Manager"
36
+ msgstr ""
37
+
38
+ #: ../includes/class.yith-woocommerce-tab-manager.php:273
39
+ msgid "Plugin Documentation"
40
+ msgstr ""
41
+
42
+ #: ../includes/class.yith-woocommerce-tab-manager.php:292
43
+ msgid "ywtm_tab"
44
+ msgstr ""
45
+
46
+ #: ../includes/class.yith-woocommerce-tab-manager.php:293
47
+ msgid "Yith Tab Manager Description"
48
+ msgstr ""
49
+
50
+ #: ../includes/class.yith-woocommerce-tab-manager.php:332
51
+ msgctxt "Post Type General Name"
52
+ msgid "YITH WooCommerce Tab Manager"
53
+ msgstr ""
54
+
55
+ #: ../includes/class.yith-woocommerce-tab-manager.php:333
56
+ msgctxt "Post Type Singular Name"
57
+ msgid "Tab"
58
+ msgstr ""
59
+
60
+ #: ../includes/class.yith-woocommerce-tab-manager.php:335
61
+ msgid "Parent Item:"
62
+ msgstr ""
63
+
64
+ #: ../includes/class.yith-woocommerce-tab-manager.php:336
65
+ msgid "All Tabs"
66
+ msgstr ""
67
+
68
+ #: ../includes/class.yith-woocommerce-tab-manager.php:337
69
+ msgid "View Tabs"
70
+ msgstr ""
71
+
72
+ #: ../includes/class.yith-woocommerce-tab-manager.php:338
73
+ #: ../includes/class.yith-woocommerce-tab-manager.php:339
74
+ msgid "Add New Tab"
75
+ msgstr ""
76
+
77
+ #: ../includes/class.yith-woocommerce-tab-manager.php:340
78
+ msgid "Edit Tab"
79
+ msgstr ""
80
+
81
+ #: ../includes/class.yith-woocommerce-tab-manager.php:341
82
+ msgid "Update Tab"
83
+ msgstr ""
84
+
85
+ #: ../includes/class.yith-woocommerce-tab-manager.php:342
86
+ msgid "Search Tab"
87
+ msgstr ""
88
+
89
+ #: ../includes/class.yith-woocommerce-tab-manager.php:343
90
+ msgid "Not found"
91
+ msgstr ""
92
+
93
+ #: ../includes/class.yith-woocommerce-tab-manager.php:344
94
+ msgid "Not found in Trash"
95
+ msgstr ""
96
+
97
+ #: ../includes/class.yith-woocommerce-tab-manager.php:364
98
+ #: ../includes/class.yith-woocommerce-tab-manager.php:367
99
+ msgid " updated"
100
+ msgstr ""
101
+
102
+ #: ../includes/class.yith-woocommerce-tab-manager.php:365
103
+ msgid "Custom field updated"
104
+ msgstr ""
105
+
106
+ #: ../includes/class.yith-woocommerce-tab-manager.php:366
107
+ msgid "Custom field deleted"
108
+ msgstr ""
109
+
110
+ #: ../includes/class.yith-woocommerce-tab-manager.php:368
111
+ #, php-format
112
+ msgid "Tab restored to version %s"
113
+ msgstr ""
114
+
115
+ #: ../includes/class.yith-woocommerce-tab-manager.php:369
116
+ msgid " published"
117
+ msgstr ""
118
+
119
+ #: ../includes/class.yith-woocommerce-tab-manager.php:370
120
+ msgid " saved"
121
+ msgstr ""
122
+
123
+ #: ../includes/class.yith-woocommerce-tab-manager.php:371
124
+ msgid " submitted"
125
+ msgstr ""
126
+
127
+ #: ../includes/class.yith-woocommerce-tab-manager.php:372
128
+ msgid " "
129
+ msgstr ""
130
+
131
+ #: ../includes/class.yith-woocommerce-tab-manager.php:373
132
+ msgid " draft updated"
133
+ msgstr ""
134
+
135
+ #: ../includes/class.yith-woocommerce-tab-manager.php:494
136
+ msgid "Title"
137
+ msgstr ""
138
+
139
+ #: ../includes/class.yith-woocommerce-tab-manager.php:495
140
+ msgid "Is Visible"
141
+ msgstr ""
142
+
143
+ #: ../includes/class.yith-woocommerce-tab-manager.php:496
144
+ msgid "Tab Position"
145
+ msgstr ""
146
+
147
+ #: ../includes/class.yith-woocommerce-tab-manager.php:497
148
+ msgid "Date"
149
+ msgstr ""
150
+
151
+ #: ../includes/metabox/tab-metabox.php:10
152
+ msgid "Tab Settings"
153
+ msgstr ""
154
+
155
+ #: ../includes/metabox/tab-metabox.php:19
156
+ msgid "Content Tab"
157
+ msgstr ""
158
+
159
+ #: ../includes/metabox/tab-metabox.php:24
160
+ msgid "Enable Tab"
161
+ msgstr ""
162
+
163
+ #: ../includes/metabox/tab-metabox.php:25
164
+ msgid "Show Tab in frontend"
165
+ msgstr ""
166
+
167
+ #: ../includes/metabox/tab-metabox.php:30
168
+ msgid "Tab Priority"
169
+ msgstr ""
170
+
171
+ #: ../includes/metabox/tab-metabox.php:31
172
+ msgid "The plugin tabs are displayed after the WooCommerce Tabs"
173
+ msgstr ""
174
+
175
+ #: ../init.php:47
176
+ msgid ""
177
+ "YITH WooCommerce Tab Manager is enabled but not effective. It requires "
178
+ "WooCommerce in order to work."
179
+ msgstr ""
180
+
181
+ #: ../init.php:56
182
+ msgid ""
183
+ "You can't activate the free version of YITH WooCommerce Tab Manager while "
184
+ "you are using the premium one."
185
+ msgstr ""
186
+
187
+ #: ../plugin-options/settings-options.php:19
188
+ msgid "Upgrade to the PREMIUM VERSION"
189
+ msgstr ""
190
+
191
+ #: ../plugin-options/settings-options.php:22
192
+ #: ../plugin-options/settings-options.php:30
193
+ msgid "YITH WooCommerce Tab Manager"
194
+ msgstr ""
195
+
196
+ #: ../plugin-options/settings-options.php:23
197
+ msgid "Discover the Advanced Features"
198
+ msgstr ""
199
+
200
+ #: ../plugin-options/settings-options.php:24
201
+ msgid ""
202
+ "Upgrade to the PREMIUM VERSION\n"
203
+ "of YITH WooCommerce Tab Manager to benefit from all features!"
204
+ msgstr ""
205
+
206
+ #: ../plugin-options/settings-options.php:32
207
+ msgid "Get Support and Pro Features"
208
+ msgstr ""
209
+
210
+ #: ../plugin-options/settings-options.php:33
211
+ msgid ""
212
+ "By purchasing the premium version of the plugin, you will take advantage of "
213
+ "the advanced features of the product and you will get one year of free "
214
+ "updates and support through our platform available 24h/24."
215
+ msgstr ""
216
+
217
+ #: ../plugin-options/settings-options.php:43
218
+ msgid "General settings"
219
+ msgstr ""
220
+
221
+ #: ../plugin-options/settings-options.php:49
222
+ msgid "Enable plugin"
223
+ msgstr ""
224
+
225
+ #: ../templates/admin/premium.php:198 ../templates/admin/premium.php:309
226
+ #, php-format
227
+ msgid ""
228
+ "Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Tab Manager%2$s "
229
+ "to benefit from all features!"
230
+ msgstr ""
231
+
232
+ #: ../templates/admin/premium.php:202 ../templates/admin/premium.php:313
233
+ msgid "UPGRADE"
234
+ msgstr ""
235
+
236
+ #: ../templates/admin/premium.php:203 ../templates/admin/premium.php:314
237
+ msgid "to the premium version"
238
+ msgstr ""
239
+
240
+ #: ../templates/admin/premium.php:209
241
+ msgid "Premium Features"
242
+ msgstr ""
243
+
244
+ #: ../templates/admin/premium.php:217
245
+ msgid "Free tab sorting"
246
+ msgstr ""
247
+
248
+ #: ../templates/admin/premium.php:220
249
+ #, php-format
250
+ msgid ""
251
+ "Enjoy creating unlimited tabs to add to your products and sort them in the "
252
+ "way you think is the best\n"
253
+ " one. To do that, take advantage of the innovation added "
254
+ "in the premium version: %1$syou will not be\n"
255
+ " forced to let your tabs appear after WooCommerce tabs"
256
+ "%2$s, but it will be up to you to decide to display\n"
257
+ " them before or after them. Finally, you are free to sort "
258
+ "them!"
259
+ msgstr ""
260
+
261
+ #: ../templates/admin/premium.php:234
262
+ msgid "An icon for each tab"
263
+ msgstr ""
264
+
265
+ #: ../templates/admin/premium.php:237
266
+ #, php-format
267
+ msgid ""
268
+ "Placing an icon next to the name of each tab is a wonderful way to give "
269
+ "style to your tab. You’ll\n"
270
+ " have a %1$swide selection of icons%2$s (Font Awesome and "
271
+ "Font Retina) put at your disposal, but if you want\n"
272
+ " even more, you can upload your own icon and preview it "
273
+ "before publishing it."
274
+ msgstr ""
275
+
276
+ #: ../templates/admin/premium.php:256
277
+ msgid "Tab type"
278
+ msgstr ""
279
+
280
+ #: ../templates/admin/premium.php:259
281
+ #, php-format
282
+ msgid ""
283
+ "Not all tabs are meant to be associated to all products indiscriminately. "
284
+ "Choose your tab type among\n"
285
+ " %1$s“global”, “category”%2$s and %1$s“product”%2$s and "
286
+ "associate the tab either to all products, as set by default,\n"
287
+ " to all products belonging to one or more categories or "
288
+ "to one or more specific products."
289
+ msgstr ""
290
+
291
+ #: ../templates/admin/premium.php:272
292
+ msgid "Custom tab for each product"
293
+ msgstr ""
294
+
295
+ #: ../templates/admin/premium.php:275
296
+ #, php-format
297
+ msgid ""
298
+ "Do you want a tab with a %1$sdifferent content%2$s for each product? You can "
299
+ "have it!%3$s A specific option of\n"
300
+ " this plugin allows you to change the content according "
301
+ "to the product and directly from its page in\n"
302
+ " WooCommerce for a quick and simple management."
303
+ msgstr ""
304
+
305
+ #: ../templates/admin/premium.php:293
306
+ msgid "8 tab layouts available"
307
+ msgstr ""
308
+
309
+ #: ../templates/admin/premium.php:296
310
+ #, php-format
311
+ msgid ""
312
+ "One would say “... and you name it!”%1$s\n"
313
+ " %2$sEight different layouts%3$s will allow you to create "
314
+ "unlimited tabs with different contents, which is\n"
315
+ " not just text. You can add image or video galleries, "
316
+ "contact forms, maps, F.A.Q.s, files available\n"
317
+ " for download or set the tab so that you can add whatever "
318
+ "shortcode you need.\n"
319
+ " %2$sYou do not need anything more to achieve the best "
320
+ "results!%3$s"
321
+ msgstr ""
modules/yith-woocommerce-tab-manager/plugin-options/settings-options.php CHANGED
@@ -16,21 +16,21 @@ return array(
16
  'settings' => array(
17
 
18
  'section_general_settings_videobox' => array(
19
- 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith_wc_tab_manager' ),
20
  'type' => 'videobox',
21
  'default' => array(
22
- 'plugin_name' => __( 'YITH WooCommerce Tab Manager', 'yith_wc_tab_manager' ),
23
- 'title_first_column' => __( 'Discover the Advanced Features', 'yith_wc_tab_manager' ),
24
  'description_first_column' => __('Upgrade to the PREMIUM VERSION
25
- of YITH WooCommerce Tab Manager to benefit from all features!', 'yith_wc_tab_manager'),
26
 
27
  'video' => array(
28
  'video_id' => '126788273',
29
  'video_image_url' => YWTM_ASSETS_URL.'/images/yith-woocommerce-tab-manager.jpg',
30
- 'video_description' => __( 'YITH WooCommerce Tab Manager', 'yith_wc_tab_manager' ),
31
  ),
32
- 'title_second_column' => __( 'Get Support and Pro Features', 'yith_wc_tab_manager' ),
33
- 'description_second_column' => __('By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith_wc_tab_manager'),
34
  'button' => array(
35
  'href' => 'http://yithemes.com/themes/plugins/yith-woocommerce-tab-manager/',
36
  'title' => 'Get Support and Pro Features'
@@ -40,13 +40,13 @@ of YITH WooCommerce Tab Manager to benefit from all features!', 'yith_wc_tab_man
40
  ),
41
 
42
  'section_general_settings' => array(
43
- 'name' => __( 'General settings', 'yith_wc_tab_manager' ),
44
  'type' => 'title',
45
  'id' => 'ywtm_section_general'
46
  ),
47
 
48
  'enable_plugin' => array(
49
- 'name' => __( 'Enable plugin', 'yith_wc_tab_manager' ),
50
  'desc' => '',
51
  'id' => 'ywtm_enable_plugin',
52
  'default' => 'no',
16
  'settings' => array(
17
 
18
  'section_general_settings_videobox' => array(
19
+ 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-tab-manager' ),
20
  'type' => 'videobox',
21
  'default' => array(
22
+ 'plugin_name' => __( 'YITH WooCommerce Tab Manager', 'yith-woocommerce-tab-manager' ),
23
+ 'title_first_column' => __( 'Discover the Advanced Features', 'yith-woocommerce-tab-manager' ),
24
  'description_first_column' => __('Upgrade to the PREMIUM VERSION
25
+ of YITH WooCommerce Tab Manager to benefit from all features!', 'yith-woocommerce-tab-manager'),
26
 
27
  'video' => array(
28
  'video_id' => '126788273',
29
  'video_image_url' => YWTM_ASSETS_URL.'/images/yith-woocommerce-tab-manager.jpg',
30
+ 'video_description' => __( 'YITH WooCommerce Tab Manager', 'yith-woocommerce-tab-manager' ),
31
  ),
32
+ 'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-tab-manager' ),
33
+ 'description_second_column' => __('By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-tab-manager'),
34
  'button' => array(
35
  'href' => 'http://yithemes.com/themes/plugins/yith-woocommerce-tab-manager/',
36
  'title' => 'Get Support and Pro Features'
40
  ),
41
 
42
  'section_general_settings' => array(
43
+ 'name' => __( 'General settings', 'yith-woocommerce-tab-manager' ),
44
  'type' => 'title',
45
  'id' => 'ywtm_section_general'
46
  ),
47
 
48
  'enable_plugin' => array(
49
+ 'name' => __( 'Enable plugin', 'yith-woocommerce-tab-manager' ),
50
  'desc' => '',
51
  'id' => 'ywtm_enable_plugin',
52
  'default' => 'no',
modules/yith-woocommerce-tab-manager/templates/admin/premium.php CHANGED
@@ -195,18 +195,18 @@
195
  <div class="landing-container">
196
  <div class="premium-cta">
197
  <p>
198
- Upgrade to the <span class="highlight">premium version</span>
199
- of <span class="highlight">YITH WooCommerce Tab Manager</span> to benefit from all features!
200
  </p>
201
  <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
202
- <span class="highlight">UPGRADE</span>
203
- <span>to the premium version</span>
204
  </a>
205
  </div>
206
  </div>
207
  </div>
208
  <div class="section section-even clear" style="background: url(<?php echo YWTM_ASSETS_URL ?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
209
- <h1>Premium Features</h1>
210
  <div class="landing-container">
211
  <div class="col-1">
212
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/01.png" alt="Review Title" />
@@ -214,13 +214,14 @@
214
  <div class="col-2">
215
  <div class="section-title">
216
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/01-icon.png" alt="Review Title"/>
217
- <h2>Free tab sorting</h2>
218
  </div>
219
  <p>
220
- Enjoy creating unlimited tabs to add to your products and sort them in the way you think is the best
221
- one. To do that, take advantage of the innovation added in the premium version: <b>you will not be
222
- forced to let your tabs appear after WooCommerce tabs</b>, but it will be up to you to decide to display
223
- them before or after them. Finally, you are free to sort them!
 
224
  </p>
225
  </div>
226
  </div>
@@ -230,11 +231,13 @@
230
  <div class="col-2">
231
  <div class="section-title">
232
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/02-icon.png" alt="Attachment List" />
233
- <h2>An icon for each tab</h2>
234
  </div>
235
- <p>Placing an icon next to the name of each tab is a wonderful way to give style to your tab. You’ll
236
- have a <b>wide selection of icons</b> (Font Awesome and Font Retina) put at your disposal, but if you want
237
- even more, you can upload your own icon and preview it before publishing it.
 
 
238
  </p>
239
  </div>
240
  <div class="col-1">
@@ -250,11 +253,14 @@
250
  <div class="col-2">
251
  <div class="section-title">
252
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/03-icon.png" alt="Vote the review" />
253
- <h2>Tab type</h2>
254
  </div>
255
- <p>Not all tabs are meant to be associated to all products indiscriminately. Choose your tab type among
256
- <b>“global”, “category”</b> and <b>“product”</b> and associate the tab either to all products, as set by default,
257
- to all products belonging to one or more categories or to one or more specific products.</p>
 
 
 
258
  </div>
259
  </div>
260
  </div>
@@ -263,11 +269,13 @@
263
  <div class="col-2">
264
  <div class="section-title">
265
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/04-icon.png" alt="Number" />
266
- <h2>Custom tab for each product</h2>
267
  </div>
268
- <p>Do you want a tab with a <b>different content</b> for each product? You can have it!<br> A specific option of
 
269
  this plugin allows you to change the content according to the product and directly from its page in
270
- WooCommerce for a quick and simple management.</p>
 
271
  </div>
272
  <div class="col-1">
273
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/04.png" alt="Number" />
@@ -282,14 +290,14 @@
282
  <div class="col-2">
283
  <div class="section-title">
284
  <img src="<?php echo YWTM_ASSETS_URL?>/images/05-icon.png" alt="Filter by rating" />
285
- <h2>8 tab layouts available</h2>
286
  </div>
287
  <p>
288
- One would say “... and you name it!”<br>
289
- <b>Eight different layouts</b> will allow you to create unlimited tabs with different contents, which is
290
  not just text. You can add image or video galleries, contact forms, maps, F.A.Q.s, files available
291
  for download or set the tab so that you can add whatever shortcode you need.
292
- <b>You do not need anything more to achieve the best results!</b>
293
  </p>
294
  </div>
295
  </div>
@@ -298,12 +306,12 @@
298
  <div class="landing-container">
299
  <div class="premium-cta">
300
  <p>
301
- Upgrade to the <span class="highlight">premium version</span>
302
- of <span class="highlight">YITH WooCommerce Tab Manager</span> to benefit from all features!
303
  </p>
304
  <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
305
- <span class="highlight">UPGRADE</span>
306
- <span>to the premium version</span>
307
  </a>
308
  </div>
309
  </div>
195
  <div class="landing-container">
196
  <div class="premium-cta">
197
  <p>
198
+ <?php echo sprintf( __('Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Tab Manager%2$s to benefit from all features!','yith-woocommerce-tab-manager'),'<span class="highlight">','</span>' );?>
199
+
200
  </p>
201
  <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
202
+ <span class="highlight"><?php _e( 'UPGRADE','yith-woocommerce-tab-manager' );?></span>
203
+ <span><?php _e( 'to the premium version','yith-woocommerce-tab-manager' );?></span>
204
  </a>
205
  </div>
206
  </div>
207
  </div>
208
  <div class="section section-even clear" style="background: url(<?php echo YWTM_ASSETS_URL ?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
209
+ <h1><?php _e( 'Premium Features' ,'yith-woocommerce-tab-manager' );?></h1>
210
  <div class="landing-container">
211
  <div class="col-1">
212
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/01.png" alt="Review Title" />
214
  <div class="col-2">
215
  <div class="section-title">
216
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/01-icon.png" alt="Review Title"/>
217
+ <h2><?php _e( 'Free tab sorting', 'yith-woocommerce-tab-manager' );?></h2>
218
  </div>
219
  <p>
220
+ <?php echo sprintf( __( 'Enjoy creating unlimited tabs to add to your products and sort them in the way you think is the best
221
+ one. To do that, take advantage of the innovation added in the premium version: %1$syou will not be
222
+ forced to let your tabs appear after WooCommerce tabs%2$s, but it will be up to you to decide to display
223
+ them before or after them. Finally, you are free to sort them!', 'yith-woocommerce-tab-manager' ), '<b>','</b>' );
224
+ ?>
225
  </p>
226
  </div>
227
  </div>
231
  <div class="col-2">
232
  <div class="section-title">
233
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/02-icon.png" alt="Attachment List" />
234
+ <h2><?php _e( 'An icon for each tab', 'yith-woocommerce-tab-manager' );?></h2>
235
  </div>
236
+ <p>
237
+ <?php echo sprintf( __( 'Placing an icon next to the name of each tab is a wonderful way to give style to your tab. You’ll
238
+ have a %1$swide selection of icons%2$s (Font Awesome and Font Retina) put at your disposal, but if you want
239
+ even more, you can upload your own icon and preview it before publishing it.', 'yith-woocommerce-tab-manager'), '<b>','</b>' );
240
+ ?>
241
  </p>
242
  </div>
243
  <div class="col-1">
253
  <div class="col-2">
254
  <div class="section-title">
255
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/03-icon.png" alt="Vote the review" />
256
+ <h2><?php _e( 'Tab type','yith-woocommerce-tab-manager' );?></h2>
257
  </div>
258
+ <p>
259
+ <?php echo sprintf( __('Not all tabs are meant to be associated to all products indiscriminately. Choose your tab type among
260
+ %1$s“global”, “category”%2$s and %1$s“product”%2$s and associate the tab either to all products, as set by default,
261
+ to all products belonging to one or more categories or to one or more specific products.', 'yith-woocommerce-tab-manager' ), '<b>','</b>' );
262
+ ?>
263
+ </p>
264
  </div>
265
  </div>
266
  </div>
269
  <div class="col-2">
270
  <div class="section-title">
271
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/04-icon.png" alt="Number" />
272
+ <h2><?php _e( 'Custom tab for each product', 'yith-woocommerce-tab-manager' );?></h2>
273
  </div>
274
+ <p>
275
+ <?php echo sprintf( __( 'Do you want a tab with a %1$sdifferent content%2$s for each product? You can have it!%3$s A specific option of
276
  this plugin allows you to change the content according to the product and directly from its page in
277
+ WooCommerce for a quick and simple management.', 'yith-woocommerce-tab-manager'), '<b>','</b>','<br>' ); ?>
278
+ </p>
279
  </div>
280
  <div class="col-1">
281
  <img src="<?php echo YWTM_ASSETS_URL ?>/images/04.png" alt="Number" />
290
  <div class="col-2">
291
  <div class="section-title">
292
  <img src="<?php echo YWTM_ASSETS_URL?>/images/05-icon.png" alt="Filter by rating" />
293
+ <h2><?php _e( '8 tab layouts available', 'yith-woocommerce-tab-manager' );?></h2>
294
  </div>
295
  <p>
296
+ <?php echo sprintf( __('One would say “... and you name it!”%1$s
297
+ %2$sEight different layouts%3$s will allow you to create unlimited tabs with different contents, which is
298
  not just text. You can add image or video galleries, contact forms, maps, F.A.Q.s, files available
299
  for download or set the tab so that you can add whatever shortcode you need.
300
+ %2$sYou do not need anything more to achieve the best results!%3$s', 'yith-woocommerce-tab-manager'), '<br>','<b>','</b>' );?>
301
  </p>
302
  </div>
303
  </div>
306
  <div class="landing-container">
307
  <div class="premium-cta">
308
  <p>
309
+ <?php echo sprintf( __('Upgrade to %1$spremium version%2$s of %1$sYITH WooCommerce Tab Manager%2$s to benefit from all features!','yith-woocommerce-tab-manager'),'<span class="highlight">','</span>' );?>
310
+
311
  </p>
312
  <a href="<?php echo $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
313
+ <span class="highlight"><?php _e( 'UPGRADE','yith-woocommerce-tab-manager' );?></span>
314
+ <span><?php _e( 'to the premium version','yith-woocommerce-tab-manager' );?></span>
315
  </a>
316
  </div>
317
  </div>
modules/yith-woocommerce-wishlist/assets/css/admin.css CHANGED
@@ -1,63 +1,63 @@
1
- /**
2
- * Admin YITH WooCommerce Wishlist CSS
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Wishlist
6
- * @version 1.1.5
7
- */
8
-
9
- h2.nav-tab-wrapper{
10
- margin-bottom: 15px;
11
- }
12
-
13
- #yith_wcwl_panel_colors .color-panel{
14
- background: #ffffff;
15
- padding: 20px;
16
- }
17
-
18
- #yith_wcwl_panel_colors .color_box {
19
- border: 1px solid #CCC;
20
- box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
21
- -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
22
- -moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
23
- -webkit-border-radius: 3px;
24
- -moz-border-radius: 3px;
25
- border-radius: 3px;
26
- padding: 4px 6px;
27
- float: left;
28
- width: 250px;
29
- margin: 0 10px 0 0;
30
- }
31
-
32
- #yith_wcwl_panel_colors .color_box strong {
33
- text-align: left;
34
- display: block;
35
- padding: 0 0 2px;
36
- font-size: .92em;
37
- }
38
-
39
- #yith_wcwl_panel_colors .color_box strong img {
40
- float: right;
41
- margin: 1px 0 0 0;
42
- }
43
-
44
- #yith_wcwl_panel_colors .color_box input {
45
- width: 100%;
46
- margin: 0;
47
- font-family: monospace;
48
- -webkit-box-sizing: border-box;
49
- -moz-box-sizing: border-box;
50
- box-sizing: border-box;
51
- }
52
-
53
- #yith_wcwl_panel_colors .color_box .colorpickdiv {
54
- z-index: 100;
55
- background: #EEE;
56
- border: 1px solid #CCC;
57
- position: absolute;
58
- display: none;
59
- }
60
-
61
- .woocommerce_page_wishlist #TB_window img#TB_Image{
62
- border: none;
63
  }
1
+ /**
2
+ * Admin YITH WooCommerce Wishlist CSS
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Wishlist
6
+ * @version 1.1.5
7
+ */
8
+
9
+ h2.nav-tab-wrapper{
10
+ margin-bottom: 15px;
11
+ }
12
+
13
+ #yith_wcwl_panel_colors .color-panel{
14
+ background: #ffffff;
15
+ padding: 20px;
16
+ }
17
+
18
+ #yith_wcwl_panel_colors .color_box {
19
+ border: 1px solid #CCC;
20
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
21
+ -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
22
+ -moz-box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
23
+ -webkit-border-radius: 3px;
24
+ -moz-border-radius: 3px;
25
+ border-radius: 3px;
26
+ padding: 4px 6px;
27
+ float: left;
28
+ width: 250px;
29
+ margin: 0 10px 0 0;
30
+ }
31
+
32
+ #yith_wcwl_panel_colors .color_box strong {
33
+ text-align: left;
34
+ display: block;
35
+ padding: 0 0 2px;
36
+ font-size: .92em;
37
+ }
38
+
39
+ #yith_wcwl_panel_colors .color_box strong img {
40
+ float: right;
41
+ margin: 1px 0 0 0;
42
+ }
43
+
44
+ #yith_wcwl_panel_colors .color_box input {
45
+ width: 100%;
46
+ margin: 0;
47
+ font-family: monospace;
48
+ -webkit-box-sizing: border-box;
49
+ -moz-box-sizing: border-box;
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ #yith_wcwl_panel_colors .color_box .colorpickdiv {
54
+ z-index: 100;
55
+ background: #EEE;
56
+ border: 1px solid #CCC;
57
+ position: absolute;
58
+ display: none;
59
+ }
60
+
61
+ .woocommerce_page_wishlist #TB_window img#TB_Image{
62
+ border: none;
63
  }
modules/yith-woocommerce-wishlist/assets/css/style.css CHANGED
@@ -1,588 +1,588 @@
1
- /**
2
- * Main YITH WooCommerce Wishlist CSS
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Wishlist
6
- * @version 1.1.5
7
- */
8
-
9
- .summary .product_meta { margin-top: 45px; }
10
-
11
- /* Selectbox style */
12
- .woocommerce a.selectBox{
13
- background: #ffffff;
14
- min-width: 100px;
15
- margin-right: 10px;
16
- color: inherit;
17
- }
18
-
19
- .woocommerce a.selectBox,
20
- .woocommerce a.selectBox:hover{
21
- border-bottom: 1px solid #bbb!important;
22
- }
23
-
24
- .woocommerce a.selectBox:hover{
25
- color: inherit;
26
- }
27
-
28
- .woocommerce a.selectBox:focus{
29
- border: 1px solid #ccc;
30
- }
31
-
32
- .selectBox-dropdown .selectBox-label{
33
- vertical-align: middle;
34
- padding: 3px 8px;
35
- }
36
-
37
- .selectBox-dropdown .selectBox-arrow{
38
- border: none;
39
- background: url(../images/jquery.selectBox-arrow.png) center right no-repeat;
40
- }
41
-
42
- .selectBox-dropdown.selectBox-menuShowing .selectBox-arrow{
43
- background: url(../images/jquery.selectBox-arrow.png) center left no-repeat;
44
- }
45
-
46
- .selectBox-dropdown-menu{
47
- border-bottom-left-radius: 3px;
48
- border-bottom-right-radius: 3px;
49
- padding: 5px;
50
- font-size: 80%;
51
- }
52
-
53
- .selectBox-label.public-visibility:before,
54
- .selectBox-dropdown-menu li.public-visibility a:before{
55
- font-family: FontAwesome;
56
- display: inline-block;
57
- content: "\f0ac";
58
- margin-right: 5px;
59
- }
60
-
61
- .selectBox-label.shared-visibility:before,
62
- .selectBox-dropdown-menu li.shared-visibility a:before{
63
- font-family: FontAwesome;
64
- display: inline-block;
65
- content: "\f0c1";
66
- margin-right: 5px;
67
- }
68
-
69
- .selectBox-label.private-visibility:before,
70
- .selectBox-dropdown-menu li.private-visibility a:before{
71
- font-family: FontAwesome;
72
- display: inline-block;
73
- content: "\f023";
74
- margin-right: 5px;
75
- }
76
-
77
- .selectBox-dropdown-menu li a{
78
- color: inherit;
79
- padding: 5px 8px;
80
- border-radius: 3px;
81
- }
82
-
83
- .selectBox-dropdown-menu a:hover{
84
- color: inherit;
85
- text-decoration: none;
86
- }
87
-
88
- /* Wishlist table */
89
- .woocommerce .wishlist_table td.product-add-to-cart a{
90
- display: block!important;
91
- margin: 0;
92
- margin-bottom: 5px;
93
- text-align: center;
94
- }
95
- .woocommerce .wishlist_table td.product-add-to-cart span.dateadded{
96
- display: block;
97
- }
98
-
99
- /* Popup add to wishlist */
100
- .yith-wcwl-add-button a.open-pretty-photo{
101
- display: none;
102
- }
103
- .yes-js .yith-wcwl-add-button a.open-pretty-photo{
104
- display: inline-block;
105
- }
106
- .yes-js .yith-wcwl-popup{
107
- display: none;
108
- text-align: center;
109
- }
110
- .yes-js .yith-wcwl-popup-content{
111
-
112
- }
113
- .yes-js .yith-wcwl-popup-content{
114
- display: table;
115
- width: 100%;
116
- }
117
- .yes-js .yith-wcwl-popup-content .yith-wcwl-first-row{
118
- display: table-header-group;
119
- }
120
- .yes-js .yith-wcwl-popup-content .yith-wcwl-second-row{
121
- display: none;
122
- }
123
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container,
124
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-thumb,
125
- .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new,
126
- .yes-js .yith-wcwl-popup-content .yith-wcwl-visibility{
127
- display: table-cell;
128
- vertical-align: bottom;
129
- }
130
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container{
131
- width: 80%;
132
- padding-bottom: 20px;
133
- }
134
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container select,
135
- .yes-js .yith-wcwl-popup-content .yith-wcwl-visibility select,
136
- .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new input{
137
- border: 1px solid #ccc;
138
- height: 35px;
139
- border-radius: 3px;
140
- }
141
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container select{
142
- width: 100%;
143
- font-weight: 700;
144
- padding-left: 10px;
145
- }
146
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-thumb{
147
- width: 20%;
148
- padding-bottom: 20px;
149
- }
150
- .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-thumb img{
151
- float: right;
152
- border: 1px solid #ccc;
153
- border-radius: 3px;
154
- }
155
- .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new{
156
- text-align: right;
157
- }
158
- .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new label{
159
- font-weight: 700;
160
- }
161
- .yes-js .yith-wcwl-popup-content .yith-wcwl-visibility select{
162
- float: right;
163
- min-width: 90px;
164
- }
165
- .yes-js .yith-wcwl-popup-footer{
166
- border-top: 1px solid #CCC;
167
- padding: 20px 20px 0 20px;
168
- margin: 20px -20px 0;
169
- text-align: right;
170
- }
171
-
172
- /* Popup message */
173
- #yith-wcwl-popup-message {
174
- background: white;
175
- border: 1px solid #CCC;
176
- border-radius: 5px;
177
- -webkit-border-radius: 5px;
178
- -moz-border-radius: 5px;
179
- line-height: 50px;
180
- padding: 15px;
181
- position: fixed;
182
- text-align: center;
183
- top: 50%;
184
- left: 50%;
185
- z-index: 10000; /* Thanks WP -.- */
186
- }
187
-
188
- /*Wishlist title form*/
189
- .wishlist-title{
190
- display: inline-block;
191
- }
192
- .wishlist-title h2{
193
- display: inline-block;
194
- padding: 5px;
195
- }
196
- .wishlist-title.wishlist-title-with-form h2:hover{
197
- background: #efefef;
198
- }
199
- .wishlist-title a.show-title-form{
200
- cursor: pointer;
201
- visibility: hidden;
202
- }
203
- .wishlist-title:hover a.show-title-form{
204
- visibility: visible;
205
- }
206
- .yes-js #yith-wcwl-form .hidden-title-form{
207
- display: none;
208
- margin: 25px 0 39px;
209
- }
210
-
211
- /* Wishlist table template */
212
-
213
- .woocommerce table.wishlist_table{
214
- font-size: 80%;
215
- }
216
-
217
- .woocommerce table.wishlist_table thead th{
218
- border-top: 1px solid;
219
- padding: 16px 12px;
220
- }
221
-
222
- .woocommerce table.wishlist_table tbody td{
223
- padding: 16px 12px;
224
- }
225
-
226
- .woocommerce table.wishlist_table thead th,
227
- .woocommerce table.wishlist_table tbody td{
228
- border-color: #e7e7e7;
229
- }
230
-
231
- .wishlist_table tr td, .wishlist_table tr th.wishlist-delete, .wishlist_table tr th.product-checkbox { text-align: center; }
232
- .wishlist_table tr th.product-checkbox { vertical-align: middle; width: 40px; }
233
- .wishlist_table tr th.product-remove { vertical-align: middle; width: 40px; }
234
- .wishlist_table tr th.product-thumbnail{ width: 80px; }
235
- .wishlist_table tr td.product-thumbnail, .wishlist_table tr td.product-name, .wishlist_table tr td.wishlist-name, .wishlist_table tr td.wishlist-privacy, .woocommerce table.wishlist_table tfoot td { text-align: left; }
236
- .woocommerce table.wishlist_table tr td.product-remove { padding: 16px 0 }
237
- .wishlist_table tr td.product-thumbnail a { display: block; border: none; max-width: 80px; }
238
- .wishlist_table tr td.product-thumbnail a img { width: 100%; }
239
- .wishlist_table tr td.product-stock-status span.wishlist-in-stock { color: #297E29; }
240
- .wishlist_table tr td.product-stock-status span.wishlist-out-of-stock { color: #F00; }
241
- .wishlist_table tr td a.button { white-space: normal; }
242
-
243
- /* Wishlist buttons */
244
- a.add_to_wishlist{
245
- cursor: pointer;
246
- }
247
-
248
- .summary .single_add_to_wishlist.button,
249
- div.product .woocommerce-price-and-add .single_add_to_wishlist.button {
250
- margin: 0px;
251
- }
252
-
253
- .wishlist_table .add_to_cart.button{
254
- padding: 7px 12px;
255
- line-height: normal;
256
- }
257
-
258
- .yith-wcwl-add-to-wishlist {
259
- margin-top: 10px;
260
- }
261
-
262
- .yith-wcwl-add-button > a i,
263
- .wishlist_table .add_to_cart.button i,
264
- .wishlist_table .ask-an-estimate-button i,
265
- .wishlist-title a.show-title-form i,
266
- .hidden-title-form a.hide-title-form i,
267
- .hidden-title-form button i,
268
- .yith-wcwl-wishlist-new button i,
269
- .wishlist_manage_table tfoot button.submit-wishlist-changes i,
270
- .wishlist_manage_table tfoot a.create-new-wishlist i,
271
- .yith-wcwl-wishlist-search-form button.wishlist-search-button i{
272
- margin-right: 10px;
273
- }
274
-
275
- .wishlist_table .add_to_cart.button,
276
- .yith-wcwl-add-button a.add_to_wishlist,
277
- .yith-wcwl-popup-button a.add_to_wishlist,
278
- .wishlist_table a.ask-an-estimate-button,
279
- .wishlist-title a.show-title-form,
280
- .hidden-title-form a.hide-title-form,
281
- .woocommerce .yith-wcwl-wishlist-new button,
282
- .wishlist_manage_table a.create-new-wishlist,
283
- .wishlist_manage_table button.submit-wishlist-changes,
284
- .yith-wcwl-wishlist-search-form button.wishlist-search-button{
285
- margin: 0px;
286
- box-shadow: none;
287
- text-shadow: none;
288
- border-radius: 3px;
289
- }
290
-
291
- /* Wishlist title */
292
- .woocommerce .wishlist-title h2{
293
- vertical-align: middle;
294
- }
295
-
296
- .woocommerce .wishlist-title a.show-title-form{
297
- vertical-align: middle;
298
- margin-left: 15px;
299
- }
300
-
301
- .woocommerce .hidden-title-form input[type="text"]{
302
- border: 1px solid #ccc;
303
- border-radius: 3px;
304
- height: 35px;
305
- min-width: 250px;
306
- vertical-align: middle;
307
- }
308
-
309
- .woocommerce .hidden-title-form button{
310
- padding: 7px 24px;
311
- vertical-align: middle;
312
- border: none;
313
- position: relative;
314
- }
315
-
316
- .woocommerce .hidden-title-form button:active{
317
- top: 1px;
318
- }
319
-
320
- .woocommerce .hidden-title-form a.hide-title-form{
321
- vertical-align: middle;
322
- line-height: normal;
323
- }
324
-
325
- /* Remove buttons */
326
- .woocommerce #content table.wishlist_table.cart a.remove{
327
- color: #c3c3c3;
328
- margin: 0 auto;
329
- }
330
-
331
- .woocommerce #content table.wishlist_table.cart a.remove:hover{
332
- background-color: #c3c3c3;
333
- color: #fff;
334
- }
335
-
336
- /* Share buttons */
337
- .yith-wcwl-share{
338
- margin-bottom: 35px;
339
- }
340
-
341
- .yith-wcwl-share h4.yith-wcwl-share-title{
342
- margin: 10px 0;
343
- }
344
-
345
- .yith-wcwl-share ul {
346
- margin: 5px 0;
347
- padding: 0;
348
- }
349
-
350
- .yith-wcwl-share ul, .yith-wcwl-share li { height: 21px; }
351
- .yith-wcwl-share li, .entry-content .yith-wcwl-share li { margin-left: 0px; margin-right: 0px; }
352
-
353
- .yith-wcwl-share li a {
354
- background-position: left top;
355
- display: inline-block;
356
- width: 21px;
357
- height: 21px;
358
- border: none;
359
- }
360
-
361
- .yith-wcwl-share li a:hover { background-position: left bottom; }
362
- .yith-wcwl-share li a.facebook { background-image: url(../images/facebook.png ); }
363
- .yith-wcwl-share li a.twitter { background-image: url(../images/twitter.png ); }
364
- .yith-wcwl-share li a.pinterest { background-image: url(../images/pinterest.jpg ); }
365
- .yith-wcwl-share li a.googleplus { background-image: url(../images/googleplus.jpg ); }
366
- .yith-wcwl-share li a.email { background-image: url(../images/email.jpg ); }
367
-
368
- /* Ask an estimate button */
369
- .woocommerce .wishlist_table.cart .ask-an-estimate-button,
370
- .woocommerce .wishlist_table.cart #custom_add_to_cart{
371
- margin: 10px 0;
372
- display: inline-block;
373
- }
374
-
375
- .woocommerce .wishlist_table.cart .ask-an-estimate-button{
376
- padding: 7px 12px;
377
- line-height: normal;
378
- }
379
-
380
- #ask_an_estimate_popup{
381
- display: none;
382
- }
383
-
384
- .ask-an-estimate-button-popup{
385
- margin-top: 30px!important;
386
- float: right;
387
- text-transform: none;
388
- }
389
-
390
- #additional_notes{
391
- min-height: 150px;
392
- }
393
-
394
- /* Create new wishlist*/
395
- .yith-wcwl-wishlist-new{
396
- padding: 20px 30px;
397
- border-bottom: 1px solid #e7e7e7;
398
- }
399
-
400
- .yith-wcwl-wishlist-new label{
401
- vertical-align: middle;
402
- margin-right: 20px;
403
- }
404
-
405
- .yith-wcwl-wishlist-new input{
406
- min-width: 190px;
407
- }
408
-
409
- .yith-wcwl-wishlist-new input[type="text"],
410
- .yith-wcwl-wishlist-new select{
411
- border: 1px solid #ccc;
412
- border-radius: 3px;
413
- height: 35px;
414
- vertical-align: middle;
415
- margin-right: 10px;
416
- }
417
-
418
- .woocommerce .yith-wcwl-wishlist-new button{
419
- padding: 7px 24px;
420
- vertical-align: middle;
421
- border: 1px solid;
422
- position: relative;
423
- }
424
-
425
- .woocommerce .yith-wcwl-wishlist-new button:active{
426
- top: 1px;
427
- }
428
-
429
- /* Manage wishlists */
430
- .woocommerce .wishlist_manage_table select{
431
- border: 1px solid #ccc;
432
- border-radius: 3px;
433
- height: 35px;
434
- vertical-align: middle;
435
- margin-right: 10px;
436
- }
437
-
438
- .woocommerce table.wishlist_manage_table tfoot td{
439
- text-align: right;
440
- padding: 24px 12px;
441
- }
442
-
443
- .woocommerce .wishlist_manage_table tfoot button.submit-wishlist-changes{
444
- padding: 7px 24px;
445
- vertical-align: middle;
446
- border: 1px solid;
447
- border-radius: 3px;
448
- position: relative;
449
- line-height: normal;
450
- }
451
-
452
- .woocommerce .wishlist_manage_table tfoot button.submit-wishlist-changes:active{
453
- top: 1px;
454
- }
455
-
456
- .woocommerce .wishlist_manage_table tfoot a.create-new-wishlist{
457
- vertical-align: middle;
458
- line-height: normal;
459
- padding: 7px 24px;
460
- }
461
-
462
- /* Search wishlist */
463
- .woocommerce .yith-wcwl-wishlist-search-form{
464
- padding: 20px 80px;
465
- border-bottom: 1px solid #e7e7e7;
466
- }
467
-
468
- .woocommerce .yith-wcwl-wishlist-search-form:after{
469
- content: '';
470
- display: block;
471
- clear: both;
472
- }
473
-
474
- .woocommerce .yith-wcwl-wishlist-search-form #wishlist_search{
475
- min-width: 300px;
476
- border: 1px solid #ccc;
477
- border-radius: 3px;
478
- height: 35px;
479
- vertical-align: middle;
480
- float: left;
481
- }
482
-
483
- .woocommerce .yith-wcwl-wishlist-search-form button.wishlist-search-button{
484
- padding: 7px 24px;
485
- vertical-align: middle;
486
- border: 1px solid;
487
- border-radius: 3px;
488
- position: relative;
489
- line-height: normal;
490
- float: right;
491
- }
492
-
493
- .woocommerce p.yith-wcwl-empty-search-result{
494
- padding: 50px 0;
495
- text-align: center;
496
- }
497
-
498
- .woocommerce .yith-wcwl-wishlist-search-form button.wishlist-search-button:active{
499
- top: 1px;
500
- }
501
-
502
- .woocommerce ul.yith-wcwl-search-results,
503
- .woocommerce ul.user-wishlists{
504
- list-style: none;
505
- margin: 0;
506
- padding: 0;
507
- }
508
-
509
- .woocommerce ul.yith-wcwl-search-results > li{
510
- padding: 50px 80px;
511
- border-bottom: 1px solid #e7e7e7;
512
- }
513
-
514
- .woocommerce ul.yith-wcwl-search-results > li:after{
515
- content: '';
516
- display: block;
517
- clear: both;
518
- }
519
-
520
- .woocommerce ul.yith-wcwl-search-results .thumb{
521
- float: left;
522
- margin-right: 15px;
523
- }
524
-
525
- .woocommerce ul.yith-wcwl-search-results .user-details{
526
- overflow: hidden;
527
- padding-top: 15px;
528
- }
529
-
530
- .woocommerce ul.yith-wcwl-search-results .user-details span{
531
- display: block;
532
- }
533
-
534
- .woocommerce ul.yith-wcwl-search-results .user-details span.name{
535
- font-weight: 700;
536
- }
537
-
538
- .woocommerce ul.yith-wcwl-search-results .reuslt-details{
539
- float: left;
540
- width: 50%;
541
- }
542
-
543
- .woocommerce ul.yith-wcwl-search-results .result-wishlists{
544
- float: right;
545
- max-width: 50%;
546
- padding-top: 15px;
547
- }
548
-
549
- .woocommerce .yith-wcwl-search-pagination{
550
- padding: 5px 0;
551
- text-align: center;
552
- }
553
-
554
- /* AJAX loading gif */
555
- .yith-wcwl-add-to-wishlist .ajax-loading {
556
- box-shadow: none !important;
557
- -moz-box-shadow: none !important;
558
- -webkit-box-shadow: none !important;
559
- display: inline !important;
560
- margin-left: 5px;
561
- vertical-align: middle;
562
- visibility: hidden;
563
- width: 16px !important;
564
- height: 16px !important;
565
- }
566
-
567
- /* Widget wishlist */
568
- .widget_yith-wcwl-lists ul.dropdown li{
569
- padding: 0;
570
- }
571
-
572
- .widget_yith-wcwl-lists ul.dropdown > li a,
573
- .widget_yith-wcwl-lists ul.dropdown ul.lists > li a{
574
- display: block;
575
- padding: 5px 15px;
576
- }
577
-
578
- .widget_yith-wcwl-lists ul.dropdown ul.lists > li a{
579
- padding: 5px 25px;
580
- }
581
-
582
- .widget_yith-wcwl-lists ul.dropdown > li.lists-section{
583
- border-bottom: 1px solid #e7e7e7;
584
- }
585
-
586
- .widget_yith-wcwl-lists ul.dropdown ul.lists{
587
- margin: 0;
588
  }
1
+ /**
2
+ * Main YITH WooCommerce Wishlist CSS
3
+ *
4
+ * @author Your Inspiration Themes
5
+ * @package YITH WooCommerce Wishlist
6
+ * @version 1.1.5
7
+ */
8
+
9
+ .summary .product_meta { margin-top: 45px; }
10
+
11
+ /* Selectbox style */
12
+ .woocommerce a.selectBox{
13
+ background: #ffffff;
14
+ min-width: 100px;
15
+ margin-right: 10px;
16
+ color: inherit;
17
+ }
18
+
19
+ .woocommerce a.selectBox,
20
+ .woocommerce a.selectBox:hover{
21
+ border-bottom: 1px solid #bbb!important;
22
+ }
23
+
24
+ .woocommerce a.selectBox:hover{
25
+ color: inherit;
26
+ }
27
+
28
+ .woocommerce a.selectBox:focus{
29
+ border: 1px solid #ccc;
30
+ }
31
+
32
+ .selectBox-dropdown .selectBox-label{
33
+ vertical-align: middle;
34
+ padding: 3px 8px;
35
+ }
36
+
37
+ .selectBox-dropdown .selectBox-arrow{
38
+ border: none;
39
+ background: url(../images/jquery.selectBox-arrow.png) center right no-repeat;
40
+ }
41
+
42
+ .selectBox-dropdown.selectBox-menuShowing .selectBox-arrow{
43
+ background: url(../images/jquery.selectBox-arrow.png) center left no-repeat;
44
+ }
45
+
46
+ .selectBox-dropdown-menu{
47
+ border-bottom-left-radius: 3px;
48
+ border-bottom-right-radius: 3px;
49
+ padding: 5px;
50
+ font-size: 80%;
51
+ }
52
+
53
+ .selectBox-label.public-visibility:before,
54
+ .selectBox-dropdown-menu li.public-visibility a:before{
55
+ font-family: FontAwesome;
56
+ display: inline-block;
57
+ content: "\f0ac";
58
+ margin-right: 5px;
59
+ }
60
+
61
+ .selectBox-label.shared-visibility:before,
62
+ .selectBox-dropdown-menu li.shared-visibility a:before{
63
+ font-family: FontAwesome;
64
+ display: inline-block;
65
+ content: "\f0c1";
66
+ margin-right: 5px;
67
+ }
68
+
69
+ .selectBox-label.private-visibility:before,
70
+ .selectBox-dropdown-menu li.private-visibility a:before{
71
+ font-family: FontAwesome;
72
+ display: inline-block;
73
+ content: "\f023";
74
+ margin-right: 5px;
75
+ }
76
+
77
+ .selectBox-dropdown-menu li a{
78
+ color: inherit;
79
+ padding: 5px 8px;
80
+ border-radius: 3px;
81
+ }
82
+
83
+ .selectBox-dropdown-menu a:hover{
84
+ color: inherit;
85
+ text-decoration: none;
86
+ }
87
+
88
+ /* Wishlist table */
89
+ .woocommerce .wishlist_table td.product-add-to-cart a{
90
+ display: block!important;
91
+ margin: 0;
92
+ margin-bottom: 5px;
93
+ text-align: center;
94
+ }
95
+ .woocommerce .wishlist_table td.product-add-to-cart span.dateadded{
96
+ display: block;
97
+ }
98
+
99
+ /* Popup add to wishlist */
100
+ .yith-wcwl-add-button a.open-pretty-photo{
101
+ display: none;
102
+ }
103
+ .yes-js .yith-wcwl-add-button a.open-pretty-photo{
104
+ display: inline-block;
105
+ }
106
+ .yes-js .yith-wcwl-popup{
107
+ display: none;
108
+ text-align: center;
109
+ }
110
+ .yes-js .yith-wcwl-popup-content{
111
+
112
+ }
113
+ .yes-js .yith-wcwl-popup-content{
114
+ display: table;
115
+ width: 100%;
116
+ }
117
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-first-row{
118
+ display: table-header-group;
119
+ }
120
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-second-row{
121
+ display: none;
122
+ }
123
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container,
124
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-thumb,
125
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new,
126
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-visibility{
127
+ display: table-cell;
128
+ vertical-align: bottom;
129
+ }
130
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container{
131
+ width: 80%;
132
+ padding-bottom: 20px;
133
+ }
134
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container select,
135
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-visibility select,
136
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new input{
137
+ border: 1px solid #ccc;
138
+ height: 35px;
139
+ border-radius: 3px;
140
+ }
141
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-select-container select{
142
+ width: 100%;
143
+ font-weight: 700;
144
+ padding-left: 10px;
145
+ }
146
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-thumb{
147
+ width: 20%;
148
+ padding-bottom: 20px;
149
+ }
150
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-wishlist-thumb img{
151
+ float: right;
152
+ border: 1px solid #ccc;
153
+ border-radius: 3px;
154
+ }
155
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new{
156
+ text-align: right;
157
+ }
158
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-popup-new label{
159
+ font-weight: 700;
160
+ }
161
+ .yes-js .yith-wcwl-popup-content .yith-wcwl-visibility select{
162
+ float: right;
163
+ min-width: 90px;
164
+ }
165
+ .yes-js .yith-wcwl-popup-footer{
166
+ border-top: 1px solid #CCC;
167
+ padding: 20px 20px 0 20px;
168
+ margin: 20px -20px 0;
169
+ text-align: right;
170
+ }
171
+
172
+ /* Popup message */
173
+ #yith-wcwl-popup-message {
174
+ background: white;
175
+ border: 1px solid #CCC;
176
+ border-radius: 5px;
177
+ -webkit-border-radius: 5px;
178
+ -moz-border-radius: 5px;
179
+ line-height: 50px;
180
+ padding: 15px;
181
+ position: fixed;
182
+ text-align: center;
183
+ top: 50%;
184
+ left: 50%;
185
+ z-index: 10000; /* Thanks WP -.- */
186
+ }
187
+
188
+ /*Wishlist title form*/
189
+ .wishlist-title{
190
+ display: inline-block;
191
+ }
192
+ .wishlist-title h2{
193
+ display: inline-block;
194
+ padding: 5px;
195
+ }
196
+ .wishlist-title.wishlist-title-with-form h2:hover{
197
+ background: #efefef;
198
+ }
199
+ .wishlist-title a.show-title-form{
200
+ cursor: pointer;
201
+ visibility: hidden;
202
+ }
203
+ .wishlist-title:hover a.show-title-form{
204
+ visibility: visible;
205
+ }
206
+ .yes-js #yith-wcwl-form .hidden-title-form{
207
+ display: none;
208
+ margin: 25px 0 39px;
209
+ }
210
+
211
+ /* Wishlist table template */
212
+
213
+ .woocommerce table.wishlist_table{
214
+ font-size: 80%;
215
+ }
216
+
217
+ .woocommerce table.wishlist_table thead th{
218
+ border-top: 1px solid;
219
+ padding: 16px 12px;
220
+ }
221
+
222
+ .woocommerce table.wishlist_table tbody td{
223
+ padding: 16px 12px;
224
+ }
225
+
226
+ .woocommerce table.wishlist_table thead th,
227
+ .woocommerce table.wishlist_table tbody td{
228
+ border-color: #e7e7e7;
229
+ }
230
+
231
+ .wishlist_table tr td, .wishlist_table tr th.wishlist-delete, .wishlist_table tr th.product-checkbox { text-align: center; }
232
+ .wishlist_table tr th.product-checkbox { vertical-align: middle; width: 40px; }
233
+ .wishlist_table tr th.product-remove { vertical-align: middle; width: 40px; }
234
+ .wishlist_table tr th.product-thumbnail{ width: 80px; }
235
+ .wishlist_table tr td.product-thumbnail, .wishlist_table tr td.product-name, .wishlist_table tr td.wishlist-name, .wishlist_table tr td.wishlist-privacy, .woocommerce table.wishlist_table tfoot td { text-align: left; }
236
+ .woocommerce table.wishlist_table tr td.product-remove { padding: 16px 0 }
237
+ .wishlist_table tr td.product-thumbnail a { display: block; border: none; max-width: 80px; }
238
+ .wishlist_table tr td.product-thumbnail a img { width: 100%; }
239
+ .wishlist_table tr td.product-stock-status span.wishlist-in-stock { color: #297E29; }
240
+ .wishlist_table tr td.product-stock-status span.wishlist-out-of-stock { color: #F00; }
241
+ .wishlist_table tr td a.button { white-space: normal; }
242
+
243
+ /* Wishlist buttons */
244
+ a.add_to_wishlist{
245
+ cursor: pointer;
246
+ }
247
+
248
+ .summary .single_add_to_wishlist.button,
249
+ div.product .woocommerce-price-and-add .single_add_to_wishlist.button {
250
+ margin: 0px;
251
+ }
252
+
253
+ .wishlist_table .add_to_cart.button{
254
+ padding: 7px 12px;
255
+ line-height: normal;
256
+ }
257
+
258
+ .yith-wcwl-add-to-wishlist {
259
+ margin-top: 10px;
260
+ }
261
+
262
+ .yith-wcwl-add-button > a i,
263
+ .wishlist_table .add_to_cart.button i,
264
+ .wishlist_table .ask-an-estimate-button i,
265
+ .wishlist-title a.show-title-form i,
266
+ .hidden-title-form a.hide-title-form i,
267
+ .hidden-title-form button i,
268
+ .yith-wcwl-wishlist-new button i,
269
+ .wishlist_manage_table tfoot button.submit-wishlist-changes i,
270
+ .wishlist_manage_table tfoot a.create-new-wishlist i,
271
+ .yith-wcwl-wishlist-search-form button.wishlist-search-button i{
272
+ margin-right: 10px;
273
+ }
274
+
275
+ .wishlist_table .add_to_cart.button,
276
+ .yith-wcwl-add-button a.add_to_wishlist,
277
+ .yith-wcwl-popup-button a.add_to_wishlist,
278
+ .wishlist_table a.ask-an-estimate-button,
279
+ .wishlist-title a.show-title-form,
280
+ .hidden-title-form a.hide-title-form,
281
+ .woocommerce .yith-wcwl-wishlist-new button,
282
+ .wishlist_manage_table a.create-new-wishlist,
283
+ .wishlist_manage_table button.submit-wishlist-changes,
284
+ .yith-wcwl-wishlist-search-form button.wishlist-search-button{
285
+ margin: 0px;
286
+ box-shadow: none;
287
+ text-shadow: none;
288
+ border-radius: 3px;
289
+ }
290
+
291
+ /* Wishlist title */
292
+ .woocommerce .wishlist-title h2{
293
+ vertical-align: middle;
294
+ }
295
+
296
+ .woocommerce .wishlist-title a.show-title-form{
297
+ vertical-align: middle;
298
+ margin-left: 15px;
299
+ }
300
+
301
+ .woocommerce .hidden-title-form input[type="text"]{
302
+ border: 1px solid #ccc;
303
+ border-radius: 3px;
304
+ height: 35px;
305
+ min-width: 250px;
306
+ vertical-align: middle;
307
+ }
308
+
309
+ .woocommerce .hidden-title-form button{
310
+ padding: 7px 24px;
311
+ vertical-align: middle;
312
+ border: none;
313
+ position: relative;
314
+ }
315
+
316
+ .woocommerce .hidden-title-form button:active{
317
+ top: 1px;
318
+ }
319
+
320
+ .woocommerce .hidden-title-form a.hide-title-form{
321
+ vertical-align: middle;
322
+ line-height: normal;
323
+ }
324
+
325
+ /* Remove buttons */
326
+ .woocommerce #content table.wishlist_table.cart a.remove{
327
+ color: #c3c3c3;
328
+ margin: 0 auto;
329
+ }
330
+
331
+ .woocommerce #content table.wishlist_table.cart a.remove:hover{
332
+ background-color: #c3c3c3;
333
+ color: #fff;
334
+ }
335
+
336
+ /* Share buttons */
337
+ .yith-wcwl-share{
338
+ margin-bottom: 35px;
339
+ }
340
+
341
+ .yith-wcwl-share h4.yith-wcwl-share-title{
342
+ margin: 10px 0;
343
+ }
344
+
345
+ .yith-wcwl-share ul {
346
+ margin: 5px 0;
347
+ padding: 0;
348
+ }
349
+
350
+ .yith-wcwl-share ul, .yith-wcwl-share li { height: 21px; }
351
+ .yith-wcwl-share li, .entry-content .yith-wcwl-share li { margin-left: 0px; margin-right: 0px; }
352
+
353
+ .yith-wcwl-share li a {
354
+ background-position: left top;
355
+ display: inline-block;
356
+ width: 21px;
357
+ height: 21px;
358
+ border: none;
359
+ }
360
+
361
+ .yith-wcwl-share li a:hover { background-position: left bottom; }
362
+ .yith-wcwl-share li a.facebook { background-image: url(../images/facebook.png ); }
363
+ .yith-wcwl-share li a.twitter { background-image: url(../images/twitter.png ); }
364
+ .yith-wcwl-share li a.pinterest { background-image: url(../images/pinterest.jpg ); }
365
+ .yith-wcwl-share li a.googleplus { background-image: url(../images/googleplus.jpg ); }
366
+ .yith-wcwl-share li a.email { background-image: url(../images/email.jpg ); }
367
+
368
+ /* Ask an estimate button */
369
+ .woocommerce .wishlist_table.cart .ask-an-estimate-button,
370
+ .woocommerce .wishlist_table.cart #custom_add_to_cart{
371
+ margin: 10px 0;
372
+ display: inline-block;
373
+ }
374
+
375
+ .woocommerce .wishlist_table.cart .ask-an-estimate-button{
376
+ padding: 7px 12px;
377
+ line-height: normal;
378
+ }
379
+
380
+ #ask_an_estimate_popup{
381
+ display: none;
382
+ }
383
+
384
+ .ask-an-estimate-button-popup{
385
+ margin-top: 30px!important;
386
+ float: right;
387
+ text-transform: none;
388
+ }
389
+
390
+ #additional_notes{
391
+ min-height: 150px;
392
+ }
393
+
394
+ /* Create new wishlist*/
395
+ .yith-wcwl-wishlist-new{
396
+ padding: 20px 30px;
397
+ border-bottom: 1px solid #e7e7e7;
398
+ }
399
+
400
+ .yith-wcwl-wishlist-new label{
401
+ vertical-align: middle;
402
+ margin-right: 20px;
403
+ }
404
+
405
+ .yith-wcwl-wishlist-new input{
406
+ min-width: 190px;
407
+ }
408
+
409
+ .yith-wcwl-wishlist-new input[type="text"],
410
+ .yith-wcwl-wishlist-new select{
411
+ border: 1px solid #ccc;
412
+ border-radius: 3px;
413
+ height: 35px;
414
+ vertical-align: middle;
415
+ margin-right: 10px;
416
+ }
417
+
418
+ .woocommerce .yith-wcwl-wishlist-new button{
419
+ padding: 7px 24px;
420
+ vertical-align: middle;
421
+ border: 1px solid;
422
+ position: relative;
423
+ }
424
+
425
+ .woocommerce .yith-wcwl-wishlist-new button:active{
426
+ top: 1px;
427
+ }
428
+
429
+ /* Manage wishlists */
430
+ .woocommerce .wishlist_manage_table select{
431
+ border: 1px solid #ccc;
432
+ border-radius: 3px;
433
+ height: 35px;
434
+ vertical-align: middle;
435
+ margin-right: 10px;
436
+ }
437
+
438
+ .woocommerce table.wishlist_manage_table tfoot td{
439
+ text-align: right;
440
+ padding: 24px 12px;
441
+ }
442
+
443
+ .woocommerce .wishlist_manage_table tfoot button.submit-wishlist-changes{
444
+ padding: 7px 24px;
445
+ vertical-align: middle;
446
+ border: 1px solid;
447
+ border-radius: 3px;
448
+ position: relative;
449
+ line-height: normal;
450
+ }
451
+
452
+ .woocommerce .wishlist_manage_table tfoot button.submit-wishlist-changes:active{
453
+ top: 1px;
454
+ }
455
+
456
+ .woocommerce .wishlist_manage_table tfoot a.create-new-wishlist{
457
+ vertical-align: middle;
458
+ line-height: normal;
459
+ padding: 7px 24px;
460
+ }
461
+
462
+ /* Search wishlist */
463
+ .woocommerce .yith-wcwl-wishlist-search-form{
464
+ padding: 20px 80px;
465
+ border-bottom: 1px solid #e7e7e7;
466
+ }
467
+
468
+ .woocommerce .yith-wcwl-wishlist-search-form:after{
469
+ content: '';
470
+ display: block;
471
+ clear: both;
472
+ }
473
+
474
+ .woocommerce .yith-wcwl-wishlist-search-form #wishlist_search{
475
+ min-width: 300px;
476
+ border: 1px solid #ccc;
477
+ border-radius: 3px;
478
+ height: 35px;
479
+ vertical-align: middle;
480
+ float: left;
481
+ }
482
+
483
+ .woocommerce .yith-wcwl-wishlist-search-form button.wishlist-search-button{
484
+ padding: 7px 24px;
485
+ vertical-align: middle;
486
+ border: 1px solid;
487
+ border-radius: 3px;
488
+ position: relative;
489
+ line-height: normal;
490
+ float: right;
491
+ }
492
+
493
+ .woocommerce p.yith-wcwl-empty-search-result{
494
+ padding: 50px 0;
495
+ text-align: center;
496
+ }
497
+
498
+ .woocommerce .yith-wcwl-wishlist-search-form button.wishlist-search-button:active{
499
+ top: 1px;
500
+ }
501
+
502
+ .woocommerce ul.yith-wcwl-search-results,
503
+ .woocommerce ul.user-wishlists{
504
+ list-style: none;
505
+ margin: 0;
506
+ padding: 0;
507
+ }
508
+
509
+ .woocommerce ul.yith-wcwl-search-results > li{
510
+ padding: 50px 80px;
511
+ border-bottom: 1px solid #e7e7e7;
512
+ }
513
+
514
+ .woocommerce ul.yith-wcwl-search-results > li:after{
515
+ content: '';
516
+ display: block;
517
+ clear: both;
518
+ }
519
+
520
+ .woocommerce ul.yith-wcwl-search-results .thumb{
521
+ float: left;
522
+ margin-right: 15px;
523
+ }
524
+
525
+ .woocommerce ul.yith-wcwl-search-results .user-details{
526
+ overflow: hidden;
527
+ padding-top: 15px;
528
+ }
529
+
530
+ .woocommerce ul.yith-wcwl-search-results .user-details span{
531
+ display: block;
532
+ }
533
+
534
+ .woocommerce ul.yith-wcwl-search-results .user-details span.name{
535
+ font-weight: 700;
536
+ }
537
+
538
+ .woocommerce ul.yith-wcwl-search-results .reuslt-details{
539
+ float: left;
540
+ width: 50%;
541
+ }
542
+
543
+ .woocommerce ul.yith-wcwl-search-results .result-wishlists{
544
+ float: right;
545
+ max-width: 50%;
546
+ padding-top: 15px;
547
+ }
548
+
549
+ .woocommerce .yith-wcwl-search-pagination{
550
+ padding: 5px 0;
551
+ text-align: center;
552
+ }
553
+
554
+ /* AJAX loading gif */
555
+ .yith-wcwl-add-to-wishlist .ajax-loading {
556
+ box-shadow: none !important;
557
+ -moz-box-shadow: none !important;
558
+ -webkit-box-shadow: none !important;
559
+ display: inline !important;
560
+ margin-left: 5px;
561
+ vertical-align: middle;
562
+ visibility: hidden;
563
+ width: 16px !important;
564
+ height: 16px !important;
565
+ }
566
+
567
+ /* Widget wishlist */
568
+ .widget_yith-wcwl-lists ul.dropdown li{
569
+ padding: 0;
570
+ }
571
+
572
+ .widget_yith-wcwl-lists ul.dropdown > li a,
573
+ .widget_yith-wcwl-lists ul.dropdown ul.lists > li a{
574
+ display: block;
575
+ padding: 5px 15px;
576
+ }
577
+
578
+ .widget_yith-wcwl-lists ul.dropdown ul.lists > li a{
579
+ padding: 5px 25px;
580
+ }
581
+
582
+ .widget_yith-wcwl-lists ul.dropdown > li.lists-section{
583
+ border-bottom: 1px solid #e7e7e7;
584
+ }
585
+
586
+ .widget_yith-wcwl-lists ul.dropdown ul.lists{
587
+ margin: 0;
588
  }
modules/yith-woocommerce-wishlist/assets/js/admin/yith-wcwl.js CHANGED
@@ -1,5 +1,5 @@
1
- jQuery(document).ready(function(a){a("input#yith_wcwl_frontend_css").on("change",function(){a(this).is(":checked")?(a("#yith_wcwl_styles_colors").hide(),a("#yith_wcwl_rounded_corners").parents("tr").hide(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").hide(),a("#yith_wcwl_add_to_cart_icon").parents("tr").hide()):(a("#yith_wcwl_styles_colors").show(),a("#yith_wcwl_use_button").is(":checked")&&(a("#yith_wcwl_rounded_corners").parents("tr").show(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").show(),
2
- a("#yith_wcwl_add_to_cart_icon").parents("tr").show()))}).change();a("input#yith_wcwl_use_button").on("change",function(){a(this).is(":checked")&&!a("#yith_wcwl_frontend_css").is(":checked")?(a("#yith_wcwl_rounded_corners").parents("tr").show(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").show(),a("#yith_wcwl_add_to_cart_icon").parents("tr").show()):(a("#yith_wcwl_rounded_corners").parents("tr").hide(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").hide(),a("#yith_wcwl_add_to_cart_icon").parents("tr").hide())}).change();
3
- a("#yith_wcwl_multi_wishlist_enable").on("change",function(){a(this).is(":checked")?(a("#yith_wcwl_wishlist_create_title").parents("tr").show(),a("#yith_wcwl_wishlist_manage_title").parents("tr").show()):(a("#yith_wcwl_wishlist_create_title").parents("tr").hide(),a("#yith_wcwl_wishlist_manage_title").parents("tr").hide())}).change();a("input#yith_wcwl_disable_wishlist_for_unauthenticated_users").on("change",function(){a(this).is(":checked")?(a("#yith_wcwl_show_login_notice").parents("tr").hide(),
4
- a("#yith_wcwl_login_anchor_text").parents("tr").hide()):(a("#yith_wcwl_show_login_notice").parents("tr").show(),a("#yith_wcwl_login_anchor_text").parents("tr").show())}).change();a("input#yith_wcwl_show_estimate_button").on("change",function(){if(a(this).is(":checked")){var b=a("#yith_wcwl_show_additional_info_textarea");b.parents("tr").show();b.on("change",function(){a(this).is(":checked")?a("#yith_wcwl_additional_info_textarea_label").parents("tr").show():a("#yith_wcwl_additional_info_textarea_label").parents("tr").hide()}).change()}else a("#yith_wcwl_show_additional_info_textarea").parents("tr").hide(),
5
  a("#yith_wcwl_additional_info_textarea_label").parents("tr").hide()}).change()});
1
+ jQuery(document).ready(function(a){a("input#yith_wcwl_frontend_css").on("change",function(){a(this).is(":checked")?(a("#yith_wcwl_styles_colors").hide(),a("#yith_wcwl_rounded_corners").parents("tr").hide(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").hide(),a("#yith_wcwl_add_to_cart_icon").parents("tr").hide()):(a("#yith_wcwl_styles_colors").show(),a("#yith_wcwl_use_button").is(":checked")&&(a("#yith_wcwl_rounded_corners").parents("tr").show(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").show(),
2
+ a("#yith_wcwl_add_to_cart_icon").parents("tr").show()))}).change();a("input#yith_wcwl_use_button").on("change",function(){a(this).is(":checked")&&!a("#yith_wcwl_frontend_css").is(":checked")?(a("#yith_wcwl_rounded_corners").parents("tr").show(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").show(),a("#yith_wcwl_add_to_cart_icon").parents("tr").show()):(a("#yith_wcwl_rounded_corners").parents("tr").hide(),a("#yith_wcwl_add_to_wishlist_icon").parents("tr").hide(),a("#yith_wcwl_add_to_cart_icon").parents("tr").hide())}).change();
3
+ a("#yith_wcwl_multi_wishlist_enable").on("change",function(){a(this).is(":checked")?(a("#yith_wcwl_wishlist_create_title").parents("tr").show(),a("#yith_wcwl_wishlist_manage_title").parents("tr").show()):(a("#yith_wcwl_wishlist_create_title").parents("tr").hide(),a("#yith_wcwl_wishlist_manage_title").parents("tr").hide())}).change();a("input#yith_wcwl_disable_wishlist_for_unauthenticated_users").on("change",function(){a(this).is(":checked")?(a("#yith_wcwl_show_login_notice").parents("tr").hide(),
4
+ a("#yith_wcwl_login_anchor_text").parents("tr").hide()):(a("#yith_wcwl_show_login_notice").parents("tr").show(),a("#yith_wcwl_login_anchor_text").parents("tr").show())}).change();a("input#yith_wcwl_show_estimate_button").on("change",function(){if(a(this).is(":checked")){var b=a("#yith_wcwl_show_additional_info_textarea");b.parents("tr").show();b.on("change",function(){a(this).is(":checked")?a("#yith_wcwl_additional_info_textarea_label").parents("tr").show():a("#yith_wcwl_additional_info_textarea_label").parents("tr").hide()}).change()}else a("#yith_wcwl_show_additional_info_textarea").parents("tr").hide(),
5
  a("#yith_wcwl_additional_info_textarea_label").parents("tr").hide()}).change()});
modules/yith-woocommerce-wishlist/assets/js/jquery.yith-wcwl.js CHANGED
@@ -1,19 +1,19 @@
1
- jQuery(document).ready(function(b){function l(){"undefined"!=typeof b.prettyPhoto&&b('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1});h.off("change");h=b('.wishlist_table tbody input[type="checkbox"]');"undefined"!=typeof b.fn.selectBox&&b("select.selectBox").selectBox();k()}function r(){var a=b(".woocommerce-message");0==a.length?b("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):
2
- a.fadeOut(300,function(){b(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}function t(a){var c=a.data("product-id"),d=b(".add-to-wishlist-"+c),c={add_to_wishlist:c,product_type:a.data("product-type"),action:yith_wcwl_l10n.actions.add_to_wishlist_action};if(yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in){var e=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),f=e.find(".wishlist-select"),g=e.find(".wishlist-name"),e=e.find(".wishlist-visibility");
3
- c.wishlist_id=f.val();c.wishlist_name=g.val();c.wishlist_visibility=e.val()}p()?b.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:c,dataType:"json",beforeSend:function(){a.siblings(".ajax-loading").css("visibility","visible")},complete:function(){a.siblings(".ajax-loading").css("visibility","hidden")},success:function(a){var c=b("#yith-wcwl-popup-message"),e=a.result,f=a.message;if(yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in){var g=b("select.wishlist-select");"undefined"!=typeof b.prettyPhoto&&
4
- b.prettyPhoto.close();g.each(function(d){d=b(this);var c=d.find("option"),c=c.slice(1,c.length-1);c.remove();if("undefined"!=typeof a.user_wishlists)for(c in c=0,a.user_wishlists)"1"!=a.user_wishlists[c].is_default&&b("<option>").val(a.user_wishlists[c].ID).html(a.user_wishlists[c].wishlist_name).insertBefore(d.find("option:last-child"))})}b("#yith-wcwl-message").html(f);c.css("margin-left","-"+b(c).width()+"px").fadeIn();window.setTimeout(function(){c.fadeOut()},2E3);"true"==e?((!yith_wcwl_l10n.multi_wishlist||
5
- !yith_wcwl_l10n.is_user_logged_in||yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in&&yith_wcwl_l10n.hide_add_button)&&d.find(".yith-wcwl-add-button").hide().removeClass("show").addClass("hide"),d.find(".yith-wcwl-wishlistexistsbrowse").hide().removeClass("show").addClass("hide").find("a").attr("href",a.wishlist_url),d.find(".yith-wcwl-wishlistaddedbrowse").show().removeClass("hide").addClass("show").find("a").attr("href",a.wishlist_url)):"exists"==e?((!yith_wcwl_l10n.multi_wishlist||
6
- !yith_wcwl_l10n.is_user_logged_in||yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in&&yith_wcwl_l10n.hide_add_button)&&d.find(".yith-wcwl-add-button").hide().removeClass("show").addClass("hide"),d.find(".yith-wcwl-wishlistexistsbrowse").show().removeClass("hide").addClass("show").find("a").attr("href",a.wishlist_url),d.find(".yith-wcwl-wishlistaddedbrowse").hide().removeClass("show").addClass("hide").find("a").attr("href",a.wishlist_url)):(d.find(".yith-wcwl-add-button").show().removeClass("hide").addClass("show"),
7
- d.find(".yith-wcwl-wishlistexistsbrowse").hide().removeClass("show").addClass("hide"),d.find(".yith-wcwl-wishlistaddedbrowse").hide().removeClass("show").addClass("hide"));b("body").trigger("added_to_wishlist")}}):alert(yith_wcwl_l10n.labels.cookie_disabled)}function u(a){var c=a.parents(".cart.wishlist_table"),d=c.data("pagination"),e=c.data("per-page"),f=c.data("page");a=a.parents("tr");c.find(".pagination-row");a=a.data("row-id");var g=c.data("id"),m=c.data("token"),d={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,
8
- remove_from_wishlist:a,pagination:d,per_page:e,current_page:f,wishlist_id:g,wishlist_token:m};b("#yith-wcwl-message").html("&nbsp;");"undefined"!=typeof b.fn.block&&c.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}});b("#yith-wcwl-form").load(yith_wcwl_l10n.ajax_url+" #yith-wcwl-form",d,function(){"undefined"!=typeof b.fn.unblock&&c.stop(!0).css("opacity","1").unblock();l();
9
- b("body").trigger("removed_from_wishlist")})}function v(a,c){var d=a.data("product-id"),e=b(document).find(".cart.wishlist_table"),f=e.data("pagination"),g=e.data("per-page"),m=e.data("id"),h=e.data("token"),d={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,pagination:f,per_page:g,wishlist_id:m,wishlist_token:h,add_to_wishlist:d,product_type:a.data("product-type")};p()?b.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:d,dataType:"html",beforeSend:function(){"undefined"!=typeof b.fn.block&&
10
- e.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}})},success:function(a){a=b(a).find("#yith-wcwl-form");c.replaceWith(a);l()}}):alert(yith_wcwl_l10n.labels.cookie_disabled)}function w(a){var c=a.parents(".cart.wishlist_table"),d=c.data("token"),e=c.data("id"),f=a.parents("tr").data("row-id");a=a.val();var g=c.data("pagination"),h=c.data("per-page"),k=c.data("page"),d={action:yith_wcwl_l10n.actions.move_to_another_wishlist_action,
11
- wishlist_token:d,wishlist_id:e,destination_wishlist_token:a,item_id:f,pagination:g,per_page:h,current_page:k};""!=a&&("undefined"!=typeof b.fn.block&&c.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),b("#yith-wcwl-form").load(yith_wcwl_l10n.ajax_url+" #yith-wcwl-form",d,function(){"undefined"!=typeof b.fn.unblock&&c.stop(!0).css("opacity","1").unblock();l();b("body").trigger("moved_to_another_wishlist")}))}
12
- function q(a){var c=b(this);a.preventDefault();c.parents(".wishlist-title").next().show();c.parents(".wishlist-title").hide()}function x(a){var c=b(this);a.preventDefault();c.parents(".hidden-title-form").hide();c.parents(".hidden-title-form").prev().show()}function p(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var a=-1!=document.cookie.indexOf("cookietest=");document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";return a}function y(){if(0!=b(".yith-wcwl-add-to-wishlist").length&&
13
- 0==b("#yith-wcwl-popup-message").length){var a=b("<div>").attr("id","yith-wcwl-message"),a=b("<div>").attr("id","yith-wcwl-popup-message").html(a).hide();b("body").prepend(a)}}function k(){h.on("change",function(){var a="",c=b(this).parents(".cart.wishlist_table"),d=c.data("id"),c=c.data("token"),e=document.URL;h.filter(":checked").each(function(){var c=b(this);a+=0!=a.length?",":"";a+=c.parents("tr").data("row-id")});e=n(e,"wishlist_products_to_add_to_cart",a);e=n(e,"wishlist_token",c);e=n(e,"wishlist_id",
14
- d);b("#custom_add_to_cart").attr("href",e)})}function n(a,b,d){d=b+"="+d;a=a.replace(new RegExp("(&|\\?)"+b+"=[^&]*"),"$1"+d);-1<a.indexOf(b+"=")||(a=-1<a.indexOf("?")?a+("&"+d):a+("?"+d));return a}var z="undefined"!==typeof wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"",h=b('.wishlist_table tbody input[type="checkbox"]:not(:disabled)');b(document).on("yith_wcwl_init",function(){var a=b(this),c=b('.wishlist_table tbody input[type="checkbox"]:not(:disabled)');a.on("click",".add_to_wishlist",
15
- function(a){var c=b(this);a.preventDefault();t(c);return!1});a.on("click",".remove_from_wishlist",function(a){var c=b(this);a.preventDefault();u(c);return!1});a.on("adding_to_cart","body",function(a,b,c){0!=b.closest(".wishlist_table").length&&(c.remove_from_wishlist_after_add_to_cart=b.closest("tr").data("row-id"),c.wishlist_id=b.closest("table").data("id"),wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart)});a.on("added_to_cart","body",function(a){wc_add_to_cart_params.cart_redirect_after_add=
16
- z;a=b(".wishlist_table");a.find(".added").removeClass("added");a.find(".added_to_cart").remove()});a.on("added_to_cart","body",r);a.on("cart_page_refreshed","body",l);a.on("click",".show-title-form",q);a.on("click",".wishlist-title-with-form h2",q);a.on("click",".hide-title-form",x);a.on("change",".change-wishlist",function(a){a=b(this);w(a);return!1});a.on("change",".yith-wcwl-popup-content .wishlist-select",function(a){a=b(this);"new"==a.val()?a.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").css("display",
17
- "table-row"):a.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()});a.on("change","#bulk_add_to_cart",function(){b(this).is(":checked")?c.attr("checked","checked").change():c.removeAttr("checked").change()});a.on("click","#custom_add_to_cart",function(a){var e=b(this),f=e.parents(".cart.wishlist_table");yith_wcwl_l10n.ajax_add_to_cart_enabled&&(a.preventDefault(),"undefined"!=typeof b.fn.block&&f.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+
18
- ") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),b("#yith-wcwl-form").load(yith_wcwl_l10n.ajax_url+e.attr("href")+" #yith-wcwl-form",{action:yith_wcwl_l10n.actions.bulk_add_to_cart_action},function(){"undefined"!=typeof b.fn.unblock&&f.stop(!0).css("opacity","1").unblock();"undefined"!=typeof b.prettyPhoto&&b('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1});c.off("change");
19
- c=b('.wishlist_table tbody input[type="checkbox"]');"undefined"!=typeof b.fn.selectBox&&b("select.selectBox").selectBox();k()}))});a.on("click",".yith-wfbt-add-wishlist",function(a){a.preventDefault();a=b(this);var c=b("#yith-wcwl-form");b("html, body").animate({scrollTop:c.offset().top},500);v(a,c)});y();k()}).trigger("yith_wcwl_init");"undefined"!=typeof b.fn.selectBox&&b("select.selectBox").selectBox()});
1
+ jQuery(document).ready(function(b){function l(){"undefined"!=typeof b.prettyPhoto&&b('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1});h.off("change");h=b('.wishlist_table tbody input[type="checkbox"]');"undefined"!=typeof b.fn.selectBox&&b("select.selectBox").selectBox();k()}function r(){var a=b(".woocommerce-message");0==a.length?b("#yith-wcwl-form").prepend(yith_wcwl_l10n.labels.added_to_cart_message):
2
+ a.fadeOut(300,function(){b(this).replaceWith(yith_wcwl_l10n.labels.added_to_cart_message).fadeIn()})}function t(a){var c=a.data("product-id"),d=b(".add-to-wishlist-"+c),c={add_to_wishlist:c,product_type:a.data("product-type"),action:yith_wcwl_l10n.actions.add_to_wishlist_action};if(yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in){var e=a.parents(".yith-wcwl-popup-footer").prev(".yith-wcwl-popup-content"),f=e.find(".wishlist-select"),g=e.find(".wishlist-name"),e=e.find(".wishlist-visibility");
3
+ c.wishlist_id=f.val();c.wishlist_name=g.val();c.wishlist_visibility=e.val()}p()?b.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:c,dataType:"json",beforeSend:function(){a.siblings(".ajax-loading").css("visibility","visible")},complete:function(){a.siblings(".ajax-loading").css("visibility","hidden")},success:function(a){var c=b("#yith-wcwl-popup-message"),e=a.result,f=a.message;if(yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in){var g=b("select.wishlist-select");"undefined"!=typeof b.prettyPhoto&&
4
+ b.prettyPhoto.close();g.each(function(d){d=b(this);var c=d.find("option"),c=c.slice(1,c.length-1);c.remove();if("undefined"!=typeof a.user_wishlists)for(c in c=0,a.user_wishlists)"1"!=a.user_wishlists[c].is_default&&b("<option>").val(a.user_wishlists[c].ID).html(a.user_wishlists[c].wishlist_name).insertBefore(d.find("option:last-child"))})}b("#yith-wcwl-message").html(f);c.css("margin-left","-"+b(c).width()+"px").fadeIn();window.setTimeout(function(){c.fadeOut()},2E3);"true"==e?((!yith_wcwl_l10n.multi_wishlist||
5
+ !yith_wcwl_l10n.is_user_logged_in||yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in&&yith_wcwl_l10n.hide_add_button)&&d.find(".yith-wcwl-add-button").hide().removeClass("show").addClass("hide"),d.find(".yith-wcwl-wishlistexistsbrowse").hide().removeClass("show").addClass("hide").find("a").attr("href",a.wishlist_url),d.find(".yith-wcwl-wishlistaddedbrowse").show().removeClass("hide").addClass("show").find("a").attr("href",a.wishlist_url)):"exists"==e?((!yith_wcwl_l10n.multi_wishlist||
6
+ !yith_wcwl_l10n.is_user_logged_in||yith_wcwl_l10n.multi_wishlist&&yith_wcwl_l10n.is_user_logged_in&&yith_wcwl_l10n.hide_add_button)&&d.find(".yith-wcwl-add-button").hide().removeClass("show").addClass("hide"),d.find(".yith-wcwl-wishlistexistsbrowse").show().removeClass("hide").addClass("show").find("a").attr("href",a.wishlist_url),d.find(".yith-wcwl-wishlistaddedbrowse").hide().removeClass("show").addClass("hide").find("a").attr("href",a.wishlist_url)):(d.find(".yith-wcwl-add-button").show().removeClass("hide").addClass("show"),
7
+ d.find(".yith-wcwl-wishlistexistsbrowse").hide().removeClass("show").addClass("hide"),d.find(".yith-wcwl-wishlistaddedbrowse").hide().removeClass("show").addClass("hide"));b("body").trigger("added_to_wishlist")}}):alert(yith_wcwl_l10n.labels.cookie_disabled)}function u(a){var c=a.parents(".cart.wishlist_table"),d=c.data("pagination"),e=c.data("per-page"),f=c.data("page");a=a.parents("tr");c.find(".pagination-row");a=a.data("row-id");var g=c.data("id"),m=c.data("token"),d={action:yith_wcwl_l10n.actions.remove_from_wishlist_action,
8
+ remove_from_wishlist:a,pagination:d,per_page:e,current_page:f,wishlist_id:g,wishlist_token:m};b("#yith-wcwl-message").html("&nbsp;");"undefined"!=typeof b.fn.block&&c.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}});b("#yith-wcwl-form").load(yith_wcwl_l10n.ajax_url+" #yith-wcwl-form",d,function(){"undefined"!=typeof b.fn.unblock&&c.stop(!0).css("opacity","1").unblock();l();
9
+ b("body").trigger("removed_from_wishlist")})}function v(a,c){var d=a.data("product-id"),e=b(document).find(".cart.wishlist_table"),f=e.data("pagination"),g=e.data("per-page"),m=e.data("id"),h=e.data("token"),d={action:yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,pagination:f,per_page:g,wishlist_id:m,wishlist_token:h,add_to_wishlist:d,product_type:a.data("product-type")};p()?b.ajax({type:"POST",url:yith_wcwl_l10n.ajax_url,data:d,dataType:"html",beforeSend:function(){"undefined"!=typeof b.fn.block&&
10
+ e.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}})},success:function(a){a=b(a).find("#yith-wcwl-form");c.replaceWith(a);l()}}):alert(yith_wcwl_l10n.labels.cookie_disabled)}function w(a){var c=a.parents(".cart.wishlist_table"),d=c.data("token"),e=c.data("id"),f=a.parents("tr").data("row-id");a=a.val();var g=c.data("pagination"),h=c.data("per-page"),k=c.data("page"),d={action:yith_wcwl_l10n.actions.move_to_another_wishlist_action,
11
+ wishlist_token:d,wishlist_id:e,destination_wishlist_token:a,item_id:f,pagination:g,per_page:h,current_page:k};""!=a&&("undefined"!=typeof b.fn.block&&c.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),b("#yith-wcwl-form").load(yith_wcwl_l10n.ajax_url+" #yith-wcwl-form",d,function(){"undefined"!=typeof b.fn.unblock&&c.stop(!0).css("opacity","1").unblock();l();b("body").trigger("moved_to_another_wishlist")}))}
12
+ function q(a){var c=b(this);a.preventDefault();c.parents(".wishlist-title").next().show();c.parents(".wishlist-title").hide()}function x(a){var c=b(this);a.preventDefault();c.parents(".hidden-title-form").hide();c.parents(".hidden-title-form").prev().show()}function p(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var a=-1!=document.cookie.indexOf("cookietest=");document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";return a}function y(){if(0!=b(".yith-wcwl-add-to-wishlist").length&&
13
+ 0==b("#yith-wcwl-popup-message").length){var a=b("<div>").attr("id","yith-wcwl-message"),a=b("<div>").attr("id","yith-wcwl-popup-message").html(a).hide();b("body").prepend(a)}}function k(){h.on("change",function(){var a="",c=b(this).parents(".cart.wishlist_table"),d=c.data("id"),c=c.data("token"),e=document.URL;h.filter(":checked").each(function(){var c=b(this);a+=0!=a.length?",":"";a+=c.parents("tr").data("row-id")});e=n(e,"wishlist_products_to_add_to_cart",a);e=n(e,"wishlist_token",c);e=n(e,"wishlist_id",
14
+ d);b("#custom_add_to_cart").attr("href",e)})}function n(a,b,d){d=b+"="+d;a=a.replace(new RegExp("(&|\\?)"+b+"=[^&]*"),"$1"+d);-1<a.indexOf(b+"=")||(a=-1<a.indexOf("?")?a+("&"+d):a+("?"+d));return a}var z="undefined"!==typeof wc_add_to_cart_params?wc_add_to_cart_params.cart_redirect_after_add:"",h=b('.wishlist_table tbody input[type="checkbox"]:not(:disabled)');b(document).on("yith_wcwl_init",function(){var a=b(this),c=b('.wishlist_table tbody input[type="checkbox"]:not(:disabled)');a.on("click",".add_to_wishlist",
15
+ function(a){var c=b(this);a.preventDefault();t(c);return!1});a.on("click",".remove_from_wishlist",function(a){var c=b(this);a.preventDefault();u(c);return!1});a.on("adding_to_cart","body",function(a,b,c){"undefined"!=typeof b&&"undefined"!=typeof c&&0!=b.closest(".wishlist_table").length&&(c.remove_from_wishlist_after_add_to_cart=b.closest("tr").data("row-id"),c.wishlist_id=b.closest("table").data("id"),wc_add_to_cart_params.cart_redirect_after_add=yith_wcwl_l10n.redirect_to_cart)});a.on("added_to_cart",
16
+ "body",function(a){wc_add_to_cart_params.cart_redirect_after_add=z;a=b(".wishlist_table");a.find(".added").removeClass("added");a.find(".added_to_cart").remove()});a.on("added_to_cart","body",r);a.on("cart_page_refreshed","body",l);a.on("click",".show-title-form",q);a.on("click",".wishlist-title-with-form h2",q);a.on("click",".hide-title-form",x);a.on("change",".change-wishlist",function(a){a=b(this);w(a);return!1});a.on("change",".yith-wcwl-popup-content .wishlist-select",function(a){a=b(this);"new"==
17
+ a.val()?a.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").css("display","table-row"):a.parents(".yith-wcwl-first-row").next(".yith-wcwl-second-row").hide()});a.on("change","#bulk_add_to_cart",function(){b(this).is(":checked")?c.attr("checked","checked").change():c.removeAttr("checked").change()});a.on("click","#custom_add_to_cart",function(a){var e=b(this),f=e.parents(".cart.wishlist_table");yith_wcwl_l10n.ajax_add_to_cart_enabled&&(a.preventDefault(),"undefined"!=typeof b.fn.block&&
18
+ f.fadeTo("400","0.6").block({message:null,overlayCSS:{background:"transparent url("+yith_wcwl_l10n.ajax_loader_url+") no-repeat center",backgroundSize:"16px 16px",opacity:.6}}),b("#yith-wcwl-form").load(yith_wcwl_l10n.ajax_url+e.attr("href")+" #yith-wcwl-form",{action:yith_wcwl_l10n.actions.bulk_add_to_cart_action},function(){"undefined"!=typeof b.fn.unblock&&f.stop(!0).css("opacity","1").unblock();"undefined"!=typeof b.prettyPhoto&&b('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({hook:"data-rel",
19
+ social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1});c.off("change");c=b('.wishlist_table tbody input[type="checkbox"]');"undefined"!=typeof b.fn.selectBox&&b("select.selectBox").selectBox();k()}))});a.on("click",".yith-wfbt-add-wishlist",function(a){a.preventDefault();a=b(this);var c=b("#yith-wcwl-form");b("html, body").animate({scrollTop:c.offset().top},500);v(a,c)});y();k()}).trigger("yith_wcwl_init");"undefined"!=typeof b.fn.selectBox&&b("select.selectBox").selectBox()});
modules/yith-woocommerce-wishlist/assets/js/unminified/admin/yith-wcwl.js CHANGED
@@ -1,73 +1,73 @@
1
- jQuery( document ).ready( function( $ ){
2
- /* === COLORS TAB === */
3
- $('input#yith_wcwl_frontend_css').on('change',function () {
4
- if ($(this).is(':checked')) {
5
- $('#yith_wcwl_styles_colors').hide();
6
- $('#yith_wcwl_rounded_corners').parents('tr').hide();
7
- $('#yith_wcwl_add_to_wishlist_icon').parents('tr').hide();
8
- $('#yith_wcwl_add_to_cart_icon').parents('tr').hide();
9
- } else {
10
- $('#yith_wcwl_styles_colors').show();
11
- if ($('#yith_wcwl_use_button').is(':checked')) {
12
- $('#yith_wcwl_rounded_corners').parents('tr').show();
13
- $('#yith_wcwl_add_to_wishlist_icon').parents('tr').show();
14
- $('#yith_wcwl_add_to_cart_icon').parents('tr').show();
15
- }
16
- }
17
- }).change();
18
-
19
- $('input#yith_wcwl_use_button').on('change',function () {
20
- if ($(this).is(':checked') && !$('#yith_wcwl_frontend_css').is(':checked')) {
21
- $('#yith_wcwl_rounded_corners').parents('tr').show();
22
- $('#yith_wcwl_add_to_wishlist_icon').parents('tr').show();
23
- $('#yith_wcwl_add_to_cart_icon').parents('tr').show();
24
- } else {
25
- $('#yith_wcwl_rounded_corners').parents('tr').hide();
26
- $('#yith_wcwl_add_to_wishlist_icon').parents('tr').hide();
27
- $('#yith_wcwl_add_to_cart_icon').parents('tr').hide();
28
- }
29
- }).change();
30
-
31
- $('#yith_wcwl_multi_wishlist_enable').on('change', function () {
32
- if ($(this).is(':checked')) {
33
- $('#yith_wcwl_wishlist_create_title').parents('tr').show();
34
- $('#yith_wcwl_wishlist_manage_title').parents('tr').show();
35
- }
36
- else{
37
- $('#yith_wcwl_wishlist_create_title').parents('tr').hide();
38
- $('#yith_wcwl_wishlist_manage_title').parents('tr').hide();
39
- }
40
- }).change();
41
-
42
- /* === SETTINGS TAB === */
43
- $('input#yith_wcwl_disable_wishlist_for_unauthenticated_users').on('change',function () {
44
- if ($(this).is(':checked')) {
45
- $('#yith_wcwl_show_login_notice').parents('tr').hide();
46
- $('#yith_wcwl_login_anchor_text').parents('tr').hide();
47
- }
48
- else{
49
- $('#yith_wcwl_show_login_notice').parents('tr').show();
50
- $('#yith_wcwl_login_anchor_text').parents('tr').show();
51
- }
52
- }).change();
53
-
54
- $('input#yith_wcwl_show_estimate_button').on('change',function () {
55
- if ($(this).is(':checked')) {
56
- var additional_info = $('#yith_wcwl_show_additional_info_textarea');
57
-
58
- additional_info.parents('tr').show();
59
- additional_info.on( 'change', function(){
60
- if ($(this).is(':checked')) {
61
- $('#yith_wcwl_additional_info_textarea_label').parents('tr').show()
62
- }
63
- else{
64
- $('#yith_wcwl_additional_info_textarea_label').parents('tr').hide()
65
- }
66
- }).change();
67
- }
68
- else{
69
- $('#yith_wcwl_show_additional_info_textarea').parents('tr').hide();
70
- $('#yith_wcwl_additional_info_textarea_label').parents('tr').hide()
71
- }
72
- }).change();
73
  } );
1
+ jQuery( document ).ready( function( $ ){
2
+ /* === COLORS TAB === */
3
+ $('input#yith_wcwl_frontend_css').on('change',function () {
4
+ if ($(this).is(':checked')) {
5
+ $('#yith_wcwl_styles_colors').hide();
6
+ $('#yith_wcwl_rounded_corners').parents('tr').hide();
7
+ $('#yith_wcwl_add_to_wishlist_icon').parents('tr').hide();
8
+ $('#yith_wcwl_add_to_cart_icon').parents('tr').hide();
9
+ } else {
10
+ $('#yith_wcwl_styles_colors').show();
11
+ if ($('#yith_wcwl_use_button').is(':checked')) {
12
+ $('#yith_wcwl_rounded_corners').parents('tr').show();
13
+ $('#yith_wcwl_add_to_wishlist_icon').parents('tr').show();
14
+ $('#yith_wcwl_add_to_cart_icon').parents('tr').show();
15
+ }
16
+ }
17
+ }).change();
18
+
19
+ $('input#yith_wcwl_use_button').on('change',function () {
20
+ if ($(this).is(':checked') && !$('#yith_wcwl_frontend_css').is(':checked')) {
21
+ $('#yith_wcwl_rounded_corners').parents('tr').show();
22
+ $('#yith_wcwl_add_to_wishlist_icon').parents('tr').show();
23
+ $('#yith_wcwl_add_to_cart_icon').parents('tr').show();
24
+ } else {
25
+ $('#yith_wcwl_rounded_corners').parents('tr').hide();
26
+ $('#yith_wcwl_add_to_wishlist_icon').parents('tr').hide();
27
+ $('#yith_wcwl_add_to_cart_icon').parents('tr').hide();
28
+ }
29
+ }).change();
30
+
31
+ $('#yith_wcwl_multi_wishlist_enable').on('change', function () {
32
+ if ($(this).is(':checked')) {
33
+ $('#yith_wcwl_wishlist_create_title').parents('tr').show();
34
+ $('#yith_wcwl_wishlist_manage_title').parents('tr').show();
35
+ }
36
+ else{
37
+ $('#yith_wcwl_wishlist_create_title').parents('tr').hide();
38
+ $('#yith_wcwl_wishlist_manage_title').parents('tr').hide();
39
+ }
40
+ }).change();
41
+
42
+ /* === SETTINGS TAB === */
43
+ $('input#yith_wcwl_disable_wishlist_for_unauthenticated_users').on('change',function () {
44
+ if ($(this).is(':checked')) {
45
+ $('#yith_wcwl_show_login_notice').parents('tr').hide();
46
+ $('#yith_wcwl_login_anchor_text').parents('tr').hide();
47
+ }
48
+ else{
49
+ $('#yith_wcwl_show_login_notice').parents('tr').show();
50
+ $('#yith_wcwl_login_anchor_text').parents('tr').show();
51
+ }
52
+ }).change();
53
+
54
+ $('input#yith_wcwl_show_estimate_button').on('change',function () {
55
+ if ($(this).is(':checked')) {
56
+ var additional_info = $('#yith_wcwl_show_additional_info_textarea');
57
+
58
+ additional_info.parents('tr').show();
59
+ additional_info.on( 'change', function(){
60
+ if ($(this).is(':checked')) {
61
+ $('#yith_wcwl_additional_info_textarea_label').parents('tr').show()
62
+ }
63
+ else{
64
+ $('#yith_wcwl_additional_info_textarea_label').parents('tr').hide()
65
+ }
66
+ }).change();
67
+ }
68
+ else{
69
+ $('#yith_wcwl_show_additional_info_textarea').parents('tr').hide();
70
+ $('#yith_wcwl_additional_info_textarea_label').parents('tr').hide()
71
+ }
72
+ }).change();
73
  } );
modules/yith-woocommerce-wishlist/assets/js/unminified/jquery.yith-wcwl.js CHANGED
@@ -1,604 +1,604 @@
1
- jQuery( document ).ready( function( $ ){
2
-
3
- var cart_redirect_after_add = typeof( wc_add_to_cart_params ) !== 'undefined' ? wc_add_to_cart_params.cart_redirect_after_add : '',
4
- this_page = window.location.toString(),
5
- checkboxes = $( '.wishlist_table tbody input[type="checkbox"]:not(:disabled)');
6
-
7
- $(document).on( 'yith_wcwl_init', function(){
8
- var t = $(this),
9
- checkboxes = $( '.wishlist_table tbody input[type="checkbox"]:not(:disabled)');
10
-
11
- t.on( 'click', '.add_to_wishlist', function( ev ) {
12
- var t = $( this);
13
-
14
- ev.preventDefault();
15
-
16
- call_ajax_add_to_wishlist( t );
17
-
18
- return false;
19
- } );
20
-
21
- t.on( 'click', '.remove_from_wishlist', function( ev ){
22
- var t = $( this );
23
-
24
- ev.preventDefault();
25
-
26
- remove_item_from_wishlist( t );
27
-
28
- return false;
29
- } );
30
-
31
- t.on( 'adding_to_cart', 'body', function( ev, button, data ){
32
- if( button.closest( '.wishlist_table' ).length != 0 ){
33
- data.remove_from_wishlist_after_add_to_cart = button.closest( 'tr' ).data( 'row-id' );
34
- data.wishlist_id = button.closest( 'table' ).data( 'id' );
35
- wc_add_to_cart_params.cart_redirect_after_add = yith_wcwl_l10n.redirect_to_cart;
36
- }
37
- } );
38
-
39
- t.on( 'added_to_cart', 'body', function( ev ){
40
- wc_add_to_cart_params.cart_redirect_after_add = cart_redirect_after_add;
41
-
42
- var wishlist = $( '.wishlist_table');
43
-
44
- wishlist.find( '.added' ).removeClass( 'added' );
45
- wishlist.find( '.added_to_cart' ).remove();
46
- } );
47
-
48
- t.on( 'added_to_cart', 'body', print_add_to_cart_notice );
49
-
50
- t.on( 'cart_page_refreshed', 'body', init_handling_after_ajax );
51
-
52
- t.on( 'click', '.show-title-form', show_title_form );
53
-
54
- t.on( 'click', '.wishlist-title-with-form h2', show_title_form );
55
-
56
- t.on( 'click', '.hide-title-form', hide_title_form );
57
-
58
- t.on( 'change', '.change-wishlist', function( ev ){
59
- var t = $(this);
60
-
61
- move_item_to_another_wishlist( t );
62
-
63
- return false;
64
- } );
65
-
66
- t.on( 'change', '.yith-wcwl-popup-content .wishlist-select', function( ev ){
67
- var t = $(this);
68
-
69
- if( t.val() == 'new' ){
70
- t.parents( '.yith-wcwl-first-row' ).next( '.yith-wcwl-second-row' ).css( 'display', 'table-row' );
71
- }
72
- else{
73
- t.parents( '.yith-wcwl-first-row' ).next( '.yith-wcwl-second-row' ).hide();
74
- }
75
- } );
76
-
77
- t.on( 'change', '#bulk_add_to_cart', function(){
78
- var t = $(this);
79
-
80
- if( t.is( ':checked' ) ){
81
- checkboxes.attr( 'checked','checked').change();
82
- }
83
- else{
84
- checkboxes.removeAttr( 'checked').change();
85
- }
86
- } );
87
-
88
- t.on( 'click', '#custom_add_to_cart', function(ev){
89
- var t = $(this),
90
- table = t.parents( '.cart.wishlist_table' );
91
-
92
- if( ! yith_wcwl_l10n.ajax_add_to_cart_enabled ){
93
- return;
94
- }
95
-
96
- ev.preventDefault();
97
-
98
- if( typeof $.fn.block != 'undefined' ) {
99
- table.fadeTo('400', '0.6').block({message: null,
100
- overlayCSS : {
101
- background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
102
- backgroundSize: '16px 16px',
103
- opacity : 0.6
104
- }
105
- });
106
- }
107
-
108
- $( '#yith-wcwl-form' ).load( yith_wcwl_l10n.ajax_url + t.attr( 'href' ) + ' #yith-wcwl-form', {action: yith_wcwl_l10n.actions.bulk_add_to_cart_action}, function(){
109
-
110
- if( typeof $.fn.unblock != 'undefined' ) {
111
- table.stop(true).css('opacity', '1').unblock();
112
- }
113
-
114
- if( typeof $.prettyPhoto != 'undefined' ) {
115
- $('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({
116
- hook : 'data-rel',
117
- social_tools : false,
118
- theme : 'pp_woocommerce',
119
- horizontal_padding: 20,
120
- opacity : 0.8,
121
- deeplinking : false
122
- });
123
- }
124
-
125
- checkboxes.off('change');
126
- checkboxes = $( '.wishlist_table tbody input[type="checkbox"]');
127
-
128
- if( typeof $.fn.selectBox != 'undefined' ) {
129
- $('select.selectBox').selectBox();
130
- }
131
-
132
- handle_wishlist_checkbox();
133
- } );
134
- } );
135
-
136
- t.on('click', '.yith-wfbt-add-wishlist', function(e){
137
- e.preventDefault();
138
- var t = $(this),
139
- form = $( '#yith-wcwl-form' );
140
-
141
- $('html, body').animate({
142
- scrollTop: ( form.offset().top)
143
- },500);
144
-
145
- // ajax call
146
- reload_wishlist_and_adding_elem( t, form );
147
- });
148
-
149
- add_wishlist_popup();
150
-
151
- handle_wishlist_checkbox();
152
-
153
- } ).trigger('yith_wcwl_init');
154
-
155
- /**
156
- * Adds selectbox where needed
157
- */
158
- if( typeof $.fn.selectBox != 'undefined' ) {
159
- $('select.selectBox').selectBox();
160
- }
161
-
162
- /**
163
- * Init js handling on wishlist table items after ajax update
164
- *
165
- * @return void
166
- * @since 2.0.7
167
- */
168
- function init_handling_after_ajax(){
169
- if( typeof $.prettyPhoto != 'undefined' ) {
170
- $('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({
171
- hook : 'data-rel',
172
- social_tools : false,
173
- theme : 'pp_woocommerce',
174
- horizontal_padding: 20,
175
- opacity : 0.8,
176
- deeplinking : false
177
- });
178
- }
179
-
180
- checkboxes.off('change');
181
- checkboxes = $( '.wishlist_table tbody input[type="checkbox"]');
182
-
183
- if( typeof $.fn.selectBox != 'undefined' ) {
184
- $('select.selectBox').selectBox();
185
- }
186
-
187
- handle_wishlist_checkbox();
188
- }
189
-
190
- /**
191
- * Print "Product added to cart" notice
192
- *
193
- * @return void
194
- * @since 2.0.11
195
- */
196
- function print_add_to_cart_notice(){
197
- var messages = $( '.woocommerce-message');
198
-
199
- if( messages.length == 0 ){
200
- $( '#yith-wcwl-form').prepend( yith_wcwl_l10n.labels.added_to_cart_message );
201
- }
202
- else{
203
- messages.fadeOut( 300, function(){
204
- $(this).replaceWith( yith_wcwl_l10n.labels.added_to_cart_message ).fadeIn();
205
- } );
206
- }
207
- }
208
-
209
- /**
210
- * Add a product in the wishlist.
211
- *
212
- * @param object el
213
- * @return void
214
- * @since 1.0.0
215
- */
216
- function call_ajax_add_to_wishlist( el ) {
217
- var product_id = el.data( 'product-id' ),
218
- el_wrap = $( '.add-to-wishlist-' + product_id ),
219
- data = {
220
- add_to_wishlist: product_id,
221
- product_type: el.data( 'product-type' ),
222
- action: yith_wcwl_l10n.actions.add_to_wishlist_action
223
- };
224
-
225
- if( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in ){
226
- var wishlist_popup_container = el.parents( '.yith-wcwl-popup-footer' ).prev( '.yith-wcwl-popup-content' ),
227
- wishlist_popup_select = wishlist_popup_container.find( '.wishlist-select' ),
228
- wishlist_popup_name = wishlist_popup_container.find( '.wishlist-name' ),
229
- wishlist_popup_visibility = wishlist_popup_container.find( '.wishlist-visibility' );
230
-
231
- data.wishlist_id = wishlist_popup_select.val();
232
- data.wishlist_name = wishlist_popup_name.val();
233
- data.wishlist_visibility = wishlist_popup_visibility.val();
234
- }
235
-
236
- if( ! is_cookie_enabled() ){
237
- alert( yith_wcwl_l10n.labels.cookie_disabled );
238
- return;
239
- }
240
-
241
- $.ajax({
242
- type: 'POST',
243
- url: yith_wcwl_l10n.ajax_url,
244
- data: data,
245
- dataType: 'json',
246
- beforeSend: function(){
247
- el.siblings( '.ajax-loading' ).css( 'visibility', 'visible' );
248
- },
249
- complete: function(){
250
- el.siblings( '.ajax-loading' ).css( 'visibility', 'hidden' );
251
- },
252
- success: function( response ) {
253
- var msg = $( '#yith-wcwl-popup-message' ),
254
- response_result = response.result,
255
- response_message = response.message;
256
-
257
- if( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in ) {
258
- var wishlist_select = $( 'select.wishlist-select' );
259
- if( typeof $.prettyPhoto != 'undefined' ) {
260
- $.prettyPhoto.close();
261
- }
262
-
263
- wishlist_select.each( function( index ){
264
- var t = $(this),
265
- wishlist_options = t.find( 'option' );
266
-
267
- wishlist_options = wishlist_options.slice( 1, wishlist_options.length - 1 );
268
- wishlist_options.remove();
269
-
270
- if( typeof( response.user_wishlists ) != 'undefined' ){
271
- var i = 0;
272
- for( i in response.user_wishlists ) {
273
- if ( response.user_wishlists[i].is_default != "1" ) {
274
- $('<option>')
275
- .val(response.user_wishlists[i].ID)
276
- .html(response.user_wishlists[i].wishlist_name)
277
- .insertBefore(t.find('option:last-child'))
278
- }
279
- }
280
- }
281
- } );
282
- }
283
-
284
- $( '#yith-wcwl-message' ).html( response_message );
285
- msg.css( 'margin-left', '-' + $( msg ).width() + 'px' ).fadeIn();
286
- window.setTimeout( function() {
287
- msg.fadeOut();
288
- }, 2000 );
289
-
290
- if( response_result == "true" ) {
291
- if( ! yith_wcwl_l10n.multi_wishlist || ! yith_wcwl_l10n.is_user_logged_in || ( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in && yith_wcwl_l10n.hide_add_button ) ) {
292
- el_wrap.find('.yith-wcwl-add-button').hide().removeClass('show').addClass('hide');
293
- }
294
-
295
- el_wrap.find( '.yith-wcwl-wishlistexistsbrowse').hide().removeClass('show').addClass('hide').find('a').attr('href', response.wishlist_url);
296
- el_wrap.find( '.yith-wcwl-wishlistaddedbrowse' ).show().removeClass('hide').addClass('show').find('a').attr('href', response.wishlist_url);
297
- } else if( response_result == "exists" ) {
298
- if( ! yith_wcwl_l10n.multi_wishlist || ! yith_wcwl_l10n.is_user_logged_in || ( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in && yith_wcwl_l10n.hide_add_button ) ) {
299
- el_wrap.find('.yith-wcwl-add-button').hide().removeClass('show').addClass('hide');
300
- }
301
-
302
- el_wrap.find( '.yith-wcwl-wishlistexistsbrowse' ).show().removeClass('hide').addClass('show').find('a').attr('href', response.wishlist_url);
303
- el_wrap.find( '.yith-wcwl-wishlistaddedbrowse' ).hide().removeClass('show').addClass('hide').find('a').attr('href', response.wishlist_url);
304
- } else {
305
- el_wrap.find( '.yith-wcwl-add-button' ).show().removeClass('hide').addClass('show');
306
- el_wrap.find( '.yith-wcwl-wishlistexistsbrowse' ).hide().removeClass('show').addClass('hide');
307
- el_wrap.find( '.yith-wcwl-wishlistaddedbrowse' ).hide().removeClass('show').addClass('hide');
308
- }
309
-
310
- $('body').trigger('added_to_wishlist');
311
- }
312
-
313
- });
314
- }
315
-
316
- /**
317
- * Remove a product from the wishlist.
318
- *
319
- * @param object el
320
- * @return void
321
- * @since 1.0.0
322
- */
323
- function remove_item_from_wishlist( el ) {
324
- var table = el.parents( '.cart.wishlist_table' ),
325
- pagination = table.data( 'pagination' ),
326
- per_page = table.data( 'per-page' ),
327
- current_page = table.data( 'page' ),
328
- row = el.parents( 'tr' ),
329
- pagination_row = table.find( '.pagination-row'),
330
- data_row_id = row.data( 'row-id'),
331
- wishlist_id = table.data( 'id' ),
332
- wishlist_token = table.data( 'token' ),
333
- data = {
334
- action: yith_wcwl_l10n.actions.remove_from_wishlist_action,
335
- remove_from_wishlist: data_row_id,
336
- pagination: pagination,
337
- per_page: per_page,
338
- current_page: current_page,
339
- wishlist_id: wishlist_id,
340
- wishlist_token: wishlist_token
341
- };
342
-
343
- $( '#yith-wcwl-message' ).html( '&nbsp;' );
344
-
345
- if( typeof $.fn.block != 'undefined' ) {
346
- table.fadeTo('400', '0.6').block({message: null,
347
- overlayCSS : {
348
- background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
349
- backgroundSize: '16px 16px',
350
- opacity : 0.6
351
- }
352
- });
353
- }
354
-
355
- $( '#yith-wcwl-form' ).load( yith_wcwl_l10n.ajax_url + ' #yith-wcwl-form', data, function(){
356
-
357
- if( typeof $.fn.unblock != 'undefined' ) {
358
- table.stop(true).css('opacity', '1').unblock();
359
- }
360
-
361
- init_handling_after_ajax();
362
-
363
- $('body').trigger('removed_from_wishlist');
364
- } );
365
- }
366
-
367
- /**
368
- * Remove a product from the wishlist.
369
- *
370
- * @param object el
371
- * @return void
372
- * @since 1.0.0
373
- */
374
- function reload_wishlist_and_adding_elem( el, form ) {
375
-
376
- var product_id = el.data( 'product-id' ),
377
- table = $(document).find( '.cart.wishlist_table' ),
378
- pagination = table.data( 'pagination' ),
379
- per_page = table.data( 'per-page' ),
380
- wishlist_id = table.data( 'id' ),
381
- wishlist_token = table.data( 'token' ),
382
- data = {
383
- action: yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,
384
- pagination: pagination,
385
- per_page: per_page,
386
- wishlist_id: wishlist_id,
387
- wishlist_token: wishlist_token,
388
- add_to_wishlist: product_id,
389
- product_type: el.data( 'product-type' )
390
- };
391
-
392
- if( ! is_cookie_enabled() ){
393
- alert( yith_wcwl_l10n.labels.cookie_disabled );
394
- return
395
- }
396
-
397
- $.ajax({
398
- type: 'POST',
399
- url: yith_wcwl_l10n.ajax_url,
400
- data: data,
401
- dataType : 'html',
402
- beforeSend: function(){
403
- if( typeof $.fn.block != 'undefined' ) {
404
- table.fadeTo('400', '0.6').block({message: null,
405
- overlayCSS : {
406
- background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
407
- backgroundSize: '16px 16px',
408
- opacity : 0.6
409
- }
410
- });
411
- }
412
- },
413
- success: function(res) {
414
- var obj = $(res),
415
- new_form = obj.find('#yith-wcwl-form'); // get new form
416
-
417
- form.replaceWith( new_form );
418
- init_handling_after_ajax();
419
- }
420
- });
421
- }
422
-
423
- /**
424
- * Move item to another wishlist
425
- *
426
- * @param object el
427
- * @return void
428
- * @since 2.0.7
429
- */
430
- function move_item_to_another_wishlist( el ){
431
- var table = el.parents( '.cart.wishlist_table'),
432
- wishlist_token = table.data( 'token'),
433
- wishlist_id = table.data( 'id' ),
434
- item = el.parents( 'tr'),
435
- item_id = item.data( 'row-id'),
436
- to_token = el.val(),
437
- pagination = table.data( 'pagination' ),
438
- per_page = table.data( 'per-page' ),
439
- current_page = table.data( 'page' ),
440
- data = {
441
- action: yith_wcwl_l10n.actions.move_to_another_wishlist_action,
442
- wishlist_token: wishlist_token,
443
- wishlist_id: wishlist_id,
444
- destination_wishlist_token: to_token,
445
- item_id: item_id,
446
- pagination: pagination,
447
- per_page: per_page,
448
- current_page: current_page
449
- };
450
-
451
- if( to_token == '' ){
452
- return;
453
- }
454
-
455
- if( typeof $.fn.block != 'undefined' ) {
456
- table.fadeTo('400', '0.6').block({message: null,
457
- overlayCSS : {
458
- background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
459
- backgroundSize: '16px 16px',
460
- opacity : 0.6
461
- }
462
- });
463
- }
464
-
465
- $( '#yith-wcwl-form' ).load( yith_wcwl_l10n.ajax_url + ' #yith-wcwl-form', data, function(){
466
-
467
- if( typeof $.fn.unblock != 'undefined' ) {
468
- table.stop(true).css('opacity', '1').unblock();
469
- }
470
-
471
- init_handling_after_ajax();
472
-
473
- $('body').trigger('moved_to_another_wishlist');
474
- } );
475
- }
476
-
477
- /**
478
- * Show form to edit wishlist title
479
- *
480
- * @param ev event
481
- * @return void
482
- * @since 2.0.0
483
- */
484
- function show_title_form( ev ){
485
- var t = $(this);
486
- ev.preventDefault();
487
-
488
- t.parents( '.wishlist-title' ).next().show();
489
- t.parents( '.wishlist-title' ).hide();
490
- }
491
-
492
- /**
493
- * Hide form to edit wishlist title
494
- *
495
- * @param ev event
496
- * @return void
497
- * @since 2.0.0
498
- */
499
- function hide_title_form( ev ) {
500
- var t = $(this);
501
- ev.preventDefault();
502
-
503
- t.parents( '.hidden-title-form').hide();
504
- t.parents( '.hidden-title-form').prev().show ();
505
- }
506
-
507
- /**
508
- * Check if cookies are enabled
509
- *
510
- * @return bool
511
- * @since 2.0.0
512
- */
513
- function is_cookie_enabled() {
514
- if (navigator.cookieEnabled) return true;
515
-
516
- // set and read cookie
517
- document.cookie = "cookietest=1";
518
- var ret = document.cookie.indexOf("cookietest=") != -1;
519
-
520
- // delete cookie
521
- document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
522
-
523
- return ret;
524
- }
525
-
526
- /**
527
- * Add wishlist popup message
528
- *
529
- * @return void
530
- * @since 2.0.0
531
- */
532
- function add_wishlist_popup() {
533
- if( $('.yith-wcwl-add-to-wishlist').length != 0 && $( '#yith-wcwl-popup-message' ).length == 0 ) {
534
- var message_div = $( '<div>' )
535
- .attr( 'id', 'yith-wcwl-message' ),
536
- popup_div = $( '<div>' )
537
- .attr( 'id', 'yith-wcwl-popup-message' )
538
- .html( message_div )
539
- .hide();
540
-
541
- $( 'body' ).prepend( popup_div );
542
- }
543
- }
544
-
545
- /**
546
- * Handle "Add to cart" checkboxes events
547
- *
548
- * @return void
549
- * @since 2.0.5
550
- */
551
- function handle_wishlist_checkbox() {
552
- checkboxes.on( 'change', function(){
553
- var ids = '',
554
- table = $(this).parents( '.cart.wishlist_table'),
555
- wishlist_id = table.data( 'id'),
556
- wishlist_token = table.data( 'token'),
557
- url = document.URL;
558
-
559
- checkboxes.filter(':checked').each( function(){
560
- var t = $(this);
561
- ids += ( ids.length != 0 ) ? ',' : '';
562
- ids += t.parents('tr').data( 'row-id' );
563
- } );
564
-
565
- url = add_query_arg( url, 'wishlist_products_to_add_to_cart', ids );
566
- url = add_query_arg( url, 'wishlist_token', wishlist_token );
567
- url = add_query_arg( url, 'wishlist_id', wishlist_id );
568
-
569
- $('#custom_add_to_cart').attr( 'href', url );
570
- } );
571
- }
572
-
573
- /**
574
- * Add a query arg to an url
575
- *
576
- * @param purl original url
577
- * @param key query argr key
578
- * @param value query arg value
579
- * @return string
580
- * @since 2.0.7
581
- */
582
- function add_query_arg(purl, key,value){
583
- var s = purl;
584
- var pair = key+"="+value;
585
-
586
- var r = new RegExp("(&|\\?)"+key+"=[^\&]*");
587
-
588
- s = s.replace(r,"$1"+pair);
589
-
590
- if(s.indexOf(key + '=')>-1){
591
-
592
-
593
- }
594
- else{
595
- if(s.indexOf('?')>-1){
596
- s+='&'+pair;
597
- }else{
598
- s+='?'+pair;
599
- }
600
- }
601
-
602
- return s;
603
- }
604
  });
1
+ jQuery( document ).ready( function( $ ){
2
+
3
+ var cart_redirect_after_add = typeof( wc_add_to_cart_params ) !== 'undefined' ? wc_add_to_cart_params.cart_redirect_after_add : '',
4
+ this_page = window.location.toString(),
5
+ checkboxes = $( '.wishlist_table tbody input[type="checkbox"]:not(:disabled)');
6
+
7
+ $(document).on( 'yith_wcwl_init', function(){
8
+ var t = $(this),
9
+ checkboxes = $( '.wishlist_table tbody input[type="checkbox"]:not(:disabled)');
10
+
11
+ t.on( 'click', '.add_to_wishlist', function( ev ) {
12
+ var t = $( this);
13
+
14
+ ev.preventDefault();
15
+
16
+ call_ajax_add_to_wishlist( t );
17
+
18
+ return false;
19
+ } );
20
+
21
+ t.on( 'click', '.remove_from_wishlist', function( ev ){
22
+ var t = $( this );
23
+
24
+ ev.preventDefault();
25
+
26
+ remove_item_from_wishlist( t );
27
+
28
+ return false;
29
+ } );
30
+
31
+ t.on( 'adding_to_cart', 'body', function( ev, button, data ){
32
+ if( typeof button != 'undefined' && typeof data != 'undefined' && button.closest( '.wishlist_table' ).length != 0 ){
33
+ data.remove_from_wishlist_after_add_to_cart = button.closest( 'tr' ).data( 'row-id' );
34
+ data.wishlist_id = button.closest( 'table' ).data( 'id' );
35
+ wc_add_to_cart_params.cart_redirect_after_add = yith_wcwl_l10n.redirect_to_cart;
36
+ }
37
+ } );
38
+
39
+ t.on( 'added_to_cart', 'body', function( ev ){
40
+ wc_add_to_cart_params.cart_redirect_after_add = cart_redirect_after_add;
41
+
42
+ var wishlist = $( '.wishlist_table');
43
+
44
+ wishlist.find( '.added' ).removeClass( 'added' );
45
+ wishlist.find( '.added_to_cart' ).remove();
46
+ } );
47
+
48
+ t.on( 'added_to_cart', 'body', print_add_to_cart_notice );
49
+
50
+ t.on( 'cart_page_refreshed', 'body', init_handling_after_ajax );
51
+
52
+ t.on( 'click', '.show-title-form', show_title_form );
53
+
54
+ t.on( 'click', '.wishlist-title-with-form h2', show_title_form );
55
+
56
+ t.on( 'click', '.hide-title-form', hide_title_form );
57
+
58
+ t.on( 'change', '.change-wishlist', function( ev ){
59
+ var t = $(this);
60
+
61
+ move_item_to_another_wishlist( t );
62
+
63
+ return false;
64
+ } );
65
+
66
+ t.on( 'change', '.yith-wcwl-popup-content .wishlist-select', function( ev ){
67
+ var t = $(this);
68
+
69
+ if( t.val() == 'new' ){
70
+ t.parents( '.yith-wcwl-first-row' ).next( '.yith-wcwl-second-row' ).css( 'display', 'table-row' );
71
+ }
72
+ else{
73
+ t.parents( '.yith-wcwl-first-row' ).next( '.yith-wcwl-second-row' ).hide();
74
+ }
75
+ } );
76
+
77
+ t.on( 'change', '#bulk_add_to_cart', function(){
78
+ var t = $(this);
79
+
80
+ if( t.is( ':checked' ) ){
81
+ checkboxes.attr( 'checked','checked').change();
82
+ }
83
+ else{
84
+ checkboxes.removeAttr( 'checked').change();
85
+ }
86
+ } );
87
+
88
+ t.on( 'click', '#custom_add_to_cart', function(ev){
89
+ var t = $(this),
90
+ table = t.parents( '.cart.wishlist_table' );
91
+
92
+ if( ! yith_wcwl_l10n.ajax_add_to_cart_enabled ){
93
+ return;
94
+ }
95
+
96
+ ev.preventDefault();
97
+
98
+ if( typeof $.fn.block != 'undefined' ) {
99
+ table.fadeTo('400', '0.6').block({message: null,
100
+ overlayCSS : {
101
+ background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
102
+ backgroundSize: '16px 16px',
103
+ opacity : 0.6
104
+ }
105
+ });
106
+ }
107
+
108
+ $( '#yith-wcwl-form' ).load( yith_wcwl_l10n.ajax_url + t.attr( 'href' ) + ' #yith-wcwl-form', {action: yith_wcwl_l10n.actions.bulk_add_to_cart_action}, function(){
109
+
110
+ if( typeof $.fn.unblock != 'undefined' ) {
111
+ table.stop(true).css('opacity', '1').unblock();
112
+ }
113
+
114
+ if( typeof $.prettyPhoto != 'undefined' ) {
115
+ $('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({
116
+ hook : 'data-rel',
117
+ social_tools : false,
118
+ theme : 'pp_woocommerce',
119
+ horizontal_padding: 20,
120
+ opacity : 0.8,
121
+ deeplinking : false
122
+ });
123
+ }
124
+
125
+ checkboxes.off('change');
126
+ checkboxes = $( '.wishlist_table tbody input[type="checkbox"]');
127
+
128
+ if( typeof $.fn.selectBox != 'undefined' ) {
129
+ $('select.selectBox').selectBox();
130
+ }
131
+
132
+ handle_wishlist_checkbox();
133
+ } );
134
+ } );
135
+
136
+ t.on('click', '.yith-wfbt-add-wishlist', function(e){
137
+ e.preventDefault();
138
+ var t = $(this),
139
+ form = $( '#yith-wcwl-form' );
140
+
141
+ $('html, body').animate({
142
+ scrollTop: ( form.offset().top)
143
+ },500);
144
+
145
+ // ajax call
146
+ reload_wishlist_and_adding_elem( t, form );
147
+ });
148
+
149
+ add_wishlist_popup();
150
+
151
+ handle_wishlist_checkbox();
152
+
153
+ } ).trigger('yith_wcwl_init');
154
+
155
+ /**
156
+ * Adds selectbox where needed
157
+ */
158
+ if( typeof $.fn.selectBox != 'undefined' ) {
159
+ $('select.selectBox').selectBox();
160
+ }
161
+
162
+ /**
163
+ * Init js handling on wishlist table items after ajax update
164
+ *
165
+ * @return void
166
+ * @since 2.0.7
167
+ */
168
+ function init_handling_after_ajax(){
169
+ if( typeof $.prettyPhoto != 'undefined' ) {
170
+ $('a[data-rel="prettyPhoto[ask_an_estimate]"]').prettyPhoto({
171
+ hook : 'data-rel',
172
+ social_tools : false,
173
+ theme : 'pp_woocommerce',
174
+ horizontal_padding: 20,
175
+ opacity : 0.8,
176
+ deeplinking : false
177
+ });
178
+ }
179
+
180
+ checkboxes.off('change');
181
+ checkboxes = $( '.wishlist_table tbody input[type="checkbox"]');
182
+
183
+ if( typeof $.fn.selectBox != 'undefined' ) {
184
+ $('select.selectBox').selectBox();
185
+ }
186
+
187
+ handle_wishlist_checkbox();
188
+ }
189
+
190
+ /**
191
+ * Print "Product added to cart" notice
192
+ *
193
+ * @return void
194
+ * @since 2.0.11
195
+ */
196
+ function print_add_to_cart_notice(){
197
+ var messages = $( '.woocommerce-message');
198
+
199
+ if( messages.length == 0 ){
200
+ $( '#yith-wcwl-form').prepend( yith_wcwl_l10n.labels.added_to_cart_message );
201
+ }
202
+ else{
203
+ messages.fadeOut( 300, function(){
204
+ $(this).replaceWith( yith_wcwl_l10n.labels.added_to_cart_message ).fadeIn();
205
+ } );
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Add a product in the wishlist.
211
+ *
212
+ * @param object el
213
+ * @return void
214
+ * @since 1.0.0
215
+ */
216
+ function call_ajax_add_to_wishlist( el ) {
217
+ var product_id = el.data( 'product-id' ),
218
+ el_wrap = $( '.add-to-wishlist-' + product_id ),
219
+ data = {
220
+ add_to_wishlist: product_id,
221
+ product_type: el.data( 'product-type' ),
222
+ action: yith_wcwl_l10n.actions.add_to_wishlist_action
223
+ };
224
+
225
+ if( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in ){
226
+ var wishlist_popup_container = el.parents( '.yith-wcwl-popup-footer' ).prev( '.yith-wcwl-popup-content' ),
227
+ wishlist_popup_select = wishlist_popup_container.find( '.wishlist-select' ),
228
+ wishlist_popup_name = wishlist_popup_container.find( '.wishlist-name' ),
229
+ wishlist_popup_visibility = wishlist_popup_container.find( '.wishlist-visibility' );
230
+
231
+ data.wishlist_id = wishlist_popup_select.val();
232
+ data.wishlist_name = wishlist_popup_name.val();
233
+ data.wishlist_visibility = wishlist_popup_visibility.val();
234
+ }
235
+
236
+ if( ! is_cookie_enabled() ){
237
+ alert( yith_wcwl_l10n.labels.cookie_disabled );
238
+ return;
239
+ }
240
+
241
+ $.ajax({
242
+ type: 'POST',
243
+ url: yith_wcwl_l10n.ajax_url,
244
+ data: data,
245
+ dataType: 'json',
246
+ beforeSend: function(){
247
+ el.siblings( '.ajax-loading' ).css( 'visibility', 'visible' );
248
+ },
249
+ complete: function(){
250
+ el.siblings( '.ajax-loading' ).css( 'visibility', 'hidden' );
251
+ },
252
+ success: function( response ) {
253
+ var msg = $( '#yith-wcwl-popup-message' ),
254
+ response_result = response.result,
255
+ response_message = response.message;
256
+
257
+ if( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in ) {
258
+ var wishlist_select = $( 'select.wishlist-select' );
259
+ if( typeof $.prettyPhoto != 'undefined' ) {
260
+ $.prettyPhoto.close();
261
+ }
262
+
263
+ wishlist_select.each( function( index ){
264
+ var t = $(this),
265
+ wishlist_options = t.find( 'option' );
266
+
267
+ wishlist_options = wishlist_options.slice( 1, wishlist_options.length - 1 );
268
+ wishlist_options.remove();
269
+
270
+ if( typeof( response.user_wishlists ) != 'undefined' ){
271
+ var i = 0;
272
+ for( i in response.user_wishlists ) {
273
+ if ( response.user_wishlists[i].is_default != "1" ) {
274
+ $('<option>')
275
+ .val(response.user_wishlists[i].ID)
276
+ .html(response.user_wishlists[i].wishlist_name)
277
+ .insertBefore(t.find('option:last-child'))
278
+ }
279
+ }
280
+ }
281
+ } );
282
+ }
283
+
284
+ $( '#yith-wcwl-message' ).html( response_message );
285
+ msg.css( 'margin-left', '-' + $( msg ).width() + 'px' ).fadeIn();
286
+ window.setTimeout( function() {
287
+ msg.fadeOut();
288
+ }, 2000 );
289
+
290
+ if( response_result == "true" ) {
291
+ if( ! yith_wcwl_l10n.multi_wishlist || ! yith_wcwl_l10n.is_user_logged_in || ( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in && yith_wcwl_l10n.hide_add_button ) ) {
292
+ el_wrap.find('.yith-wcwl-add-button').hide().removeClass('show').addClass('hide');
293
+ }
294
+
295
+ el_wrap.find( '.yith-wcwl-wishlistexistsbrowse').hide().removeClass('show').addClass('hide').find('a').attr('href', response.wishlist_url);
296
+ el_wrap.find( '.yith-wcwl-wishlistaddedbrowse' ).show().removeClass('hide').addClass('show').find('a').attr('href', response.wishlist_url);
297
+ } else if( response_result == "exists" ) {
298
+ if( ! yith_wcwl_l10n.multi_wishlist || ! yith_wcwl_l10n.is_user_logged_in || ( yith_wcwl_l10n.multi_wishlist && yith_wcwl_l10n.is_user_logged_in && yith_wcwl_l10n.hide_add_button ) ) {
299
+ el_wrap.find('.yith-wcwl-add-button').hide().removeClass('show').addClass('hide');
300
+ }
301
+
302
+ el_wrap.find( '.yith-wcwl-wishlistexistsbrowse' ).show().removeClass('hide').addClass('show').find('a').attr('href', response.wishlist_url);
303
+ el_wrap.find( '.yith-wcwl-wishlistaddedbrowse' ).hide().removeClass('show').addClass('hide').find('a').attr('href', response.wishlist_url);
304
+ } else {
305
+ el_wrap.find( '.yith-wcwl-add-button' ).show().removeClass('hide').addClass('show');
306
+ el_wrap.find( '.yith-wcwl-wishlistexistsbrowse' ).hide().removeClass('show').addClass('hide');
307
+ el_wrap.find( '.yith-wcwl-wishlistaddedbrowse' ).hide().removeClass('show').addClass('hide');
308
+ }
309
+
310
+ $('body').trigger('added_to_wishlist');
311
+ }
312
+
313
+ });
314
+ }
315
+
316
+ /**
317
+ * Remove a product from the wishlist.
318
+ *
319
+ * @param object el
320
+ * @return void
321
+ * @since 1.0.0
322
+ */
323
+ function remove_item_from_wishlist( el ) {
324
+ var table = el.parents( '.cart.wishlist_table' ),
325
+ pagination = table.data( 'pagination' ),
326
+ per_page = table.data( 'per-page' ),
327
+ current_page = table.data( 'page' ),
328
+ row = el.parents( 'tr' ),
329
+ pagination_row = table.find( '.pagination-row'),
330
+ data_row_id = row.data( 'row-id'),
331
+ wishlist_id = table.data( 'id' ),
332
+ wishlist_token = table.data( 'token' ),
333
+ data = {
334
+ action: yith_wcwl_l10n.actions.remove_from_wishlist_action,
335
+ remove_from_wishlist: data_row_id,
336
+ pagination: pagination,
337
+ per_page: per_page,
338
+ current_page: current_page,
339
+ wishlist_id: wishlist_id,
340
+ wishlist_token: wishlist_token
341
+ };
342
+
343
+ $( '#yith-wcwl-message' ).html( '&nbsp;' );
344
+
345
+ if( typeof $.fn.block != 'undefined' ) {
346
+ table.fadeTo('400', '0.6').block({message: null,
347
+ overlayCSS : {
348
+ background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
349
+ backgroundSize: '16px 16px',
350
+ opacity : 0.6
351
+ }
352
+ });
353
+ }
354
+
355
+ $( '#yith-wcwl-form' ).load( yith_wcwl_l10n.ajax_url + ' #yith-wcwl-form', data, function(){
356
+
357
+ if( typeof $.fn.unblock != 'undefined' ) {
358
+ table.stop(true).css('opacity', '1').unblock();
359
+ }
360
+
361
+ init_handling_after_ajax();
362
+
363
+ $('body').trigger('removed_from_wishlist');
364
+ } );
365
+ }
366
+
367
+ /**
368
+ * Remove a product from the wishlist.
369
+ *
370
+ * @param object el
371
+ * @return void
372
+ * @since 1.0.0
373
+ */
374
+ function reload_wishlist_and_adding_elem( el, form ) {
375
+
376
+ var product_id = el.data( 'product-id' ),
377
+ table = $(document).find( '.cart.wishlist_table' ),
378
+ pagination = table.data( 'pagination' ),
379
+ per_page = table.data( 'per-page' ),
380
+ wishlist_id = table.data( 'id' ),
381
+ wishlist_token = table.data( 'token' ),
382
+ data = {
383
+ action: yith_wcwl_l10n.actions.reload_wishlist_and_adding_elem_action,
384
+ pagination: pagination,
385
+ per_page: per_page,
386
+ wishlist_id: wishlist_id,
387
+ wishlist_token: wishlist_token,
388
+ add_to_wishlist: product_id,
389
+ product_type: el.data( 'product-type' )
390
+ };
391
+
392
+ if( ! is_cookie_enabled() ){
393
+ alert( yith_wcwl_l10n.labels.cookie_disabled );
394
+ return
395
+ }
396
+
397
+ $.ajax({
398
+ type: 'POST',
399
+ url: yith_wcwl_l10n.ajax_url,
400
+ data: data,
401
+ dataType : 'html',
402
+ beforeSend: function(){
403
+ if( typeof $.fn.block != 'undefined' ) {
404
+ table.fadeTo('400', '0.6').block({message: null,
405
+ overlayCSS : {
406
+ background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
407
+ backgroundSize: '16px 16px',
408
+ opacity : 0.6
409
+ }
410
+ });
411
+ }
412
+ },
413
+ success: function(res) {
414
+ var obj = $(res),
415
+ new_form = obj.find('#yith-wcwl-form'); // get new form
416
+
417
+ form.replaceWith( new_form );
418
+ init_handling_after_ajax();
419
+ }
420
+ });
421
+ }
422
+
423
+ /**
424
+ * Move item to another wishlist
425
+ *
426
+ * @param object el
427
+ * @return void
428
+ * @since 2.0.7
429
+ */
430
+ function move_item_to_another_wishlist( el ){
431
+ var table = el.parents( '.cart.wishlist_table'),
432
+ wishlist_token = table.data( 'token'),
433
+ wishlist_id = table.data( 'id' ),
434
+ item = el.parents( 'tr'),
435
+ item_id = item.data( 'row-id'),
436
+ to_token = el.val(),
437
+ pagination = table.data( 'pagination' ),
438
+ per_page = table.data( 'per-page' ),
439
+ current_page = table.data( 'page' ),
440
+ data = {
441
+ action: yith_wcwl_l10n.actions.move_to_another_wishlist_action,
442
+ wishlist_token: wishlist_token,
443
+ wishlist_id: wishlist_id,
444
+ destination_wishlist_token: to_token,
445
+ item_id: item_id,
446
+ pagination: pagination,
447
+ per_page: per_page,
448
+ current_page: current_page
449
+ };
450
+
451
+ if( to_token == '' ){
452
+ return;
453
+ }
454
+
455
+ if( typeof $.fn.block != 'undefined' ) {
456
+ table.fadeTo('400', '0.6').block({message: null,
457
+ overlayCSS : {
458
+ background : 'transparent url(' + yith_wcwl_l10n.ajax_loader_url + ') no-repeat center',
459
+ backgroundSize: '16px 16px',
460
+ opacity : 0.6
461
+ }
462
+ });
463
+ }
464
+
465
+ $( '#yith-wcwl-form' ).load( yith_wcwl_l10n.ajax_url + ' #yith-wcwl-form', data, function(){
466
+
467
+ if( typeof $.fn.unblock != 'undefined' ) {
468
+ table.stop(true).css('opacity', '1').unblock();
469
+ }
470
+
471
+ init_handling_after_ajax();
472
+
473
+ $('body').trigger('moved_to_another_wishlist');
474
+ } );
475
+ }
476
+
477
+ /**
478
+ * Show form to edit wishlist title
479
+ *
480
+ * @param ev event
481
+ * @return void
482
+ * @since 2.0.0
483
+ */
484
+ function show_title_form( ev ){
485
+ var t = $(this);
486
+ ev.preventDefault();
487
+
488
+ t.parents( '.wishlist-title' ).next().show();
489
+ t.parents( '.wishlist-title' ).hide();
490
+ }
491
+
492
+ /**
493
+ * Hide form to edit wishlist title
494
+ *
495
+ * @param ev event
496
+ * @return void
497
+ * @since 2.0.0
498
+ */
499
+ function hide_title_form( ev ) {
500
+ var t = $(this);
501
+ ev.preventDefault();
502
+
503
+ t.parents( '.hidden-title-form').hide();
504
+ t.parents( '.hidden-title-form').prev().show ();
505
+ }
506
+
507
+ /**
508
+ * Check if cookies are enabled
509
+ *
510
+ * @return bool
511
+ * @since 2.0.0
512
+ */
513
+ function is_cookie_enabled() {
514
+ if (navigator.cookieEnabled) return true;
515
+
516
+ // set and read cookie
517
+ document.cookie = "cookietest=1";
518
+ var ret = document.cookie.indexOf("cookietest=") != -1;
519
+
520
+ // delete cookie
521
+ document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
522
+
523
+ return ret;
524
+ }
525
+
526
+ /**
527
+ * Add wishlist popup message
528
+ *
529
+ * @return void
530
+ * @since 2.0.0
531
+ */
532
+ function add_wishlist_popup() {
533
+ if( $('.yith-wcwl-add-to-wishlist').length != 0 && $( '#yith-wcwl-popup-message' ).length == 0 ) {
534
+ var message_div = $( '<div>' )
535
+ .attr( 'id', 'yith-wcwl-message' ),
536
+ popup_div = $( '<div>' )
537
+ .attr( 'id', 'yith-wcwl-popup-message' )
538
+ .html( message_div )
539
+ .hide();
540
+
541
+ $( 'body' ).prepend( popup_div );
542
+ }
543
+ }
544
+
545
+ /**
546
+ * Handle "Add to cart" checkboxes events
547
+ *
548
+ * @return void
549
+ * @since 2.0.5
550
+ */
551
+ function handle_wishlist_checkbox() {
552
+ checkboxes.on( 'change', function(){
553
+ var ids = '',
554
+ table = $(this).parents( '.cart.wishlist_table'),
555
+ wishlist_id = table.data( 'id'),
556
+ wishlist_token = table.data( 'token'),
557
+ url = document.URL;
558
+
559
+ checkboxes.filter(':checked').each( function(){
560
+ var t = $(this);
561
+ ids += ( ids.length != 0 ) ? ',' : '';
562
+ ids += t.parents('tr').data( 'row-id' );
563
+ } );
564
+
565
+ url = add_query_arg( url, 'wishlist_products_to_add_to_cart', ids );
566
+ url = add_query_arg( url, 'wishlist_token', wishlist_token );
567
+ url = add_query_arg( url, 'wishlist_id', wishlist_id );
568
+
569
+ $('#custom_add_to_cart').attr( 'href', url );
570
+ } );
571
+ }
572
+
573
+ /**
574
+ * Add a query arg to an url
575
+ *
576
+ * @param purl original url
577
+ * @param key query argr key
578
+ * @param value query arg value
579
+ * @return string
580
+ * @since 2.0.7
581
+ */
582
+ function add_query_arg(purl, key,value){
583
+ var s = purl;
584
+ var pair = key+"="+value;
585
+
586
+ var r = new RegExp("(&|\\?)"+key+"=[^\&]*");
587
+
588
+ s = s.replace(r,"$1"+pair);
589
+
590
+ if(s.indexOf(key + '=')>-1){
591
+
592
+
593
+ }
594
+ else{
595
+ if(s.indexOf('?')>-1){
596
+ s+='&'+pair;
597
+ }else{
598
+ s+='?'+pair;
599
+ }
600
+ }
601
+
602
+ return s;
603
+ }
604
  });
modules/yith-woocommerce-wishlist/includes/class.yith-wcwl-admin-init.php CHANGED
@@ -1,1512 +1,1495 @@
1
- <?php
2
- /**
3
- * Admin init class
4
- *
5
- * @author Your Inspiration Themes
6
- * @package YITH WooCommerce Wishlist
7
- * @version 2.0.0
8
- */
9
-
10
- if ( ! defined( 'YITH_WCWL' ) ) {
11
- exit;
12
- } // Exit if accessed directly
13
-
14
- if ( ! class_exists( 'YITH_WCWL_Admin_Init' ) ) {
15
- /**
16
- * Initiator class. Create and populate admin views.
17
- *
18
- * @since 1.0.0
19
- */
20
- class YITH_WCWL_Admin_Init {
21
-
22
- /**
23
- * Single instance of the class
24
- *
25
- * @var \YITH_WCWL_Admin_Init
26
- * @since 2.0.0
27
- */
28
- protected static $instance;
29
-
30
- /**
31
- * Plugin version
32
- *
33
- * @var string
34
- * @since 1.0.0
35
- */
36
- public $version = '2.0.12';
37
-
38
- /**
39
- * Plugin database version
40
- *
41
- * @var string
42
- * @since 1.0.0
43
- */
44
- public $db_version = '2.0.0';
45
-
46
- /**
47
- * Wishlist panel
48
- *
49
- * @var string Panel hookname
50
- * @since 2.0.0
51
- */
52
- protected $_panel = null;
53
-
54
- /**
55
- * Tab name
56
- *
57
- * @var string
58
- * @since 1.0.0
59
- */
60
- public $tab;
61
-
62
- /**
63
- * Various links
64
- *
65
- * @var string
66
- * @access public
67
- * @since 1.0.0
68
- */
69
- public $banner_url = 'http://cdn.yithemes.com/plugins/yith_wishlist.php?url';
70
- public $banner_img = 'http://cdn.yithemes.com/plugins/yith_wishlist.php';
71
- public $doc_url = 'http://yithemes.com/docs-plugins/yith-woocommerce-wishlist/';
72
- public $premium_landing_url = 'http://yithemes.com/themes/plugins/yith-woocommerce-wishlist/';
73
-
74
- /**
75
- * Plugin options
76
- *
77
- * @var array
78
- * @since 1.0.0
79
- */
80
- public $options;
81
-
82
- /**
83
- * List of available tab for wishlist panel
84
- *
85
- * @var array
86
- * @access public
87
- * @since 2.0.0
88
- */
89
- public $available_tabs = array();
90
-
91
- /**
92
- * Default tab to show when no selected
93
- *
94
- * @var string
95
- * @access public
96
- * @since 2.0.0
97
- */
98
- public $default_tab = 'settings';
99
-
100
- /**
101
- * Returns single instance of the class
102
- *
103
- * @return \YITH_WCWL_Admin_Init
104
- * @since 2.0.0
105
- */
106
- public static function get_instance(){
107
- if( is_null( self::$instance ) ){
108
- self::$instance = new self();
109
- }
110
-
111
- return self::$instance;
112
- }
113
-
114
- /**
115
- * Constructor of the class
116
- *
117
- * @return \YITH_WCWL_Admin_Init
118
- * @since 2.0.0
119
- */
120
- public function __construct(){
121
- define( 'YITH_WCWL_VERSION', $this->version );
122
- define( 'YITH_WCWL_DB_VERSION', $this->db_version );
123
-
124
- // init premium features for admin panel
125
- if( function_exists( 'YITH_WCWL_Admin_Premium' ) ){
126
- YITH_WCWL_Admin_Premium();
127
- }
128
-
129
- /**
130
- * Support to WC 2.0.x
131
- */
132
- global $woocommerce;
133
- $is_woocommerce_2_0 = version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.1', '<' );
134
- $is_woocommerce_2_4 = version_compare( $woocommerce->version, '2.4.0', '>=' );
135
-
136
- $this->options = $this->_plugin_options();
137
-
138
- if ( ! defined( 'DOING_AJAX' ) ) {
139
- $this->install();
140
- }
141
-
142
- add_action( 'init', array( $this, 'init' ), 0 );
143
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ), 20 );
144
- add_filter( 'plugin_action_links_' . plugin_basename( YITH_WCWL_DIR . 'init.php' ), array( $this, 'action_links' ) );
145
- add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta' ), 10, 2 );
146
-
147
- if( $is_woocommerce_2_0 ) {
148
- add_filter( 'woocommerce_page_settings', array( $this, 'add_page_setting_woocommerce' ) );
149
- }
150
-
151
- // saves panel options
152
- if( $is_woocommerce_2_4 ){
153
- add_filter( 'woocommerce_admin_settings_sanitize_option_yith_wcwl_color_panel', array( $this, 'update_color_options' ) );
154
- }
155
- else{
156
- add_action( 'woocommerce_update_option_yith_wcwl_color_panel', array( $this, 'update_color_options' ) );
157
- }
158
-
159
- // handles custom wc option type
160
- add_action( 'woocommerce_admin_field_yith_wcwl_color_panel', array( $this, 'print_color_panel' ) );
161
-
162
- // register wishlist panel
163
- add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
164
- add_action( 'yith_wcwl_premium_tab', array( $this, 'print_premium_tab' ) );
165
-
166
- // register pointer methods
167
- add_action( 'admin_init', array( $this, 'register_pointer' ) );
168
-
169
- //Apply filters
170
- $this->banner_url = apply_filters( 'yith_wcmg_banner_url', $this->banner_url );
171
- }
172
-
173
- /**
174
- * Get the premium landing uri
175
- *
176
- * @since 1.0.0
177
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
178
- * @return string The premium landing link
179
- */
180
- public function get_premium_landing_uri(){
181
- return defined( 'YITH_REFER_ID' ) ? $this->premium_landing_url . '?refer_id=' . YITH_REFER_ID : $this->premium_landing_url . '?refer_id=1030585';
182
- }
183
-
184
- /* === INITIALIZATION SECTION === */
185
-
186
- /**
187
- * Initiator method. Initiate properties.
188
- *
189
- * @return void
190
- * @access private
191
- * @since 1.0.0
192
- */
193
- public function init() {
194
- $this->tab = __( 'Wishlist', 'yith-woocommerce-wishlist' );
195
- $this->available_tabs = apply_filters( 'yith_wcwl_available_admin_tabs', array(
196
- 'settings' => __( 'Settings', 'yith-woocommerce-wishlist' ),
197
- 'colors' => __( 'Colors', 'yith-woocommerce-wishlist' ),
198
- 'premium' => __( 'Premium Version', 'yith-woocommerce-wishlist' )
199
- ) );
200
- $this->default_tab = apply_filters( 'yith_wcwl_default_admin_tab', $this->default_tab );
201
-
202
- wp_register_style( 'yith-wcwl-admin', YITH_WCWL_URL . 'assets/css/admin.css' );
203
- wp_register_script( 'yith-wcwl-admin', YITH_WCWL_URL . 'assets/js/admin/yith-wcwl.js' );
204
- }
205
-
206
- /**
207
- * Run the installation
208
- *
209
- * @return void
210
- * @since 1.0.0
211
- */
212
- public function install() {
213
- $stored_db_version = get_option( 'yith_wcwl_db_version' );
214
-
215
- if( $stored_db_version == '1.0.0' ){
216
- add_action( 'init', array( YITH_WCWL_Install(), 'update' ) );
217
- add_action( 'init', 'flush_rewrite_rules' );
218
- YITH_WCWL_Install()->default_options( $this->options );
219
-
220
- // Plugin installed
221
- do_action( 'yith_wcwl_installed' );
222
- do_action( 'yith_wcwl_updated' );
223
- }
224
- elseif ( $this->db_version != $stored_db_version || ! YITH_WCWL_Install()->is_installed() ) {
225
- add_action( 'init', array( YITH_WCWL_Install(), 'init' ) );
226
- YITH_WCWL_Install()->default_options( $this->options );
227
-
228
- // Plugin installed
229
- do_action( 'yith_wcwl_installed' );
230
- }
231
- }
232
-
233
- /**
234
- * Update plugin color options.
235
- *
236
- * @return void
237
- * @since 1.0.0
238
- */
239
- public function update_color_options( $value = false ) {
240
- global $pagenow;
241
-
242
- $colors_options = array();
243
-
244
- foreach ( YITH_WCWL_Init()->colors_options as $name => $option ) {
245
- foreach ( $option as $id => $color ) {
246
- $default_value = isset( $colors_options[$name][$id] ) ? $colors_options[$name][$id] : '';
247
- $colors_options[$name][$id] = isset( $_POST['yith_wcwl_color_' . $name . '_' . $id] ) && ! empty( $_POST['yith_wcwl_color_' . $name . '_' . $id] ) ? woocommerce_format_hex( $_POST['yith_wcwl_color_' . $name . '_' . $id] ) : $default_value;
248
- }
249
- }
250
-
251
- update_option( 'yith_wcwl_frontend_css_colors', maybe_serialize( $colors_options ) );
252
-
253
- return null;
254
- }
255
-
256
- /**
257
- * Print color panel.
258
- *
259
- * @return void
260
- * @since 1.0.0
261
- */
262
- public function print_color_panel() {
263
- ?>
264
- <div id="yith_wcwl_styles_colors">
265
- <h3><?php _e( 'Colors', 'yith-woocommerce-wishlist' ) ?></h3>
266
- <?php $this->_styles_options() ?>
267
- </div> <?php
268
- }
269
-
270
- /**
271
- * Add the select for the Wishlist page in WooCommerce > Settings > Pages
272
- *
273
- * @param array $settings
274
- *
275
- * @return array
276
- * @since 1.0.0
277
- */
278
- public function add_page_setting_woocommerce( $settings ) {
279
- unset( $settings[count( $settings ) - 1] );
280
-
281
- $setting[] = $this->get_wcwl_page_option();
282
-
283
- $settings[] = array( 'type' => 'sectionend', 'id' => 'page_options' );
284
-
285
- return $settings;
286
- }
287
-
288
- /**
289
- * action_links function.
290
- *
291
- * @access public
292
- *
293
- * @param mixed $links
294
- * @return array
295
- */
296
- public function action_links( $links ) {
297
- $plugin_links = array(
298
- '<a href="' . admin_url( 'admin.php?page=yith_wcwl_panel&tab=settings' ) . '">' . __( 'Settings', 'yith-woocommerce-wishlist' ) . '</a>'
299
- );
300
-
301
- if( ! function_exists( 'YITH_WCWL_Premium' ) ){
302
- $plugin_links[] = '<a target="_blank" href="' . $this->get_premium_landing_uri() . '">' . __( 'Premium Version', 'yith-woocommerce-wishlist' ) . '</a>';
303
- }
304
-
305
- return array_merge( $links, $plugin_links );
306
- }
307
-
308
- /**
309
- * Adds plugin row meta
310
- *
311
- * @param $plugin_meta array
312
- * @param $plugin_file string
313
- * @return array
314
- * @since 2.0.0
315
- */
316
- public function add_plugin_meta( $plugin_meta, $plugin_file ){
317
- global $woocommerce;
318
-
319
- if ( $plugin_file == plugin_basename( YITH_WCWL_DIR . 'init.php' ) ) {
320
-
321
- // outdated wc alert
322
-
323
- if( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.2', '<' ) ){
324
- $woocommerce_file = $woocommerce->plugin_path;
325
- if ( ! is_multisite() && current_user_can( 'delete_plugins' ) ) {
326
- $plugin_meta['outdated_wc_alert'] = '<a class="outdated-wc-alert" style="color: red" href="' . wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $woocommerce_file, 'upgrade-plugin_' . $woocommerce_file ) . '">' . __( 'WARNING: This plugin requires at least WooCommerce 2.2! Please, use this link to update it.', 'yith-woocommerce-wishlist' ) . '</a>';
327
- }
328
- else{
329
- $plugin_meta['outdated_wc_alert'] = '<span class="outdated-wc-alert" style="color: red">' . __( 'WARNING: This plugin requires at least WooCommerce 2.2!', 'yith-woocommerce-wishlist' ) . '</span>';
330
- }
331
- }
332
-
333
- // documentation link
334
- $plugin_meta['documentation'] = '<a target="_blank" href="' . $this->doc_url . '">' . __( 'Plugin Documentation', 'yith-woocommerce-wishlist' ) . '</a>';
335
- }
336
-
337
- return $plugin_meta;
338
- }
339
-
340
- /**
341
- * Return the option to add the wishlist page
342
- *
343
- * @access public
344
- * @return mxied array
345
- * @since 1.1.3
346
- */
347
- public function get_wcwl_page_option(){
348
-
349
- return array(
350
- 'name' => __( 'Wishlist Page', 'yith-woocommerce-wishlist' ),
351
- 'desc' => __( 'Page contents: [yith_wcwl_wishlist]', 'yith-woocommerce-wishlist' ),
352
- 'id' => 'yith_wcwl_wishlist_page_id',
353
- 'type' => 'single_select_page',
354
- 'std' => '', // for woocommerce < 2.0
355
- 'default' => '', // for woocommerce >= 2.0
356
- 'class' => 'chosen_select_nostd',
357
- 'css' => 'min-width:300px;',
358
- 'desc_tip' => false,
359
- );
360
- }
361
-
362
- /**
363
- * Print the banner
364
- *
365
- * @access protected
366
- * @return void
367
- * @since 1.0.0
368
- */
369
- protected function _printBanner() {
370
- ?>
371
- <div class="yith_banner">
372
- <a href="<?php echo $this->banner_url ?>" target="_blank">
373
- <img src="<?php echo $this->banner_img ?>" alt="" />
374
- </a>
375
- </div>
376
- <?php
377
- }
378
-
379
- /**
380
- * Plugin options and tabs.
381
- *
382
- * @return array
383
- * @since 1.0.0
384
- */
385
- private function _plugin_options() {
386
- $icons = array(
387
- 'fa-glass' => 'Glass',
388
- 'fa-music' => 'Music',
389
- 'fa-search' => 'Search',
390
- 'fa-envelope-o' => 'Envelope O',
391
- 'fa-heart' => 'Heart',
392
- 'fa-star' => 'Star',
393
- 'fa-star-o' => 'Star O',
394
- 'fa-user' => 'User',
395
- 'fa-film' => 'Film',
396
- 'fa-th-large' => 'Th Large',
397
- 'fa-th' => 'Th',
398
- 'fa-th-list' => 'Th List',
399
- 'fa-check' => 'Check',
400
- 'fa-remove' => 'Remove',
401
- 'fa-search-plus' => 'Search Plus',
402
- 'fa-search-minus' => 'Search Minus',
403
- 'fa-power-off' => 'Power Off',
404
- 'fa-signal' => 'Signal',
405
- 'fa-cog' => 'Cog',
406
- 'fa-trash-o' => 'Trash O',
407
- 'fa-home' => 'Home',
408
- 'fa-file-o' => 'File O',
409
- 'fa-clock-o' => 'Clock O',
410
- 'fa-road' => 'Road',
411
- 'fa-download' => 'Download',
412
- 'fa-arrow-circle-o-down' => 'Arrow Circle O Down',
413
- 'fa-arrow-circle-o-up' => 'Arrow Circle O Up',
414
- 'fa-inbox' => 'Inbox',
415
- 'fa-play-circle-o' => 'Play Circle O',
416
- 'fa-repeat' => 'Repeat',
417
- 'fa-refresh' => 'Refresh',
418
- 'fa-list-alt' => 'List Alt',
419
- 'fa-lock' => 'Lock',
420
- 'fa-flag' => 'Flag',
421
- 'fa-headphones' => 'Headphones',
422
- 'fa-volume-off' => 'Volume Off',
423
- 'fa-volume-down' => 'Volume Down',
424
- 'fa-volume-up' => 'Volume Up',
425
- 'fa-qrcode' => 'Qrcode',
426
- 'fa-barcode' => 'Barcode',
427
- 'fa-tag' => 'Tag',
428
- 'fa-tags' => 'Tags',
429
- 'fa-book' => 'Book',
430
- 'fa-bookmark' => 'Bookmark',
431
- 'fa-print' => 'Print',
432
- 'fa-camera' => 'Camera',
433
- 'fa-font' => 'Font',
434
- 'fa-bold' => 'Bold',
435
- 'fa-italic' => 'Italic',
436
- 'fa-text-height' => 'Text Height',
437
- 'fa-text-width' => 'Text Width',
438
- 'fa-align-left' => 'Align Left',
439
- 'fa-align-center' => 'Align Center',
440
- 'fa-align-right' => 'Align Right',
441
- 'fa-align-justify' => 'Align Justify',
442
- 'fa-list' => 'List',
443
- 'fa-dedent' => 'Dedent',
444
- 'fa-indent' => 'Indent',
445
- 'fa-video-camera' => 'Video Camera',
446
- 'fa-picture-o' => 'Photo',
447
- 'fa-pencil' => 'Pencil',
448
- 'fa-map-marker' => 'Map Marker',
449
- 'fa-adjust' => 'Adjust',
450
- 'fa-tint' => 'Tint',
451
- 'fa-edit' => 'Edit',
452
- 'fa-share-square-o' => 'Share Square O',
453
- 'fa-check-square-o' => 'Check Square O',
454
- 'fa-arrows' => 'Arrows',
455
- 'fa-step-backward' => 'Step Backward',
456
- 'fa-fast-backward' => 'Fast Backward',
457
- 'fa-backward' => 'Backward',
458
- 'fa-play' => 'Play',
459
- 'fa-pause' => 'Pause',
460
- 'fa-stop' => 'Stop',
461
- 'fa-forward' => 'Forward',
462
- 'fa-fast-forward' => 'Fast Forward',
463
- 'fa-step-forward' => 'Step Forward',
464
- 'fa-eject' => 'Eject',
465
- 'fa-chevron-left' => 'Chevron Left',
466
- 'fa-chevron-right' => 'Chevron Right',
467
- 'fa-plus-circle' => 'Plus Circle',
468
- 'fa-minus-circle' => 'Minus Circle',
469
- 'fa-times-circle' => 'Times Circle',
470
- 'fa-check-circle' => 'Check Circle',
471
- 'fa-question-circle' => 'Question Circle',
472
- 'fa-info-circle' => 'Info Circle',
473
- 'fa-crosshairs' => 'Crosshairs',
474
- 'fa-times-circle-o' => 'Times Circle O',
475
- 'fa-check-circle-o' => 'Check Circle O',
476
- 'fa-ban' => 'Ban',
477
- 'fa-arrow-left' => 'Arrow Left',
478
- 'fa-arrow-right' => 'Arrow Right',
479
- 'fa-arrow-up' => 'Arrow Up',
480
- 'fa-arrow-down' => 'Arrow Down',
481
- 'fa-share' => 'Share',
482
- 'fa-expand' => 'Expand',
483
- 'fa-compress' => 'Compress',
484
- 'fa-plus' => 'Plus',
485
- 'fa-minus' => 'Minus',
486
- 'fa-asterisk' => 'Asterisk',
487
- 'fa-exclamation-circle' => 'Exclamation Circle',
488
- 'fa-gift' => 'Gift',
489
- 'fa-leaf' => 'Leaf',
490
- 'fa-fire' => 'Fire',
491
- 'fa-eye' => 'Eye',
492
- 'fa-eye-slash' => 'Eye Slash',
493
- 'fa-warning' => 'Warning',
494
- 'fa-plane' => 'Plane',
495
- 'fa-calendar' => 'Calendar',
496
- 'fa-random' => 'Random',
497
- 'fa-comment' => 'Comment',
498
- 'fa-magnet' => 'Magnet',
499
- 'fa-chevron-up' => 'Chevron Up',
500
- 'fa-chevron-down' => 'Chevron Down',
501
- 'fa-retweet' => 'Retweet',
502
- 'fa-shopping-cart' => 'Shopping Cart',
503
- 'fa-folder' => 'Folder',
504
- 'fa-folder-open' => 'Folder Open',
505
- 'fa-arrows-v' => 'Arrows V',
506
- 'fa-arrows-h' => 'Arrows H',
507
- 'fa-bar-chart' => 'Bar Chart',
508
- 'fa-twitter-square' => 'Twitter Square',
509
- 'fa-facebook-square' => 'Facebook Square',
510
- 'fa-camera-retro' => 'Camera Retro',
511
- 'fa-key' => 'Key',
512
- 'fa-cogs' => 'Cogs',
513
- 'fa-comments' => 'Comments',
514
- 'fa-thumbs-o-up' => 'Thumbs O Up',
515
- 'fa-thumbs-o-down' => 'Thumbs O Down',
516
- 'fa-star-half' => 'Star Half',
517
- 'fa-heart-o' => 'Heart O',
518
- 'fa-sign-out' => 'Sign Out',
519
- 'fa-linkedin-square' => 'Linkedin Square',
520
- 'fa-thumb-tack' => 'Thumb Tack',
521
- 'fa-external-link' => 'External Link',
522
- 'fa-sign-in' => 'Sign In',
523
- 'fa-trophy' => 'Trophy',
524
- 'fa-github-square' => 'Github Square',
525
- 'fa-upload' => 'Upload',
526
- 'fa-lemon-o' => 'Lemon O',
527
- 'fa-phone' => 'Phone',
528
- 'fa-square-o' => 'Square O',
529
- 'fa-bookmark-o' => 'Bookmark O',
530
- 'fa-phone-square' => 'Phone Square',
531
- 'fa-twitter' => 'Twitter',
532
- 'fa-facebook' => 'Facebook',
533
- 'fa-github' => 'Github',
534
- 'fa-unlock' => 'Unlock',
535
- 'fa-credit-card' => 'Credit Card',
536
- 'fa-rss' => 'Rss',
537
- 'fa-hdd-o' => 'Hdd O',
538
- 'fa-bullhorn' => 'Bullhorn',
539
- 'fa-bell' => 'Bell',
540
- 'fa-certificate' => 'Certificate',
541
- 'fa-hand-o-right' => 'Hand O Right',
542
- 'fa-hand-o-left' => 'Hand O Left',
543
- 'fa-hand-o-up' => 'Hand O Up',
544
- 'fa-hand-o-down' => 'Hand O Down',
545
- 'fa-arrow-circle-left' => 'Arrow Circle Left',
546
- 'fa-arrow-circle-right' => 'Arrow Circle Right',
547
- 'fa-arrow-circle-up' => 'Arrow Circle Up',
548
- 'fa-arrow-circle-down' => 'Arrow Circle Down',
549
- 'fa-globe' => 'Globe',
550
- 'fa-wrench' => 'Wrench',
551
- 'fa-tasks' => 'Tasks',
552
- 'fa-filter' => 'Filter',
553
- 'fa-briefcase' => 'Briefcase',
554
- 'fa-arrows-alt' => 'Arrows Alt',
555
- 'fa-group' => 'Group',
556
- 'fa-link' => 'Link',
557
- 'fa-cloud' => 'Cloud',
558
- 'fa-flask' => 'Flask',
559
- 'fa-cut' => 'Cut',
560
- 'fa-copy' => 'Copy',
561
- 'fa-paperclip' => 'Paperclip',
562
- 'fa-save' => 'Save',
563
- 'fa-square' => 'Square',
564
- 'fa-navicon' => 'Navicon',
565
- 'fa-list-ul' => 'List Ul',
566
- 'fa-list-ol' => 'List Ol',
567
- 'fa-strikethrough' => 'Strikethrough',
568
- 'fa-underline' => 'Underline',
569
- 'fa-table' => 'Table',
570
- 'fa-magic' => 'Magic',
571
- 'fa-truck' => 'Truck',
572
- 'fa-pinterest' => 'Pinterest',
573
- 'fa-pinterest-square' => 'Pinterest Square',
574
- 'fa-google-plus-square' => 'Google Plus Square',
575
- 'fa-google-plus' => 'Google Plus',
576
- 'fa-money' => 'Money',
577
- 'fa-caret-down' => 'Caret Down',
578
- 'fa-caret-up' => 'Caret Up',
579
- 'fa-caret-left' => 'Caret Left',
580
- 'fa-caret-right' => 'Caret Right',
581
- 'fa-columns' => 'Columns',
582
- 'fa-unsorted' => 'Unsorted',
583
- 'fa-sort-down' => 'Sort Down',
584
- 'fa-sort-up' => 'Sort Up',
585
- 'fa-envelope' => 'Envelope',
586
- 'fa-linkedin' => 'Linkedin',
587
- 'fa-undo' => 'Undo',
588
- 'fa-legal' => 'Legal',
589
- 'fa-dashboard' => 'Dashboard',
590
- 'fa-comment-o' => 'Comment O',
591
- 'fa-comments-o' => 'Comments O',
592
- 'fa-bolt' => 'Bolt',
593
- 'fa-sitemap' => 'Sitemap',
594
- 'fa-umbrella' => 'Umbrella',
595
- 'fa-paste' => 'Paste',
596
- 'fa-lightbulb-o' => 'Lightbulb O',
597
- 'fa-exchange' => 'Exchange',
598
- 'fa-cloud-download' => 'Cloud Download',
599
- 'fa-cloud-upload' => 'Cloud Upload',
600
- 'fa-user-md' => 'User Md',
601
- 'fa-stethoscope' => 'Stethoscope',
602
- 'fa-suitcase' => 'Suitcase',
603
- 'fa-bell-o' => 'Bell O',
604
- 'fa-coffee' => 'Coffee',
605
- 'fa-cutlery' => 'Cutlery',
606
- 'fa-file-text-o' => 'File Text O',
607
- 'fa-building-o' => 'Building O',
608
- 'fa-hospital-o' => 'Hospital O',
609
- 'fa-ambulance' => 'Ambulance',
610
- 'fa-medkit' => 'Medkit',
611
- 'fa-fighter-jet' => 'Fighter Jet',
612
- 'fa-beer' => 'Beer',
613
- 'fa-h-square' => 'H Square',
614
- 'fa-plus-square' => 'Plus Square',
615
- 'fa-angle-double-left' => 'Angle Double Left',
616
- 'fa-angle-double-right' => 'Angle Double Right',
617
- 'fa-angle-double-up' => 'Angle Double Up',
618
- 'fa-angle-double-down' => 'Angle Double Down',
619
- 'fa-angle-left' => 'Angle Left',
620
- 'fa-angle-right' => 'Angle Right',
621
- 'fa-angle-up' => 'Angle Up',
622
- 'fa-angle-down' => 'Angle Down',
623
- 'fa-desktop' => 'Desktop',
624
- 'fa-laptop' => 'Laptop',
625
- 'fa-tablet' => 'Tablet',
626
- 'fa-mobile' => 'Mobile',
627
- 'fa-circle-o' => 'Circle O',
628
- 'fa-quote-left' => 'Quote Left',
629
- 'fa-quote-right' => 'Quote Right',
630
- 'fa-spinner' => 'Spinner',
631
- 'fa-circle' => 'Circle',
632
- 'fa-reply' => 'Reply',
633
- 'fa-github-alt' => 'Github Alt',
634
- 'fa-folder-o' => 'Folder O',
635
- 'fa-folder-open-o' => 'Folder Open O',
636
- 'fa-smile-o' => 'Smile O',
637
- 'fa-frown-o' => 'Frown O',
638
- 'fa-meh-o' => 'Meh O',
639
- 'fa-gamepad' => 'Gamepad',
640
- 'fa-keyboard-o' => 'Keyboard O',
641
- 'fa-flag-o' => 'Flag O',
642
- 'fa-flag-checkered' => 'Flag Checkered',
643
- 'fa-terminal' => 'Terminal',
644
- 'fa-code' => 'Code',
645
- 'fa-reply-all' => 'Reply All',
646
- 'fa-star-half-o' => 'Star Half O',
647
- 'fa-location-arrow' => 'Location Arrow',
648
- 'fa-crop' => 'Crop',
649
- 'fa-code-fork' => 'Code Fork',
650
- 'fa-chain-broken' => 'Chain Broken',
651
- 'fa-question' => 'Question',
652
- 'fa-info' => 'Info',
653
- 'fa-exclamation' => 'Exclamation',
654
- 'fa-superscript' => 'Superscript',
655
- 'fa-subscript' => 'Subscript',
656
- 'fa-eraser' => 'Eraser',
657
- 'fa-puzzle-piece' => 'Puzzle Piece',
658
- 'fa-microphone' => 'Microphone',
659
- 'fa-microphone-slash' => 'Microphone Slash',
660
- 'fa-shield' => 'Shield',
661
- 'fa-calendar-o' => 'Calendar O',
662
- 'fa-fire-extinguisher' => 'Fire Extinguisher',
663
- 'fa-rocket' => 'Rocket',
664
- 'fa-maxcdn' => 'Maxcdn',
665
- 'fa-chevron-circle-left' => 'Chevron Circle Left',
666
- 'fa-chevron-circle-right' => 'Chevron Circle Right',
667
- 'fa-chevron-circle-up' => 'Chevron Circle Up',
668
- 'fa-chevron-circle-down' => 'Chevron Circle Down',
669
- 'fa-html5' => 'Html5',
670
- 'fa-css3' => 'Css3',
671
- 'fa-anchor' => 'Anchor',
672
- 'fa-unlock-alt' => 'Unlock Alt',
673
- 'fa-bullseye' => 'Bullseye',
674
- 'fa-ellipsis-h' => 'Ellipsis H',
675
- 'fa-ellipsis-v' => 'Ellipsis V',
676
- 'fa-rss-square' => 'Rss Square',
677
- 'fa-play-circle' => 'Play Circle',
678
- 'fa-ticket' => 'Ticket',
679
- 'fa-minus-square' => 'Minus Square',
680
- 'fa-minus-square-o' => 'Minus Square O',
681
- 'fa-level-up' => 'Level Up',
682
- 'fa-level-down' => 'Level Down',
683
- 'fa-check-square' => 'Check Square',
684
- 'fa-pencil-square' => 'Pencil Square',
685
- 'fa-external-link-square' => 'External Link Square',
686
- 'fa-share-square' => 'Share Square',
687
- 'fa-compass' => 'Compass',
688
- 'fa-caret-square-o-down' => 'Caret Square O Down',
689
- 'fa-caret-square-o-up' => 'Caret Square O Up',
690
- 'fa-caret-square-o-right' => 'Caret Square O Right',
691
- 'fa-eur' => 'Eur',
692
- 'fa-gbp' => 'Gbp',
693
- 'fa-usd' => 'Usd',
694
- 'fa-inr' => 'Inr',
695
- 'fa-jpy' => 'Jpy',
696
- 'fa-rub' => 'Rub',
697
- 'fa-krw' => 'Krw',
698
- 'fa-btc' => 'Btc',
699
- 'fa-file' => 'File',
700
- 'fa-file-text' => 'File Text',
701
- 'fa-sort-alpha-asc' => 'Sort Alpha Asc',
702
- 'fa-sort-alpha-desc' => 'Sort Alpha Desc',
703
- 'fa-sort-amount-asc' => 'Sort Amount Asc',
704
- 'fa-sort-amount-desc' => 'Sort Amount Desc',
705
- 'fa-sort-numeric-asc' => 'Sort Numeric Asc',
706
- 'fa-sort-numeric-desc' => 'Sort Numeric Desc',
707
- 'fa-thumbs-up' => 'Thumbs Up',
708
- 'fa-thumbs-down' => 'Thumbs Down',
709
- 'fa-youtube-square' => 'Youtube Square',
710
- 'fa-youtube' => 'Youtube',
711
- 'fa-xing' => 'Xing',
712
- 'fa-xing-square' => 'Xing Square',
713
- 'fa-youtube-play' => 'Youtube Play',
714
- 'fa-dropbox' => 'Dropbox',
715
- 'fa-stack-overflow' => 'Stack Overflow',
716
- 'fa-instagram' => 'Instagram',
717
- 'fa-flickr' => 'Flickr',
718
- 'fa-adn' => 'Adn',
719
- 'fa-bitbucket' => 'Bitbucket',
720
- 'fa-bitbucket-square' => 'Bitbucket Square',
721
- 'fa-tumblr' => 'Tumblr',
722
- 'fa-tumblr-square' => 'Tumblr Square',
723
- 'fa-long-arrow-down' => 'Long Arrow Down',
724
- 'fa-long-arrow-up' => 'Long Arrow Up',
725
- 'fa-long-arrow-left' => 'Long Arrow Left',
726
- 'fa-long-arrow-right' => 'Long Arrow Right',
727
- 'fa-apple' => 'Apple',
728
- 'fa-windows' => 'Windows',
729
- 'fa-android' => 'Android',
730
- 'fa-linux' => 'Linux',
731
- 'fa-dribbble' => 'Dribbble',
732
- 'fa-skype' => 'Skype',
733
- 'fa-foursquare' => 'Foursquare',
734
- 'fa-trello' => 'Trello',
735
- 'fa-female' => 'Female',
736
- 'fa-male' => 'Male',
737
- 'fa-gratipay' => 'Gratipay',
738
- 'fa-sun-o' => 'Sun O',
739
- 'fa-moon-o' => 'Moon O',
740
- 'fa-archive' => 'Archive',
741
- 'fa-bug' => 'Bug',
742
- 'fa-vk' => 'Vk',
743
- 'fa-weibo' => 'Weibo',
744
- 'fa-renren' => 'Renren',
745
- 'fa-pagelines' => 'Pagelines',
746
- 'fa-stack-exchange' => 'Stack Exchange',
747
- 'fa-arrow-circle-o-right' => 'Arrow Circle O Right',
748
- 'fa-arrow-circle-o-left' => 'Arrow Circle O Left',
749
- 'fa-caret-square-o-left' => 'Caret Square O Left',
750
- 'fa-dot-circle-o' => 'Dot Circle O',
751
- 'fa-wheelchair' => 'Wheelchair',
752
- 'fa-vimeo-square' => 'Vimeo Square',
753
- 'fa-try' => 'Try',
754
- 'fa-plus-square-o' => 'Plus Square O',
755
- 'fa-space-shuttle' => 'Space Shuttle',
756
- 'fa-slack' => 'Slack',
757
- 'fa-envelope-square' => 'Envelope Square',
758
- 'fa-wordpress' => 'Wordpress',
759
- 'fa-openid' => 'Openid',
760
- 'fa-university' => 'University',
761
- 'fa-graduation-cap' => 'Graduation Cap',
762
- 'fa-yahoo' => 'Yahoo',
763
- 'fa-google' => 'Google',
764
- 'fa-reddit' => 'Reddit',
765
- 'fa-reddit-square' => 'Reddit Square',
766
- 'fa-stumbleupon-circle' => 'Stumbleupon Circle',
767
- 'fa-stumbleupon' => 'Stumbleupon',
768
- 'fa-delicious' => 'Delicious',
769
- 'fa-digg' => 'Digg',
770
- 'fa-pied-piper' => 'Pied Piper',
771
- 'fa-pied-piper-alt' => 'Pied Piper Alt',
772
- 'fa-drupal' => 'Drupal',
773
- 'fa-joomla' => 'Joomla',
774
- 'fa-language' => 'Language',
775
- 'fa-fax' => 'Fax',
776
- 'fa-building' => 'Building',
777
- 'fa-child' => 'Child',
778
- 'fa-paw' => 'Paw',
779
- 'fa-spoon' => 'Spoon',
780
- 'fa-cube' => 'Cube',
781
- 'fa-cubes' => 'Cubes',
782
- 'fa-behance' => 'Behance',
783
- 'fa-behance-square' => 'Behance Square',
784
- 'fa-steam' => 'Steam',
785
- 'fa-steam-square' => 'Steam Square',
786
- 'fa-recycle' => 'Recycle',
787
- 'fa-car' => 'Car',
788
- 'fa-taxi' => 'Taxi',
789
- 'fa-tree' => 'Tree',
790
- 'fa-spotify' => 'Spotify',
791
- 'fa-deviantart' => 'Deviantart',
792
- 'fa-soundcloud' => 'Soundcloud',
793
- 'fa-database' => 'Database',
794
- 'fa-file-pdf-o' => 'File Pdf O',
795
- 'fa-file-word-o' => 'File Word O',
796
- 'fa-file-excel-o' => 'File Excel O',
797
- 'fa-file-powerpoint-o' => 'File Powerpoint O',
798
- 'fa-file-image-o' => 'File Image O',
799
- 'fa-file-archive-o' => 'File Archive O',
800
- 'fa-file-audio-o' => 'File Audio O',
801
- 'fa-file-video-o' => 'File Video O',
802
- 'fa-file-code-o' => 'File Code O',
803
- 'fa-vine' => 'Vine',
804
- 'fa-codepen' => 'Codepen',
805
- 'fa-jsfiddle' => 'Jsfiddle',
806
- 'fa-life-ring' => 'Life Ring',
807
- 'fa-circle-o-notch' => 'Circle O Notch',
808
- 'fa-rebel' => 'Rebel',
809
- 'fa-empire' => 'Empire',
810
- 'fa-git-square' => 'Git Square',
811
- 'fa-git' => 'Git',
812
- 'fa-hacker-news' => 'Hacker News',
813
- 'fa-tencent-weibo' => 'Tencent Weibo',
814
- 'fa-qq' => 'Qq',
815
- 'fa-weixin' => 'Weixin',
816
- 'fa-paper-plane' => 'Paper Plane',
817
- 'fa-paper-plane-o' => 'Paper Plane O',
818
- 'fa-history' => 'History',
819
- 'fa-circle-thin' => 'Circle Thin',
820
- 'fa-header' => 'Header',
821
- 'fa-paragraph' => 'Paragraph',
822
- 'fa-sliders' => 'Sliders',
823
- 'fa-share-alt' => 'Share Alt',
824
- 'fa-share-alt-square' => 'Share Alt Square',
825
- 'fa-bomb' => 'Bomb',
826
- 'fa-futbol-o' => 'Futbol O',
827
- 'fa-tty' => 'Tty',
828
- 'fa-binoculars' => 'Binoculars',
829
- 'fa-plug' => 'Plug',
830
- 'fa-slideshare' => 'Slideshare',
831
- 'fa-twitch' => 'Twitch',
832
- 'fa-yelp' => 'Yelp',
833
- 'fa-newspaper-o' => 'Newspaper O',
834
- 'fa-wifi' => 'Wifi',
835
- 'fa-calculator' => 'Calculator',
836
- 'fa-paypal' => 'Paypal',
837
- 'fa-google-wallet' => 'Google Wallet',
838
- 'fa-cc-visa' => 'Cc Visa',
839
- 'fa-cc-mastercard' => 'Cc Mastercard',
840
- 'fa-cc-discover' => 'Cc Discover',
841
- 'fa-cc-amex' => 'Cc Amex',
842
- 'fa-cc-paypal' => 'Cc Paypal',
843
- 'fa-cc-stripe' => 'Cc Stripe',
844
- 'fa-bell-slash' => 'Bell Slash',
845
- 'fa-bell-slash-o' => 'Bell Slash O',
846
- 'fa-trash' => 'Trash',
847
- 'fa-copyright' => 'Copyright',
848
- 'fa-at' => 'At',
849
- 'fa-eyedropper' => 'Eyedropper',
850
- 'fa-paint-brush' => 'Paint Brush',
851
- 'fa-birthday-cake' => 'Birthday Cake',
852
- 'fa-area-chart' => 'Area Chart',
853
- 'fa-pie-chart' => 'Pie Chart',
854
- 'fa-line-chart' => 'Line Chart',
855
- 'fa-lastfm' => 'Lastfm',
856
- 'fa-lastfm-square' => 'Lastfm Square',
857
- 'fa-toggle-off' => 'Toggle Off',
858
- 'fa-toggle-on' => 'Toggle On',
859
- 'fa-bicycle' => 'Bicycle',
860
- 'fa-bus' => 'Bus',
861
- 'fa-ioxhost' => 'Ioxhost',
862
- 'fa-angellist' => 'Angellist',
863
- 'fa-cc' => 'Cc',
864
- 'fa-ils' => 'Ils',
865
- 'fa-meanpath' => 'Meanpath',
866
- 'fa-buysellads' => 'Buysellads',
867
- 'fa-connectdevelop' => 'Connectdevelop',
868
- 'fa-dashcube' => 'Dashcube',
869
- 'fa-forumbee' => 'Forumbee',
870
- 'fa-leanpub' => 'Leanpub',
871
- 'fa-sellsy' => 'Sellsy',
872
- 'fa-shirtsinbulk' => 'Shirtsinbulk',
873
- 'fa-simplybuilt' => 'Simplybuilt',
874
- 'fa-skyatlas' => 'Skyatlas',
875
- 'fa-cart-plus' => 'Cart Plus',
876
- 'fa-cart-arrow-down' => 'Cart Arrow Down',
877
- 'fa-diamond' => 'Diamond',
878
- 'fa-ship' => 'Ship',
879
- 'fa-user-secret' => 'User Secret',
880
- 'fa-motorcycle' => 'Motorcycle',
881
- 'fa-street-view' => 'Street View',
882
- 'fa-heartbeat' => 'Heartbeat',
883
- 'fa-venus' => 'Venus',
884
- 'fa-mars' => 'Mars',
885
- 'fa-mercury' => 'Mercury',
886
- 'fa-transgender' => 'Transgender',
887
- 'fa-transgender-alt' => 'Transgender Alt',
888
- 'fa-venus-double' => 'Venus Double',
889
- 'fa-mars-double' => 'Mars Double',
890
- 'fa-venus-mars' => 'Venus Mars',
891
- 'fa-mars-stroke' => 'Mars Stroke',
892
- 'fa-mars-stroke-v' => 'Mars Stroke V',
893
- 'fa-mars-stroke-h' => 'Mars Stroke H',
894
- 'fa-neuter' => 'Neuter',
895
- 'fa-facebook-official' => 'Facebook Official',
896
- 'fa-pinterest-p' => 'Pinterest P',
897
- 'fa-whatsapp' => 'Whatsapp',
898
- 'fa-server' => 'Server',
899
- 'fa-user-plus' => 'User Plus',
900
- 'fa-user-times' => 'User Times',
901
- 'fa-bed' => 'Bed',
902
- 'fa-viacoin' => 'Viacoin',
903
- 'fa-train' => 'Train',
904
- 'fa-subway' => 'Subway',
905
- 'fa-medium' => 'Medium'
906
- );
907
-
908
- ksort( $icons );
909
-
910
- global $woocommerce;
911
-
912
- $is_woocommerce_2_0 =version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.1', '<' );
913
-
914
- $options['general_settings'] = array();
915
-
916
- if( $is_woocommerce_2_0 ){
917
- $settings_page = 'WooCommerce &gt; Settings &gt; Pages' ;
918
- }
919
- else{
920
- $settings_page = 'in this settings page';
921
- }
922
-
923
- $general_settings_start = array(
924
-
925
- 'section_general_settings_videobox' => array(
926
- 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yith-woocommerce-wishlist' ),
927
- 'type' => 'videobox',
928
- 'default' => array(
929
- 'plugin_name' => __( 'YITH WooCommerce Wishlist', 'yith-woocommerce-wishlist' ),
930
- 'title_first_column' => __( 'Discover the Advanced Features', 'yith-woocommerce-wishlist' ),
931
- 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION
932
- of YITH WOOCOMMERCE WISHLIST to benefit from all features!', 'yith-woocommerce-wishlist' ),
933
- 'video' => array(
934
- 'video_id' => '118797844',
935
- 'video_image_url' => YITH_WCWL_URL . '/assets/images/video-thumb.jpg',
936
- 'video_description' => '',
937
- ),
938
- 'title_second_column' => __( 'Get Support and Pro Features', 'yith-woocommerce-wishlist' ),
939
- 'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yith-woocommerce-wishlist' ),
940
- 'button' => array(
941
- 'href' => $this->get_premium_landing_uri(),
942
- 'title' => 'Get Support and Pro Features'
943
- )
944
- ),
945
- 'id' => 'yith_wcwl_general_videobox'
946
- ),
947
-
948
- 'general_section_start' => array(
949
- 'name' => __( 'General Settings', 'yith-woocommerce-wishlist' ),
950
- 'type' => 'title',
951
- 'desc' => '',
952
- 'id' => 'yith_wcwl_general_settings'
953
- ),
954
-
955
- 'wishlist_enable' => array(
956
- 'name' => __( 'Enable YITH Wishlist', 'yith-woocommerce-wishlist' ),
957
- 'desc' => sprintf( __( 'Enable all plugin features. <strong>Be sure to select at least one option in the Wishlist page menu in %s.</strong> Also, please read the plugin <a href="%s" target="_blank">documentation</a>.', 'yith-woocommerce-wishlist' ), $settings_page, esc_url( $this->doc_url ) ),
958
- 'id' => 'yith_wcwl_enabled',
959
- 'std' => 'yes', // for woocommerce < 2.0
960
- 'default' => 'yes', // for woocommerce >= 2.0
961
- 'type' => 'checkbox'
962
- ),
963
- 'default_wishlist_title' => array(
964
- 'name' => __( 'Default wishlist title', 'yith-woocommerce-wishlist' ),
965
- 'id' => 'yith_wcwl_wishlist_title',
966
- 'std' => sprintf( __( 'My wishlist on %s', 'yith-woocommerce-wishlist' ), get_bloginfo( 'name' ) ), // for woocommerce < 2.0
967
- 'default' => sprintf( __( 'My wishlist on %s', 'yith-woocommerce-wishlist' ), get_bloginfo( 'name' ) ), // for woocommerce >= 2.0
968
- 'type' => 'text',
969
- 'css' => 'min-width:300px;',
970
- )
971
- );
972
-
973
- $general_settings_end = array(
974
- 'add_to_wishlist_position' => array(
975
- 'name' => __( 'Position', 'yith-woocommerce-wishlist' ),
976
- 'desc' => __( 'You can add the button in variable products only after the "Add to Cart" button or using the shortcode [yith_wcwl_add_to_wishlist].', 'yith-woocommerce-wishlist' ),
977
- 'id' => 'yith_wcwl_button_position',
978
- 'type' => 'select',
979
- 'class' => 'chosen_select',
980
- 'css' => 'min-width:300px;',
981
- 'options' => array(
982
- 'add-to-cart' => __( 'After "Add to cart"', 'yith-woocommerce-wishlist' ),
983
- 'thumbnails' => __( 'After thumbnails', 'yith-woocommerce-wishlist' ),
984
- 'summary' => __( 'After summary', 'yith-woocommerce-wishlist' ),
985
- 'shortcode' => __( 'Use shortcode', 'yith-woocommerce-wishlist' )
986
- ),
987
- 'desc_tip' => true
988
- ),
989
- 'redirect_to_cart' => array(
990
- 'name' => __( 'Redirect to cart', 'yith-woocommerce-wishlist' ),
991
- 'desc' => __( 'Redirect to cart page if "Add to cart" button is clicked in the wishlist page.', 'yith-woocommerce-wishlist' ),
992
- 'id' => 'yith_wcwl_redirect_cart',
993
- 'std' => 'no', // for woocommerce < 2.0
994
- 'default' => 'no', // for woocommerce >= 2.0
995
- 'type' => 'checkbox'
996
- ),
997
- 'remove_after_add_to_cart' => array(
998
- 'name' => __( 'Remove if added to the cart', 'yith-woocommerce-wishlist' ),
999
- 'desc' => __( 'Remove the product from the wishlist if it has been added to the cart.', 'yith-woocommerce-wishlist' ),
1000
- 'id' => 'yith_wcwl_remove_after_add_to_cart',
1001
- 'std' => 'yes', // for woocommerce < 2.0
1002
- 'default' => 'yes', // for woocommerce >= 2.0
1003
- 'type' => 'checkbox'
1004
- ),
1005
- 'add_to_wishlist_text' => array(
1006
- 'name' => __( '"Add to Wishlist" text', 'yith-woocommerce-wishlist' ),
1007
- 'id' => 'yith_wcwl_add_to_wishlist_text',
1008
- 'std' => __( 'Add to Wishlist', 'yith-woocommerce-wishlist' ), // for woocommerce < 2.0
1009
- 'default' => __( 'Add to Wishlist', 'yith-woocommerce-wishlist' ), // for woocommerce >= 2.0
1010
- 'type' => 'text',
1011
- 'css' => 'min-width:300px;',
1012
- ),
1013
- 'browse_wishlist_text' => array(
1014
- 'name' => __( '"Browse wishlist" text', 'yith-woocommerce-wishlist' ),
1015
- 'id' => 'yith_wcwl_browse_wishlist_text',
1016
- 'std' => __( 'Browse Wishlist', 'yith-woocommerce-wishlist' ), // for woocommerce < 2.0
1017
- 'default' => __( 'Browse Wishlist', 'yith-woocommerce-wishlist' ), // for woocommerce >= 2.0
1018
- 'type' => 'text',
1019
- 'css' => 'min-width:300px;',
1020
- ),
1021
- 'already_in_wishlist_text' => array(
1022
- 'name' => __( '"Product already in wishlist" text', 'yith-woocommerce-wishlist' ),
1023
- 'id' => 'yith_wcwl_already_in_wishlist_text',
1024
- 'std' => __( 'The product is already in the wishlist!', 'yith-woocommerce-wishlist' ), // for woocommerce < 2.0
1025
- 'default' => __( 'The product is already in the wishlist!', 'yith-woocommerce-wishlist' ), // for woocommerce >= 2.0
1026
- 'type' => 'text',
1027
- 'css' => 'min-width:300px;',
1028
- ),
1029
- 'product_added_text' => array(
1030
- 'name' => __( '"Product added" text', 'yith-woocommerce-wishlist' ),
1031
- 'id' => 'yith_wcwl_product_added_text',
1032
- 'std' => __( 'Product added!', 'yith-woocommerce-wishlist' ), // for woocommerce < 2.0
1033
- 'default' => __( 'Product added!', 'yith-woocommerce-wishlist' ), // for woocommerce >= 2.0
1034
- 'type' => 'text',
1035
- 'css' => 'min-width:300px;',
1036
- ),
1037
- 'add_to_cart_text' => array(
1038
- 'name' => __( '"Add to Cart" text', 'yith-woocommerce-wishlist' ),
1039
- 'id' => 'yith_wcwl_add_to_cart_text',
1040
- 'std' => __( 'Add to Cart', 'yith-woocommerce-wishlist' ), // for woocommerce < 2.0
1041
- 'default' => __( 'Add to Cart', 'yith-woocommerce-wishlist' ), // for woocommerce >= 2.0
1042
- 'type' => 'text',
1043
- 'css' => 'min-width:300px;',
1044
- ),
1045
- 'show_unit_price' => array(
1046
- 'name' => __( 'Show Unit price', 'yith-woocommerce-wishlist' ),
1047
- 'desc' => __( 'Show unit price for each product in wishlist', 'yith-woocommerce-wishlist' ),
1048
- 'id' => 'yith_wcwl_price_show',
1049
- 'std' => 'yes', // for woocommerce < 2.0
1050
- 'default' => 'yes', // for woocommerce >= 2.0
1051
- 'type' => 'checkbox',
1052
- 'css' => 'min-width:300px;',
1053
- ),
1054
- 'show_add_to_cart' => array(
1055
- 'name' => __( 'Show "Add to Cart" button', 'yith-woocommerce-wishlist' ),
1056
- 'desc' => __( 'Show "Add to Cart" button for each product in wishlist', 'yith-woocommerce-wishlist' ),
1057
- 'id' => 'yith_wcwl_add_to_cart_show',
1058
- 'std' => 'yes', // for woocommerce < 2.0
1059
- 'default' => 'yes', // for woocommerce >= 2.0
1060
- 'type' => 'checkbox',
1061
- 'css' => 'min-width:300px;',
1062
- ),
1063
- 'show_stock_status' => array(
1064
- 'name' => __( 'Show Stock status', 'yith-woocommerce-wishlist' ),
1065
- 'desc' => __( 'Show "In stock" or "Out of stock" label for each product in wishlist', 'yith-woocommerce-wishlist' ),
1066
- 'id' => 'yith_wcwl_stock_show',
1067
- 'std' => 'yes', // for woocommerce < 2.0
1068
- 'default' => 'yes', // for woocommerce >= 2.0
1069
- 'type' => 'checkbox',
1070
- 'css' => 'min-width:300px;',
1071
- ),
1072
- 'show_dateadded' => array(
1073
- 'name' => __( 'Show Date of addition', 'yith-woocommerce-wishlist' ),
1074
- 'desc' => __( 'Show the date when users have added a product to the wishlist', 'yith-woocommerce-wishlist' ),
1075
- 'id' => 'yith_wcwl_show_dateadded',
1076
- 'std' => 'no', // for woocommerce < 2.0
1077
- 'default' => 'no', // for woocommerce >= 2.0
1078
- 'type' => 'checkbox',
1079
- 'css' => 'min-width:300px;',
1080
- ),
1081
- 'repeat_remove_button' => array(
1082
- 'name' => __( 'Add second remove button', 'yith-woocommerce-wishlist' ),
1083
- 'desc' => __( 'Add a second remove button in the last column, with extended label', 'yith-woocommerce-wishlist' ),
1084
- 'id' => 'yith_wcwl_repeat_remove_button',
1085
- 'std' => 'no', // for woocommerce < 2.0
1086
- 'default' => 'no', // for woocommerce >= 2.0
1087
- 'type' => 'checkbox',
1088
- 'css' => 'min-width:300px;',
1089
- ),
1090
-
1091
- 'general_section_end' => array(
1092
- 'type' => 'sectionend',
1093
- 'id' => 'yith_wcwl_general_settings'
1094
- )
1095
- );
1096
-
1097
- if( $is_woocommerce_2_0 ) {
1098
- $options['general_settings'] = array_merge( $general_settings_start, $general_settings_end );
1099
- }
1100
- else{
1101
- $options['general_settings'] = array_merge( $general_settings_start, array( $this->get_wcwl_page_option() ), $general_settings_end );
1102
- }
1103
-
1104
- $options['styles'] = array(
1105
- 'styles_section_start' => array(
1106
- 'name' => __( 'Styles', 'yith-woocommerce-wishlist' ),
1107
- 'type' => 'title',
1108
- 'desc' => '',
1109
- 'id' => 'yith_wcwl_styles'
1110
- ),
1111
-
1112
- 'use_buttons' => array(
1113
- 'name' => __( 'Use buttons', 'yith-woocommerce-wishlist' ),
1114
- 'desc' => __( 'Use buttons instead of simple anchors.', 'yith-woocommerce-wishlist' ),
1115
- 'id' => 'yith_wcwl_use_button',
1116
- 'std' => 'no', // for woocommerce < 2.0
1117
- 'default' => 'no', // for woocommerce >= 2.0
1118
- 'type' => 'checkbox'
1119
- ),
1120
- 'custom_css' => array(
1121
- 'name' => __( 'Custom CSS', 'yith-woocommerce-wishlist' ),
1122
- 'id' => 'yith_wcwl_custom_css',
1123
- 'css' => 'width:100%; height: 75px;',
1124
- 'std' => '', // for woocommerce < 2.0
1125
- 'default' => '', // for woocommerce >= 2.0
1126
- 'type' => 'textarea'
1127
- ),
1128
- 'use_theme_style' => array(
1129
- 'name' => __( 'Use theme style', 'yith-woocommerce-wishlist' ),
1130
- 'desc' => __( 'Use the theme style.', 'yith-woocommerce-wishlist' ),
1131
- 'id' => 'yith_wcwl_frontend_css',
1132
- 'std' => 'yes', // for woocommerce < 2.0
1133
- 'default' => 'yes', // for woocommerce >= 2.0
1134
- 'type' => 'checkbox'
1135
- ),
1136
- 'rounded_buttons' => array(
1137
- 'name' => __( 'Rounded buttons', 'yith-woocommerce-wishlist' ),
1138
- 'desc' => __( 'Make button corners rounded', 'yith-woocommerce-wishlist' ),
1139
- 'id' => 'yith_wcwl_rounded_corners',
1140
- 'std' => 'yes', // for woocommerce < 2.0
1141
- 'default' => 'yes', // for woocommerce >= 2.0
1142
- 'type' => 'checkbox'
1143
- ),
1144
- 'add_to_wishlist_icon' => array(
1145
- 'name' => __( '"Add to Wishlist" icon', 'yith-woocommerce-wishlist' ),
1146
- 'desc' => __( 'Add an icon to the "Add to Wishlist" button', 'yith-woocommerce-wishlist' ),
1147
- 'id' => 'yith_wcwl_add_to_wishlist_icon',
1148
- 'css' => 'min-width:300px;width:300px;',
1149
- 'std' => apply_filters( 'yith_wcwl_add_to_wishlist_std_icon', 'none' ), // for woocommerce < 2.0
1150
- 'default' => apply_filters( 'yith_wcwl_add_to_wishlist_std_icon', 'none' ), // for woocommerce >= 2.0
1151
- 'type' => 'select',
1152
- 'class' => 'chosen_select',
1153
- 'desc_tip' => true,
1154
- 'options' => array( 'none' => 'None' ) + $icons
1155
- ),
1156
- 'add_to_cart_icon' => array(
1157
- 'name' => __( '"Add to Cart" icon', 'yith-woocommerce-wishlist' ),
1158
- 'desc' => __( 'Add an icon to the "Add to Cart" button', 'yith-woocommerce-wishlist' ),
1159
- 'id' => 'yith_wcwl_add_to_cart_icon',
1160
- 'css' => 'min-width:300px;width:300px;',
1161
- 'std' => apply_filters( 'yith_wcwl_add_to_cart_std_icon', 'fa-shopping-cart' ), // for woocommerce < 2.0
1162
- 'default' => apply_filters( 'yith_wcwl_add_to_cart_std_icon', 'fa-shopping-cart' ), // for woocommerce >= 2.0
1163
- 'type' => 'select',
1164
- 'class' => 'chosen_select',
1165
- 'desc_tip' => true,
1166
- 'options' => array( 'none' => 'None' ) + $icons
1167
- ),
1168
-
1169
- 'styles_section_end' => array(
1170
- 'type' => 'sectionend',
1171
- 'id' => 'yith_wcwl_styles'
1172
- )
1173
- );
1174
-
1175
- $options['socials_share'] = array(
1176
- 'socials_section_start' => array(
1177
- 'name' => __( 'Social Networks & Share', 'yith-woocommerce-wishlist' ),
1178
- 'type' => 'title',
1179
- 'desc' => '',
1180
- 'id' => 'yith_wcwl_socials_share'
1181
- ),
1182
-
1183
- 'share_on_facebook' => array(
1184
- 'name' => __( 'Share on Facebook', 'yith-woocommerce-wishlist' ),
1185
- 'desc' => __( 'Show "Share on Facebook" button', 'yith-woocommerce-wishlist' ),
1186
- 'id' => 'yith_wcwl_share_fb',
1187
- 'std' => 'yes', // for woocommerce < 2.0
1188
- 'default' => 'yes', // for woocommerce >= 2.0
1189
- 'type' => 'checkbox'
1190
- ),
1191
- 'share_on_twitter' => array(
1192
- 'name' => __( 'Tweet on Twitter', 'yith-woocommerce-wishlist' ),
1193
- 'desc' => __( 'Show "Tweet on Twitter" button', 'yith-woocommerce-wishlist' ),
1194
- 'id' => 'yith_wcwl_share_twitter',
1195
- 'std' => 'yes', // for woocommerce < 2.0
1196
- 'default' => 'yes', // for woocommerce >= 2.0
1197
- 'type' => 'checkbox'
1198
- ),
1199
- 'share_on_pinterest' => array(
1200
- 'name' => __( 'Pin on Pinterest', 'yith-woocommerce-wishlist' ),
1201
- 'desc' => __( 'Show "Pin on Pinterest" button', 'yith-woocommerce-wishlist' ),
1202
- 'id' => 'yith_wcwl_share_pinterest',
1203
- 'std' => 'yes', // for woocommerce < 2.0
1204
- 'default' => 'yes', // for woocommerce >= 2.0
1205
- 'type' => 'checkbox'
1206
- ),
1207
- 'share_on_googleplus' => array(
1208
- 'name' => __( 'Share on Google+', 'yith-woocommerce-wishlist' ),
1209
- 'desc' => __( 'Show "Share on Google+" button', 'yith-woocommerce-wishlist' ),
1210
- 'id' => 'yith_wcwl_share_googleplus',
1211
- 'std' => 'yes', // for woocommerce < 2.0
1212
- 'default' => 'yes', // for woocommerce >= 2.0
1213
- 'type' => 'checkbox'
1214
- ),
1215
- 'share_by_email' => array(
1216
- 'name' => __( 'Share by Email', 'yith-woocommerce-wishlist' ),
1217
- 'desc' => __( 'Show "Share by Email" button', 'yith-woocommerce-wishlist' ),
1218
- 'id' => 'yith_wcwl_share_email',
1219
- 'std' => 'yes', // for woocommerce < 2.0
1220
- 'default' => 'yes', // for woocommerce >= 2.0
1221
- 'type' => 'checkbox'
1222
- ),
1223
- 'socials_title' => array(
1224
- 'name' => __( 'Social title', 'yith-woocommerce-wishlist' ),
1225
- 'id' => 'yith_wcwl_socials_title',
1226
- 'std' => sprintf( __( 'My wishlist on %s', 'yith-woocommerce-wishlist' ), get_bloginfo( 'name' ) ), // for woocommerce < 2.0
1227
- 'default' => sprintf( __( 'My wishlist on %s', 'yith-woocommerce-wishlist' ), get_bloginfo( 'name' ) ), // for woocommerce >= 2.0
1228
- 'type' => 'text',
1229
- 'css' => 'min-width:300px;',
1230
- ),
1231
- 'socials_text' => array(
1232
- 'name' => __( 'Social text', 'yith-woocommerce-wishlist' ),
1233
- 'desc' => __( 'It will be used by Facebook, Twitter and Pinterest. Use <strong>%wishlist_url%</strong> where you want to show the URL of your wishlist.', 'yith-woocommerce-wishlist' ),
1234
- 'id' => 'yith_wcwl_socials_text',
1235
- 'css' => 'width:100%; height: 75px;',
1236
- 'std' => '', // for woocommerce < 2.0
1237
- 'default' => '', // for woocommerce >= 2.0
1238
- 'type' => 'textarea'
1239
- ),
1240
- 'socials_image' => array(
1241
- 'name' => __( 'Social image URL', 'yith-woocommerce-wishlist' ),
1242
- 'id' => 'yith_wcwl_socials_image_url',
1243
- 'std' => '', // for woocommerce < 2.0
1244
- 'default' => '', // for woocommerce >= 2.0
1245
- 'type' => 'text',
1246
- 'css' => 'min-width:300px;',
1247
- ),
1248
-
1249
- 'socials_section_end' => array(
1250
- 'type' => 'sectionend',
1251
- 'id' => 'yith_wcwl_styles'
1252
- )
1253
- );
1254
-
1255
- $yith_wfbt_thickbox = YITH_WCWL_URL . 'assets/images/landing/yith-wfbt-slider.jpg';
1256
- $yith_wfbt_promo = sprintf( __( 'If you want to take advantage of this feature, you could consider to purchase the %s.', 'yith-woocommerce-wishlist' ), '<a href="https://yithemes.com/themes/plugins/yith-woocommerce-frequently-bought-together/">YITH WooCommerce Frequently Bought Together Plugin</a>' );
1257
-
1258
- $options['yith_wfbt_integration'] = array(
1259
-
1260
- 'yith_wfbt_start' => array(
1261
- 'name' => __( 'YITH WooCommerce Frequently Bought Together Integration', 'yith-woocommerce-wishlist' ),
1262
- 'type' => 'title',
1263
- 'desc' => '',
1264
- 'id' => 'yith_wcwl_yith_wfbt'
1265
- ),
1266
-
1267
- 'yith_wfbt_enable_integration' => array(
1268
- 'name' => __( 'Enable slider in wishlist', 'yith-woocommerce-wishlist' ),
1269
- 'desc' => sprintf( __( 'Choose to enable product slider in wishlist page with linked products (<a href="%s" class="thickbox">Example</a>). %s', 'yith-woocommerce-wishlist' ), $yith_wfbt_thickbox, ( ! ( defined( 'YITH_WFBT' ) && YITH_WFBT ) ) ? $yith_wfbt_promo : '' ),
1270
- 'id' => 'yith_wfbt_enable_integration',
1271
- 'std' => 'yes', // for woocommerce < 2.0
1272
- 'default' => 'yes', // for woocommerce >= 2.0
1273
- 'type' => 'checkbox',
1274
- 'custom_attributes' => ( ! ( defined( 'YITH_WFBT' ) && YITH_WFBT ) ) ? array( 'disabled' => 'disabled' ) : false
1275
- ),
1276
-
1277
- 'yith_wfbt_end' => array(
1278
- 'type' => 'sectionend',
1279
- 'id' => 'yith_wcwl_yith_wfbt'
1280
- )
1281
-
1282
- );
1283
-
1284
- return apply_filters( 'yith_wcwl_admin_options', $options );
1285
- }
1286
-
1287
- /**
1288
- * Add colors options to the panel.
1289
- *
1290
- * @return void
1291
- * @access private
1292
- * @since 1.0.0
1293
- */
1294
- private function _styles_options() {
1295
- $colors = maybe_unserialize( get_option( 'yith_wcwl_frontend_css_colors' ) );
1296
-
1297
- foreach ( YITH_WCWL_Init()->colors_options as $color => $attrs ) {
1298
- if ( ! isset( $colors[$color] ) ) {
1299
- $colors[$color] = $attrs;
1300
- }
1301
- }
1302
-
1303
- ?>
1304
- <div class="color-panel">
1305
- <div class="clear"></div>
1306
- <h4><?php _e( '"Add to wishlist" button', 'yith-woocommerce-wishlist' ) ?></h4>
1307
- <?php
1308
-
1309
- yith_frontend_css_color_picker( __( 'Background', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_wishlist_background', $colors['add_to_wishlist']['background'] );
1310
- yith_frontend_css_color_picker( __( 'Text', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_wishlist_color', $colors['add_to_wishlist']['color'] );
1311
- yith_frontend_css_color_picker( __( 'Border', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_wishlist_border_color', $colors['add_to_wishlist']['border_color'] );
1312
-
1313
- ?>
1314
- <div class="clear" style="height:10px;"></div>
1315
- <?php
1316
-
1317
- // hover
1318
- yith_frontend_css_color_picker( __( 'Background (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_wishlist_hover_background', $colors['add_to_wishlist_hover']['background'] );
1319
- yith_frontend_css_color_picker( __( 'Text (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_wishlist_hover_color', $colors['add_to_wishlist_hover']['color'] );
1320
- yith_frontend_css_color_picker( __( 'Border (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_wishlist_hover_border_color', $colors['add_to_wishlist_hover']['border_color'] );
1321
-
1322
- ?>
1323
- <div class="clear" style="height:30px;"></div>
1324
- <h4><?php _e( '"Add to Cart" button', 'yith-woocommerce-wishlist' ) ?></h4>
1325
- <?php
1326
-
1327
- yith_frontend_css_color_picker( __( 'Background', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_cart_background', $colors['add_to_cart']['background'] );
1328
- yith_frontend_css_color_picker( __( 'Text', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_cart_color', $colors['add_to_cart']['color'] );
1329
- yith_frontend_css_color_picker( __( 'Border', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_cart_border_color', $colors['add_to_cart']['border_color'] );
1330
-
1331
- ?>
1332
- <div class="clear" style="height:10px;"></div>
1333
- <?php
1334
-
1335
- // hover
1336
- yith_frontend_css_color_picker( __( 'Background (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_cart_hover_background', $colors['add_to_cart_hover']['background'] );
1337
- yith_frontend_css_color_picker( __( 'Text (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_cart_hover_color', $colors['add_to_cart_hover']['color'] );
1338
- yith_frontend_css_color_picker( __( 'Border (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_add_to_cart_hover_border_color', $colors['add_to_cart_hover']['border_color'] );
1339
-
1340
- ?>
1341
- <div class="clear" style="height:30px;"></div>
1342
- <h4><?php _e( '"Style 1" button', 'yith-woocommerce-wishlist' ) ?></h4>
1343
- <?php
1344
-
1345
- yith_frontend_css_color_picker( __( 'Background', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_1_background', $colors['button_style_1']['background'] );
1346
- yith_frontend_css_color_picker( __( 'Text', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_1_color', $colors['button_style_1']['color'] );
1347
- yith_frontend_css_color_picker( __( 'Border', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_1_border_color', $colors['button_style_1']['border_color'] );
1348
-
1349
- ?>
1350
- <div class="clear" style="height:10px;"></div>
1351
- <?php
1352
-
1353
- // hover
1354
- yith_frontend_css_color_picker( __( 'Background (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_1_hover_background', $colors['button_style_1_hover']['background'] );
1355
- yith_frontend_css_color_picker( __( 'Text (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_1_hover_color', $colors['button_style_1_hover']['color'] );
1356
- yith_frontend_css_color_picker( __( 'Border (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_1_hover_border_color', $colors['button_style_1_hover']['border_color'] );
1357
-
1358
- ?>
1359
- <div class="clear" style="height:30px;"></div>
1360
- <h4><?php _e( '"Style 2" button', 'yith-woocommerce-wishlist' ) ?></h4>
1361
- <?php
1362
-
1363
- yith_frontend_css_color_picker( __( 'Background', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_2_background', $colors['button_style_2']['background'] );
1364
- yith_frontend_css_color_picker( __( 'Text', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_2_color', $colors['button_style_2']['color'] );
1365
- yith_frontend_css_color_picker( __( 'Border', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_2_border_color', $colors['button_style_2']['border_color'] );
1366
-
1367
- ?>
1368
- <div class="clear" style="height:10px;"></div>
1369
- <?php
1370
-
1371
- // hover
1372
- yith_frontend_css_color_picker( __( 'Background (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_2_hover_background', $colors['button_style_2_hover']['background'] );
1373
- yith_frontend_css_color_picker( __( 'Text (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_2_hover_color', $colors['button_style_2_hover']['color'] );
1374
- yith_frontend_css_color_picker( __( 'Border (hover)', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_button_style_2_hover_border_color', $colors['button_style_2_hover']['border_color'] );
1375
-
1376
- ?>
1377
- <div class="clear" style="height:30px;"></div>
1378
- <h4><?php _e( 'Wishlist table', 'yith-woocommerce-wishlist' )?></h4>
1379
- <?php
1380
-
1381
- yith_frontend_css_color_picker( __( 'Background', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_wishlist_table_background', $colors['wishlist_table']['background'] );
1382
- yith_frontend_css_color_picker( __( 'Text', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_wishlist_table_color', $colors['wishlist_table']['color'] );
1383
- yith_frontend_css_color_picker( __( 'Border', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_wishlist_table_border_color', $colors['wishlist_table']['border_color'] );
1384
-
1385
- ?>
1386
- <div class="clear" style="height:30px;"></div>
1387
- <h4><?php _e( 'Headers', 'yith-woocommerce-wishlist' ) ?></h4>
1388
- <?php
1389
-
1390
- yith_frontend_css_color_picker( __( 'Background color', 'yith-woocommerce-wishlist' ), 'yith_wcwl_color_headers_background', $colors['headers']['background'] );
1391
-
1392
- do_action( 'yith_wcwl_admin_color_pickers' );
1393
-
1394
- ?>
1395
- <div class="clear"></div>
1396
- </div>
1397
- <div class="clear" style="height:30px;"></div>
1398
- <?php
1399
- }
1400
-
1401
- /* === WISHLIST SUBPANEL SECTION === */
1402
-
1403
- /**
1404
- * Register wishlist panel
1405
- *
1406
- * @return void
1407
- * @since 2.0.0
1408
- */
1409
- public function register_panel() {
1410
-
1411
- $args = array(
1412
- 'create_menu_page' => true,
1413
- 'parent_slug' => '',
1414
- 'page_title' => __( 'Wishlist', 'yith-woocommerce-wishlist' ),
1415
- 'menu_title' => __( 'Wishlist', 'yith-woocommerce-wishlist' ),
1416
- 'capability' => 'manage_options',
1417
- 'parent' => '',
1418
- 'parent_page' => 'yit_plugin_panel',
1419
- 'page' => 'yith_wcwl_panel',
1420
- 'admin-tabs' => $this->available_tabs,
1421
- 'options-path' => YITH_WCWL_DIR . 'plugin-options'
1422
- );
1423
-
1424
- /* === Fixed: not updated theme === */
1425
- if( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
1426
- require_once( YITH_WCWL_DIR . 'plugin-fw/lib/yit-plugin-panel-wc.php' );
1427
- }
1428
-
1429
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
1430
- }
1431
-
1432
- /**
1433
- * Load admin style.
1434
- *
1435
- * @return void
1436
- * @since 1.0.0
1437
- */
1438
- public function enqueue() {
1439
- global $woocommerce, $pagenow;
1440
-
1441
- if( $pagenow == 'admin.php' && isset( $_GET['page'] ) && $_GET['page'] == 'yith_wcwl_panel' ) {
1442
- wp_enqueue_style( 'yith-wcwl-admin' );
1443
- wp_enqueue_script( 'yith-wcwl-admin' );
1444
- }
1445
- }
1446
-
1447
- /**
1448
- * Prints tab premium of the plugin
1449
- *
1450
- * @return void
1451
- * @since 2.0.0
1452
- */
1453
- public function print_premium_tab() {
1454
- $premium_tab = YITH_WCWL_DIR . 'templates/admin/wishlist-panel-premium.php';
1455
-
1456
- if( file_exists( $premium_tab ) ){
1457
- include( $premium_tab );
1458
- }
1459
- }
1460
-
1461
- /* === POINTER SECTION === */
1462
-
1463
- /**
1464
- * Register pointers for notify plugin updates to user
1465
- *
1466
- * @return void
1467
- * @since 2.0.0
1468
- */
1469
- public function register_pointer(){
1470
-
1471
- if( ! class_exists( 'YIT_Pointers' ) ){
1472
- include_once( 'plugin-fw/lib/yit-pointers.php' );
1473
- }
1474
-
1475
- $args[] = array(
1476
- 'screen_id' => 'plugins',
1477
- 'pointer_id' => 'yith_wcwl_panel',
1478
- 'target' => '#toplevel_page_yit_plugin_panel',
1479
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
1480
- __( 'Wishlist Activated', 'yith-woocommerce-wishlist' ),
1481
- apply_filters( 'yith_wcwl_activated_pointer_content', sprintf( __( 'In the YIT Plugin tab you can find the Wishlist options. With this menu, you can access to all the settings of our plugins that you have activated. Wishlist is available in an outstanding PREMIUM version with many new options, <a href="%s">discover it now</a>.', 'yith-woocommerce-wishlist' ), $this->get_premium_landing_uri() ) )
1482
- ),
1483
- 'position' => array( 'edge' => 'left', 'align' => 'center' ),
1484
- 'init' => YITH_WCWL_INIT
1485
- );
1486
-
1487
- $args[] = array(
1488
- 'screen_id' => 'update',
1489
- 'pointer_id' => 'yith_wcwl_panel',
1490
- 'target' => '#toplevel_page_yit_plugin_panel',
1491
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
1492
- __( 'Wishlist Updated', 'yith-woocommerce-wishlist' ),
1493
- apply_filters( 'yith_wcwl_updated_pointer_content', sprintf( __( 'From now on, you can find all the options of Wishlist under YIT Plugin -> Wishlist instead of WooCommerce -> Settings -> Wishlist, as in the previous version. When one of our plugins is updated, a new voice will be added to this menu. Wishlist has been updated with new available options, <a href="%s">discover the PREMIUM version.</a>', 'yith-woocommerce-wishlist' ), $this->get_premium_landing_uri() ) )
1494
- ),
1495
- 'position' => array( 'edge' => 'left', 'align' => 'center' ),
1496
- 'init' => YITH_WCWL_INIT
1497
- );
1498
-
1499
- YIT_Pointers()->register( $args );
1500
- }
1501
- }
1502
- }
1503
-
1504
- /**
1505
- * Unique access to instance of YITH_WCWL_Admin_Init class
1506
- *
1507
- * @return \YITH_WCWL_Admin_Init
1508
- * @since 2.0.0
1509
- */
1510
- function YITH_WCWL_Admin_Init(){
1511
- return YITH_WCWL_Admin_Init::get_instance();
1
+ <?php
2
+ /**
3
+ * Admin init class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Wishlist
7
+ * @version 2.0.0
8
+ */
9
+
10
+ if ( ! defined( 'YITH_WCWL' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'YITH_WCWL_Admin_Init' ) ) {
15
+ /**
16
+ * Initiator class. Create and populate admin views.
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class YITH_WCWL_Admin_Init {
21
+
22
+ /**
23
+ * Single instance of the class
24
+ *
25
+ * @var \YITH_WCWL_Admin_Init
26
+ * @since 2.0.0
27
+ */
28
+ protected static $instance;
29
+
30
+ /**
31
+ * Wishlist panel
32
+ *
33
+ * @var string Panel hookname
34
+ * @since 2.0.0
35
+ */
36
+ protected $_panel = null;
37
+
38
+ /**
39
+ * Tab name
40
+ *
41
+ * @var string
42
+ * @since 1.0.0
43
+ */
44
+ public $tab;
45
+
46
+ /**
47
+ * Various links
48
+ *
49
+ * @var string
50
+ * @access public
51
+ * @since 1.0.0
52
+ */
53
+ public $banner_url = 'http://cdn.yithemes.com/plugins/yith_wishlist.php?url';
54
+ public $banner_img = 'http://cdn.yithemes.com/plugins/yith_wishlist.php';
55
+ public $doc_url = 'http://yithemes.com/docs-plugins/yith-woocommerce-wishlist/';
56
+ public $premium_landing_url = 'http://yithemes.com/themes/plugins/yith-woocommerce-wishlist/';
57
+ public $live_demo_url = 'http://plugins.yithemes.com/yith-woocommerce-wishlist/';
58
+
59
+ /**
60
+ * Plugin options
61
+ *
62
+ * @var array
63
+ * @since 1.0.0
64
+ */
65
+ public $options;
66
+
67
+ /**
68
+ * List of available tab for wishlist panel
69
+ *
70
+ * @var array
71
+ * @access public
72
+ * @since 2.0.0
73
+ */
74
+ public $available_tabs = array();
75
+
76
+ /**
77
+ * Default tab to show when no selected
78
+ *
79
+ * @var string
80
+