Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress - Version 1.5.15

Version Description

Download this release

Release Info

Developer sandesh055
Plugin Icon Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress
Version 1.5.15
Comparing to
See all releases

Code changes from version 1.5.14 to 1.5.15

Files changed (51) hide show
  1. admin/assets/css/admin-embed-header-rtl.css +65 -0
  2. admin/assets/css/admin-embed-header.css +65 -0
  3. admin/assets/css/admin-menu-settings-rtl.css +31 -0
  4. admin/assets/css/admin-menu-settings.css +31 -0
  5. admin/assets/css/flow-admin-edit-rtl.css +215 -0
  6. admin/assets/css/flow-admin-edit.css +215 -0
  7. admin/assets/css/global-admin-rtl.css +53 -5
  8. admin/assets/css/global-admin.css +53 -5
  9. admin/assets/css/setup-wizard-rtl.css +6 -2
  10. admin/assets/css/setup-wizard.css +6 -2
  11. admin/assets/icons/wcf-loader.svg +1 -0
  12. admin/assets/js/admin-menu-settings.js +32 -2
  13. admin/assets/js/flow-admin-edit.js +109 -4
  14. admin/assets/js/setup-wizard.js +19 -1
  15. admin/bsf-analytics/class-bsf-analytics-loader.php +118 -115
  16. admin/bsf-analytics/class-bsf-analytics.php +503 -560
  17. admin/bsf-analytics/version.json +4 -1
  18. assets/css/import-rtl.css +1 -0
  19. assets/css/import.css +1 -0
  20. assets/js/frontend.js +3 -3
  21. assets/min-css/import-rtl.min.css +1 -1
  22. assets/min-css/import.min.css +1 -1
  23. assets/min-js/frontend.min.js +1 -1
  24. cartflows.php +24 -24
  25. changelog.txt +6 -0
  26. classes/class-cartflows-admin.php +713 -657
  27. classes/class-cartflows-cloning.php +30 -26
  28. classes/class-cartflows-flow-frontend.php +214 -247
  29. classes/class-cartflows-frontend.php +672 -654
  30. classes/class-cartflows-functions.php +555 -539
  31. classes/class-cartflows-loader.php +599 -583
  32. classes/class-cartflows-meta-fields.php +1046 -1039
  33. classes/class-cartflows-stats.php +87 -0
  34. classes/class-cartflows-step-factory.php +250 -0
  35. classes/class-cartflows-update.php +0 -22
  36. classes/class-cartflows-utils.php +581 -591
  37. classes/class-cartflows-wizard.php +8 -2
  38. includes/admin/cartflows-admin-header.php +21 -0
  39. includes/admin/cartflows-admin.php +1 -1
  40. includes/admin/cartflows-general-bck.php +0 -47
  41. includes/admin/cartflows-general.php +507 -525
  42. includes/admin/cartflows-home.php +92 -0
  43. languages/cartflows.pot +2158 -2118
  44. modules/checkout/classes/class-cartflows-checkout-markup.php +2 -1
  45. modules/flow/classes/class-cartflows-flow-meta.php +866 -760
  46. modules/flow/classes/class-cartflows-flow-post-type.php +373 -383
  47. modules/flow/view/meta-flow-steps.php +158 -210
  48. modules/flow/view/view-flow-inner-step.php +129 -0
  49. modules/flow/view/view-remote-importer.php +78 -0
  50. modules/optin/classes/class-cartflows-optin-markup.php +17 -0
  51. readme.txt +9 -3
admin/assets/css/admin-embed-header-rtl.css ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .notice:not(.wcf-notice) {
2
+ display: none;
3
+ }
4
+ .wcf-flex {
5
+ -js-display: flex;
6
+ display: -webkit-box;
7
+ display: -webkit-flex;
8
+ display: -moz-box;
9
+ display: -ms-flexbox;
10
+ display: flex;
11
+ -webkit-box-align: center;
12
+ -webkit-align-items: center;
13
+ -moz-box-align: center;
14
+ -ms-flex-align: center;
15
+ align-items: center;
16
+ -webkit-flex-wrap: wrap;
17
+ -ms-flex-wrap: wrap;
18
+ flex-wrap: wrap;
19
+ -webkit-align-content: center;
20
+ -ms-flex-line-pack: center;
21
+ align-content: center;
22
+ }
23
+
24
+ /* Header */
25
+ .wcf-menu-page-header {
26
+ background-color: #fff;
27
+ text-align: center;
28
+ padding: 20px 0;
29
+ /* margin-bottom: 20px; */
30
+ margin: 0;
31
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
32
+ right: -20px;
33
+ position: relative;
34
+ width: calc( 100% + 20px);
35
+ }
36
+
37
+ .wcf-container {
38
+ /* max-width: 930px; */
39
+ margin: 0 auto;
40
+ padding: 0 20px;
41
+ box-sizing: border-box;
42
+ }
43
+
44
+ .wcf-title {
45
+ flex: auto;
46
+ align-content: flex-start;
47
+ text-align: right;
48
+ }
49
+ .wcf-title a,
50
+ .wcf-title span {
51
+ display: block;
52
+ outline: none;
53
+ box-shadow: none;
54
+ font-size: 1.5rem;
55
+ color: #333333;
56
+ font-weight: 500;
57
+ }
58
+ .wcf-logo {
59
+ max-width: 170px;
60
+ }
61
+ .wcf-top-links {
62
+ flex: auto;
63
+ text-align: left;
64
+ font-weight: 500;
65
+ }
admin/assets/css/admin-embed-header.css ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .notice:not(.wcf-notice) {
2
+ display: none;
3
+ }
4
+ .wcf-flex {
5
+ -js-display: flex;
6
+ display: -webkit-box;
7
+ display: -webkit-flex;
8
+ display: -moz-box;
9
+ display: -ms-flexbox;
10
+ display: flex;
11
+ -webkit-box-align: center;
12
+ -webkit-align-items: center;
13
+ -moz-box-align: center;
14
+ -ms-flex-align: center;
15
+ align-items: center;
16
+ -webkit-flex-wrap: wrap;
17
+ -ms-flex-wrap: wrap;
18
+ flex-wrap: wrap;
19
+ -webkit-align-content: center;
20
+ -ms-flex-line-pack: center;
21
+ align-content: center;
22
+ }
23
+
24
+ /* Header */
25
+ .wcf-menu-page-header {
26
+ background-color: #fff;
27
+ text-align: center;
28
+ padding: 20px 0;
29
+ /* margin-bottom: 20px; */
30
+ margin: 0;
31
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
32
+ left: -20px;
33
+ position: relative;
34
+ width: calc( 100% + 20px);
35
+ }
36
+
37
+ .wcf-container {
38
+ /* max-width: 930px; */
39
+ margin: 0 auto;
40
+ padding: 0 20px;
41
+ box-sizing: border-box;
42
+ }
43
+
44
+ .wcf-title {
45
+ flex: auto;
46
+ align-content: flex-start;
47
+ text-align: left;
48
+ }
49
+ .wcf-title a,
50
+ .wcf-title span {
51
+ display: block;
52
+ outline: none;
53
+ box-shadow: none;
54
+ font-size: 1.5rem;
55
+ color: #333333;
56
+ font-weight: 500;
57
+ }
58
+ .wcf-logo {
59
+ max-width: 170px;
60
+ }
61
+ .wcf-top-links {
62
+ flex: auto;
63
+ text-align: right;
64
+ font-weight: 500;
65
+ }
admin/assets/css/admin-menu-settings-rtl.css CHANGED
@@ -315,4 +315,35 @@
315
 
316
  .wcf_permalink_settings .form-field-desc p{
317
  word-break: break-all;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  }
315
 
316
  .wcf_permalink_settings .form-field-desc p{
317
  word-break: break-all;
318
+ }
319
+
320
+ /***************************************************************
321
+ * CartFlows Home
322
+ ****************************************************************/
323
+
324
+ /* Stat box */
325
+ .wcf-col-33 {
326
+ width: 33.33%;
327
+ }
328
+ .wcf-col-50 {
329
+ width: 50%;
330
+ }
331
+ .wcf-stats-grid-container {
332
+ align-content: space-between;
333
+ border-top: 1px solid #dfdfdf;
334
+ border-bottom: 1px solid #dfdfdf;
335
+ }
336
+ .wcf-stats-box {
337
+ padding: 15px;
338
+ box-sizing: border-box;
339
+ border-left: 1px solid #dfdfdf;
340
+ }
341
+ .wcf-stats-box:last-child {
342
+ border: 0;
343
+ }
344
+ /*.wcf-stats-grid-container:last-of-type {
345
+ border-top: 0;
346
+ }*/
347
+ .wcf-stats-buttons {
348
+ padding: 15px 0;
349
  }
admin/assets/css/admin-menu-settings.css CHANGED
@@ -315,4 +315,35 @@
315
 
316
  .wcf_permalink_settings .form-field-desc p{
317
  word-break: break-all;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  }
315
 
316
  .wcf_permalink_settings .form-field-desc p{
317
  word-break: break-all;
318
+ }
319
+
320
+ /***************************************************************
321
+ * CartFlows Home
322
+ ****************************************************************/
323
+
324
+ /* Stat box */
325
+ .wcf-col-33 {
326
+ width: 33.33%;
327
+ }
328
+ .wcf-col-50 {
329
+ width: 50%;
330
+ }
331
+ .wcf-stats-grid-container {
332
+ align-content: space-between;
333
+ border-top: 1px solid #dfdfdf;
334
+ border-bottom: 1px solid #dfdfdf;
335
+ }
336
+ .wcf-stats-box {
337
+ padding: 15px;
338
+ box-sizing: border-box;
339
+ border-right: 1px solid #dfdfdf;
340
+ }
341
+ .wcf-stats-box:last-child {
342
+ border: 0;
343
+ }
344
+ /*.wcf-stats-grid-container:last-of-type {
345
+ border-top: 0;
346
+ }*/
347
+ .wcf-stats-buttons {
348
+ padding: 15px 0;
349
  }
admin/assets/css/flow-admin-edit-rtl.css CHANGED
@@ -102,3 +102,218 @@
102
  border-right: 3px solid #f16334;
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  border-right: 3px solid #f16334;
103
  }
104
 
105
+ #wcf-edit-dropdown .wcf-question-icon {
106
+ margin-left: 3px;
107
+ }
108
+
109
+ .wcf-edit-above:after {
110
+ bottom: -7px;
111
+ }
112
+
113
+ .wcf-edit-below:after {
114
+ top: -7px;
115
+ }
116
+
117
+ .wcf-edit-content {
118
+ visibility: hidden;
119
+ opacity: 0;
120
+ background: #fafafa;
121
+ border-top: none;
122
+ box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15);
123
+ position: fixed;
124
+ left: -1px;
125
+ width: 175px;
126
+ z-index: 999999;
127
+ border-radius: 3px;
128
+ }
129
+
130
+ .wcf-edit-content a {
131
+ padding: 9px 12px;
132
+ background: #fafafa;
133
+ text-align: right;
134
+ text-decoration: none;
135
+ display: block;
136
+ border-top: 1px solid rgba(230, 230, 230, 0.5);
137
+ height: auto;
138
+ color: #666;
139
+ font-size: 13px;
140
+ -webkit-transition: all linear 200ms;
141
+ transition: all linear 200ms;
142
+ }
143
+ .wcf-edit-content a:hover {
144
+ background: #f2f2f2;
145
+ }
146
+
147
+ .wcf-edit-content a i {
148
+ color: #444;
149
+ }
150
+
151
+ .wcf-edit-show {
152
+ visibility: visible;
153
+ opacity: 1;
154
+ }
155
+
156
+ .wcf-edit-action-modal select {
157
+ height: 34px;
158
+ }
159
+
160
+ .wcf-edit-settings:after {
161
+ content: '\2807';
162
+ font-size: 25px;
163
+ }
164
+
165
+ .wcf-edit-settings {
166
+ position: relative;
167
+ color: #ccc;
168
+ cursor: pointer;
169
+ display: inline-block;
170
+ top:7px;
171
+ }
172
+
173
+ .wcf-edit-settings:hover {
174
+ color: #333;
175
+ }
176
+
177
+ #wcf-edit-dropdown a{
178
+ display: block;
179
+ text-align: right;
180
+ }
181
+
182
+
183
+ #wcf-edit-dropdown .wcf-delete-action span {
184
+ width: 100%;
185
+ }
186
+
187
+ #wcf-edit-dropdown:after {
188
+ background: #fafafa;
189
+ height: 14px;
190
+ position: absolute;
191
+ -webkit-transform: rotate(-45deg);
192
+ transform: rotate(-45deg);
193
+ width: 14px;
194
+ content: "";
195
+ position: absolute;
196
+ left: 5%;
197
+ z-index: -7;
198
+ box-shadow: 0px 0 7px rgba(0, 0, 0, 0.07);
199
+ border: 1px solid rgba(0, 0, 0, 0.14);
200
+ }
201
+
202
+ .wcf-basic-action-buttons {
203
+ display: inline-block;
204
+ text-decoration: none;
205
+ }
206
+
207
+ .wcf-basic-action-buttons a{
208
+ margin-left: 15px;
209
+ }
210
+
211
+ #wcf-edit-dropdown a:hover{
212
+ color: #1e8cbe;
213
+ }
214
+
215
+ .wcf-step{
216
+ position: relative;
217
+ }
218
+
219
+ #wcf-edit-dropdown {
220
+ position: absolute;
221
+ z-index: 1;
222
+ /* top: 0;
223
+ right:0;*/
224
+ }
225
+
226
+ .wcf-edit-above{
227
+ left:10px;
228
+ top: 10px;
229
+ transform: translate(0, -100%);
230
+ }
231
+ .wcf-edit-below{
232
+ left:10px;
233
+ bottom: 5px;
234
+ transform: translate(0, 100%);
235
+ }
236
+
237
+ /*Tooltip*/
238
+ #wcf-tooltip {
239
+ position: relative;
240
+ display: inline-block;
241
+ cursor: pointer;
242
+ margin-right: 5px;
243
+ }
244
+
245
+ #wcf-tooltip .wcf-ab-test-note-badge {
246
+ visibility: hidden;
247
+ width: 110px;
248
+ background-color: #555;
249
+ color: #fff;
250
+ padding: 3px 0 3px 0;
251
+ position: absolute;
252
+ z-index: 1;
253
+ bottom: 125%;
254
+ right: 50%;
255
+ margin-right: -60px;
256
+ opacity: 0;
257
+ transition: opacity 0.3s;
258
+ font-size: 13px;
259
+ }
260
+
261
+ #wcf-tooltip .wcf-ab-test-note-badge::after {
262
+ content: "";
263
+ position: absolute;
264
+ top: 100%;
265
+ right: 50%;
266
+ transform: translate(50%, 0);
267
+ margin-right: -5px;
268
+ border-width: 5px;
269
+ border-style: solid;
270
+ border-color: #555 transparent transparent transparent;
271
+ }
272
+
273
+ #wcf-tooltip:hover .wcf-ab-test-note-badge {
274
+ visibility: visible;
275
+ opacity: 1;
276
+ padding: 6px 10px;
277
+ text-align: right;
278
+ font-size: 12px;
279
+ font-family: apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
280
+ }
281
+
282
+
283
+ .wcf-loader{
284
+ position:relative;
285
+ }
286
+ .wcf-step.wcf-loader:before{
287
+ content: '';
288
+ position: absolute;
289
+ width: 100%;
290
+ height: 100%;
291
+ top: 0;
292
+ background-color: #ffffff;
293
+ right: 0;
294
+ opacity: 0.70;
295
+ }
296
+ .wcf-step.wcf-loader:after{
297
+ content: '';
298
+ background-image: url(../icons/wcf-loader.svg);
299
+ right: 50%;
300
+ top: 40%;
301
+ top: calc( 50% - 10px);
302
+ background-repeat: no-repeat;
303
+ width: 20px;
304
+ height: 20px;
305
+ position: absolute;
306
+ align-items: center;
307
+ animation: rotate 0.8s infinite linear;
308
+ }
309
+
310
+
311
+
312
+ @keyframes rotate {
313
+ 0% {
314
+ transform: rotate(0deg);
315
+ }
316
+ 100% {
317
+ transform: rotate(-360deg);
318
+ }
319
+ }
admin/assets/css/flow-admin-edit.css CHANGED
@@ -102,3 +102,218 @@
102
  border-left: 3px solid #f16334;
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  border-left: 3px solid #f16334;
103
  }
104
 
105
+ #wcf-edit-dropdown .wcf-question-icon {
106
+ margin-right: 3px;
107
+ }
108
+
109
+ .wcf-edit-above:after {
110
+ bottom: -7px;
111
+ }
112
+
113
+ .wcf-edit-below:after {
114
+ top: -7px;
115
+ }
116
+
117
+ .wcf-edit-content {
118
+ visibility: hidden;
119
+ opacity: 0;
120
+ background: #fafafa;
121
+ border-top: none;
122
+ box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15);
123
+ position: fixed;
124
+ right: -1px;
125
+ width: 175px;
126
+ z-index: 999999;
127
+ border-radius: 3px;
128
+ }
129
+
130
+ .wcf-edit-content a {
131
+ padding: 9px 12px;
132
+ background: #fafafa;
133
+ text-align: left;
134
+ text-decoration: none;
135
+ display: block;
136
+ border-top: 1px solid rgba(230, 230, 230, 0.5);
137
+ height: auto;
138
+ color: #666;
139
+ font-size: 13px;
140
+ -webkit-transition: all linear 200ms;
141
+ transition: all linear 200ms;
142
+ }
143
+ .wcf-edit-content a:hover {
144
+ background: #f2f2f2;
145
+ }
146
+
147
+ .wcf-edit-content a i {
148
+ color: #444;
149
+ }
150
+
151
+ .wcf-edit-show {
152
+ visibility: visible;
153
+ opacity: 1;
154
+ }
155
+
156
+ .wcf-edit-action-modal select {
157
+ height: 34px;
158
+ }
159
+
160
+ .wcf-edit-settings:after {
161
+ content: '\2807';
162
+ font-size: 25px;
163
+ }
164
+
165
+ .wcf-edit-settings {
166
+ position: relative;
167
+ color: #ccc;
168
+ cursor: pointer;
169
+ display: inline-block;
170
+ top:7px;
171
+ }
172
+
173
+ .wcf-edit-settings:hover {
174
+ color: #333;
175
+ }
176
+
177
+ #wcf-edit-dropdown a{
178
+ display: block;
179
+ text-align: left;
180
+ }
181
+
182
+
183
+ #wcf-edit-dropdown .wcf-delete-action span {
184
+ width: 100%;
185
+ }
186
+
187
+ #wcf-edit-dropdown:after {
188
+ background: #fafafa;
189
+ height: 14px;
190
+ position: absolute;
191
+ -webkit-transform: rotate(45deg);
192
+ transform: rotate(45deg);
193
+ width: 14px;
194
+ content: "";
195
+ position: absolute;
196
+ right: 5%;
197
+ z-index: -7;
198
+ box-shadow: 0px 0 7px rgba(0, 0, 0, 0.07);
199
+ border: 1px solid rgba(0, 0, 0, 0.14);
200
+ }
201
+
202
+ .wcf-basic-action-buttons {
203
+ display: inline-block;
204
+ text-decoration: none;
205
+ }
206
+
207
+ .wcf-basic-action-buttons a{
208
+ margin-right: 15px;
209
+ }
210
+
211
+ #wcf-edit-dropdown a:hover{
212
+ color: #1e8cbe;
213
+ }
214
+
215
+ .wcf-step{
216
+ position: relative;
217
+ }
218
+
219
+ #wcf-edit-dropdown {
220
+ position: absolute;
221
+ z-index: 1;
222
+ /* top: 0;
223
+ right:0;*/
224
+ }
225
+
226
+ .wcf-edit-above{
227
+ right:10px;
228
+ top: 10px;
229
+ transform: translate(0, -100%);
230
+ }
231
+ .wcf-edit-below{
232
+ right:10px;
233
+ bottom: 5px;
234
+ transform: translate(0, 100%);
235
+ }
236
+
237
+ /*Tooltip*/
238
+ #wcf-tooltip {
239
+ position: relative;
240
+ display: inline-block;
241
+ cursor: pointer;
242
+ margin-left: 5px;
243
+ }
244
+
245
+ #wcf-tooltip .wcf-ab-test-note-badge {
246
+ visibility: hidden;
247
+ width: 110px;
248
+ background-color: #555;
249
+ color: #fff;
250
+ padding: 3px 0 3px 0;
251
+ position: absolute;
252
+ z-index: 1;
253
+ bottom: 125%;
254
+ left: 50%;
255
+ margin-left: -60px;
256
+ opacity: 0;
257
+ transition: opacity 0.3s;
258
+ font-size: 13px;
259
+ }
260
+
261
+ #wcf-tooltip .wcf-ab-test-note-badge::after {
262
+ content: "";
263
+ position: absolute;
264
+ top: 100%;
265
+ left: 50%;
266
+ transform: translate(-50%, 0);
267
+ margin-left: -5px;
268
+ border-width: 5px;
269
+ border-style: solid;
270
+ border-color: #555 transparent transparent transparent;
271
+ }
272
+
273
+ #wcf-tooltip:hover .wcf-ab-test-note-badge {
274
+ visibility: visible;
275
+ opacity: 1;
276
+ padding: 6px 10px;
277
+ text-align: left;
278
+ font-size: 12px;
279
+ font-family: apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
280
+ }
281
+
282
+
283
+ .wcf-loader{
284
+ position:relative;
285
+ }
286
+ .wcf-step.wcf-loader:before{
287
+ content: '';
288
+ position: absolute;
289
+ width: 100%;
290
+ height: 100%;
291
+ top: 0;
292
+ background-color: #ffffff;
293
+ left: 0;
294
+ opacity: 0.70;
295
+ }
296
+ .wcf-step.wcf-loader:after{
297
+ content: '';
298
+ background-image: url(../icons/wcf-loader.svg);
299
+ left: 50%;
300
+ top: 40%;
301
+ top: calc( 50% - 10px);
302
+ background-repeat: no-repeat;
303
+ width: 20px;
304
+ height: 20px;
305
+ position: absolute;
306
+ align-items: center;
307
+ animation: rotate 0.8s infinite linear;
308
+ }
309
+
310
+
311
+
312
+ @keyframes rotate {
313
+ 0% {
314
+ transform: rotate(0deg);
315
+ }
316
+ 100% {
317
+ transform: rotate(360deg);
318
+ }
319
+ }
admin/assets/css/global-admin-rtl.css CHANGED
@@ -51,6 +51,10 @@
51
  * Step Meta - All Page Css
52
  */
53
 
 
 
 
 
54
  .post-type-cartflows_step #delete-action {
55
  display: none;
56
  }
@@ -359,6 +363,7 @@
359
  color: #fff;
360
  }
361
 
 
362
  .wcf-flow-steps-meta-box .wcf-new-step-badge,
363
  .wcf-flow-steps-meta-box .wcf-step-wrap .wcf-step .wcf-flow-badge,
364
  .wcf-flow-steps-meta-box .wcf-step-wrap.active .wcf-step .wcf-flow-badge{
@@ -374,6 +379,15 @@
374
  vertical-align: middle;
375
  }
376
 
 
 
 
 
 
 
 
 
 
377
  #wcf-flow-settings .inside{
378
  margin: 10px 0 0;
379
  }
@@ -414,13 +428,13 @@
414
  }
415
 
416
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button{
417
- display: inline-block;
418
  font-size: 1em;
419
- line-height: 1em;
420
  vertical-align: middle;
421
  text-align: center;
422
- margin-right: 15px;
423
- text-decoration: none;
424
  }
425
 
426
  .wcf-flow-settings .wcf-action-button .dashicons{
@@ -432,7 +446,8 @@
432
  }
433
 
434
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button .wcf-step-act-btn-text {
435
- display: inline-block;
 
436
  line-height: 1.5em;
437
  }
438
 
@@ -460,6 +475,7 @@
460
  }
461
 
462
  .wcf-step-wrap {
 
463
  margin-bottom: 15px;
464
  }
465
 
@@ -558,6 +574,11 @@ input[type="text"].error:focus{
558
  * 5. Upsell Meta Box (#wcf-upsell-settings)
559
  * ************************************************
560
  */
 
 
 
 
 
561
  .wcf-repeat-notice,
562
  #wcf-checkout-settings .wcf-checkout-table .wcf-checkout-style .wcf-cs-fields .wcf-cs-checkbox-field .field-wcf-advance-options-fields{
563
  border-top: 1px #ddd solid;
@@ -1173,8 +1194,35 @@ input[type="text"].error:focus{
1173
  padding:10px;
1174
  }
1175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1176
 
1177
 
 
 
 
 
 
 
1178
  /**
1179
  * ******************************
1180
  * Media Query for 768 Devices
51
  * Step Meta - All Page Css
52
  */
53
 
54
+ .edit-post-layout .interface-interface-skeleton__content{
55
+ background-color: #fff;
56
+ }
57
+
58
  .post-type-cartflows_step #delete-action {
59
  display: none;
60
  }
363
  color: #fff;
364
  }
365
 
366
+ .wcf-flow-steps-meta-box .wcf-step-badge,
367
  .wcf-flow-steps-meta-box .wcf-new-step-badge,
368
  .wcf-flow-steps-meta-box .wcf-step-wrap .wcf-step .wcf-flow-badge,
369
  .wcf-flow-steps-meta-box .wcf-step-wrap.active .wcf-step .wcf-flow-badge{
379
  vertical-align: middle;
380
  }
381
 
382
+ .wcf-flow-steps-meta-box .wcf-abtest-control-badge {
383
+ background: #f16334;
384
+ color: #fff;
385
+ }
386
+ .wcf-flow-steps-meta-box .wcf-abtest-variation-badge {
387
+ background: #1e8cbe;
388
+ color: #fff;
389
+ }
390
+
391
  #wcf-flow-settings .inside{
392
  margin: 10px 0 0;
393
  }
428
  }
429
 
430
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button{
431
+ /*display: inline-block;*/
432
  font-size: 1em;
433
+ line-height: 0.9em;
434
  vertical-align: middle;
435
  text-align: center;
436
+ /* margin-left: 15px;
437
+ */ text-decoration: none;
438
  }
439
 
440
  .wcf-flow-settings .wcf-action-button .dashicons{
446
  }
447
 
448
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button .wcf-step-act-btn-text {
449
+ /* display: inline-block;
450
+ display: none !important;*/
451
  line-height: 1.5em;
452
  }
453
 
475
  }
476
 
477
  .wcf-step-wrap {
478
+ background: #ffffff;
479
  margin-bottom: 15px;
480
  }
481
 
574
  * 5. Upsell Meta Box (#wcf-upsell-settings)
575
  * ************************************************
576
  */
577
+
578
+ .edit-post-meta-boxes-area #poststuff #wcf-checkout-settings h2.hndle{
579
+ border-bottom: 0px;
580
+ }
581
+
582
  .wcf-repeat-notice,
583
  #wcf-checkout-settings .wcf-checkout-table .wcf-checkout-style .wcf-cs-fields .wcf-cs-checkbox-field .field-wcf-advance-options-fields{
584
  border-top: 1px #ddd solid;
1194
  padding:10px;
1195
  }
1196
 
1197
+ /**
1198
+ * *******************************
1199
+ * A/B testing CSS Start
1200
+ * *******************************
1201
+ */
1202
+
1203
+ /* Dropdown menu Buttons */
1204
+ #wcf-edit-dropdown.wcf-edit-content a.wcf-action-button{
1205
+ padding: 10px 15px;
1206
+ border-right: 1px solid rgba(230, 230, 230, 0.5);
1207
+ }
1208
+
1209
+ #wcf-edit-dropdown.wcf-edit-content a.wcf-action-button:hover{
1210
+ background: #ffffff;
1211
+ border-right: 1px solid #1e8cbe;
1212
+ }
1213
+
1214
+ #wcf-edit-dropdown.wcf-edit-content a.wcf-action-button .wcf-step-act-btn-text{
1215
+ margin-right: 5px;
1216
+ }
1217
+ /* Dropdown menu Buttons */
1218
 
1219
 
1220
+ /**
1221
+ * *******************************
1222
+ * A/B testing CSS End
1223
+ * *******************************
1224
+ */
1225
+
1226
  /**
1227
  * ******************************
1228
  * Media Query for 768 Devices
admin/assets/css/global-admin.css CHANGED
@@ -51,6 +51,10 @@
51
  * Step Meta - All Page Css
52
  */
53
 
 
 
 
 
54
  .post-type-cartflows_step #delete-action {
55
  display: none;
56
  }
@@ -359,6 +363,7 @@
359
  color: #fff;
360
  }
361
 
 
362
  .wcf-flow-steps-meta-box .wcf-new-step-badge,
363
  .wcf-flow-steps-meta-box .wcf-step-wrap .wcf-step .wcf-flow-badge,
364
  .wcf-flow-steps-meta-box .wcf-step-wrap.active .wcf-step .wcf-flow-badge{
@@ -374,6 +379,15 @@
374
  vertical-align: middle;
375
  }
376
 
 
 
 
 
 
 
 
 
 
377
  #wcf-flow-settings .inside{
378
  margin: 10px 0 0;
379
  }
@@ -414,13 +428,13 @@
414
  }
415
 
416
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button{
417
- display: inline-block;
418
  font-size: 1em;
419
- line-height: 1em;
420
  vertical-align: middle;
421
  text-align: center;
422
- margin-left: 15px;
423
- text-decoration: none;
424
  }
425
 
426
  .wcf-flow-settings .wcf-action-button .dashicons{
@@ -432,7 +446,8 @@
432
  }
433
 
434
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button .wcf-step-act-btn-text {
435
- display: inline-block;
 
436
  line-height: 1.5em;
437
  }
438
 
@@ -460,6 +475,7 @@
460
  }
461
 
462
  .wcf-step-wrap {
 
463
  margin-bottom: 15px;
464
  }
465
 
@@ -558,6 +574,11 @@ input[type="text"].error:focus{
558
  * 5. Upsell Meta Box (#wcf-upsell-settings)
559
  * ************************************************
560
  */
 
 
 
 
 
561
  .wcf-repeat-notice,
562
  #wcf-checkout-settings .wcf-checkout-table .wcf-checkout-style .wcf-cs-fields .wcf-cs-checkbox-field .field-wcf-advance-options-fields{
563
  border-top: 1px #ddd solid;
@@ -1173,8 +1194,35 @@ input[type="text"].error:focus{
1173
  padding:10px;
1174
  }
1175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1176
 
1177
 
 
 
 
 
 
 
1178
  /**
1179
  * ******************************
1180
  * Media Query for 768 Devices
51
  * Step Meta - All Page Css
52
  */
53
 
54
+ .edit-post-layout .interface-interface-skeleton__content{
55
+ background-color: #fff;
56
+ }
57
+
58
  .post-type-cartflows_step #delete-action {
59
  display: none;
60
  }
363
  color: #fff;
364
  }
365
 
366
+ .wcf-flow-steps-meta-box .wcf-step-badge,
367
  .wcf-flow-steps-meta-box .wcf-new-step-badge,
368
  .wcf-flow-steps-meta-box .wcf-step-wrap .wcf-step .wcf-flow-badge,
369
  .wcf-flow-steps-meta-box .wcf-step-wrap.active .wcf-step .wcf-flow-badge{
379
  vertical-align: middle;
380
  }
381
 
382
+ .wcf-flow-steps-meta-box .wcf-abtest-control-badge {
383
+ background: #f16334;
384
+ color: #fff;
385
+ }
386
+ .wcf-flow-steps-meta-box .wcf-abtest-variation-badge {
387
+ background: #1e8cbe;
388
+ color: #fff;
389
+ }
390
+
391
  #wcf-flow-settings .inside{
392
  margin: 10px 0 0;
393
  }
428
  }
429
 
430
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button{
431
+ /*display: inline-block;*/
432
  font-size: 1em;
433
+ line-height: 0.9em;
434
  vertical-align: middle;
435
  text-align: center;
436
+ /* margin-left: 15px;
437
+ */ text-decoration: none;
438
  }
439
 
440
  .wcf-flow-settings .wcf-action-button .dashicons{
446
  }
447
 
448
  .wcf-flow-settings .wcf-flow-steps-wrap .wcf-action-button .wcf-step-act-btn-text {
449
+ /* display: inline-block;
450
+ display: none !important;*/
451
  line-height: 1.5em;
452
  }
453
 
475
  }
476
 
477
  .wcf-step-wrap {
478
+ background: #ffffff;
479
  margin-bottom: 15px;
480
  }
481
 
574
  * 5. Upsell Meta Box (#wcf-upsell-settings)
575
  * ************************************************
576
  */
577
+
578
+ .edit-post-meta-boxes-area #poststuff #wcf-checkout-settings h2.hndle{
579
+ border-bottom: 0px;
580
+ }
581
+
582
  .wcf-repeat-notice,
583
  #wcf-checkout-settings .wcf-checkout-table .wcf-checkout-style .wcf-cs-fields .wcf-cs-checkbox-field .field-wcf-advance-options-fields{
584
  border-top: 1px #ddd solid;
1194
  padding:10px;
1195
  }
1196
 
1197
+ /**
1198
+ * *******************************
1199
+ * A/B testing CSS Start
1200
+ * *******************************
1201
+ */
1202
+
1203
+ /* Dropdown menu Buttons */
1204
+ #wcf-edit-dropdown.wcf-edit-content a.wcf-action-button{
1205
+ padding: 10px 15px;
1206
+ border-left: 1px solid rgba(230, 230, 230, 0.5);
1207
+ }
1208
+
1209
+ #wcf-edit-dropdown.wcf-edit-content a.wcf-action-button:hover{
1210
+ background: #ffffff;
1211
+ border-left: 1px solid #1e8cbe;
1212
+ }
1213
+
1214
+ #wcf-edit-dropdown.wcf-edit-content a.wcf-action-button .wcf-step-act-btn-text{
1215
+ margin-left: 5px;
1216
+ }
1217
+ /* Dropdown menu Buttons */
1218
 
1219
 
1220
+ /**
1221
+ * *******************************
1222
+ * A/B testing CSS End
1223
+ * *******************************
1224
+ */
1225
+
1226
  /**
1227
  * ******************************
1228
  * Media Query for 768 Devices
admin/assets/css/setup-wizard-rtl.css CHANGED
@@ -303,7 +303,7 @@
303
 
304
  .cartflows-setup-wizard-content p,
305
  .cartflows-setup-content p {
306
- margin: 0 0 24px
307
  }
308
 
309
  .cartflows-setup-wizard-content p,
@@ -1248,4 +1248,8 @@
1248
  .cartflows-usage-tracking .usage-tracking-wrap p,
1249
  .cartflows-usage-tracking .usage-tracking-wrap label{
1250
  font-size: 14px;
1251
- }
 
 
 
 
303
 
304
  .cartflows-setup-wizard-content p,
305
  .cartflows-setup-content p {
306
+ margin: 0 0 10px
307
  }
308
 
309
  .cartflows-setup-wizard-content p,
1248
  .cartflows-usage-tracking .usage-tracking-wrap p,
1249
  .cartflows-usage-tracking .usage-tracking-wrap label{
1250
  font-size: 14px;
1251
+ }
1252
+
1253
+ #wcf-page-builder{
1254
+ text-transform: capitalize;
1255
+ }
admin/assets/css/setup-wizard.css CHANGED
@@ -303,7 +303,7 @@
303
 
304
  .cartflows-setup-wizard-content p,
305
  .cartflows-setup-content p {
306
- margin: 0 0 24px
307
  }
308
 
309
  .cartflows-setup-wizard-content p,
@@ -1248,4 +1248,8 @@
1248
  .cartflows-usage-tracking .usage-tracking-wrap p,
1249
  .cartflows-usage-tracking .usage-tracking-wrap label{
1250
  font-size: 14px;
1251
- }
 
 
 
 
303
 
304
  .cartflows-setup-wizard-content p,
305
  .cartflows-setup-content p {
306
+ margin: 0 0 10px
307
  }
308
 
309
  .cartflows-setup-wizard-content p,
1248
  .cartflows-usage-tracking .usage-tracking-wrap p,
1249
  .cartflows-usage-tracking .usage-tracking-wrap label{
1250
  font-size: 14px;
1251
+ }
1252
+
1253
+ #wcf-page-builder{
1254
+ text-transform: capitalize;
1255
+ }
admin/assets/icons/wcf-loader.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 91.3 91.1"><circle cx="45.7" cy="45.7" r="45.7"/><circle fill="#FFF" cx="45.7" cy="24.4" r="12.5"/></svg>
admin/assets/js/admin-menu-settings.js CHANGED
@@ -7,7 +7,7 @@
7
  jQuery("#wcf_wcf_facebook_pixel_tracking").click(function () {
8
  jQuery(fb_pixel_fields).toggle(jQuery("#wcf_wcf_facebook_pixel_tracking").is(":checked"));
9
  });
10
- }
11
  /* Disable/Enable Facebook Pixel Field section*/
12
 
13
  /* Disable/Enable Google Analytics Field section */
@@ -19,9 +19,39 @@
19
  jQuery("#wcf_enable_google-analytics-id").click(function () {
20
  jQuery(google_analytics_fields).toggle(jQuery("#wcf_enable_google-analytics-id").is(":checked"));
21
  });
22
- }
23
  /* Disable/Enable Google Analytics Field section */
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  $(document).ready(function () {
26
  wcf_toggle_fields_facebook_pixel();
27
  wcf_toggle_fields_google_analytics();
7
  jQuery("#wcf_wcf_facebook_pixel_tracking").click(function () {
8
  jQuery(fb_pixel_fields).toggle(jQuery("#wcf_wcf_facebook_pixel_tracking").is(":checked"));
9
  });
10
+ };
11
  /* Disable/Enable Facebook Pixel Field section*/
12
 
13
  /* Disable/Enable Google Analytics Field section */
19
  jQuery("#wcf_enable_google-analytics-id").click(function () {
20
  jQuery(google_analytics_fields).toggle(jQuery("#wcf_enable_google-analytics-id").is(":checked"));
21
  });
22
+ };
23
  /* Disable/Enable Google Analytics Field section */
24
 
25
+ var wcf_fetch_stats_overview = function() {
26
+
27
+ $('.wcf-stats-buttons button').on('click', function(e) {
28
+
29
+ e.preventDefault();
30
+
31
+ var $this = $(this),
32
+ wrap = $this.closest('.wcf-stats-buttons'),
33
+ filter = $this.data('filter');
34
+
35
+ wrap.find('.button').removeClass('button-primary').addClass('button-secondary');
36
+ $this.addClass('button-primary').removeClass('button-secondary');
37
+
38
+ $.ajax({
39
+ url: ajaxurl,
40
+ data: {
41
+ action: "cartflows_fetch_stats",
42
+ filter: filter,
43
+ security: cartflows_admin.wcf_fetch_stats_nonce
44
+ },
45
+ dataType: 'json',
46
+ type: 'POST',
47
+ success: function ( data ) {
48
+
49
+ console.log( data );
50
+ }
51
+ });
52
+ });
53
+ };
54
+
55
  $(document).ready(function () {
56
  wcf_toggle_fields_facebook_pixel();
57
  wcf_toggle_fields_google_analytics();
admin/assets/js/flow-admin-edit.js CHANGED
@@ -11,6 +11,7 @@
11
  step_id = $this.data('id'),
12
  icon_span = $this.find('.dashicons-trash'),
13
  text_span = $this.find('.wcf-step-act-btn-text'),
 
14
  parent = $this.parents('.wcf-step-wrap');
15
 
16
  var delete_status = confirm( "This action will delete this flow step. Are you sure?" );
@@ -23,6 +24,7 @@
23
 
24
  var post_id = $( 'form#post #post_ID').val();
25
 
 
26
  $.ajax({
27
  url: ajaxurl,
28
  data: {
@@ -34,9 +36,14 @@
34
  dataType: 'json',
35
  type: 'POST',
36
  success: function ( data ) {
37
- parent.slideUp(400, 'swing', function() {
38
- parent.remove();
39
- });
 
 
 
 
 
40
 
41
  setTimeout(function() {
42
  $('.wcf-flow-steps-container').trigger('wcf-step-deleted',[step_id]);
@@ -48,6 +55,53 @@
48
  }
49
  });
50
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  var wcf_flow_steps_sortbale = function() {
53
 
@@ -69,7 +123,6 @@
69
  });
70
 
71
  $this.sortable('disable');
72
-
73
  $.ajax({
74
  url: ajaxurl,
75
  data: {
@@ -95,10 +148,62 @@
95
  });
96
 
97
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  $(document).ready(function($) {
99
 
100
  wcf_steps_hide_show_delete();
101
 
102
  wcf_flow_steps_sortbale();
 
 
 
 
103
  });
104
  })(jQuery);
11
  step_id = $this.data('id'),
12
  icon_span = $this.find('.dashicons-trash'),
13
  text_span = $this.find('.wcf-step-act-btn-text'),
14
+ wcf_step = $this.closest('.wcf-step'),
15
  parent = $this.parents('.wcf-step-wrap');
16
 
17
  var delete_status = confirm( "This action will delete this flow step. Are you sure?" );
24
 
25
  var post_id = $( 'form#post #post_ID').val();
26
 
27
+ wcf_step.addClass('wcf-loader');
28
  $.ajax({
29
  url: ajaxurl,
30
  data: {
36
  dataType: 'json',
37
  type: 'POST',
38
  success: function ( data ) {
39
+
40
+ if ( data.reload ) {
41
+ location.reload();
42
+ }else{
43
+ parent.slideUp(400, 'swing', function() {
44
+ parent.remove();
45
+ });
46
+ }
47
 
48
  setTimeout(function() {
49
  $('.wcf-flow-steps-container').trigger('wcf-step-deleted',[step_id]);
55
  }
56
  });
57
  }
58
+
59
+ var wcf_flow_step_clone = function() {
60
+
61
+ $('.wcf-flow-settings .wcf-step-clone').on('click', function (e) {
62
+
63
+ e.preventDefault();
64
+
65
+ if( $(this).hasClass('wcf-pro') ) {
66
+ return;
67
+ }
68
+
69
+ var $this = $(this),
70
+ step_id = $this.data('id'),
71
+ icon_span = $this.find('.dashicons-trash'),
72
+ text_span = $this.find('.wcf-step-act-btn-text'),
73
+ wcf_step = $this.closest('.wcf-step');
74
+
75
+ var clone_status = confirm("Do you want to clone this step? Are you sure?");
76
+
77
+ if (true == clone_status) {
78
+
79
+ console.log('Clonning Step');
80
+ icon_span.addClass('wp-ui-text-notification');
81
+ text_span.addClass('wp-ui-text-notification').text('Clonning...');
82
+
83
+ var post_id = $('form#post #post_ID').val();
84
+
85
+ wcf_step.addClass('wcf-loader');
86
+
87
+ $.ajax({
88
+ url: ajaxurl,
89
+ data: {
90
+ action: "cartflows_clone_flow_step",
91
+ post_id: post_id,
92
+ step_id: step_id,
93
+ security: cartflows_admin.wcf_clone_flow_step_nonce
94
+ },
95
+ dataType: 'json',
96
+ type: 'POST',
97
+ success: function (data) {
98
+ location.reload();
99
+ }
100
+ });
101
+ }
102
+ });
103
+
104
+ }
105
 
106
  var wcf_flow_steps_sortbale = function() {
107
 
123
  });
124
 
125
  $this.sortable('disable');
 
126
  $.ajax({
127
  url: ajaxurl,
128
  data: {
148
  });
149
 
150
  }
151
+
152
+ var wcf_handle_flow_options = function (){
153
+
154
+ $(document).on("click", ".wcf-edit-settings", function (e) {
155
+
156
+ var setting_button = $(this),
157
+ $window = $(window),
158
+ step_wrap = setting_button.closest('.wcf-step-wrap');
159
+
160
+ if( step_wrap.hasClass('wcf-ab-test')){
161
+ step_wrap = setting_button.closest('.wcf-step');
162
+ }
163
+
164
+ var setting_menu = step_wrap.find('#wcf-edit-dropdown'),
165
+ step_wrap_height = step_wrap.height(),
166
+ step_wrap_top = step_wrap.offset().top - $window.scrollTop(),
167
+ el_parent_bottom = step_wrap_top + step_wrap.outerHeight(),
168
+ el_dropdown_height = setting_menu.outerHeight(true),
169
+ class_css = '';
170
+
171
+
172
+ if ( setting_button.hasClass('active') ) {
173
+ setting_button.removeClass('active');
174
+ setting_menu.removeClass('wcf-edit-show wcf-edit-above wcf-edit-below');
175
+ return false;
176
+ }
177
+
178
+ setting_button.addClass('active');
179
+
180
+ setting_menu.addClass('wcf-edit-show');
181
+
182
+ if (step_wrap_top > el_dropdown_height) {
183
+ class_css = 'wcf-edit-above';
184
+ }else{
185
+ class_css = 'wcf-edit-below';
186
+ }
187
+
188
+ setting_menu.addClass(class_css);
189
+ });
190
+
191
+
192
+ $('body').click(function(){
193
+ $('.wcf-edit-settings').removeClass('active');
194
+ $('.wcf-flow-steps-container').find('.wcf-step-wrap #wcf-edit-dropdown').removeClass('wcf-edit-above wcf-edit-below wcf-edit-show');
195
+ });
196
+
197
+ }
198
+
199
  $(document).ready(function($) {
200
 
201
  wcf_steps_hide_show_delete();
202
 
203
  wcf_flow_steps_sortbale();
204
+
205
+ wcf_handle_flow_options();
206
+
207
+ wcf_flow_step_clone();
208
  });
209
  })(jQuery);
admin/assets/js/setup-wizard.js CHANGED
@@ -11,14 +11,32 @@
11
  */
12
  _bind: function() {
13
  $( document ).on('click', '.wcf-install-plugins', CartFlowsWizard._installNow );
14
- $( document ).on('click', '.button-next-wrap', CartFlowsWizard._usage_tracking );
15
  $( document ).on('click', '.wcf-install-wc', CartFlowsWizard._installWc );
16
  $( document ).on('wp-plugin-installing' , CartFlowsWizard._pluginInstalling);
17
  $( document ).on('wp-plugin-install-error' , CartFlowsWizard._installError);
18
  $( document ).on('wp-plugin-install-success' , CartFlowsWizard._installSuccess);
19
  $( document ).on('click', '.mautic-form-submit', CartFlowsWizard._onMauticSubmit );
 
20
  },
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  _usage_tracking: function( event ){
24
 
11
  */
12
  _bind: function() {
13
  $( document ).on('click', '.wcf-install-plugins', CartFlowsWizard._installNow );
14
+ $( document ).on('click', '.wcf-usage-tracking', CartFlowsWizard._usage_tracking );
15
  $( document ).on('click', '.wcf-install-wc', CartFlowsWizard._installWc );
16
  $( document ).on('wp-plugin-installing' , CartFlowsWizard._pluginInstalling);
17
  $( document ).on('wp-plugin-install-error' , CartFlowsWizard._installError);
18
  $( document ).on('wp-plugin-install-success' , CartFlowsWizard._installSuccess);
19
  $( document ).on('click', '.mautic-form-submit', CartFlowsWizard._onMauticSubmit );
20
+ $( document ).on('change', '.page-builder-list', CartFlowsWizard._onChangePagebuilder );
21
  },
22
 
23
+ _onChangePagebuilder: function ( event ){
24
+
25
+
26
+ var page_builder = $(this).val(),
27
+ plugin_slug = $( '.page-builder-list option:selected' ).data( 'slug' ) || '',
28
+ new_url = 'https://wordpress.org/plugins/'+plugin_slug;
29
+
30
+ $('.cartflows-setup-extra-notice').show();
31
+ if( 'other' === plugin_slug || 'divi' === plugin_slug ){
32
+ $('.cartflows-setup-extra-notice').hide();
33
+ return;
34
+ }
35
+
36
+ plugin_slug = plugin_slug.replace(/-/gi," ");
37
+ $('#wcf-page-builder').attr("href", new_url);
38
+ $('#wcf-page-builder').html( plugin_slug );
39
+ },
40
 
41
  _usage_tracking: function( event ){
42
 
admin/bsf-analytics/class-bsf-analytics-loader.php CHANGED
@@ -1,115 +1,118 @@
1
- <?php
2
- /**
3
- * BSF analytics loader file.
4
- *
5
- * @version 1.0.0
6
- *
7
- * @package bsf-analytics
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit();
12
- }
13
-
14
- /**
15
- * Class BSF_Analytics_Loader.
16
- */
17
- class BSF_Analytics_Loader {
18
-
19
- /**
20
- * Analytics Entities.
21
- *
22
- * @access private
23
- * @var array Entities array.
24
- */
25
- private $entities = array();
26
-
27
- /**
28
- * Analytics Version.
29
- *
30
- * @access private
31
- * @var float analytics version.
32
- */
33
- private $analytics_version = '';
34
-
35
- /**
36
- * Analytics path.
37
- *
38
- * @access private
39
- * @var string path array.
40
- */
41
- private $analytics_path = '';
42
-
43
- /**
44
- * Instance
45
- *
46
- * @access private
47
- * @var object Class object.
48
- */
49
- private static $instance = null;
50
-
51
- /**
52
- * Get instace of class.
53
- *
54
- * @return object
55
- */
56
- public static function get_instance() {
57
- if ( null === self::$instance ) {
58
- self::$instance = new self();
59
- }
60
-
61
- return self::$instance;
62
- }
63
-
64
- /**
65
- * Constructor
66
- */
67
- public function __construct() {
68
- add_action( 'init', array( $this, 'load_analytics' ) );
69
- }
70
-
71
- /**
72
- * Set entity for analytics.
73
- *
74
- * @param string $data Entity attributes data.
75
- * @return void
76
- */
77
- public function set_entity( $data ) {
78
- array_push( $this->entities, $data );
79
- }
80
-
81
- /**
82
- * Load Analytics library.
83
- *
84
- * @return void
85
- */
86
- public function load_analytics() {
87
- $unique_entities = array();
88
-
89
- if ( ! empty( $this->entities ) ) {
90
- foreach ( $this->entities as $entity ) {
91
- foreach ( $entity as $key => $data ) {
92
-
93
- if ( isset( $data['path'] ) ) {
94
- if ( file_exists( $data['path'] . '/version.json' ) ) {
95
- $analytics_version = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96
- if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
97
- $this->analytics_version = $analytics_version;
98
- $this->analytics_path = $data['path'];
99
- }
100
- }
101
- }
102
-
103
- if ( ! isset( $unique_entities[ $key ] ) ) {
104
- $unique_entities[ $key ] = $data;
105
- }
106
- }
107
- }
108
-
109
- if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
110
- require_once $this->analytics_path . '/class-bsf-analytics.php';
111
- new BSF_Analytics( $unique_entities );
112
- }
113
- }
114
- }
115
- }
 
 
 
1
+ <?php
2
+ /**
3
+ * BSF analytics loader file.
4
+ *
5
+ * @version 1.0.0
6
+ *
7
+ * @package bsf-analytics
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit();
12
+ }
13
+
14
+ /**
15
+ * Class BSF_Analytics_Loader.
16
+ */
17
+ class BSF_Analytics_Loader {
18
+
19
+ /**
20
+ * Analytics Entities.
21
+ *
22
+ * @access private
23
+ * @var array Entities array.
24
+ */
25
+ private $entities = array();
26
+
27
+ /**
28
+ * Analytics Version.
29
+ *
30
+ * @access private
31
+ * @var float analytics version.
32
+ */
33
+ private $analytics_version = '';
34
+
35
+ /**
36
+ * Analytics path.
37
+ *
38
+ * @access private
39
+ * @var string path array.
40
+ */
41
+ private $analytics_path = '';
42
+
43
+ /**
44
+ * Instance
45
+ *
46
+ * @access private
47
+ * @var object Class object.
48
+ */
49
+ private static $instance = null;
50
+
51
+ /**
52
+ * Get instace of class.
53
+ *
54
+ * @return object
55
+ */
56
+ public static function get_instance() {
57
+ if ( null === self::$instance ) {
58
+ self::$instance = new self();
59
+ }
60
+
61
+ return self::$instance;
62
+ }
63
+
64
+ /**
65
+ * Constructor
66
+ */
67
+ public function __construct() {
68
+ add_action( 'init', array( $this, 'load_analytics' ) );
69
+ }
70
+
71
+ /**
72
+ * Set entity for analytics.
73
+ *
74
+ * @param string $data Entity attributes data.
75
+ * @return void
76
+ */
77
+ public function set_entity( $data ) {
78
+ array_push( $this->entities, $data );
79
+ }
80
+
81
+ /**
82
+ * Load Analytics library.
83
+ *
84
+ * @return void
85
+ */
86
+ public function load_analytics() {
87
+ $unique_entities = array();
88
+
89
+ if ( ! empty( $this->entities ) ) {
90
+ foreach ( $this->entities as $entity ) {
91
+ foreach ( $entity as $key => $data ) {
92
+
93
+ if ( isset( $data['path'] ) ) {
94
+ if ( file_exists( $data['path'] . '/version.json' ) ) {
95
+ $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96
+ $analytics_version = json_decode( $file_contents, 1 );
97
+ $analytics_version = $analytics_version['bsf-analytics-ver'];
98
+
99
+ if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
100
+ $this->analytics_version = $analytics_version;
101
+ $this->analytics_path = $data['path'];
102
+ }
103
+ }
104
+ }
105
+
106
+ if ( ! isset( $unique_entities[ $key ] ) ) {
107
+ $unique_entities[ $key ] = $data;
108
+ }
109
+ }
110
+ }
111
+
112
+ if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
113
+ require_once $this->analytics_path . '/class-bsf-analytics.php';
114
+ new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version );
115
+ }
116
+ }
117
+ }
118
+ }
admin/bsf-analytics/class-bsf-analytics.php CHANGED
@@ -1,560 +1,503 @@
1
- <?php
2
- /**
3
- * BSF analytics class file.
4
- *
5
- * @version 1.0.0
6
- *
7
- * @package bsf-analytics
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit; // Exit if accessed directly.
12
- }
13
-
14
- if ( ! class_exists( 'BSF_Analytics' ) ) {
15
-
16
- /**
17
- * BSF analytics
18
- */
19
- class BSF_Analytics {
20
-
21
- /**
22
- * Member Variable
23
- *
24
- * @var string Product name
25
- */
26
- public $product_name = '';
27
-
28
- /**
29
- * Member Variable
30
- *
31
- * @var array Entities data.
32
- */
33
- private $entities;
34
-
35
- /**
36
- * Member Variable
37
- *
38
- * @var string Usage tracking document URL
39
- */
40
- public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
41
-
42
- /**
43
- * Setup actions, load files.
44
- *
45
- * @param array $args entity data for analytics.
46
- * @since 1.0.0
47
- */
48
- public function __construct( $args ) {
49
-
50
- // Bail when no analytics entities are registered.
51
- if ( empty( $args ) ) {
52
- return;
53
- }
54
-
55
- $this->entities = $args;
56
-
57
- define( 'BSF_ANALYTICS_FILE', __FILE__ );
58
- define( 'BSF_ANALYTICS_URI', $this->bsf_analytics_url() );
59
-
60
- add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
61
- add_action( 'cron_schedules', array( $this, 'every_two_days_schedule' ) );
62
- add_action( 'admin_notices', array( $this, 'option_notice' ) );
63
- add_action( 'init', array( $this, 'schedule_unschedule_event' ), 99 );
64
-
65
- $this->set_actions();
66
-
67
- if ( ! has_action( 'bsf_analytics_send', array( $this, 'send' ) ) ) {
68
- add_action( 'bsf_analytics_send', array( $this, 'send' ) );
69
- }
70
-
71
- add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) );
72
-
73
- $this->includes();
74
- }
75
-
76
- /**
77
- * Setup actions for admin notice style and analytics cron event.
78
- *
79
- * @since 1.0.4
80
- */
81
- public function set_actions() {
82
-
83
- foreach ( $this->entities as $key => $data ) {
84
- add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) );
85
- add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 );
86
- add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 );
87
- }
88
- }
89
-
90
- /**
91
- * BSF Analytics URL
92
- *
93
- * @return String URL of bsf-analytics directory.
94
- * @since 1.0.0
95
- */
96
- public function bsf_analytics_url() {
97
-
98
- $path = wp_normalize_path( dirname( __FILE__ ) );
99
- $theme_dir = wp_normalize_path( get_template_directory() );
100
-
101
- if ( strpos( $path, $theme_dir ) !== false ) {
102
- return rtrim( get_template_directory_uri() . '/admin/bsf-analytics/', '/' );
103
- } else {
104
- return rtrim( plugin_dir_url( BSF_ANALYTICS_FILE ), '/' );
105
- }
106
- }
107
-
108
- /**
109
- * Get API URL for sending analytics.
110
- *
111
- * @return string API URL.
112
- * @since 1.0.0
113
- */
114
- private function get_api_url() {
115
- return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
116
- }
117
-
118
- /**
119
- * Enqueue Scripts.
120
- *
121
- * @since 1.0.0
122
- * @return void
123
- */
124
- public function enqueue_assets() {
125
-
126
- global $bsf_analytics_version;
127
- /**
128
- * Load unminified if SCRIPT_DEBUG is true.
129
- *
130
- * Directory and Extensions.
131
- */
132
- $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
133
- $file_rtl = ( is_rtl() ) ? '-rtl' : '';
134
- $css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
135
-
136
- $css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
137
-
138
- wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, $bsf_analytics_version, 'all' );
139
- }
140
-
141
- /**
142
- * Send analytics API call.
143
- *
144
- * @since 1.0.0
145
- */
146
- public function send() {
147
- wp_remote_post(
148
- $this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
149
- array(
150
- 'body' => BSF_Analytics_Stats::instance()->get_stats(),
151
- 'timeout' => 5,
152
- 'blocking' => false,
153
- )
154
- );
155
- }
156
-
157
- /**
158
- * Check if usage tracking is enabled.
159
- *
160
- * @return bool
161
- * @since 1.0.0
162
- */
163
- public function is_tracking_enabled() {
164
-
165
- foreach ( $this->entities as $key => $data ) {
166
-
167
- $is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false;
168
- $is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled;
169
-
170
- if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) {
171
- return true;
172
- }
173
- }
174
-
175
- return false;
176
- }
177
-
178
- /**
179
- * Check if WHITE label is enabled for BSF products.
180
- *
181
- * @param string $source source of analytics.
182
- * @return bool
183
- * @since 1.0.0
184
- */
185
- public function is_white_label_enabled( $source ) {
186
-
187
- $options = apply_filters( $source . '_white_label_options', array() );
188
- $is_enabled = false;
189
-
190
- if ( is_array( $options ) ) {
191
- foreach ( $options as $option ) {
192
- if ( true === $option ) {
193
- $is_enabled = true;
194
- break;
195
- }
196
- }
197
- }
198
-
199
- return $is_enabled;
200
- }
201
-
202
- /**
203
- * Display admin notice for usage tracking.
204
- *
205
- * @since 1.0.0
206
- */
207
- public function option_notice() {
208
-
209
- if ( ! current_user_can( 'manage_options' ) ) {
210
- return;
211
- }
212
-
213
- foreach ( $this->entities as $key => $data ) {
214
-
215
- $time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours';
216
- $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
217
-
218
- // Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
219
- if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) {
220
- continue;
221
- }
222
-
223
- // Show tracker consent notice after 24 hours from installed time.
224
- if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) {
225
- continue;
226
- }
227
-
228
- /* translators: %s product name */
229
- $notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'cartflows' );
230
-
231
- if ( is_multisite() ) {
232
- $notice_string .= __( 'This will be applicable for all sites from the network.', 'cartflows' );
233
- }
234
-
235
- $language_dir = is_rtl() ? 'rtl' : 'ltr';
236
-
237
- Astra_Notices::add_notice(
238
- array(
239
- 'id' => $key . '-optin-notice',
240
- 'type' => '',
241
- 'message' => sprintf(
242
- '<div class="notice-content">
243
- <div class="notice-heading">
244
- %1$s
245
- </div>
246
- <div class="astra-notices-container">
247
- <a href="%2$s" class="astra-notices button-primary">
248
- %3$s
249
- </a>
250
- <a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
251
- %6$s
252
- </a>
253
- </div>
254
- </div>',
255
- /* translators: %s usage doc link */
256
- sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'cartflows' ) ),
257
- add_query_arg(
258
- array(
259
- $key . '_analytics_optin' => 'yes',
260
- $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
261
- 'bsf_analytics_source' => $key,
262
- )
263
- ),
264
- __( 'Yes! Allow it', 'cartflows' ),
265
- add_query_arg(
266
- array(
267
- $key . '_analytics_optin' => 'no',
268
- $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
269
- 'bsf_analytics_source' => $key,
270
- )
271
- ),
272
- MONTH_IN_SECONDS,
273
- __( 'No Thanks', 'cartflows' )
274
- ),
275
- 'show_if' => true,
276
- 'repeat-notice-after' => false,
277
- 'priority' => 18,
278
- 'display-with-other-notices' => true,
279
- )
280
- );
281
- }
282
- }
283
-
284
- /**
285
- * Process usage tracking opt out.
286
- *
287
- * @since 1.0.0
288
- */
289
- public function handle_optin_optout() {
290
-
291
- if ( ! current_user_can( 'manage_options' ) ) {
292
- return;
293
- }
294
-
295
- $source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : '';
296
-
297
- if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) {
298
- return;
299
- }
300
-
301
- if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) {
302
- return;
303
- }
304
-
305
- $optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : '';
306
-
307
- if ( 'yes' === $optin_status ) {
308
- $this->optin( $source );
309
- } elseif ( 'no' === $optin_status ) {
310
- $this->optout( $source );
311
- }
312
-
313
- wp_safe_redirect(
314
- remove_query_arg(
315
- array(
316
- $source . '_analytics_optin',
317
- $source . '_analytics_nonce',
318
- 'bsf_analytics_source',
319
- )
320
- )
321
- );
322
- }
323
-
324
- /**
325
- * Opt in to usage tracking.
326
- *
327
- * @param string $source source of analytics.
328
- * @since 1.0.0
329
- */
330
- private function optin( $source ) {
331
- update_site_option( $source . '_analytics_optin', 'yes' );
332
- }
333
-
334
- /**
335
- * Opt out to usage tracking.
336
- *
337
- * @param string $source source of analytics.
338
- * @since 1.0.0
339
- */
340
- private function optout( $source ) {
341
- update_site_option( $source . '_analytics_optin', 'no' );
342
- }
343
-
344
- /**
345
- * Add two days event schedule variables.
346
- *
347
- * @param array $schedules scheduled array data.
348
- * @since 1.0.0
349
- */
350
- public function every_two_days_schedule( $schedules ) {
351
- $schedules['every_two_days'] = array(
352
- 'interval' => 2 * DAY_IN_SECONDS,
353
- 'display' => __( 'Every two days', 'cartflows' ),
354
- );
355
-
356
- return $schedules;
357
- }
358
-
359
- /**
360
- * Schedule usage tracking event.
361
- *
362
- * @since 1.0.0
363
- */
364
- private function schedule_event() {
365
- if ( ! wp_next_scheduled( 'bsf_analytics_send' ) && $this->is_tracking_enabled() ) {
366
- wp_schedule_event( time(), 'every_two_days', 'bsf_analytics_send' );
367
- }
368
- }
369
-
370
- /**
371
- * Unschedule usage tracking event.
372
- *
373
- * @since 1.0.0
374
- */
375
- private function unschedule_event() {
376
- wp_clear_scheduled_hook( 'bsf_analytics_send' );
377
- }
378
-
379
- /**
380
- * Load analytics stat class.
381
- *
382
- * @since 1.0.0
383
- */
384
- private function includes() {
385
- require_once __DIR__ . '/class-bsf-analytics-stats.php';
386
- }
387
-
388
- /**
389
- * Register usage tracking option in General settings page.
390
- *
391
- * @since 1.0.0
392
- */
393
- public function register_usage_tracking_setting() {
394
-
395
- foreach ( $this->entities as $key => $data ) {
396
-
397
- if ( ! apply_filters( $key . 'tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) {
398
- return;
399
- }
400
-
401
- $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
402
- $author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force';
403
-
404
- register_setting(
405
- 'general', // Options group.
406
- $key . '_analytics_optin', // Option name/database.
407
- array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function.
408
- );
409
-
410
- add_settings_field(
411
- $key . '-analytics-optin', // Field ID.
412
- __( 'Usage Tracking', 'cartflows' ), // Field title.
413
- array( $this, 'render_settings_field_html' ), // Field callback function.
414
- 'general',
415
- 'default', // Settings page slug.
416
- array(
417
- 'type' => 'checkbox',
418
- 'title' => $author,
419
- 'name' => $key . '_analytics_optin',
420
- 'label_for' => $key . '-analytics-optin',
421
- 'id' => $key . '-analytics-optin',
422
- 'usage_doc_link' => $usage_doc_link,
423
- )
424
- );
425
- }
426
- }
427
-
428
- /**
429
- * Sanitize Callback Function
430
- *
431
- * @param bool $input Option value.
432
- * @since 1.0.0
433
- */
434
- public function sanitize_option( $input ) {
435
-
436
- if ( ! $input || 'no' === $input ) {
437
- return 'no';
438
- }
439
-
440
- return 'yes';
441
- }
442
-
443
- /**
444
- * Print settings field HTML.
445
- *
446
- * @param array $args arguments to field.
447
- * @since 1.0.0
448
- */
449
- public function render_settings_field_html( $args ) {
450
- ?>
451
- <fieldset>
452
- <label for="<?php echo esc_attr( $args['label_for'] ); ?>">
453
- <input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
454
- <?php
455
- /* translators: %s Product title */
456
- esc_html_e( sprintf( 'Allow %s products to track non-sensitive usage tracking data.', $args['cartflows'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
457
-
458
- if ( is_multisite() ) {
459
- esc_html_e( ' This will be applicable for all sites from the network.', 'cartflows' );
460
- }
461
- ?>
462
- </label>
463
- <?php
464
- echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'cartflows' ) ) );
465
- ?>
466
- </fieldset>
467
- <?php
468
- }
469
-
470
- /**
471
- * Set analytics installed time in option.
472
- *
473
- * @param string $source source of analytics.
474
- * @return string $time analytics installed time.
475
- * @since 1.0.0
476
- */
477
- private function get_analytics_install_time( $source ) {
478
-
479
- $time = get_site_option( $source . '_analytics_installed_time' );
480
-
481
- if ( ! $time ) {
482
- $time = time();
483
- update_site_option( $source . '_analytics_installed_time', time() );
484
- }
485
-
486
- return $time;
487
- }
488
-
489
- /**
490
- * Schedule/unschedule cron event on updation of option.
491
- *
492
- * @param string $old_value old value of option.
493
- * @param string $value value of option.
494
- * @param string $option Option name.
495
- * @since 1.0.0
496
- */
497
- public function update_analytics_option_callback( $old_value, $value, $option ) {
498
- if ( is_multisite() ) {
499
- $this->add_option_to_network( $option, $value );
500
- }
501
- }
502
-
503
- /**
504
- * Analytics option add callback.
505
- *
506
- * @param string $option Option name.
507
- * @param string $value value of option.
508
- * @since 1.0.0
509
- */
510
- public function add_analytics_option_callback( $option, $value ) {
511
- if ( is_multisite() ) {
512
- $this->add_option_to_network( $option, $value );
513
- }
514
- }
515
-
516
- /**
517
- * Schedule or unschedule event based on analytics option value.
518
- *
519
- * @since 1.0.0
520
- */
521
- public function schedule_unschedule_event() {
522
-
523
- foreach ( $this->entities as $key => $source ) {
524
-
525
- if ( true === $this->is_white_label_enabled( $key ) ) {
526
- $this->unschedule_event();
527
- return;
528
- }
529
-
530
- $analytics_option = get_site_option( $key . '_analytics_optin' );
531
-
532
- if ( 'yes' === $analytics_option ) {
533
- $this->schedule_event();
534
- } else {
535
- $this->unschedule_event();
536
- }
537
- }
538
- }
539
-
540
- /**
541
- * Save analytics option to network.
542
- *
543
- * @param string $option name of option.
544
- * @param string $value value of option.
545
- * @since 1.0.0
546
- */
547
- public function add_option_to_network( $option, $value ) {
548
-
549
- // If action coming from general settings page.
550
- if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
551
-
552
- if ( get_site_option( $option ) ) {
553
- update_site_option( $option, $value );
554
- } else {
555
- add_site_option( $option, $value );
556
- }
557
- }
558
- }
559
- }
560
- }
1
+ <?php
2
+ /**
3
+ * BSF analytics class file.
4
+ *
5
+ * @version 1.0.0
6
+ *
7
+ * @package bsf-analytics
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
+ }
13
+
14
+ if ( ! class_exists( 'BSF_Analytics' ) ) {
15
+
16
+ /**
17
+ * BSF analytics
18
+ */
19
+ class BSF_Analytics {
20
+
21
+ /**
22
+ * Member Variable
23
+ *
24
+ * @var array Entities data.
25
+ */
26
+ private $entities;
27
+
28
+ /**
29
+ * Member Variable
30
+ *
31
+ * @var string Usage tracking document URL
32
+ */
33
+ public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
34
+
35
+ /**
36
+ * Setup actions, load files.
37
+ *
38
+ * @param array $args entity data for analytics.
39
+ * @param string $analytics_path directory path to analytics library.
40
+ * @param float $analytics_version analytics library version.
41
+ * @since 1.0.0
42
+ */
43
+ public function __construct( $args, $analytics_path, $analytics_version ) {
44
+
45
+ // Bail when no analytics entities are registered.
46
+ if ( empty( $args ) ) {
47
+ return;
48
+ }
49
+
50
+ $this->entities = $args;
51
+
52
+ define( 'BSF_ANALYTICS_VERSION', $analytics_version );
53
+ define( 'BSF_ANALYTICS_URI', $this->get_analytics_url( $analytics_path ) );
54
+
55
+ add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
56
+ add_action( 'admin_notices', array( $this, 'option_notice' ) );
57
+ add_action( 'init', array( $this, 'maybe_track_analytics' ), 99 );
58
+
59
+ $this->set_actions();
60
+
61
+ add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) );
62
+
63
+ $this->includes();
64
+ }
65
+
66
+ /**
67
+ * Setup actions for admin notice style and analytics cron event.
68
+ *
69
+ * @since 1.0.4
70
+ */
71
+ public function set_actions() {
72
+
73
+ foreach ( $this->entities as $key => $data ) {
74
+ add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) );
75
+ add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 );
76
+ add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 );
77
+ }
78
+ }
79
+
80
+ /**
81
+ * BSF Analytics URL
82
+ *
83
+ * @param string $analytics_path directory path to analytics library.
84
+ * @return String URL of bsf-analytics directory.
85
+ * @since 1.0.0
86
+ */
87
+ public function get_analytics_url( $analytics_path ) {
88
+ return str_replace( WP_CONTENT_DIR, content_url(), $analytics_path );
89
+ }
90
+
91
+ /**
92
+ * Get API URL for sending analytics.
93
+ *
94
+ * @return string API URL.
95
+ * @since 1.0.0
96
+ */
97
+ private function get_api_url() {
98
+ return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
99
+ }
100
+
101
+ /**
102
+ * Enqueue Scripts.
103
+ *
104
+ * @since 1.0.0
105
+ * @return void
106
+ */
107
+ public function enqueue_assets() {
108
+
109
+ /**
110
+ * Load unminified if SCRIPT_DEBUG is true.
111
+ *
112
+ * Directory and Extensions.
113
+ */
114
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
115
+ $file_rtl = ( is_rtl() ) ? '-rtl' : '';
116
+ $css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
117
+
118
+ $css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
119
+
120
+ wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
121
+ }
122
+
123
+ /**
124
+ * Send analytics API call.
125
+ *
126
+ * @since 1.0.0
127
+ */
128
+ public function send() {
129
+ wp_remote_post(
130
+ $this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
131
+ array(
132
+ 'body' => BSF_Analytics_Stats::instance()->get_stats(),
133
+ 'timeout' => 5,
134
+ 'blocking' => false,
135
+ )
136
+ );
137
+ }
138
+
139
+ /**
140
+ * Check if usage tracking is enabled.
141
+ *
142
+ * @return bool
143
+ * @since 1.0.0
144
+ */
145
+ public function is_tracking_enabled() {
146
+
147
+ foreach ( $this->entities as $key => $data ) {
148
+
149
+ $is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false;
150
+ $is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled;
151
+
152
+ if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) {
153
+ return true;
154
+ }
155
+ }
156
+
157
+ return false;
158
+ }
159
+
160
+ /**
161
+ * Check if WHITE label is enabled for BSF products.
162
+ *
163
+ * @param string $source source of analytics.
164
+ * @return bool
165
+ * @since 1.0.0
166
+ */
167
+ public function is_white_label_enabled( $source ) {
168
+
169
+ $options = apply_filters( $source . '_white_label_options', array() );
170
+ $is_enabled = false;
171
+
172
+ if ( is_array( $options ) ) {
173
+ foreach ( $options as $option ) {
174
+ if ( true === $option ) {
175
+ $is_enabled = true;
176
+ break;
177
+ }
178
+ }
179
+ }
180
+
181
+ return $is_enabled;
182
+ }
183
+
184
+ /**
185
+ * Display admin notice for usage tracking.
186
+ *
187
+ * @since 1.0.0
188
+ */
189
+ public function option_notice() {
190
+
191
+ if ( ! current_user_can( 'manage_options' ) ) {
192
+ return;
193
+ }
194
+
195
+ foreach ( $this->entities as $key => $data ) {
196
+
197
+ $time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours';
198
+ $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
199
+
200
+ // Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
201
+ if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) {
202
+ continue;
203
+ }
204
+
205
+ // Show tracker consent notice after 24 hours from installed time.
206
+ if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) {
207
+ continue;
208
+ }
209
+
210
+ /* translators: %s product name */
211
+ $notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'cartflows' );
212
+
213
+ if ( is_multisite() ) {
214
+ $notice_string .= __( 'This will be applicable for all sites from the network.', 'cartflows' );
215
+ }
216
+
217
+ $language_dir = is_rtl() ? 'rtl' : 'ltr';
218
+
219
+ Astra_Notices::add_notice(
220
+ array(
221
+ 'id' => $key . '-optin-notice',
222
+ 'type' => '',
223
+ 'message' => sprintf(
224
+ '<div class="notice-content">
225
+ <div class="notice-heading">
226
+ %1$s
227
+ </div>
228
+ <div class="astra-notices-container">
229
+ <a href="%2$s" class="astra-notices button-primary">
230
+ %3$s
231
+ </a>
232
+ <a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
233
+ %6$s
234
+ </a>
235
+ </div>
236
+ </div>',
237
+ /* translators: %s usage doc link */
238
+ sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'cartflows' ) ),
239
+ add_query_arg(
240
+ array(
241
+ $key . '_analytics_optin' => 'yes',
242
+ $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
243
+ 'bsf_analytics_source' => $key,
244
+ )
245
+ ),
246
+ __( 'Yes! Allow it', 'cartflows' ),
247
+ add_query_arg(
248
+ array(
249
+ $key . '_analytics_optin' => 'no',
250
+ $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
251
+ 'bsf_analytics_source' => $key,
252
+ )
253
+ ),
254
+ MONTH_IN_SECONDS,
255
+ __( 'No Thanks', 'cartflows' )
256
+ ),
257
+ 'show_if' => true,
258
+ 'repeat-notice-after' => false,
259
+ 'priority' => 18,
260
+ 'display-with-other-notices' => true,
261
+ )
262
+ );
263
+ }
264
+ }
265
+
266
+ /**
267
+ * Process usage tracking opt out.
268
+ *
269
+ * @since 1.0.0
270
+ */
271
+ public function handle_optin_optout() {
272
+
273
+ if ( ! current_user_can( 'manage_options' ) ) {
274
+ return;
275
+ }
276
+
277
+ $source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : '';
278
+
279
+ if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) {
280
+ return;
281
+ }
282
+
283
+ if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) {
284
+ return;
285
+ }
286
+
287
+ $optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : '';
288
+
289
+ if ( 'yes' === $optin_status ) {
290
+ $this->optin( $source );
291
+ } elseif ( 'no' === $optin_status ) {
292
+ $this->optout( $source );
293
+ }
294
+
295
+ wp_safe_redirect(
296
+ remove_query_arg(
297
+ array(
298
+ $source . '_analytics_optin',
299
+ $source . '_analytics_nonce',
300
+ 'bsf_analytics_source',
301
+ )
302
+ )
303
+ );
304
+ }
305
+
306
+ /**
307
+ * Opt in to usage tracking.
308
+ *
309
+ * @param string $source source of analytics.
310
+ * @since 1.0.0
311
+ */
312
+ private function optin( $source ) {
313
+ update_site_option( $source . '_analytics_optin', 'yes' );
314
+ }
315
+
316
+ /**
317
+ * Opt out to usage tracking.
318
+ *
319
+ * @param string $source source of analytics.
320
+ * @since 1.0.0
321
+ */
322
+ private function optout( $source ) {
323
+ update_site_option( $source . '_analytics_optin', 'no' );
324
+ }
325
+
326
+ /**
327
+ * Load analytics stat class.
328
+ *
329
+ * @since 1.0.0
330
+ */
331
+ private function includes() {
332
+ require_once __DIR__ . '/class-bsf-analytics-stats.php';
333
+ }
334
+
335
+ /**
336
+ * Register usage tracking option in General settings page.
337
+ *
338
+ * @since 1.0.0
339
+ */
340
+ public function register_usage_tracking_setting() {
341
+
342
+ foreach ( $this->entities as $key => $data ) {
343
+
344
+ if ( ! apply_filters( $key . '_tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) {
345
+ return;
346
+ }
347
+
348
+ $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
349
+ $author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force';
350
+
351
+ register_setting(
352
+ 'general', // Options group.
353
+ $key . '_analytics_optin', // Option name/database.
354
+ array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function.
355
+ );
356
+
357
+ add_settings_field(
358
+ $key . '-analytics-optin', // Field ID.
359
+ __( 'Usage Tracking', 'cartflows' ), // Field title.
360
+ array( $this, 'render_settings_field_html' ), // Field callback function.
361
+ 'general',
362
+ 'default', // Settings page slug.
363
+ array(
364
+ 'type' => 'checkbox',
365
+ 'title' => $author,
366
+ 'name' => $key . '_analytics_optin',
367
+ 'label_for' => $key . '-analytics-optin',
368
+ 'id' => $key . '-analytics-optin',
369
+ 'usage_doc_link' => $usage_doc_link,
370
+ )
371
+ );
372
+ }
373
+ }
374
+
375
+ /**
376
+ * Sanitize Callback Function
377
+ *
378
+ * @param bool $input Option value.
379
+ * @since 1.0.0
380
+ */
381
+ public function sanitize_option( $input ) {
382
+
383
+ if ( ! $input || 'no' === $input ) {
384
+ return 'no';
385
+ }
386
+
387
+ return 'yes';
388
+ }
389
+
390
+ /**
391
+ * Print settings field HTML.
392
+ *
393
+ * @param array $args arguments to field.
394
+ * @since 1.0.0
395
+ */
396
+ public function render_settings_field_html( $args ) {
397
+ ?>
398
+ <fieldset>
399
+ <label for="<?php echo esc_attr( $args['label_for'] ); ?>">
400
+ <input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
401
+ <?php
402
+ /* translators: %s Product title */
403
+ echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'cartflows' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
404
+
405
+ if ( is_multisite() ) {
406
+ esc_html_e( ' This will be applicable for all sites from the network.', 'cartflows' );
407
+ }
408
+ ?>
409
+ </label>
410
+ <?php
411
+ echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'cartflows' ) ) );
412
+ ?>
413
+ </fieldset>
414
+ <?php
415
+ }
416
+
417
+ /**
418
+ * Set analytics installed time in option.
419
+ *
420
+ * @param string $source source of analytics.
421
+ * @return string $time analytics installed time.
422
+ * @since 1.0.0
423
+ */
424
+ private function get_analytics_install_time( $source ) {
425
+
426
+ $time = get_site_option( $source . '_analytics_installed_time' );
427
+
428
+ if ( ! $time ) {
429
+ $time = time();
430
+ update_site_option( $source . '_analytics_installed_time', time() );
431
+ }
432
+
433
+ return $time;
434
+ }
435
+
436
+ /**
437
+ * Schedule/unschedule cron event on updation of option.
438
+ *
439
+ * @param string $old_value old value of option.
440
+ * @param string $value value of option.
441
+ * @param string $option Option name.
442
+ * @since 1.0.0
443
+ */
444
+ public function update_analytics_option_callback( $old_value, $value, $option ) {
445
+ if ( is_multisite() ) {
446
+ $this->add_option_to_network( $option, $value );
447
+ }
448
+ }
449
+
450
+ /**
451
+ * Analytics option add callback.
452
+ *
453
+ * @param string $option Option name.
454
+ * @param string $value value of option.
455
+ * @since 1.0.0
456
+ */
457
+ public function add_analytics_option_callback( $option, $value ) {
458
+ if ( is_multisite() ) {
459
+ $this->add_option_to_network( $option, $value );
460
+ }
461
+ }
462
+
463
+ /**
464
+ * Send analaytics track event if tracking is enabled.
465
+ *
466
+ * @since 1.0.0
467
+ */
468
+ public function maybe_track_analytics() {
469
+
470
+ if ( ! $this->is_tracking_enabled() ) {
471
+ return;
472
+ }
473
+
474
+ $analytics_track = get_site_transient( 'bsf_analytics_track' );
475
+
476
+ // If the last data sent is 2 days old i.e. transient is expired.
477
+ if ( ! $analytics_track ) {
478
+ $this->send();
479
+ set_site_transient( 'bsf_analytics_track', true, 2 * DAY_IN_SECONDS );
480
+ }
481
+ }
482
+
483
+ /**
484
+ * Save analytics option to network.
485
+ *
486
+ * @param string $option name of option.
487
+ * @param string $value value of option.
488
+ * @since 1.0.0
489
+ */
490
+ public function add_option_to_network( $option, $value ) {
491
+
492
+ // If action coming from general settings page.
493
+ if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
494
+
495
+ if ( get_site_option( $option ) ) {
496
+ update_site_option( $option, $value );
497
+ } else {
498
+ add_site_option( $option, $value );
499
+ }
500
+ }
501
+ }
502
+ }
503
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/bsf-analytics/version.json CHANGED
@@ -1 +1,4 @@
1
- 1.0.1
 
 
 
1
+ {
2
+ "bsf-analytics-ver": "1.1.0"
3
+ }
4
+
assets/css/import-rtl.css CHANGED
@@ -903,6 +903,7 @@ html.wcf-popup-open{
903
 
904
  .wcf-popup-close-wrap .close-icon{
905
  cursor: pointer;
 
906
  }
907
 
908
  .wcf-popup-close-wrap .wcf-cartflow-icons{
903
 
904
  .wcf-popup-close-wrap .close-icon{
905
  cursor: pointer;
906
+ margin: 0 12px;
907
  }
908
 
909
  .wcf-popup-close-wrap .wcf-cartflow-icons{
assets/css/import.css CHANGED
@@ -903,6 +903,7 @@ html.wcf-popup-open{
903
 
904
  .wcf-popup-close-wrap .close-icon{
905
  cursor: pointer;
 
906
  }
907
 
908
  .wcf-popup-close-wrap .wcf-cartflow-icons{
903
 
904
  .wcf-popup-close-wrap .close-icon{
905
  cursor: pointer;
906
+ margin: 0 12px;
907
  }
908
 
909
  .wcf-popup-close-wrap .wcf-cartflow-icons{
assets/js/frontend.js CHANGED
@@ -85,7 +85,7 @@
85
  var ga_add_payment_info = cartflows.wcf_ga_active['enable_add_payment_info'];
86
  var ga_purchase_event = cartflows.wcf_ga_active['enable_purchase_event'];
87
  var ga_add_to_cart = cartflows.wcf_ga_active['enable_add_to_cart'];
88
- var cookies = $.cookie('wcf_ga_trans_data');
89
  var is_checkout_page = cartflows.is_checkout_page;
90
 
91
  if( 'disable' === ga_for_other_page ){
@@ -117,8 +117,8 @@
117
  }
118
  }
119
 
120
- if( typeof cookies !== 'undefined' ){
121
- var ga_order_details = jQuery.parseJSON(cookies);
122
 
123
  var purchase_data = {
124
  send_to: google_a_id,
85
  var ga_add_payment_info = cartflows.wcf_ga_active['enable_add_payment_info'];
86
  var ga_purchase_event = cartflows.wcf_ga_active['enable_purchase_event'];
87
  var ga_add_to_cart = cartflows.wcf_ga_active['enable_add_to_cart'];
88
+ var ga_cookies = $.cookie('wcf_ga_trans_data');
89
  var is_checkout_page = cartflows.is_checkout_page;
90
 
91
  if( 'disable' === ga_for_other_page ){
117
  }
118
  }
119
 
120
+ if( typeof ga_cookies !== 'undefined' && ga_cookies != null ){
121
+ var ga_order_details = jQuery.parseJSON(ga_cookies);
122
 
123
  var purchase_data = {
124
  send_to: google_a_id,
assets/min-css/import-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .no-elementor-notice{border-right:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-right:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;right:0;left:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);left:0;right:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:22%;right:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;left:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-right:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:right}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;right:0;left:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 0 0 5px;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;right:0!important;left:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;left:0;bottom:50px;right:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:left}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:right;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1.5em 1em 1em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-left:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;right:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(50%,-40%);-ms-transform:translate(50%,-40%);transform:translate(50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-left:2em;padding-left:0;text-align:left;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px 6px 2px 2px;line-height:25px;width:155px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;left:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;right:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;right:50%;-webkit-transform:translate(50%,-35%);-ms-transform:translate(50%,-35%);transform:translate(50%,-35%);width:70%;min-height:85%;max-height:85%;height:85%;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:right;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}.wcf-templates-popup-content .wcf-templates-wrap{height:100%}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;left:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;right:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-flow-actions{min-height:52px;max-height:55px}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:-webkit-calc(100% - 55px);height:calc(100% - 55px);min-height:-webkit-calc(100% - 55px);min-height:calc(100% - 55px);max-height:-webkit-calc(100% - 55px);max-height:calc(100% - 55px);padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:right;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;left:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-right:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;right:50%;bottom:0;left:0;max-width:100%;max-height:100%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-right:0}#wcf-remote-filters .filter-links li:last-child a{margin-left:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 3px 0 0}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-left:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
1
+ .no-elementor-notice{border-right:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-right:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;right:0;left:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);left:0;right:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:22%;right:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;left:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-right:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:right}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;right:0;left:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 0 0 5px;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;right:0!important;left:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;left:0;bottom:50px;right:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:left}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:right;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1.5em 1em 1em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-left:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;right:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(50%,-40%);-ms-transform:translate(50%,-40%);transform:translate(50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-left:2em;padding-left:0;text-align:left;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px 6px 2px 2px;line-height:25px;width:155px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;left:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;right:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;right:50%;-webkit-transform:translate(50%,-35%);-ms-transform:translate(50%,-35%);transform:translate(50%,-35%);width:70%;min-height:85%;max-height:85%;height:85%;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:right;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}.wcf-templates-popup-content .wcf-templates-wrap{height:100%}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;left:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;right:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-flow-actions{min-height:52px;max-height:55px}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:-webkit-calc(100% - 55px);height:calc(100% - 55px);min-height:-webkit-calc(100% - 55px);min-height:calc(100% - 55px);max-height:-webkit-calc(100% - 55px);max-height:calc(100% - 55px);padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:right;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;left:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-right:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer;margin:0 12px}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;right:50%;bottom:0;left:0;max-width:100%;max-height:100%;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-right:0}#wcf-remote-filters .filter-links li:last-child a{margin-left:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 3px 0 0}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-left:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
assets/min-css/import.min.css CHANGED
@@ -1 +1 @@
1
- .no-elementor-notice{border-left:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-left:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;left:0;right:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);right:0;left:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:22%;left:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;right:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:left}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;left:0;right:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 5px 0 0;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;right:0;bottom:50px;left:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:right}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:left;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1em 1em 1.5em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-right:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;left:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(-50%,-40%);-ms-transform:translate(-50%,-40%);transform:translate(-50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-right:2em;padding-right:0;text-align:right;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px 2px 2px 6px;line-height:25px;width:155px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;right:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;left:50%;-webkit-transform:translate(-50%,-35%);-ms-transform:translate(-50%,-35%);transform:translate(-50%,-35%);width:70%;min-height:85%;max-height:85%;height:85%;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:left;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}.wcf-templates-popup-content .wcf-templates-wrap{height:100%}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;right:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;left:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-flow-actions{min-height:52px;max-height:55px}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:-webkit-calc(100% - 55px);height:calc(100% - 55px);min-height:-webkit-calc(100% - 55px);min-height:calc(100% - 55px);max-height:-webkit-calc(100% - 55px);max-height:calc(100% - 55px);padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:left;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;right:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-left:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;left:50%;bottom:0;right:0;max-width:100%;max-height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-left:0}#wcf-remote-filters .filter-links li:last-child a{margin-right:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 0 0 3px}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-right:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
1
+ .no-elementor-notice{border-left:none;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding-left:0}.no-elementor-notice span{color:#f16334;font-size:18px;vertical-align:middle}.site-preview{background:#c5c5c5;display:block;overflow:hidden;position:relative;-webkit-backface-visibility:hidden}.template.importing .site-preview:after,.template:hover .site-preview:after{opacity:.3}.template.importing .site-preview,.template:hover .site-preview{background:#fff;cursor:pointer}.template .site-preview:after{content:"";background:#fff;opacity:0;top:0;content:"";display:block;top:0;position:absolute;padding-top:66.66666%;-webkit-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;left:0;right:0;bottom:0}.template .notice{padding:.6em;background:rgba(0,0,0,.8);color:#fff;font-weight:400;border:none;font-size:13px;text-decoration:none;position:absolute;width:100%;vertical-align:middle;bottom:0;margin:0;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);right:0;left:0;z-index:4;text-align:center;-webkit-border-radius:3px;border-radius:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;-webkit-font-smoothing:antialiased}.template .notice a{color:#f16334}.template .notice p{padding:0;margin:0}#wcf_create_notice{display:none}.preview:focus,.preview:hover{color:#fff;-webkit-box-shadow:none;box-shadow:none}.preview{text-decoration:none;opacity:0;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);right:22%;left:22%;z-index:4;background:#23282d;background:rgba(0,0,0,.7);color:#fff;font-size:13px;text-shadow:0 1px 0 rgba(0,0,0,.6);-webkit-font-smoothing:antialiased;font-weight:600;padding:10px 12px;text-align:center;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out}.template-id-container{font-size:15px;font-weight:600;margin:0;padding:10px;-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:#fff;background:rgba(255,255,255,.65);position:relative}.template-actions{opacity:0;-webkit-transition:opacity .1s ease-in-out;transition:opacity .1s ease-in-out;position:absolute;bottom:0;right:0;top:0;padding:5px 5px 0 5px;background:rgba(244,244,244,.7);border-left:1px solid rgba(0,0,0,.05)}.template.importing .preview,.template.importing .template-actions,.template:hover .preview,.template:hover .template-actions,.wcf-step-content .template-actions{opacity:1}.wcf-remote-list .template{position:relative;overflow:hidden}.wcf-remote-list h3{margin-bottom:1em;margin-top:0;font-size:15px;font-weight:600;margin:0;padding:0;text-align:left}.wcf-remote-list img{max-width:100%;vertical-align:middle}.wcf-remote-list *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cartflows-steps-list img{width:100%}#cartflows-steps-list .title{font-weight:700;color:#474747;line-height:2;background:#f7f7f7;padding:.5em 1em}#cartflows-steps-list .image-wrap{-webkit-background-size:cover;background-size:cover;overflow:hidden}#cartflows-steps .close{display:inline-block;padding:2em;cursor:pointer}.template-message-block{text-align:center;margin:0 auto;padding:4em 0}.templator #TB_ajaxContent{width:100%!important}.template-message-block .description{font-style:normal}.template-message-block .spinner{float:none;margin:0}.cartflows-steps-popup{position:fixed;left:0;right:0;top:0;bottom:0;z-index:99999;background:#fff;overflow-y:scroll}.cartflows-steps-popup .notice{max-width:700px;margin:0 auto}.cartflows-load-steps-library .dashicons{height:auto;width:auto;line-height:normal;margin:0 5px 0 0;vertical-align:initial;font-size:100%}.cartflows-load-steps .dashicons{vertical-align:text-bottom}#TB_window{width:100%!important;margin:0 auto!important;text-align:center!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important}#TB_iframeContent{width:100%!important;height:100%!important}@media only screen and (min-device-width :320px) and (max-device-width :1024px){#TB_iframeContent-wrapper{position:fixed;right:0;bottom:50px;left:0;top:0;overflow-y:scroll;-webkit-overflow-scrolling:touch}}#TB_window #TB_ajaxWindowTitle{font-size:1.2rem;display:inline-block;width:auto;padding:0}#TB_window #TB_closeWindowButton{position:relative}.tb-close-icon:before{vertical-align:middle}#TB_window{text-align:center}#TB_iframeContent.tablet{width:768px!important;height:1024px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.tablet.landscape{width:1024px!important}#TB_iframeContent.mobile{width:360px!important;height:640px!important;background:#111;padding:40px 10px 70px;-webkit-border-radius:30px;border-radius:30px}#TB_iframeContent.mobile.landscape{width:360px!important}#TB_closeAjaxWindow{float:right}#TB_window.thickbox-loading{margin:0!important}div#TB_window{background-color:#fff}#TB_window #TB_title{color:#0a0c0d;text-align:left;bottom:0;-webkit-box-shadow:none;box-shadow:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;padding:1em 1em 1em 1.5em}@media all and (min-width:769px){#TB_window #TB_title{-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}}#TB_window.mobile,#TB_window.tablet{overflow-y:scroll}.top #TB_iframeContent-wrapper{bottom:0;top:80px}#TB_window.top #TB_title{top:0}#TB_window #TB_closeWindowButton:focus .tb-close-icon{-webkit-box-shadow:none;box-shadow:none;color:#666}@media all and (max-width:768px){#TB_closeAjaxWindow{padding-right:0}#TB_window #TB_closeWindowButton,#TB_window .tb-close-icon{width:80px}}.responsive-view .dashicons{color:#ddd}.responsive-view .active{color:#111}.responsive-view a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#TB_window.mobile #TB_iframeContent,#TB_window.tablet #TB_iframeContent{margin-bottom:50px;margin-top:50px}.responsive-view a{color:#666;cursor:pointer;display:inline-block;padding:1em;vertical-align:middle;text-decoration:none}#TB_closeAjaxWindow .tb-close-icon{position:relative}.site-loading{display:none;position:absolute;left:50%;top:50%;text-align:center;color:#555;-webkit-transform:translate(-50%,-40%);-ms-transform:translate(-50%,-40%);transform:translate(-50%,-40%)}.top .site-loading{top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.site-loading h3{font-size:33px;font-weight:600;margin:0 0 .8em 0}.site-loading p{margin:0}.cartflows-thickbox-loading .site-loading{display:block}.cartflows-thickbox-loading #TB_iframeContent,.cartflows-thickbox-loading #TB_iframeContent-wrapper{display:none}.wcf-remote-list:after,.wcf-remote-list:before{content:"";display:table}.wcf-remote-list::after{content:"";display:table;clear:both}.wcf-template-header .filter-count{line-height:normal}#wcf-page-builders{display:none}#wcf-remote-flow-filters>div,#wcf-remote-step-filters>div{display:inline-block}.wcf-template-header .filter-links{margin:0;padding:0}.wcf-template-header li:focus{outline:0}.wcf-template-header .filter-links li{margin:0;display:inline-block}.wcf-template-header .filter-links li a:focus,.wcf-template-header .filter-links li a:hove{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-template-header .filter-links li .current{color:#000;border-bottom:2px solid #f16334;font-weight:600}.wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8}.wcf-search-form{margin-right:2em;padding-right:0;text-align:right;margin-top:1em;margin-bottom:1em;position:relative}.wcf-template-notice{display:none}#wcf-start-from-scratch{text-align:center}#wcf-start-from-scratch .inner{background:0 0;-webkit-box-shadow:none;box-shadow:none;width:94%;margin:0 auto;float:none;position:absolute;top:40%}#wcf-scratch-steps-categories{display:inline-block}#wcf-scratch-steps-categories select{-webkit-border-radius:0;border-radius:0;height:29px;border:1px solid;border-color:#9e9e9e;border-width:1px;-webkit-box-shadow:none;box-shadow:none;padding:2px 2px 2px 6px;line-height:25px;width:155px}#wcf-start-from-scratch .description{margin-bottom:2em}#wcf-remote-step-importer .wcf-search-form{display:none}.wcf-search-form .wcf-flow-search-input{border:none;-webkit-box-shadow:none;box-shadow:none;border-bottom:1px solid #eee;line-height:1.8;background:0 0;border-bottom:1px solid #ccc;font-size:1em}.wcf-search-form .wcf-flow-search-input:focus{-webkit-box-shadow:none;box-shadow:none;border-color:#ccc}.cartflows-preview-flow-steps li{display:inline-block;margin:0 1em;position:relative}.cartflows-flow-import-blank.updating-message:before{vertical-align:text-bottom}#wpwrap .cartflows-step-loading h2,#wpwrap .template-message-block h2{font-size:1.5em;margin:0 0 .5em 0;padding:8px 12px;line-height:1.4}#wpwrap .cartflows-step-loading p,#wpwrap .template-message-block p{font-size:1.2em}#wpwrap .cartflows-step-loading .spinner{vertical-align:initial}.wcf-flow-type{position:absolute;right:0;top:0;padding:3px 10px;color:#fff}.wcf-flow-type.pro{background:#f06262}.wcf-templates-popup-overlay{position:fixed;height:100%;width:100%;top:0;left:0;background:rgba(0,0,0,.7);-webkit-transition:opacity .5s;transition:opacity .5s;visibility:hidden;opacity:0;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:none;transition:none}.wcf-templates-popup-overlay.open{visibility:visible;opacity:1;z-index:9999}.wcf-templates-popup-content{max-width:1200px;background-color:#fff;position:absolute;-webkit-border-radius:3px;border-radius:3px;top:40%;left:50%;-webkit-transform:translate(-50%,-35%);-ms-transform:translate(-50%,-35%);transform:translate(-50%,-35%);width:70%;min-height:85%;max-height:85%;height:85%;overflow:hidden}.wcf-templates-popup-content .inner{background:#fff;position:relative;padding:8px 8px 0 8px;display:block;float:left;margin:15px;text-align:center;-webkit-box-shadow:0 0 5px 1px rgba(204,204,204,.3);box-shadow:0 0 5px 1px rgba(204,204,204,.3)}.wcf-templates-popup-content .wcf-templates-wrap{height:100%}@media only screen and (max-width:480px){.wcf-templates-popup-content{width:90%}.wcf-template-header{display:block!important;padding:15px 15px 0 15px!important}.wcf-popup-close-wrap{position:absolute;top:10px;right:5px}}@media only screen and (min-width:768px){.wcf-templates-popup-content .inner{width:-webkit-calc(25% - 30px);width:calc(25% - 30px)}}html.wcf-popup-open{overflow:hidden}.wcf-button-wrap{margin-top:0;position:absolute;top:10px;left:110px}.wcf-steps-loading #wcf-remote-step-list{display:none!important}#wcf-remote-flow-actions{min-height:52px;max-height:55px}#wcf-remote-content{background-color:#f5f5f5;overflow-y:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:-webkit-calc(100% - 55px);height:calc(100% - 55px);min-height:-webkit-calc(100% - 55px);min-height:calc(100% - 55px);max-height:-webkit-calc(100% - 55px);max-height:calc(100% - 55px);padding:20px 20px 20px 20px;clear:both}#wcf-remote-content #wcf-start-from-scratch h1{font-size:23px;font-weight:400;margin:0 0 1em 0;padding:9px 0 4px;line-height:29px}.wcf-template-list-wrap .template-name{margin:0;text-align:left;font-size:13px}.wcf-template-list-wrap img{width:100%;vertical-align:middle}.wcf-templates-popup-content .template{margin:0;position:relative;overflow:hidden}.wcf-tab.nav-tabs{overflow:hidden;margin:0}.wcf-template-header{-moz-box-align:center;align-items:center;background:#fff;-webkit-box-shadow:0 0 8px rgba(0,0,0,.2);box-shadow:0 0 8px rgba(0,0,0,.2);-js-display:flex;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;-moz-box-pack:justify;justify-content:space-between;padding:0 15px;min-height:50px}.wcf-search-form:after{content:"\f179";display:inline-block;font-family:dashicons;text-decoration:inherit;font-weight:400;font-style:normal;text-align:center;-webkit-transition:color .1s ease-in 0;transition:color .1s ease-in 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:absolute;right:.5em;top:.5em;color:#81868a}.wcf-template-logo-wrap{font-size:16px;font-weight:600;text-align:center}.wcf-template-logo-wrap .wcf-cartflows-logo-img{vertical-align:middle}.wcf-tab.nav-tabs:before{display:table;content:""}.wcf-tab.nav-tabs:after{clear:both}.wcf-tab.nav-tabs>li{display:inline-block;padding:15px 0;margin:0;font-weight:400}.wcf-tab.nav-tabs>li.active{border-bottom:3px solid #f16334;font-weight:600}.wcf-template-header .filter-links li>a{border-color:transparent;margin:0}.wcf-tab.nav-tabs>li:active,.wcf-tab.nav-tabs>li:focus,.wcf-tab.nav-tabs>li>a:focus,.wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li:focus .wcf-template-header .filter-links>li:active,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{outline:0;-webkit-box-shadow:none;box-shadow:none}.wcf-tab.nav-tabs>li>a,.wcf-template-header .filter-links>li>a,.wcf-template-header .filter-links>li>a:focus,.wcf-template-header .filter-links>li>a:hover{padding:15px;color:#555;text-decoration:none}.wcf-nav-section-content{display:none}.wcf-nav-section-content.active{display:block;overflow:hidden}.wcf-popup-close-wrap{width:35px;text-align:center;border-left:1px #eee solid}.wcf-popup-close-wrap .close-icon{cursor:pointer;margin:0 12px}.wcf-popup-close-wrap .wcf-cartflow-icons{pointer-events:none;font-size:20px;height:20px;width:20px;line-height:20px;opacity:.7}.wcf-popup-close-wrap .close-icon:hover .wcf-cartflow-icons{opacity:1}.wcf-templates-popup-content .spinner{position:absolute;top:50%;left:50%;bottom:0;right:0;max-width:100%;max-height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);z-index:99999}.wcf-templates-popup-content .wcf-template-header .wcf-tab-wrapper{margin:0 auto}#wcf-upcoming-page-builders .description{font-size:1rem;margin:4em 0 0 0;text-align:center}.flow-type-filter-links{display:none}#wcf-remote-filters{padding:0 15px}#wcf-remote-filters a{text-decoration:none}#wcf-remote-filters .filter-links li:focus,#wcf-remote-filters a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-filters .filter-links li a{border-bottom:none}#wcf-remote-filters .filter-links li:first-child a{margin-left:0}#wcf-remote-filters .filter-links li:last-child a{margin-right:0}#wcf-remote-filters .filter-links li .current,#wcf-remote-filters .filter-links li a:focus,#wcf-remote-filters .filter-links li a:hover{color:#f16334}.wrap .wcf-page-builder-notice .notice{margin:5px 15px}#wcf-api-notice-block{text-align:center;margin-top:5em}.wcf-templates-popup-overlay a{-webkit-transition:none;transition:none}.wcf-notice-wrap .notice{display:inline-block}.wcf-learn-how i{font-size:1rem;vertical-align:middle}.wcf-learn-how a{text-decoration:none}#wcf-remote-content .wcf-install-plugin::focus{border-color:none;-webkit-box-shadow:none;box-shadow:none}#wcf-remote-content .wcf-install-plugin.updating-message{background:0 0;padding:0;font-size:1rem;-webkit-box-shadow:none;box-shadow:none;border:none;margin:0 0 0 3px}.wcf-page-builder-message{margin:5em auto 0 auto;width:700px}.wcf-page-builder-message p{font-size:1rem}.wcf-page-builder-message i{font-size:1rem;vertical-align:middle}.wcf-page-builder-message a{text-decoration:none;margin:1.5em 0 0 0}.cartflows-ie .postbox{padding:1em}.cartflows-ie{padding-top:2em;padding-right:2em}.admin_page_flow_exporter .notice,.admin_page_flow_importer .notice{margin:1em 0 0 0}.cartflows-website-unreachable{padding:1em 2em}.wcf-notice-wrap{margin-top:20px;font-size:15px;color:red}.wcf-activate-wc{text-decoration:none}.wcf-activate-wc.button{border:none;-webkit-box-shadow:none;box-shadow:none}.wcf-hidden{display:none}
assets/min-js/frontend.min.js CHANGED
@@ -1 +1 @@
1
- !function(w){w(document).on("click",'a[href*="wcf-next-step"]',function(e){if(e.preventDefault(),void 0===cartflows.is_pb_preview||"1"!=cartflows.is_pb_preview)return window.location.href=cartflows.next_step,!1;e.stopPropagation()}),w(document).on("click",".wcf-next-step-link",function(e){if(void 0!==cartflows.is_pb_preview&&"1"==cartflows.is_pb_preview)return e.preventDefault(),e.stopPropagation(),!1});w(document).ready(function(e){var a=e('a[href*="wcf-next-step"]');0<a.length&&void 0!==cartflows.next_step&&(a.addClass("wcf-next-step-link"),a.attr("href",cartflows.next_step)),function(){if("OceanWP"===cartflows.current_theme&&"default"!==cartflows.page_template){var e=document.getElementById("oceanwp-style-css");null!=e&&e.remove()}}(),"1"!==cartflows.is_pb_preview&&(function(){if("enable"===cartflows.fb_active.facebook_pixel_tracking&&""!=cartflows.fb_active.facebook_pixel_id){var e=cartflows.fb_active.facebook_pixel_id,a=cartflows.fb_active.facebook_pixel_initiate_checkout,t=cartflows.fb_active.facebook_pixel_purchase_complete,c=cartflows.fb_active.facebook_pixel_add_payment_info,o=(cartflows.fb_active.facebook_pixel_tracking_for_site,cartflows.is_checkout_page);if(fbq("init",e),fbq("track","PageView",{plugin:"CartFlows"}),"enable"===a&&"1"===o&&(fbq("track","AddToCart",cartflows.params),fbq("track","InitiateCheckout",cartflows.params)),"enable"===t){var n=w.cookie("wcf_order_details");void 0!==n&&(fbq("track","Purchase",jQuery.parseJSON(n)),w.removeCookie("wcf_order_details",{path:"/"}))}"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){var e=cartflows.params;fbq("track","AddPaymentInfo",e)})}}(),function(){if("enable"===cartflows.wcf_ga_active.enable_google_analytics){var e=cartflows.wcf_ga_active.google_analytics_id,a=cartflows.wcf_ga_active.enable_google_analytics_for_site,t=cartflows.wcf_ga_active.enable_begin_checkout,c=cartflows.wcf_ga_active.enable_add_payment_info,o=cartflows.wcf_ga_active.enable_purchase_event,n=cartflows.wcf_ga_active.enable_add_to_cart,i=w.cookie("wcf_ga_trans_data"),r=cartflows.is_checkout_page;if("disable"===a&&gtag("event","page_view",{send_to:e,non_interaction:!0}),"1"===r){var _=cartflows.ga_param,f={send_to:e,event_category:"ecommerce",items:_,non_interaction:!0};"enable"===t&&gtag("event","begin_checkout",f),"enable"===n&&gtag("event","add_to_cart",f),"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){gtag("event","add_payment_info",{send_to:e,non_interaction:!0})})}if(void 0!==i){var s=jQuery.parseJSON(i),l={send_to:e,event_category:"ecommerce",transaction_id:s.transaction_id,value:s.value,currency:s.currency,shipping:s.shipping,tax:s.tax,items:s.items,non_interaction:!0};"enable"===o&&(gtag("event","purchase",l),w.removeCookie("wcf_ga_trans_data",{path:"/"}))}}}())})}(jQuery);
1
+ !function(w){w(document).on("click",'a[href*="wcf-next-step"]',function(e){if(e.preventDefault(),void 0===cartflows.is_pb_preview||"1"!=cartflows.is_pb_preview)return window.location.href=cartflows.next_step,!1;e.stopPropagation()}),w(document).on("click",".wcf-next-step-link",function(e){if(void 0!==cartflows.is_pb_preview&&"1"==cartflows.is_pb_preview)return e.preventDefault(),e.stopPropagation(),!1});w(document).ready(function(e){var a=e('a[href*="wcf-next-step"]');0<a.length&&void 0!==cartflows.next_step&&(a.addClass("wcf-next-step-link"),a.attr("href",cartflows.next_step)),function(){if("OceanWP"===cartflows.current_theme&&"default"!==cartflows.page_template){var e=document.getElementById("oceanwp-style-css");null!=e&&e.remove()}}(),"1"!==cartflows.is_pb_preview&&(function(){if("enable"===cartflows.fb_active.facebook_pixel_tracking&&""!=cartflows.fb_active.facebook_pixel_id){var e=cartflows.fb_active.facebook_pixel_id,a=cartflows.fb_active.facebook_pixel_initiate_checkout,t=cartflows.fb_active.facebook_pixel_purchase_complete,c=cartflows.fb_active.facebook_pixel_add_payment_info,o=(cartflows.fb_active.facebook_pixel_tracking_for_site,cartflows.is_checkout_page);if(fbq("init",e),fbq("track","PageView",{plugin:"CartFlows"}),"enable"===a&&"1"===o&&(fbq("track","AddToCart",cartflows.params),fbq("track","InitiateCheckout",cartflows.params)),"enable"===t){var n=w.cookie("wcf_order_details");void 0!==n&&(fbq("track","Purchase",jQuery.parseJSON(n)),w.removeCookie("wcf_order_details",{path:"/"}))}"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){var e=cartflows.params;fbq("track","AddPaymentInfo",e)})}}(),function(){if("enable"===cartflows.wcf_ga_active.enable_google_analytics){var e=cartflows.wcf_ga_active.google_analytics_id,a=cartflows.wcf_ga_active.enable_google_analytics_for_site,t=cartflows.wcf_ga_active.enable_begin_checkout,c=cartflows.wcf_ga_active.enable_add_payment_info,o=cartflows.wcf_ga_active.enable_purchase_event,n=cartflows.wcf_ga_active.enable_add_to_cart,i=w.cookie("wcf_ga_trans_data"),r=cartflows.is_checkout_page;if("disable"===a&&gtag("event","page_view",{send_to:e,non_interaction:!0}),"1"===r){var _=cartflows.ga_param,f={send_to:e,event_category:"ecommerce",items:_,non_interaction:!0};"enable"===t&&gtag("event","begin_checkout",f),"enable"===n&&gtag("event","add_to_cart",f),"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){gtag("event","add_payment_info",{send_to:e,non_interaction:!0})})}if(void 0!==i&&null!=i){var s=jQuery.parseJSON(i),l={send_to:e,event_category:"ecommerce",transaction_id:s.transaction_id,value:s.value,currency:s.currency,shipping:s.shipping,tax:s.tax,items:s.items,non_interaction:!0};"enable"===o&&(gtag("event","purchase",l),w.removeCookie("wcf_ga_trans_data",{path:"/"}))}}}())})}(jQuery);
cartflows.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- /**
3
- * Plugin Name: CartFlows
4
- * Plugin URI: https://cartflows.com/
5
- * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.5.14
7
- * Author: CartFlows Inc
8
- * Author URI: https://cartflows.com/
9
- * Text Domain: cartflows
10
- * WC requires at least: 3.0
11
- * WC tested up to: 4.3
12
- *
13
- * @package CartFlows
14
- */
15
-
16
- /**
17
- * Set constants.
18
- */
19
- define( 'CARTFLOWS_FILE', __FILE__ );
20
-
21
- /**
22
- * Loader
23
- */
24
- require_once 'classes/class-cartflows-loader.php';
1
+ <?php
2
+ /**
3
+ * Plugin Name: CartFlows
4
+ * Plugin URI: https://cartflows.com/
5
+ * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.5.15
7
+ * Author: CartFlows Inc
8
+ * Author URI: https://cartflows.com/
9
+ * Text Domain: cartflows
10
+ * WC requires at least: 3.0
11
+ * WC tested up to: 4.3
12
+ *
13
+ * @package CartFlows
14
+ */
15
+
16
+ /**
17
+ * Set constants.
18
+ */
19
+ define( 'CARTFLOWS_FILE', __FILE__ );
20
+
21
+ /**
22
+ * Loader
23
+ */
24
+ require_once 'classes/class-cartflows-loader.php';
changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  Version 1.5.14 - Thursday, 30th July 2020
2
  - Fix: Not able to search & select the course type of product.
3
 
1
+ Version 1.5.15 - Wednesday, 12th August 2020
2
+ - Improvement: Added Split Testing compatibility for a future release of CartFlows Pro.
3
+ - Improvement: Added WordPress 5.5 Compatibility.
4
+ - Fix: Product discount price & percentage options were not working if the full discount is applied.
5
+ - Fix: Account already exists error message on the Optin step.
6
+
7
  Version 1.5.14 - Thursday, 30th July 2020
8
  - Fix: Not able to search & select the course type of product.
9
 
classes/class-cartflows-admin.php CHANGED
@@ -1,657 +1,713 @@
1
- <?php
2
- /**
3
- * CartFlows Admin.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Admin.
10
- */
11
- class Cartflows_Admin {
12
-
13
- /**
14
- * Calls on initialization
15
- *
16
- * @since 1.0.0
17
- */
18
- public static function init() {
19
-
20
- self::initialise_plugin();
21
- self::init_hooks();
22
- }
23
-
24
- /**
25
- * Init Hooks.
26
- *
27
- * @since 1.0.0
28
- * @return void
29
- */
30
- public static function init_hooks() {
31
-
32
- if ( ! is_admin() ) {
33
- return;
34
- }
35
-
36
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin-fields.php';
37
-
38
- /*
39
- Add CARTFLOWS menu option to admin.
40
- add_action( 'network_admin_menu', __CLASS__ . '::menu' );
41
- */
42
- add_action( 'admin_menu', __CLASS__ . '::menu' );
43
- add_action( 'admin_menu', __CLASS__ . '::submenu', 999 );
44
-
45
- add_action( 'cartflows_render_admin_content', __CLASS__ . '::render_content' );
46
-
47
- add_action( 'admin_init', __CLASS__ . '::settings_admin_scripts' );
48
-
49
- /* Global Addmin Script */
50
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::global_admin_scripts', 20 );
51
-
52
- add_action( 'admin_footer', __CLASS__ . '::global_admin_data', 9555 );
53
-
54
- /* Add lite version class to body */
55
- add_action( 'admin_body_class', __CLASS__ . '::add_admin_body_class' );
56
-
57
- add_filter( 'plugin_action_links_' . CARTFLOWS_BASE, __CLASS__ . '::add_action_links' );
58
-
59
- add_action( 'admin_init', __CLASS__ . '::cartflows_after_save_permalinks' );
60
-
61
- }
62
-
63
- /**
64
- * After save of permalinks.
65
- */
66
- public static function cartflows_after_save_permalinks() {
67
-
68
- $has_saved_permalinks = get_option( 'cartflows_permalink_saved' );
69
- if ( $has_saved_permalinks ) {
70
- flush_rewrite_rules();
71
- delete_option( 'cartflows_permalink_saved' );
72
- }
73
- }
74
-
75
-
76
- /**
77
- * Initialize after Cartflows pro get loaded.
78
- */
79
- public static function settings_admin_scripts() {
80
- // Enqueue admin scripts.
81
- if ( isset( $_GET['page'] ) && false !== strpos( $_GET['page'], 'cartflows_' ) ) { //phpcs:ignore
82
- add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
83
-
84
- self::save_settings();
85
- }
86
- }
87
- /**
88
- * Show action on plugin page.
89
- *
90
- * @param array $links links.
91
- * @return array
92
- */
93
- public static function add_action_links( $links ) {
94
- $mylinks = array(
95
- '<a href="' . admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS ) . '">Settings</a>',
96
- '<a target="_blank" href="' . esc_url( 'https://cartflows.com/docs' ) . '">Docs</a>',
97
- );
98
-
99
- if ( ! _is_cartflows_pro() ) {
100
- array_push( $mylinks, '<a style="color: #39b54a; font-weight: bold;" target="_blank" href="' . esc_url( 'https://cartflows.com/pricing/' ) . '"> Go Pro </a>' );
101
- }
102
-
103
- return array_merge( $links, $mylinks );
104
- }
105
-
106
- /**
107
- * Initialises the Plugin Name.
108
- *
109
- * @since 1.0.0
110
- * @return void
111
- */
112
- public static function initialise_plugin() {
113
-
114
- $name = 'Cartflows';
115
- $short_name = 'Cflows';
116
-
117
- define( 'CARTFLOWS_PLUGIN_NAME', $name );
118
- define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
119
- }
120
-
121
- /**
122
- * Renders the admin settings menu.
123
- *
124
- * @since 1.0.0
125
- * @return void
126
- */
127
- public static function menu() {
128
-
129
- if ( ! current_user_can( 'manage_options' ) ) {
130
- return;
131
- }
132
-
133
- add_menu_page(
134
- 'CartFlows',
135
- 'CartFlows',
136
- 'manage_options',
137
- CARTFLOWS_SLUG,
138
- __CLASS__ . '::render',
139
- 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),//phpcs:ignore
140
- 39.7
141
- );
142
-
143
- }
144
-
145
- /**
146
- * Add submenu to admin menu.
147
- *
148
- * @since 1.0.0
149
- */
150
- public static function submenu() {
151
-
152
- $parent_slug = CARTFLOWS_SLUG;
153
- $page_title = __( 'Settings', 'cartflows' );
154
- $menu_title = __( 'Settings', 'cartflows' );
155
- $capability = 'manage_options';
156
- $menu_slug = 'cartflows_settings';
157
- $callback = __CLASS__ . '::render';
158
-
159
- add_submenu_page(
160
- $parent_slug,
161
- $page_title,
162
- $menu_title,
163
- $capability,
164
- $menu_slug,
165
- $callback
166
- );
167
- }
168
-
169
- /**
170
- * Renders the admin settings.
171
- *
172
- * @since 1.0.0
173
- * @return void
174
- */
175
- public static function render() {
176
- $menu_page_slug = ( isset( $_GET['page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : CARTFLOWS_SETTINGS; //phpcs:ignore
177
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
178
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
179
- $action = str_replace( '_', '-', $action );
180
-
181
- // Enable header icon filter below.
182
- $header_wrapper_class = apply_filters( 'cartflows_admin_header_wrapper_class', array( $action, $menu_page_slug ) );
183
-
184
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
185
- }
186
-
187
- /**
188
- * Renders the admin settings content.
189
- *
190
- * @since 1.0.0
191
- * @param sting $menu_page_slug current page name.
192
- *
193
- * @return void
194
- */
195
- public static function render_content( $menu_page_slug ) {
196
-
197
- if ( CARTFLOWS_SETTINGS === $menu_page_slug ) {
198
-
199
- $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
200
- $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
201
- $action = str_replace( '_', '-', $action );
202
- $action = 'general';
203
-
204
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
205
- }
206
- }
207
-
208
- /**
209
- * Save Global Setting options.
210
- *
211
- * @since 1.0.0
212
- */
213
- public static function save_common_settings() {
214
-
215
- if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-common-settings-nonce'] ) ), 'cartflows-common-settings' ) ) {
216
-
217
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
218
- $new_settings = array();
219
-
220
- if ( isset( $_POST['_cartflows_common'] ) ) {
221
- // Loop through the input and sanitize each of the values.
222
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_common'] ) ); //phpcs:ignore
223
- }
224
-
225
- Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, false );
226
-
227
- $query = array(
228
- 'message' => 'saved',
229
- );
230
-
231
- $redirect_to = add_query_arg( $query, $url );
232
-
233
- wp_safe_redirect( $redirect_to );
234
- exit;
235
- } // End if statement.
236
- }
237
-
238
- /**
239
- * Save Debug Setting options.
240
- *
241
- * @since 1.1.14
242
- */
243
- public static function save_debug_settings() {
244
-
245
- if ( isset( $_POST['cartflows-debug-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-debug-settings-nonce'] ) ), 'cartflows-debug-settings' ) ) {
246
-
247
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
248
- $new_settings = array();
249
-
250
- if ( isset( $_POST['_cartflows_debug_data'] ) ) {
251
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_debug_data'] ) ); //phpcs:ignore
252
- }
253
-
254
- Cartflows_Helper::update_admin_settings_option( '_cartflows_debug_data', $new_settings, false );
255
-
256
- $query = array(
257
- 'message' => 'saved',
258
- );
259
-
260
- $redirect_to = add_query_arg( $query, $url );
261
-
262
- wp_safe_redirect( $redirect_to );
263
- exit;
264
-
265
- }
266
- }
267
-
268
-
269
- /**
270
- * Save permalink Setting options.
271
- *
272
- * @since 1.1.14
273
- */
274
- public static function save_permalink_settings() {
275
-
276
- if ( isset( $_POST['cartflows-permalink-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-permalink-settings-nonce'] ) ), 'cartflows-permalink-settings' ) ) {
277
-
278
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
279
- $new_settings = array();
280
-
281
- if ( isset( $_POST['reset'] ) ) {
282
- $_POST['_cartflows_permalink'] = array(
283
- 'permalink' => CARTFLOWS_STEP_POST_TYPE,
284
- 'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
285
- 'permalink_structure' => '',
286
- );
287
-
288
- }
289
-
290
- if ( isset( $_POST['_cartflows_permalink'] ) ) {
291
- $cartflows_permalink_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_permalink'] ) ); //phpcs:ignore
292
-
293
- if ( empty( $cartflows_permalink_settings['permalink'] ) ) {
294
- $new_settings['permalink'] = CARTFLOWS_STEP_POST_TYPE;
295
- } else {
296
- $new_settings['permalink'] = $cartflows_permalink_settings['permalink'];
297
- }
298
-
299
- if ( empty( $cartflows_permalink_settings['permalink_flow_base'] ) ) {
300
- $new_settings['permalink_flow_base'] = CARTFLOWS_FLOW_POST_TYPE;
301
- } else {
302
- $new_settings['permalink_flow_base'] = $cartflows_permalink_settings['permalink_flow_base'];
303
- }
304
-
305
- $new_settings['permalink_structure'] = $cartflows_permalink_settings['permalink_structure'];
306
-
307
- }
308
-
309
- Cartflows_Helper::update_admin_settings_option( '_cartflows_permalink', $new_settings, false );
310
-
311
- $query = array(
312
- 'message' => 'saved',
313
- );
314
-
315
- $redirect_to = add_query_arg( $query, $url );
316
-
317
- update_option( 'cartflows_permalink_saved', true );
318
-
319
- wp_safe_redirect( $redirect_to );
320
- exit;
321
-
322
- }
323
- }
324
-
325
- /**
326
- * Save google analytics Setting options.
327
- *
328
- * @since 1.1.14
329
- */
330
- public static function save_google_analytics_settings() {
331
-
332
- if ( isset( $_POST['cartflows-google-analytics-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-google-analytics-settings-nonce'] ) ), 'cartflows-google-analytics-settings' ) ) {
333
-
334
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
335
- $new_settings = array();
336
-
337
- if ( isset( $_POST['_cartflows_google_analytics'] ) ) {
338
- $new_settings = self::sanitize_form_inputs( $_POST['_cartflows_google_analytics'] ); //phpcs:ignore
339
-
340
- }
341
-
342
- Cartflows_Helper::update_admin_settings_option( '_cartflows_google_analytics', $new_settings, true );
343
-
344
- $query = array(
345
- 'message' => 'saved',
346
- );
347
-
348
- $redirect_to = add_query_arg( $query, $url );
349
-
350
- wp_safe_redirect( $redirect_to );
351
- exit;
352
-
353
- }
354
- }
355
-
356
- /**
357
- * Loop through the input and sanitize each of the values.
358
- *
359
- * @param array $input_settings input settings.
360
- * @return array
361
- */
362
- public static function sanitize_form_inputs( $input_settings = array() ) {
363
- $new_settings = array();
364
- foreach ( $input_settings as $key => $val ) {
365
-
366
- if ( is_array( $val ) ) {
367
- foreach ( $val as $k => $v ) {
368
- $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
369
- }
370
- } else {
371
- $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
372
- }
373
- }
374
- return $new_settings;
375
- }
376
-
377
- /**
378
- * Check is cartflows admin.
379
- *
380
- * @since 1.0.0
381
- * @return boolean
382
- */
383
- public static function is_global_admin() {
384
-
385
- $current_screen = get_current_screen();
386
-
387
- if (
388
- is_object( $current_screen ) &&
389
- isset( $current_screen->post_type ) &&
390
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
391
- CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
392
- )
393
- ) {
394
- return true;
395
- }
396
- return false;
397
- }
398
-
399
- /**
400
- * Check is flow admin.
401
- *
402
- * @since 1.0.0
403
- * @return boolean
404
- */
405
- public static function is_flow_edit_admin() {
406
-
407
- $current_screen = get_current_screen();
408
-
409
- if (
410
- is_object( $current_screen ) &&
411
- isset( $current_screen->post_type ) &&
412
- ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
413
- isset( $current_screen->base ) &&
414
- ( 'post' === $current_screen->base )
415
- ) {
416
- return true;
417
- }
418
- return false;
419
- }
420
-
421
- /**
422
- * Global Admin Scripts.
423
- *
424
- * @since 1.0.0
425
- */
426
- public static function global_admin_scripts() {
427
-
428
- $installed_plugins = get_plugins();
429
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? true : false;
430
- $edit_test_mode = filter_input( INPUT_GET, 'edit_test_mode', FILTER_SANITIZE_STRING );
431
- $edit_test_mode = 'yes' === $edit_test_mode ? true : false;
432
-
433
- $localize = array(
434
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
435
- 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
436
- 'wc_status' => array(
437
- 'installed' => $is_wc_installed,
438
- 'active' => wcf()->is_woo_active,
439
- ),
440
- 'wc_activating_message' => __( 'Installing and activating..', 'cartflows' ),
441
- 'wc_install_error' => __( 'There was an error with the installation of plugin.', 'cartflows' ),
442
- 'wcf_edit_test_mode' => $edit_test_mode,
443
- );
444
-
445
- wp_localize_script( 'jquery', 'cartflows_admin', apply_filters( 'cartflows_admin_js_localize', $localize ) );
446
-
447
- if ( self::is_global_admin() ) {
448
-
449
- // Styles.
450
- wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
451
- wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
452
-
453
- wp_enqueue_script(
454
- 'wcf-global-admin',
455
- CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
456
- array( 'jquery' ),
457
- CARTFLOWS_VER,
458
- true
459
- );
460
-
461
- do_action( 'cartflows_global_admin_scripts' );
462
- }
463
- }
464
-
465
- /**
466
- * Global Admin Data.
467
- *
468
- * @since 1.0.0
469
- */
470
- public static function global_admin_data() {
471
-
472
- $current_screen = get_current_screen();
473
-
474
- if ( ! $current_screen ) {
475
- return;
476
- }
477
-
478
- if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
479
- return;
480
- }
481
-
482
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
483
- ?>
484
-
485
- <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
486
- <div class="wcf-templates-popup-content">
487
- <div class="spinner"></div>
488
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
489
-
490
- <div id="wcf-remote-flow-actions" class="wcf-template-header">
491
- <div class="wcf-template-logo-wrap">
492
- <span class="wcf-cartflows-logo-img">
493
- <span class="cartflows-logo-icon"></span>
494
- </span>
495
- <span class="wcf-cartflows-title"><?php esc_html_e( 'Flows Library', 'cartflows' ); ?></span>
496
- </div>
497
- <div class="wcf-tab-wrapper">
498
- <?php if ( 'other' !== $default_page_builder ) { ?>
499
- <div id="wcf-get-started-steps">
500
- <ul class="filter-links ">
501
- <li>
502
- <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
503
- </li>
504
- <li>
505
- <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
506
- </li>
507
- </ul>
508
- </div>
509
- <?php } ?>
510
- </div>
511
- <div class="wcf-popup-close-wrap">
512
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
513
- </div>
514
- </div>
515
- <!-- <div class="wcf-search-form">
516
- <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
517
- <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
518
- </div> -->
519
-
520
- <div id="wcf-remote-content">
521
- <?php if ( 'other' !== $default_page_builder ) { ?>
522
- <div id="wcf-ready-templates">
523
- <div id="wcf-remote-filters">
524
- <div id="wcf-page-builders"></div>
525
- <div id="wcf-categories"></div>
526
- </div>
527
- <div class="wcf-page-builder-notice"></div>
528
- <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
529
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
530
- </div>
531
- <?php } ?>
532
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
533
- <div class="inner">
534
- <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php esc_html_e( 'Design Your Flow', 'cartflows' ); ?></a>
535
- <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
536
- </div>
537
- </div>
538
- </div>
539
- </div>
540
- </div>
541
- </div>
542
-
543
- <?php
544
- }
545
-
546
- /**
547
- * Enqueues the needed CSS/JS for the builder's admin settings page.
548
- *
549
- * @since 1.0.0
550
- */
551
- public static function styles_scripts() {
552
-
553
- // Styles.
554
- wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
555
- wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
556
-
557
- // Script.
558
- wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
559
-
560
- $localize = array(
561
- 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
562
- );
563
-
564
- wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
565
-
566
- do_action( 'cartflows_admin_settings_after_enqueue_scripts' );
567
- }
568
-
569
- /**
570
- * Save All admin settings here
571
- */
572
- public static function save_settings() {
573
-
574
- // Only admins can save settings.
575
- if ( ! current_user_can( 'manage_options' ) ) {
576
- return;
577
- }
578
-
579
- self::save_common_settings();
580
- self::save_debug_settings();
581
- self::save_permalink_settings();
582
-
583
- self::save_google_analytics_settings();
584
- self::save_facebook_settings();
585
-
586
- // Let extensions hook into saving.
587
- do_action( 'cartflows_admin_settings_save' );
588
- }
589
-
590
- /**
591
- * Get and return page URL
592
- *
593
- * @param string $menu_slug Menu name.
594
- * @since 1.0.0
595
- * @return string page url
596
- */
597
- public static function get_page_url( $menu_slug ) {
598
-
599
- $parent_page = self::$default_menu_position;
600
-
601
- if ( strpos( $parent_page, '?' ) !== false ) {
602
- $query_var = '&page=' . self::$plugin_slug;
603
- } else {
604
- $query_var = '?page=' . self::$plugin_slug;
605
- }
606
-
607
- $parent_page_url = admin_url( $parent_page . $query_var );
608
-
609
- $url = $parent_page_url . '&action=' . $menu_slug;
610
-
611
- return esc_url( $url );
612
- }
613
-
614
- /**
615
- * Admin body classes.
616
- *
617
- * Body classes to be added to <body> tag in admin page
618
- *
619
- * @param String $classes body classes returned from the filter.
620
- * @return String body classes to be added to <body> tag in admin page
621
- */
622
- public static function add_admin_body_class( $classes ) {
623
-
624
- $classes .= ' cartflows-' . CARTFLOWS_VER;
625
-
626
- return $classes;
627
- }
628
-
629
- /**
630
- * Save Global Setting options.
631
- *
632
- * @since 1.0.0
633
- */
634
- public static function save_facebook_settings() {
635
-
636
- if ( isset( $_POST['cartflows-facebook-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-facebook-settings-nonce'] ) ), 'cartflows-facebook-settings' ) ) {
637
-
638
- $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
639
- $new_settings = array();
640
-
641
- if ( isset( $_POST['_cartflows_facebook'] ) ) {
642
- $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_facebook'] ) ); //phpcs:ignore
643
- }
644
-
645
- Cartflows_Helper::update_admin_settings_option( '_cartflows_facebook', $new_settings, false );
646
- $query = array(
647
- 'message' => 'saved',
648
- );
649
- $redirect_to = add_query_arg( $query, $url );
650
- wp_safe_redirect( $redirect_to );
651
- exit;
652
- }
653
- }
654
-
655
- }
656
-
657
- Cartflows_Admin::init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Admin.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Admin.
10
+ */
11
+ class Cartflows_Admin {
12
+
13
+ /**
14
+ * Calls on initialization
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ public static function init() {
19
+
20
+ self::initialise_plugin();
21
+ self::init_hooks();
22
+ }
23
+
24
+ /**
25
+ * Init Hooks.
26
+ *
27
+ * @since 1.0.0
28
+ * @return void
29
+ */
30
+ public static function init_hooks() {
31
+
32
+ if ( ! is_admin() ) {
33
+ return;
34
+ }
35
+
36
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin-fields.php';
37
+
38
+ /*
39
+ Add CARTFLOWS menu option to admin.
40
+ add_action( 'network_admin_menu', __CLASS__ . '::menu' );
41
+ */
42
+ add_action( 'admin_menu', __CLASS__ . '::menu' );
43
+ add_action( 'admin_menu', __CLASS__ . '::submenu', 999 );
44
+
45
+ add_action( 'cartflows_render_admin_content', __CLASS__ . '::render_content' );
46
+
47
+ add_action( 'admin_init', __CLASS__ . '::settings_admin_scripts' );
48
+
49
+ /* Global Addmin Script */
50
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::global_admin_scripts', 20 );
51
+
52
+ add_action( 'admin_footer', __CLASS__ . '::global_admin_data', 9555 );
53
+
54
+ /* Add lite version class to body */
55
+ add_action( 'admin_body_class', __CLASS__ . '::add_admin_body_class' );
56
+
57
+ add_filter( 'plugin_action_links_' . CARTFLOWS_BASE, __CLASS__ . '::add_action_links' );
58
+
59
+ add_action( 'admin_init', __CLASS__ . '::cartflows_after_save_permalinks' );
60
+
61
+ add_action( 'in_admin_header', __CLASS__ . '::embed_page_header' );
62
+ }
63
+
64
+ /**
65
+ * After save of permalinks.
66
+ */
67
+ public static function cartflows_after_save_permalinks() {
68
+
69
+ $has_saved_permalinks = get_option( 'cartflows_permalink_saved' );
70
+ if ( $has_saved_permalinks ) {
71
+ flush_rewrite_rules();
72
+ delete_option( 'cartflows_permalink_saved' );
73
+ }
74
+ }
75
+
76
+
77
+ /**
78
+ * Initialize after Cartflows pro get loaded.
79
+ */
80
+ public static function settings_admin_scripts() {
81
+ // Enqueue admin scripts.
82
+ if ( isset( $_GET['page'] ) && ( 'cartflows' === $_GET['page'] || false !== strpos( $_GET['page'], 'cartflows_' ) ) ) { //phpcs:ignore
83
+ add_action( 'admin_enqueue_scripts', __CLASS__ . '::styles_scripts' );
84
+
85
+ self::save_settings();
86
+ }
87
+ }
88
+ /**
89
+ * Show action on plugin page.
90
+ *
91
+ * @param array $links links.
92
+ * @return array
93
+ */
94
+ public static function add_action_links( $links ) {
95
+ $mylinks = array(
96
+ '<a href="' . admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS ) . '">Settings</a>',
97
+ '<a target="_blank" href="' . esc_url( 'https://cartflows.com/docs' ) . '">Docs</a>',
98
+ );
99
+
100
+ if ( ! _is_cartflows_pro() ) {
101
+ array_push( $mylinks, '<a style="color: #39b54a; font-weight: bold;" target="_blank" href="' . esc_url( 'https://cartflows.com/pricing/' ) . '"> Go Pro </a>' );
102
+ }
103
+
104
+ return array_merge( $links, $mylinks );
105
+ }
106
+
107
+ /**
108
+ * Initialises the Plugin Name.
109
+ *
110
+ * @since 1.0.0
111
+ * @return void
112
+ */
113
+ public static function initialise_plugin() {
114
+
115
+ $name = 'Cartflows';
116
+ $short_name = 'Cflows';
117
+
118
+ define( 'CARTFLOWS_PLUGIN_NAME', $name );
119
+ define( 'CARTFLOWS_PLUGIN_SHORT_NAME', $short_name );
120
+ }
121
+
122
+ /**
123
+ * Renders the admin settings menu.
124
+ *
125
+ * @since 1.0.0
126
+ * @return void
127
+ */
128
+ public static function menu() {
129
+
130
+ if ( ! current_user_can( 'manage_options' ) ) {
131
+ return;
132
+ }
133
+
134
+ add_menu_page(
135
+ 'CartFlows',
136
+ 'CartFlows',
137
+ 'manage_options',
138
+ CARTFLOWS_SLUG,
139
+ __CLASS__ . '::render',
140
+ 'data:image/svg+xml;base64,' . base64_encode( file_get_contents( CARTFLOWS_DIR . 'assets/images/cartflows-icon.svg' ) ),//phpcs:ignore
141
+ 39.7
142
+ );
143
+
144
+ }
145
+
146
+ /**
147
+ * Add submenu to admin menu.
148
+ *
149
+ * @since 1.0.0
150
+ */
151
+ public static function submenu() {
152
+
153
+ global $submenu;
154
+
155
+ $parent_slug = CARTFLOWS_SLUG;
156
+ $capability = 'manage_options';
157
+
158
+ // Home menu.
159
+ $submenu[ $parent_slug ][0][0] = __( 'Home', 'cartflows' ); //phpcs:ignore
160
+
161
+ // Add settings menu.
162
+ add_submenu_page(
163
+ $parent_slug,
164
+ __( 'Settings', 'cartflows' ),
165
+ __( 'Settings', 'cartflows' ),
166
+ $capability,
167
+ 'cartflows_settings',
168
+ __CLASS__ . '::render'
169
+ );
170
+ }
171
+
172
+ /**
173
+ * Renders the admin settings.
174
+ *
175
+ * @since 1.0.0
176
+ * @return void
177
+ */
178
+ public static function render() {
179
+ $menu_page_slug = ( isset( $_GET['page'] ) ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : CARTFLOWS_SETTINGS; //phpcs:ignore
180
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
181
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
182
+ $action = str_replace( '_', '-', $action );
183
+
184
+ // Enable header icon filter below.
185
+ $header_wrapper_class = apply_filters( 'cartflows_admin_header_wrapper_class', array( $action, $menu_page_slug ) );
186
+
187
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin.php';
188
+ }
189
+
190
+ /**
191
+ * Renders the admin settings content.
192
+ *
193
+ * @since 1.0.0
194
+ * @param sting $menu_page_slug current page name.
195
+ *
196
+ * @return void
197
+ */
198
+ public static function render_content( $menu_page_slug ) {
199
+
200
+ if ( CARTFLOWS_SETTINGS === $menu_page_slug ) {
201
+
202
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
203
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
204
+ $action = str_replace( '_', '-', $action );
205
+ $action = 'general';
206
+
207
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-general.php';
208
+ }
209
+
210
+ if ( 'cartflows' === $menu_page_slug ) {
211
+
212
+ $action = ( isset( $_GET['action'] ) ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : ''; //phpcs:ignore
213
+ $action = ( ! empty( $action ) && '' != $action ) ? $action : 'general';
214
+ $action = str_replace( '_', '-', $action );
215
+ $action = 'general';
216
+
217
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-home.php';
218
+ }
219
+ }
220
+
221
+ /**
222
+ * Save Global Setting options.
223
+ *
224
+ * @since 1.0.0
225
+ */
226
+ public static function save_common_settings() {
227
+
228
+ if ( isset( $_POST['cartflows-common-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-common-settings-nonce'] ) ), 'cartflows-common-settings' ) ) {
229
+
230
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
231
+ $new_settings = array();
232
+
233
+ if ( isset( $_POST['_cartflows_common'] ) ) {
234
+ // Loop through the input and sanitize each of the values.
235
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_common'] ) ); //phpcs:ignore
236
+ }
237
+
238
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_common', $new_settings, false );
239
+
240
+ $query = array(
241
+ 'message' => 'saved',
242
+ );
243
+
244
+ $redirect_to = add_query_arg( $query, $url );
245
+
246
+ wp_safe_redirect( $redirect_to );
247
+ exit;
248
+ } // End if statement.
249
+ }
250
+
251
+ /**
252
+ * Save Debug Setting options.
253
+ *
254
+ * @since 1.1.14
255
+ */
256
+ public static function save_debug_settings() {
257
+
258
+ if ( isset( $_POST['cartflows-debug-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-debug-settings-nonce'] ) ), 'cartflows-debug-settings' ) ) {
259
+
260
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
261
+ $new_settings = array();
262
+
263
+ if ( isset( $_POST['_cartflows_debug_data'] ) ) {
264
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_debug_data'] ) ); //phpcs:ignore
265
+ }
266
+
267
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_debug_data', $new_settings, false );
268
+
269
+ $query = array(
270
+ 'message' => 'saved',
271
+ );
272
+
273
+ $redirect_to = add_query_arg( $query, $url );
274
+
275
+ wp_safe_redirect( $redirect_to );
276
+ exit;
277
+
278
+ }
279
+ }
280
+
281
+
282
+ /**
283
+ * Save permalink Setting options.
284
+ *
285
+ * @since 1.1.14
286
+ */
287
+ public static function save_permalink_settings() {
288
+
289
+ if ( isset( $_POST['cartflows-permalink-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-permalink-settings-nonce'] ) ), 'cartflows-permalink-settings' ) ) {
290
+
291
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
292
+ $new_settings = array();
293
+
294
+ if ( isset( $_POST['reset'] ) ) {
295
+ $_POST['_cartflows_permalink'] = array(
296
+ 'permalink' => CARTFLOWS_STEP_POST_TYPE,
297
+ 'permalink_flow_base' => CARTFLOWS_FLOW_POST_TYPE,
298
+ 'permalink_structure' => '',
299
+ );
300
+
301
+ }
302
+
303
+ if ( isset( $_POST['_cartflows_permalink'] ) ) {
304
+ $cartflows_permalink_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_permalink'] ) ); //phpcs:ignore
305
+
306
+ if ( empty( $cartflows_permalink_settings['permalink'] ) ) {
307
+ $new_settings['permalink'] = CARTFLOWS_STEP_POST_TYPE;
308
+ } else {
309
+ $new_settings['permalink'] = $cartflows_permalink_settings['permalink'];
310
+ }
311
+
312
+ if ( empty( $cartflows_permalink_settings['permalink_flow_base'] ) ) {
313
+ $new_settings['permalink_flow_base'] = CARTFLOWS_FLOW_POST_TYPE;
314
+ } else {
315
+ $new_settings['permalink_flow_base'] = $cartflows_permalink_settings['permalink_flow_base'];
316
+ }
317
+
318
+ $new_settings['permalink_structure'] = $cartflows_permalink_settings['permalink_structure'];
319
+
320
+ }
321
+
322
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_permalink', $new_settings, false );
323
+
324
+ $query = array(
325
+ 'message' => 'saved',
326
+ );
327
+
328
+ $redirect_to = add_query_arg( $query, $url );
329
+
330
+ update_option( 'cartflows_permalink_saved', true );
331
+
332
+ wp_safe_redirect( $redirect_to );
333
+ exit;
334
+
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Save google analytics Setting options.
340
+ *
341
+ * @since 1.1.14
342
+ */
343
+ public static function save_google_analytics_settings() {
344
+
345
+ if ( isset( $_POST['cartflows-google-analytics-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-google-analytics-settings-nonce'] ) ), 'cartflows-google-analytics-settings' ) ) {
346
+
347
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
348
+ $new_settings = array();
349
+
350
+ if ( isset( $_POST['_cartflows_google_analytics'] ) ) {
351
+ $new_settings = self::sanitize_form_inputs( $_POST['_cartflows_google_analytics'] ); //phpcs:ignore
352
+
353
+ }
354
+
355
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_google_analytics', $new_settings, true );
356
+
357
+ $query = array(
358
+ 'message' => 'saved',
359
+ );
360
+
361
+ $redirect_to = add_query_arg( $query, $url );
362
+
363
+ wp_safe_redirect( $redirect_to );
364
+ exit;
365
+
366
+ }
367
+ }
368
+
369
+ /**
370
+ * Loop through the input and sanitize each of the values.
371
+ *
372
+ * @param array $input_settings input settings.
373
+ * @return array
374
+ */
375
+ public static function sanitize_form_inputs( $input_settings = array() ) {
376
+ $new_settings = array();
377
+ foreach ( $input_settings as $key => $val ) {
378
+
379
+ if ( is_array( $val ) ) {
380
+ foreach ( $val as $k => $v ) {
381
+ $new_settings[ $key ][ $k ] = ( isset( $val[ $k ] ) ) ? sanitize_text_field( $v ) : '';
382
+ }
383
+ } else {
384
+ $new_settings[ $key ] = ( isset( $input_settings[ $key ] ) ) ? sanitize_text_field( $val ) : '';
385
+ }
386
+ }
387
+ return $new_settings;
388
+ }
389
+
390
+ /**
391
+ * Check is cartflows admin.
392
+ *
393
+ * @since 1.0.0
394
+ * @return boolean
395
+ */
396
+ public static function is_global_admin() {
397
+
398
+ $current_screen = get_current_screen();
399
+
400
+ if (
401
+ is_object( $current_screen ) &&
402
+ isset( $current_screen->post_type ) &&
403
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ||
404
+ CARTFLOWS_STEP_POST_TYPE === $current_screen->post_type
405
+ )
406
+ ) {
407
+ return true;
408
+ }
409
+ return false;
410
+ }
411
+
412
+ /**
413
+ * Check is flow admin.
414
+ *
415
+ * @since 1.0.0
416
+ * @return boolean
417
+ */
418
+ public static function is_flow_edit_admin() {
419
+
420
+ $current_screen = get_current_screen();
421
+
422
+ if (
423
+ is_object( $current_screen ) &&
424
+ isset( $current_screen->post_type ) &&
425
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
426
+ isset( $current_screen->base ) &&
427
+ ( 'post' === $current_screen->base )
428
+ ) {
429
+ return true;
430
+ }
431
+ return false;
432
+ }
433
+
434
+ /**
435
+ * Global Admin Scripts.
436
+ *
437
+ * @since 1.0.0
438
+ */
439
+ public static function global_admin_scripts() {
440
+
441
+ $installed_plugins = get_plugins();
442
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? true : false;
443
+ $edit_test_mode = filter_input( INPUT_GET, 'edit_test_mode', FILTER_SANITIZE_STRING );
444
+ $edit_test_mode = 'yes' === $edit_test_mode ? true : false;
445
+
446
+ $localize = array(
447
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
448
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-nonce' ),
449
+ 'wc_status' => array(
450
+ 'installed' => $is_wc_installed,
451
+ 'active' => wcf()->is_woo_active,
452
+ ),
453
+ 'wc_activating_message' => __( 'Installing and activating..', 'cartflows' ),
454
+ 'wc_install_error' => __( 'There was an error with the installation of plugin.', 'cartflows' ),
455
+ 'wcf_edit_test_mode' => $edit_test_mode,
456
+ 'wcf_fetch_stats_nonce' => wp_create_nonce( 'wcf-fetch-stats' ),
457
+ );
458
+
459
+ $localize = apply_filters( 'cartflows_admin_js_localize', $localize );
460
+
461
+ $localize_script = '<!-- script to print the admin localized variables -->';
462
+ $localize_script .= '<script type="text/javascript">';
463
+ $localize_script .= 'var cartflows_admin = ' . wp_json_encode( $localize ) . ';';
464
+ $localize_script .= '</script>';
465
+
466
+ echo $localize_script;
467
+
468
+ if ( self::is_global_admin() ) {
469
+
470
+ // Styles.
471
+ wp_enqueue_style( 'cartflows-global-admin', CARTFLOWS_URL . 'admin/assets/css/global-admin.css', array(), CARTFLOWS_VER );
472
+ wp_style_add_data( 'cartflows-global-admin', 'rtl', 'replace' );
473
+
474
+ wp_enqueue_script(
475
+ 'wcf-global-admin',
476
+ CARTFLOWS_URL . 'admin/assets/js/global-admin.js',
477
+ array( 'jquery' ),
478
+ CARTFLOWS_VER,
479
+ true
480
+ );
481
+
482
+ do_action( 'cartflows_global_admin_scripts' );
483
+ }
484
+ }
485
+
486
+ /**
487
+ * Global Admin Data.
488
+ *
489
+ * @since 1.0.0
490
+ */
491
+ public static function global_admin_data() {
492
+
493
+ $current_screen = get_current_screen();
494
+
495
+ if ( ! $current_screen ) {
496
+ return;
497
+ }
498
+
499
+ if ( 'edit-' . CARTFLOWS_FLOW_POST_TYPE != $current_screen->id ) {
500
+ return;
501
+ }
502
+
503
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
504
+ ?>
505
+
506
+ <div id="wcf-remote-flow-importer" class="wcf-templates-popup-overlay">
507
+ <div class="wcf-templates-popup-content">
508
+ <div class="spinner"></div>
509
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
510
+
511
+ <div id="wcf-remote-flow-actions" class="wcf-template-header">
512
+ <div class="wcf-template-logo-wrap">
513
+ <span class="wcf-cartflows-logo-img">
514
+ <span class="cartflows-logo-icon"></span>
515
+ </span>
516
+ <span class="wcf-cartflows-title"><?php esc_html_e( 'Flows Library', 'cartflows' ); ?></span>
517
+ </div>
518
+ <div class="wcf-tab-wrapper">
519
+ <?php if ( 'other' !== $default_page_builder ) { ?>
520
+ <div id="wcf-get-started-steps">
521
+ <ul class="filter-links ">
522
+ <li>
523
+ <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
524
+ </li>
525
+ <li>
526
+ <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
527
+ </li>
528
+ </ul>
529
+ </div>
530
+ <?php } ?>
531
+ </div>
532
+ <div class="wcf-popup-close-wrap">
533
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
534
+ </div>
535
+ </div>
536
+ <!-- <div class="wcf-search-form">
537
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
538
+ <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
539
+ </div> -->
540
+
541
+ <div id="wcf-remote-content">
542
+ <?php if ( 'other' !== $default_page_builder ) { ?>
543
+ <div id="wcf-ready-templates">
544
+ <div id="wcf-remote-filters">
545
+ <div id="wcf-page-builders"></div>
546
+ <div id="wcf-categories"></div>
547
+ </div>
548
+ <div class="wcf-page-builder-notice"></div>
549
+ <div id="wcf-remote-flow-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
550
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
551
+ </div>
552
+ <?php } ?>
553
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
554
+ <div class="inner">
555
+ <a href="#" class="button button-hero button-primary cartflows-flow-import-blank"><?php esc_html_e( 'Design Your Flow', 'cartflows' ); ?></a>
556
+ <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
557
+ </div>
558
+ </div>
559
+ </div>
560
+ </div>
561
+ </div>
562
+ </div>
563
+
564
+ <?php
565
+ }
566
+
567
+ /**
568
+ * Enqueues the needed CSS/JS for the builder's admin settings page.
569
+ *
570
+ * @since 1.0.0
571
+ */
572
+ public static function styles_scripts() {
573
+
574
+ // Styles.
575
+ wp_enqueue_style( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/css/admin-menu-settings.css', array(), CARTFLOWS_VER );
576
+ wp_style_add_data( 'cartflows-admin-settings', 'rtl', 'replace' );
577
+
578
+ // Script.
579
+ wp_enqueue_script( 'cartflows-admin-settings', CARTFLOWS_URL . 'admin/assets/js/admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), CARTFLOWS_VER, false );
580
+
581
+ $localize = array(
582
+ 'ajax_nonce' => wp_create_nonce( 'cartflows-widget-nonce' ),
583
+ );
584
+
585
+ wp_localize_script( 'cartflows-admin-settings', 'cartflows', apply_filters( 'cartflows_js_localize', $localize ) );
586
+
587
+ do_action( 'cartflows_admin_settings_after_enqueue_scripts' );
588
+ }
589
+
590
+ /**
591
+ * Save All admin settings here
592
+ */
593
+ public static function save_settings() {
594
+
595
+ // Only admins can save settings.
596
+ if ( ! current_user_can( 'manage_options' ) ) {
597
+ return;
598
+ }
599
+
600
+ self::save_common_settings();
601
+ self::save_debug_settings();
602
+ self::save_permalink_settings();
603
+
604
+ self::save_google_analytics_settings();
605
+ self::save_facebook_settings();
606
+
607
+ // Let extensions hook into saving.
608
+ do_action( 'cartflows_admin_settings_save' );
609
+ }
610
+
611
+ /**
612
+ * Get and return page URL
613
+ *
614
+ * @param string $menu_slug Menu name.
615
+ * @since 1.0.0
616
+ * @return string page url
617
+ */
618
+ public static function get_page_url( $menu_slug ) {
619
+
620
+ $parent_page = self::$default_menu_position;
621
+
622
+ if ( strpos( $parent_page, '?' ) !== false ) {
623
+ $query_var = '&page=' . self::$plugin_slug;
624
+ } else {
625
+ $query_var = '?page=' . self::$plugin_slug;
626
+ }
627
+
628
+ $parent_page_url = admin_url( $parent_page . $query_var );
629
+
630
+ $url = $parent_page_url . '&action=' . $menu_slug;
631
+
632
+ return esc_url( $url );
633
+ }
634
+
635
+ /**
636
+ * Admin body classes.
637
+ *
638
+ * Body classes to be added to <body> tag in admin page
639
+ *
640
+ * @param String $classes body classes returned from the filter.
641
+ * @return String body classes to be added to <body> tag in admin page
642
+ */
643
+ public static function add_admin_body_class( $classes ) {
644
+
645
+ $classes .= ' cartflows-' . CARTFLOWS_VER;
646
+
647
+ return $classes;
648
+ }
649
+
650
+ /**
651
+ * Save Global Setting options.
652
+ *
653
+ * @since 1.0.0
654
+ */
655
+ public static function save_facebook_settings() {
656
+
657
+ if ( isset( $_POST['cartflows-facebook-settings-nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-facebook-settings-nonce'] ) ), 'cartflows-facebook-settings' ) ) {
658
+
659
+ $url = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
660
+ $new_settings = array();
661
+
662
+ if ( isset( $_POST['_cartflows_facebook'] ) ) {
663
+ $new_settings = self::sanitize_form_inputs( wp_unslash( $_POST['_cartflows_facebook'] ) ); //phpcs:ignore
664
+ }
665
+
666
+ Cartflows_Helper::update_admin_settings_option( '_cartflows_facebook', $new_settings, false );
667
+ $query = array(
668
+ 'message' => 'saved',
669
+ );
670
+ $redirect_to = add_query_arg( $query, $url );
671
+ wp_safe_redirect( $redirect_to );
672
+ exit;
673
+ }
674
+ }
675
+
676
+ /**
677
+ * Show embed header.
678
+ *
679
+ * @since 1.0.0
680
+ */
681
+ public static function show_embed_header() {
682
+
683
+ $current_screen = get_current_screen();
684
+
685
+ if (
686
+ is_object( $current_screen ) &&
687
+ isset( $current_screen->post_type ) &&
688
+ ( CARTFLOWS_FLOW_POST_TYPE === $current_screen->post_type ) &&
689
+ isset( $current_screen->base ) &&
690
+ ( 'post' === $current_screen->base || 'edit' === $current_screen->base )
691
+ ) {
692
+ return true;
693
+ }
694
+
695
+ return false;
696
+ }
697
+ /**
698
+ * Set up a div for the header embed to render into.
699
+ * The initial contents here are meant as a place loader for when the PHP page initialy loads.
700
+ */
701
+ public static function embed_page_header() {
702
+
703
+ if ( ! is_admin() || ! self::show_embed_header() ) {
704
+ return;
705
+ }
706
+
707
+ wp_enqueue_style( 'cartflows-admin-embed-header', CARTFLOWS_URL . 'admin/assets/css/admin-embed-header.css', array(), CARTFLOWS_VER );
708
+
709
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-admin-header.php';
710
+ }
711
+ }
712
+
713
+ Cartflows_Admin::init();
classes/class-cartflows-cloning.php CHANGED
@@ -37,7 +37,7 @@ class Cartflows_Cloning {
37
 
38
  add_filter( 'post_row_actions', array( $this, 'clone_link' ), 99, 2 );
39
  add_action( 'admin_action_cartflows_clone_flow', array( $this, 'clone_flow' ) );
40
- add_action( 'admin_action_cartflows_clone_step', array( $this, 'clone_step' ) );
41
  }
42
 
43
  /**
@@ -266,26 +266,32 @@ class Cartflows_Cloning {
266
 
267
  global $wpdb;
268
 
269
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_clone_step' === $_REQUEST['action'] ) ) ) {
270
- wp_die( 'No post to duplicate has been supplied!' );
271
  }
272
 
273
- /*
274
- * Nonce verification
275
- */
276
- if ( ! isset( $_GET['step_clone_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['step_clone_nonce'] ) ), 'step_clone' ) ) {
277
- return;
278
  }
279
 
280
- /**
281
- * Get the original post id
282
- */
283
- $post_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
 
 
 
 
 
 
284
 
285
  /**
286
  * And all the original post data then
287
  */
288
- $post = get_post( $post_id );
289
 
290
  /**
291
  * Assign current user to be the new post author
@@ -330,7 +336,7 @@ class Cartflows_Cloning {
330
 
331
  foreach ( $taxonomies as $taxonomy ) {
332
 
333
- $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
334
 
335
  wp_set_object_terms( $new_step_id, $post_terms, $taxonomy, false );
336
  }
@@ -340,7 +346,7 @@ class Cartflows_Cloning {
340
  */
341
  // @codingStandardsIgnoreStart
342
  $post_meta_infos = $wpdb->get_results(
343
- "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id"
344
  );
345
  // @codingStandardsIgnoreEnd
346
 
@@ -370,9 +376,8 @@ class Cartflows_Cloning {
370
  // @codingStandardsIgnoreEnd
371
  }
372
 
373
- $flow_id = get_post_meta( $post_id, 'wcf-flow-id', true );
374
  $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
375
- $step_type = get_post_meta( $post_id, 'wcf-step-type', true );
376
 
377
  if ( ! is_array( $flow_steps ) ) {
378
  $flow_steps = array();
@@ -389,16 +394,15 @@ class Cartflows_Cloning {
389
  /* Clear Page Builder Cache */
390
  $this->clear_cache();
391
 
392
- /**
393
- * Redirect to the new flow edit screen
394
- */
395
- $redirect_url = add_query_arg( 'highlight-step-id', $new_step_id, get_edit_post_link( $flow_id, 'default' ) );
396
-
397
- wp_safe_redirect( $redirect_url );
398
- exit;
399
- } else {
400
- wp_die( 'Post creation failed, could not find original post: ' . $post_id );
401
  }
 
 
402
  }
403
 
404
  /**
37
 
38
  add_filter( 'post_row_actions', array( $this, 'clone_link' ), 99, 2 );
39
  add_action( 'admin_action_cartflows_clone_flow', array( $this, 'clone_flow' ) );
40
+ add_action( 'wp_ajax_cartflows_clone_flow_step', array( $this, 'clone_step' ) );
41
  }
42
 
43
  /**
266
 
267
  global $wpdb;
268
 
269
+ if ( ! current_user_can( 'manage_options' ) ) {
270
+ return;
271
  }
272
 
273
+ check_ajax_referer( 'wcf-clone-flow-step', 'security' );
274
+
275
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
276
+ $flow_id = intval( $_POST['post_id'] );
277
+ $step_id = intval( $_POST['step_id'] );
278
  }
279
 
280
+ $result = array(
281
+ 'status' => false,
282
+ 'reload' => true,
283
+ /* translators: %s flow id */
284
+ 'text' => sprintf( __( 'Can\'t clone this step - %1$s. Flow - %2$s', 'cartflows' ), $step_id, $flow_id ),
285
+ );
286
+
287
+ if ( ! $flow_id || ! $step_id ) {
288
+ wp_send_json( $result );
289
+ }
290
 
291
  /**
292
  * And all the original post data then
293
  */
294
+ $post = get_post( $step_id );
295
 
296
  /**
297
  * Assign current user to be the new post author
336
 
337
  foreach ( $taxonomies as $taxonomy ) {
338
 
339
+ $post_terms = wp_get_object_terms( $step_id, $taxonomy, array( 'fields' => 'slugs' ) );
340
 
341
  wp_set_object_terms( $new_step_id, $post_terms, $taxonomy, false );
342
  }
346
  */
347
  // @codingStandardsIgnoreStart
348
  $post_meta_infos = $wpdb->get_results(
349
+ "SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$step_id"
350
  );
351
  // @codingStandardsIgnoreEnd
352
 
376
  // @codingStandardsIgnoreEnd
377
  }
378
 
 
379
  $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
380
+ $step_type = get_post_meta( $step_id, 'wcf-step-type', true );
381
 
382
  if ( ! is_array( $flow_steps ) ) {
383
  $flow_steps = array();
394
  /* Clear Page Builder Cache */
395
  $this->clear_cache();
396
 
397
+ $result = array(
398
+ 'status' => true,
399
+ 'reload' => true,
400
+ /* translators: %s flow id */
401
+ 'text' => sprintf( __( 'Step - %1$s cloned. Flow - %2$s', 'cartflows' ), $step_id, $flow_id ),
402
+ );
 
 
 
403
  }
404
+
405
+ wp_send_json( $result );
406
  }
407
 
408
  /**
classes/class-cartflows-flow-frontend.php CHANGED
@@ -1,247 +1,214 @@
1
- <?php
2
- /**
3
- * Frontend & Markup
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Flow Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Flow_Frontend {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var object instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- /* Analytics */
39
- add_action( 'cartflows_wp_footer', array( $this, 'footer_markup' ) );
40
- }
41
-
42
- /**
43
- * Footer markup
44
- */
45
- public function footer_markup() {
46
-
47
- if ( wcf()->utils->is_step_post_type() ) {
48
- // @codingStandardsIgnoreStart
49
- $flow_id = wcf()->utils->get_flow_id();
50
- ?>
51
- <?php if( $this->is_flow_testmode( $flow_id ) ) { ?>
52
- <div class="wcf-preview-mode">
53
- <span><?php _e( 'Test mode is active — which displays random products for previewing. It can be deactivated from the flow settings in the admin dashboard.', 'cartflows' ); ?></span>
54
- <?php if ( current_user_can( 'manage_options' ) ) { ?>
55
- <?php
56
- $flow_edit_link = add_query_arg( 'edit_test_mode', 'yes', get_edit_post_link( $flow_id ) );
57
- ?>
58
- <a href="<?php echo $flow_edit_link; ?>"><?php _e( 'Click here to disable it', 'cartflows'); ?></a>
59
- <?php } ?>
60
- </div>
61
- <?php } ?>
62
- <?php
63
- // @codingStandardsIgnoreEnd
64
- }
65
- }
66
-
67
- /**
68
- * Check if flow test mode is enable.
69
- *
70
- * @since 1.0.0
71
- * @param int $flow_id flow ID.
72
- *
73
- * @return boolean
74
- */
75
- public function is_flow_testmode( $flow_id = '' ) {
76
-
77
- if ( ! $flow_id ) {
78
- $flow_id = wcf()->utils->get_flow_id();
79
- }
80
-
81
- $test_mode = wcf()->options->get_flow_meta_value( $flow_id, 'wcf-testing' );
82
-
83
- if ( 'no' === $test_mode ) {
84
- return false;
85
- }
86
-
87
- return true;
88
- }
89
-
90
- /**
91
- * Get steps data.
92
- *
93
- * @since 1.0.0
94
- * @param int $flow_id flow ID.
95
- *
96
- * @return array
97
- */
98
- public function get_steps( $flow_id ) {
99
-
100
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
101
-
102
- if ( ! is_array( $steps ) ) {
103
-
104
- $steps = array();
105
- }
106
-
107
- return $steps;
108
- }
109
-
110
- /**
111
- * Check thank you page exists.
112
- *
113
- * @since 1.0.0
114
- * @param array $order order data.
115
- *
116
- * @return bool
117
- */
118
- public function is_thankyou_page_exists( $order ) {
119
-
120
- $thankyou_step_exist = false;
121
-
122
- $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
123
-
124
- if ( $flow_id ) {
125
-
126
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
127
- $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
128
-
129
- if ( is_array( $flow_steps ) ) {
130
-
131
- $current_step_found = false;
132
-
133
- foreach ( $flow_steps as $index => $data ) {
134
-
135
- if ( $current_step_found ) {
136
-
137
- if ( 'thankyou' === $data['type'] ) {
138
-
139
- $thankyou_step_exist = true;
140
- break;
141
- }
142
- } else {
143
-
144
- if ( intval( $data['id'] ) === $step_id ) {
145
-
146
- $current_step_found = true;
147
- }
148
- }
149
- }
150
- }
151
- }
152
-
153
- return $thankyou_step_exist;
154
- }
155
-
156
- /**
157
- * Check thank you page exists.
158
- *
159
- * @since 1.0.0
160
- * @param array $order order data.
161
- *
162
- * @return bool
163
- */
164
- public function get_thankyou_page_id( $order ) {
165
-
166
- $thankyou_step_id = false;
167
-
168
- $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
169
-
170
- if ( $flow_id ) {
171
-
172
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
173
- $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
174
-
175
- if ( is_array( $flow_steps ) ) {
176
-
177
- $current_step_found = false;
178
-
179
- foreach ( $flow_steps as $index => $data ) {
180
-
181
- if ( $current_step_found ) {
182
-
183
- if ( 'thankyou' === $data['type'] ) {
184
-
185
- $thankyou_step_id = intval( $data['id'] );
186
- break;
187
- }
188
- } else {
189
-
190
- if ( intval( $data['id'] ) === $step_id ) {
191
-
192
- $current_step_found = true;
193
- }
194
- }
195
- }
196
- }
197
- }
198
-
199
- return $thankyou_step_id;
200
- }
201
-
202
- /**
203
- * Check thank you page exists.
204
- *
205
- * @since 1.0.0
206
- * @param array $order order data.
207
- *
208
- * @return bool
209
- */
210
- public function get_next_step_id( $order ) {
211
-
212
- $next_step_id = false;
213
-
214
- $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
215
-
216
- if ( $flow_id ) {
217
-
218
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
219
- $step_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
220
-
221
- if ( is_array( $flow_steps ) ) {
222
-
223
- foreach ( $flow_steps as $index => $data ) {
224
-
225
- if ( intval( $data['id'] ) === $step_id ) {
226
-
227
- $next_step_index = $index + 1;
228
-
229
- if ( isset( $flow_steps[ $next_step_index ] ) ) {
230
-
231
- $next_step_id = intval( $flow_steps[ $next_step_index ]['id'] );
232
- }
233
-
234
- break;
235
- }
236
- }
237
- }
238
- }
239
-
240
- return $next_step_id;
241
- }
242
- }
243
-
244
- /**
245
- * Kicking this off by calling 'get_instance()' method
246
- */
247
- Cartflows_Flow_Frontend::get_instance();
1
+ <?php
2
+ /**
3
+ * Frontend & Markup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Flow Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Flow_Frontend {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var object instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ /* Analytics */
39
+ add_action( 'cartflows_wp_footer', array( $this, 'footer_markup' ) );
40
+ }
41
+
42
+ /**
43
+ * Footer markup
44
+ */
45
+ public function footer_markup() {
46
+
47
+ if ( wcf()->utils->is_step_post_type() ) {
48
+ // @codingStandardsIgnoreStart
49
+ $flow_id = wcf()->utils->get_flow_id();
50
+ ?>
51
+ <?php if( $this->is_flow_testmode( $flow_id ) ) { ?>
52
+ <div class="wcf-preview-mode">
53
+ <span><?php _e( 'Test mode is active — which displays random products for previewing. It can be deactivated from the flow settings in the admin dashboard.', 'cartflows' ); ?></span>
54
+ <?php if ( current_user_can( 'manage_options' ) ) { ?>
55
+ <?php
56
+ $flow_edit_link = add_query_arg( 'edit_test_mode', 'yes', get_edit_post_link( $flow_id ) );
57
+ ?>
58
+ <a href="<?php echo $flow_edit_link; ?>"><?php _e( 'Click here to disable it', 'cartflows'); ?></a>
59
+ <?php } ?>
60
+ </div>
61
+ <?php } ?>
62
+ <?php
63
+ // @codingStandardsIgnoreEnd
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Check if flow test mode is enable.
69
+ *
70
+ * @since 1.0.0
71
+ * @param int $flow_id flow ID.
72
+ *
73
+ * @return boolean
74
+ */
75
+ public function is_flow_testmode( $flow_id = '' ) {
76
+
77
+ if ( ! $flow_id ) {
78
+ $flow_id = wcf()->utils->get_flow_id();
79
+ }
80
+
81
+ $test_mode = wcf()->options->get_flow_meta_value( $flow_id, 'wcf-testing' );
82
+
83
+ if ( 'no' === $test_mode ) {
84
+ return false;
85
+ }
86
+
87
+ return true;
88
+ }
89
+
90
+ /**
91
+ * Get steps data.
92
+ *
93
+ * @since 1.0.0
94
+ * @param int $flow_id flow ID.
95
+ *
96
+ * @return array
97
+ */
98
+ public function get_steps( $flow_id ) {
99
+
100
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
101
+
102
+ if ( ! is_array( $steps ) ) {
103
+
104
+ $steps = array();
105
+ }
106
+
107
+ return $steps;
108
+ }
109
+
110
+ /**
111
+ * Check thank you page exists.
112
+ *
113
+ * @since 1.0.0
114
+ * @param array $order order data.
115
+ *
116
+ * @return bool
117
+ */
118
+ public function is_thankyou_page_exists( $order ) {
119
+
120
+ $thankyou_step_exist = false;
121
+
122
+ $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
123
+
124
+ if ( $flow_id ) {
125
+
126
+ $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
127
+
128
+ // Get control step and flow steps.
129
+ $wcf_step_obj = wcf_get_step( $step_id );
130
+ $flow_steps = $wcf_step_obj->get_flow_steps();
131
+ $control_step = $wcf_step_obj->get_control_step();
132
+
133
+ if ( is_array( $flow_steps ) ) {
134
+
135
+ $current_step_found = false;
136
+
137
+ foreach ( $flow_steps as $index => $data ) {
138
+
139
+ if ( $current_step_found ) {
140
+
141
+ if ( 'thankyou' === $data['type'] ) {
142
+
143
+ $thankyou_step_exist = true;
144
+ break;
145
+ }
146
+ } else {
147
+
148
+ if ( intval( $data['id'] ) === $control_step ) {
149
+
150
+ $current_step_found = true;
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+
157
+ return $thankyou_step_exist;
158
+ }
159
+
160
+ /**
161
+ * Check thank you page exists.
162
+ *
163
+ * @since 1.0.0
164
+ * @param array $order order data.
165
+ *
166
+ * @return bool
167
+ */
168
+ public function get_thankyou_page_id( $order ) {
169
+
170
+ $thankyou_step_id = false;
171
+
172
+ $flow_id = wcf()->utils->get_flow_id_from_order( $order->get_id() );
173
+
174
+ if ( $flow_id ) {
175
+
176
+ $step_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
177
+
178
+ // Get control step and flow steps.
179
+ $wcf_step_obj = wcf_get_step( $step_id );
180
+ $flow_steps = $wcf_step_obj->get_flow_steps();
181
+ $control_step = $wcf_step_obj->get_control_step();
182
+
183
+ if ( is_array( $flow_steps ) ) {
184
+
185
+ $current_step_found = false;
186
+
187
+ foreach ( $flow_steps as $index => $data ) {
188
+
189
+ if ( $current_step_found ) {
190
+
191
+ if ( 'thankyou' === $data['type'] ) {
192
+
193
+ $thankyou_step_id = intval( $data['id'] );
194
+ break;
195
+ }
196
+ } else {
197
+
198
+ if ( intval( $data['id'] ) === $control_step ) {
199
+
200
+ $current_step_found = true;
201
+ }
202
+ }
203
+ }
204
+ }
205
+ }
206
+
207
+ return $thankyou_step_id;
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Kicking this off by calling 'get_instance()' method
213
+ */
214
+ Cartflows_Flow_Frontend::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/class-cartflows-frontend.php CHANGED
@@ -1,654 +1,672 @@
1
- <?php
2
- /**
3
- * CartFlows Frontend.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Frontend.
10
- */
11
- class Cartflows_Frontend {
12
-
13
- /**
14
- * Member Variable
15
- *
16
- * @var instance
17
- */
18
- private static $instance;
19
-
20
- /**
21
- * Initiator
22
- */
23
- public static function get_instance() {
24
- if ( ! isset( self::$instance ) ) {
25
- self::$instance = new self();
26
- }
27
- return self::$instance;
28
- }
29
-
30
- /**
31
- * Constructor
32
- */
33
- public function __construct() {
34
-
35
- /* Set / Destroy Flow Sessions. Set data */
36
- add_action( 'wp', array( $this, 'init_actions' ), 1 );
37
-
38
- add_action( 'init', array( $this, 'debug_data_setting_actions' ) );
39
- add_action( 'init', array( $this, 'setup_optin_checkout_filter' ) );
40
- /* Enqueue global required scripts */
41
- add_action( 'wp', array( $this, 'wp_actions' ), 55 );
42
-
43
- /* Modify the checkout order received url to go thank you page in our flow */
44
- add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
45
-
46
- add_action( 'wp_head', array( $this, 'facebook_pixel_init' ) );
47
-
48
- }
49
-
50
- /**
51
- * Redirect to thank page if upsell not exists
52
- *
53
- * @param string $order_recieve_url url.
54
- * @param object $order order object.
55
- * @since 1.0.0
56
- */
57
- public function redirect_to_thankyou_page( $order_recieve_url, $order ) {
58
-
59
- /* Only for thank you page */
60
- wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
61
- wcf()->logger->log( 'Only for thank you page' );
62
-
63
- if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
64
-
65
- if ( _is_wcf_doing_checkout_ajax() ) {
66
-
67
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
68
-
69
- if ( ! $checkout_id ) {
70
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
71
- }
72
- } else {
73
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
74
- }
75
-
76
- wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
77
-
78
- if ( $checkout_id ) {
79
-
80
- $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
81
-
82
- if ( $thankyou_step_id ) {
83
-
84
- $order_recieve_url = get_permalink( $thankyou_step_id );
85
-
86
- $order_recieve_url = add_query_arg(
87
- array(
88
- 'wcf-key' => $order->get_order_key(),
89
- 'wcf-order' => $order->get_id(),
90
- ),
91
- $order_recieve_url
92
- );
93
- }
94
- }
95
- }
96
-
97
- wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
98
-
99
- Cartflows_Helper::send_fb_response_if_enabled( $order->get_id() );
100
-
101
- Cartflows_Tracking::send_ga_data_if_enabled( $order->get_id() );
102
-
103
- return $order_recieve_url;
104
- }
105
-
106
- /**
107
- * Cancel and redirect to checkout
108
- *
109
- * @param string $return_url url.
110
- * @since 1.0.0
111
- */
112
- public function redirect_to_checkout_on_cancel( $return_url ) {
113
-
114
- if ( _is_wcf_doing_checkout_ajax() ) {
115
-
116
- $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
117
-
118
- if ( ! $checkout_id ) {
119
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
120
- }
121
- } else {
122
- $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
123
- }
124
-
125
- if ( $checkout_id ) {
126
-
127
- $return_url = add_query_arg(
128
- array(
129
- 'cancel_order' => 'true',
130
- '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
131
- ),
132
- get_permalink( $checkout_id )
133
- );
134
- }
135
-
136
- return $return_url;
137
- }
138
-
139
-
140
- /**
141
- * Remove theme styles.
142
- *
143
- * @since 1.0.0
144
- */
145
- public function remove_theme_styles() {
146
-
147
- if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
148
- return;
149
- }
150
-
151
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
152
-
153
- $page_template = apply_filters( 'cartflows_page_template', $page_template );
154
-
155
- if ( ! _wcf_supported_template( $page_template ) ) {
156
- return;
157
- }
158
-
159
- // get all styles data.
160
- global $wp_styles;
161
- global $wp_scripts;
162
-
163
- $get_stylesheet = 'themes/' . get_stylesheet() . '/';
164
- $get_template = 'themes/' . get_template() . '/';
165
-
166
- $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
167
-
168
- if ( $remove_styles ) {
169
-
170
- // loop over all of the registered scripts..
171
- foreach ( $wp_styles->registered as $handle => $data ) {
172
-
173
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
174
-
175
- // remove it.
176
- wp_deregister_style( $handle );
177
- wp_dequeue_style( $handle );
178
- }
179
- }
180
- }
181
-
182
- $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
183
-
184
- if ( $remove_scripts ) {
185
-
186
- // loop over all of the registered scripts.
187
- foreach ( $wp_scripts->registered as $handle => $data ) {
188
-
189
- if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
190
-
191
- // remove it.
192
- wp_deregister_script( $handle );
193
- wp_dequeue_script( $handle );
194
- }
195
- }
196
- }
197
-
198
- }
199
-
200
- /**
201
- * Update main order data in transient.
202
- *
203
- * @param array $woo_styles new styles array.
204
- * @since 1.0.0
205
- * @return array.
206
- */
207
- public function woo_default_css( $woo_styles ) {
208
-
209
- $woo_styles = array(
210
- 'woocommerce-layout' => array(
211
- 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
212
- 'deps' => '',
213
- 'version' => WC_VERSION,
214
- 'media' => 'all',
215
- 'has_rtl' => true,
216
- ),
217
- 'woocommerce-smallscreen' => array(
218
- 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
219
- 'deps' => 'woocommerce-layout',
220
- 'version' => WC_VERSION,
221
- 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
222
- 'has_rtl' => true,
223
- ),
224
- 'woocommerce-general' => array(
225
- 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
226
- 'deps' => '',
227
- 'version' => WC_VERSION,
228
- 'media' => 'all',
229
- 'has_rtl' => true,
230
- ),
231
- );
232
-
233
- return $woo_styles;
234
- }
235
-
236
- /**
237
- * Init Actions.
238
- *
239
- * @since 1.0.0
240
- */
241
- public function init_actions() {
242
-
243
- $this->set_flow_session();
244
- }
245
-
246
- /**
247
- * Set flow session.
248
- *
249
- * @since 1.0.0
250
- */
251
- public function set_flow_session() {
252
-
253
- if ( wcf()->utils->is_step_post_type() ) {
254
- global $wp;
255
- add_action( 'wp_head', array( $this, 'noindex_flow' ) );
256
-
257
- wcf()->utils->do_not_cache();
258
-
259
- if ( _is_wcf_thankyou_type() ) {
260
- /* Set key to support pixel */
261
- if ( isset( $_GET['wcf-key'] ) ) { //phpcs:ignore
262
-
263
- $wcf_key = sanitize_text_field( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
264
-
265
- $_GET['key'] = $wcf_key;
266
- $_REQUEST['key'] = $wcf_key;
267
- }
268
-
269
- if ( isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
270
-
271
- $wcf_order = intval( wp_unslash( $_GET['wcf-order'] ) ); //phpcs:ignore
272
-
273
- $_GET['order'] = $wcf_order;
274
- $_REQUEST['order'] = $wcf_order;
275
- $_GET['order-received'] = $wcf_order;
276
- $_REQUEST['order-received'] = $wcf_order;
277
-
278
- $wp->set_query_var( 'order-received', $wcf_order );
279
- }
280
- }
281
- }
282
- }
283
-
284
- /**
285
- * Add noindex, nofollow.
286
- *
287
- * @since 1.0.0
288
- */
289
- public function noindex_flow() {
290
-
291
- $common = Cartflows_Helper::get_common_settings();
292
-
293
- if ( 'enable' === $common['disallow_indexing'] ) {
294
- echo '<meta name="robots" content="noindex,nofollow">';
295
- }
296
- }
297
-
298
- /**
299
- * WP Actions.
300
- *
301
- * @since 1.0.0
302
- */
303
- public function wp_actions() {
304
-
305
- if ( wcf()->utils->is_step_post_type() ) {
306
-
307
- if ( ! wcf()->is_woo_active && wcf()->utils->check_is_woo_required_page() ) {
308
- wp_die( ' This page requires WooCommerce plugin installed and activated!', 'WooCommerce Required' );
309
- }
310
-
311
- /* CSS Compatibility for All theme */
312
- add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
313
-
314
- add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
315
- add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
316
-
317
- /* Load woo templates from plugin */
318
- add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
319
-
320
- /* Add version class to body in frontend. */
321
- add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
322
-
323
- /* Custom Script Option */
324
- add_action( 'wp_head', array( $this, 'custom_script_option' ) );
325
-
326
- /* Remove the action applied by the Flatsome theme */
327
- if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
328
- $this->remove_flatsome_action();
329
- }
330
- }
331
- }
332
-
333
- /**
334
- * Function for facebook pixel.
335
- */
336
- public function facebook_pixel_init() {
337
-
338
- $facebook_settings = Cartflows_Helper::get_facebook_settings();
339
- if ( 'enable' === $facebook_settings['facebook_pixel_tracking'] ) {
340
-
341
- $facebook_id = $facebook_settings['facebook_pixel_id'];
342
- echo '<!-- Facebook Pixel Script By CartFlows -->';
343
- $fb_script = "<script type='text/javascript'>
344
- !function(f,b,e,v,n,t,s)
345
- {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
346
- n.callMethod.apply(n,arguments):n.queue.push(arguments)};
347
- if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
348
- n.queue=[];t=b.createElement(e);t.async=!0;
349
- t.src=v;s=b.getElementsByTagName(e)[0];
350
- s.parentNode.insertBefore(t,s)}(window, document,'script',
351
- 'https://connect.facebook.net/en_US/fbevents.js');
352
- </script>
353
- <noscript><img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=" . $facebook_id . "&ev=PageView&noscript=1'/></noscript>";
354
-
355
- $fb_page_view = "<script type='text/javascript'>
356
- fbq('init', $facebook_id);
357
- fbq('track', 'PageView', {'plugin': 'CartFlows'});
358
- </script>";
359
-
360
- if ( 'enable' === $facebook_settings['facebook_pixel_tracking_for_site'] && ! wcf()->utils->is_step_post_type() ) {
361
- echo $fb_script;
362
- echo $fb_page_view;
363
- } else {
364
- echo $fb_script;
365
- }
366
- echo '<!-- End Facebook Pixel Script By CartFlows -->';
367
- }
368
-
369
- }
370
-
371
- /**
372
- * Debug Data Setting Actions.
373
- *
374
- * @since 1.1.14
375
- */
376
- public function debug_data_setting_actions() {
377
-
378
- add_filter( 'cartflows_load_min_assets', array( $this, 'allow_load_minify' ) );
379
- }
380
-
381
- /**
382
- * Get/Set the allow minify option.
383
- *
384
- * @since 1.1.14
385
- */
386
- public function allow_load_minify() {
387
- $debug_data = Cartflows_Helper::get_debug_settings();
388
- $allow_minified = $debug_data['allow_minified_files'];
389
- $allow_minify = false;
390
-
391
- if ( 'enable' === $allow_minified ) {
392
- $allow_minify = true;
393
- }
394
-
395
- return $allow_minify;
396
- }
397
-
398
- /**
399
- * Global flow scripts.
400
- *
401
- * @since 1.0.0
402
- */
403
- public function global_flow_scripts() {
404
-
405
- global $post;
406
-
407
- $flow = get_post_meta( $post->ID, 'wcf-flow-id', true );
408
- $current_step = $post->ID;
409
- $next_step_link = '';
410
- $compatibility = Cartflows_Compatibility::get_instance();
411
-
412
- if ( _is_wcf_landing_type() ) {
413
-
414
- $next_step_id = wcf()->utils->get_next_step_id( $flow, $current_step );
415
- $next_step_link = get_permalink( $next_step_id );
416
- }
417
-
418
- $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
419
-
420
- $fb_active = Cartflows_Helper::get_facebook_settings();
421
- $wcf_ga_active = Cartflows_Helper::get_google_analytics_settings();
422
- $params = array();
423
- $ga_param = array();
424
-
425
- if ( 'enable' === $fb_active['facebook_pixel_tracking'] && Cartflows_Loader::get_instance()->is_woo_active ) {
426
-
427
- $params = Cartflows_Helper::prepare_cart_data_fb_response();
428
- }
429
-
430
- if ( 'enable' === $wcf_ga_active['enable_google_analytics'] ) {
431
- $ga_param = Cartflows_Tracking::get_ga_items_list();
432
- }
433
-
434
- $localize = array(
435
- 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
436
- 'is_pb_preview' => $compatibility->is_page_builder_preview(),
437
- 'current_theme' => $compatibility->get_current_theme(),
438
- 'current_flow' => $flow,
439
- 'current_step' => $current_step,
440
- 'next_step' => $next_step_link,
441
- 'page_template' => $page_template,
442
- 'is_checkout_page' => _is_wcf_checkout_type(),
443
- 'params' => $params,
444
- 'fb_active' => $fb_active,
445
- 'wcf_ga_active' => $wcf_ga_active,
446
- 'ga_param' => $ga_param,
447
- );
448
-
449
- wp_localize_script( 'jquery', 'cartflows', apply_filters( 'global_cartflows_js_localize', $localize ) );
450
-
451
- if ( _wcf_supported_template( $page_template ) ) {
452
-
453
- wp_enqueue_style( 'wcf-normalize-frontend-global', wcf()->utils->get_css_url( 'cartflows-normalize' ), array(), CARTFLOWS_VER );
454
- }
455
-
456
- wp_enqueue_style( 'wcf-frontend-global', wcf()->utils->get_css_url( 'frontend' ), array(), CARTFLOWS_VER );
457
-
458
- wp_enqueue_script(
459
- 'wcf-frontend-global',
460
- wcf()->utils->get_js_url( 'frontend' ),
461
- array( 'jquery', 'jquery-cookie' ),
462
- CARTFLOWS_VER,
463
- false
464
- );
465
- }
466
-
467
- /**
468
- * Custom Script in head.
469
- *
470
- * @since 1.0.0
471
- */
472
- public function custom_script_option() {
473
-
474
- /* Add custom script to header in frontend. */
475
- $script = $this->get_custom_script();
476
- if ( '' !== $script ) {
477
- if ( false === strpos( $script, '<script' ) ) {
478
- $script = '<script>' . $script . '</script>';
479
- }
480
- echo '<!-- Custom CartFlows Script -->';
481
- echo $script;
482
- echo '<!-- End Custom CartFlows Script -->';
483
- }
484
- }
485
-
486
- /**
487
- * Override woo templates.
488
- *
489
- * @param string $template new Template full path.
490
- * @param string $template_name Template name.
491
- * @param string $template_path Template Path.
492
- * @since 1.1.5
493
- * @return string.
494
- */
495
- public function override_woo_template( $template, $template_name, $template_path ) {
496
-
497
- global $woocommerce;
498
-
499
- $_template = $template;
500
-
501
- $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
502
-
503
- if ( file_exists( $plugin_path . $template_name ) ) {
504
- $template = $plugin_path . $template_name;
505
- }
506
-
507
- if ( ! $template ) {
508
- $template = $_template;
509
- }
510
-
511
- return $template;
512
- }
513
-
514
- /**
515
- * Remove the action applied by the Flatsome theme.
516
- *
517
- * @since 1.1.5
518
- * @return void.
519
- */
520
- public function remove_flatsome_action() {
521
-
522
- // Remove action where flatsome dequeued the woocommerce's default styles.
523
- remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
524
- }
525
-
526
- /**
527
- * Add version class to body in frontend.
528
- *
529
- * @since 1.1.5
530
- * @param array $classes classes.
531
- * @return array $classes classes.
532
- */
533
- public function add_cartflows_lite_version_to_body( $classes ) {
534
-
535
- $classes[] = 'cartflows-' . CARTFLOWS_VER;
536
-
537
- return $classes;
538
-
539
- }
540
-
541
- /**
542
- * Get custom script data.
543
- *
544
- * @since 1.0.0
545
- */
546
- public function get_custom_script() {
547
-
548
- global $post;
549
-
550
- $script = get_post_meta( $post->ID, 'wcf-custom-script', true );
551
-
552
- return $script;
553
- }
554
-
555
-
556
- /**
557
- * Set appropriate filter sctions.
558
- *
559
- * @since 1.1.14
560
- */
561
- public function setup_optin_checkout_filter() {
562
-
563
- if ( _is_wcf_doing_optin_ajax() ) {
564
- /* Modify the optin order received url to go next step */
565
- remove_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
566
- add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_optin_to_next_step' ), 10, 2 );
567
- }
568
- }
569
-
570
- /**
571
- * Redirect to thank page if upsell not exists
572
- *
573
- * @param string $order_recieve_url url.
574
- * @param object $order order object.
575
- * @since 1.0.0
576
- */
577
- public function redirect_optin_to_next_step( $order_recieve_url, $order ) {
578
-
579
- /* Only for optin page */
580
- wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
581
- wcf()->logger->log( 'Only for optin page' );
582
-
583
- if ( _is_wcf_doing_optin_ajax() ) {
584
-
585
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
586
-
587
- if ( ! $optin_id ) {
588
- $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
589
- }
590
- } else {
591
- $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
592
- }
593
-
594
- wcf()->logger->log( 'Optin ID : ' . $optin_id );
595
-
596
- if ( $optin_id ) {
597
-
598
- $next_step_id = wcf()->flow->get_next_step_id( $order );
599
-
600
- if ( $next_step_id ) {
601
-
602
- $order_recieve_url = get_permalink( $next_step_id );
603
- $query_param = array(
604
- 'wcf-key' => $order->get_order_key(),
605
- 'wcf-order' => $order->get_id(),
606
- );
607
-
608
- if ( 'yes' === wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-fields' ) ) {
609
-
610
- $fields_string = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-specific-fields' );
611
-
612
- $fields = array_map( 'trim', explode( ',', $fields_string ) );
613
-
614
- if ( is_array( $fields ) ) {
615
-
616
- $order_id = $order->get_id();
617
-
618
- foreach ( $fields as $in => $key ) {
619
- switch ( $key ) {
620
- case 'first_name':
621
- $query_param[ $key ] = $order->get_billing_first_name();
622
- break;
623
- case 'last_name':
624
- $query_param[ $key ] = $order->get_billing_last_name();
625
- break;
626
- case 'email':
627
- $query_param[ $key ] = $order->get_billing_email();
628
- break;
629
- default:
630
- $query_param[ $key ] = get_post_meta( $order_id, '_billing_' . $key, true );
631
- break;
632
- }
633
- }
634
- }
635
- }
636
-
637
- $order_recieve_url = add_query_arg(
638
- $query_param,
639
- $order_recieve_url
640
- );
641
- }
642
- }
643
-
644
- wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
645
-
646
- return $order_recieve_url;
647
- }
648
- }
649
-
650
- /**
651
- * Prepare if class 'Cartflows_Frontend' exist.
652
- * Kicking this off by calling 'get_instance()' method
653
- */
654
- Cartflows_Frontend::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Frontend.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Frontend.
10
+ */
11
+ class Cartflows_Frontend {
12
+
13
+ /**
14
+ * Member Variable
15
+ *
16
+ * @var instance
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Initiator
22
+ */
23
+ public static function get_instance() {
24
+ if ( ! isset( self::$instance ) ) {
25
+ self::$instance = new self();
26
+ }
27
+ return self::$instance;
28
+ }
29
+
30
+ /**
31
+ * Constructor
32
+ */
33
+ public function __construct() {
34
+
35
+ /* Set / Destroy Flow Sessions. Set data */
36
+ add_action( 'wp', array( $this, 'init_actions' ), 1 );
37
+
38
+ add_action( 'init', array( $this, 'debug_data_setting_actions' ) );
39
+ add_action( 'init', array( $this, 'setup_optin_checkout_filter' ) );
40
+ /* Enqueue global required scripts */
41
+ add_action( 'wp', array( $this, 'wp_actions' ), 55 );
42
+
43
+ /* Modify the checkout order received url to go thank you page in our flow */
44
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
45
+
46
+ add_action( 'wp_head', array( $this, 'facebook_pixel_init' ) );
47
+
48
+ }
49
+
50
+ /**
51
+ * Redirect to thank page if upsell not exists
52
+ *
53
+ * @param string $order_recieve_url url.
54
+ * @param object $order order object.
55
+ * @since 1.0.0
56
+ */
57
+ public function redirect_to_thankyou_page( $order_recieve_url, $order ) {
58
+
59
+ /* Only for thank you page */
60
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
61
+ wcf()->logger->log( 'Only for thank you page' );
62
+
63
+ if ( wcf()->flow->is_thankyou_page_exists( $order ) ) {
64
+
65
+ if ( _is_wcf_doing_checkout_ajax() ) {
66
+
67
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
68
+
69
+ if ( ! $checkout_id ) {
70
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
71
+ }
72
+ } else {
73
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
74
+ }
75
+
76
+ wcf()->logger->log( 'Checkout ID : ' . $checkout_id );
77
+
78
+ if ( $checkout_id ) {
79
+
80
+ $thankyou_step_id = wcf()->flow->get_thankyou_page_id( $order );
81
+
82
+ if ( $thankyou_step_id ) {
83
+
84
+ $order_recieve_url = get_permalink( $thankyou_step_id );
85
+
86
+ $order_recieve_url = add_query_arg(
87
+ array(
88
+ 'wcf-key' => $order->get_order_key(),
89
+ 'wcf-order' => $order->get_id(),
90
+ ),
91
+ $order_recieve_url
92
+ );
93
+ }
94
+ }
95
+ }
96
+
97
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
98
+
99
+ Cartflows_Helper::send_fb_response_if_enabled( $order->get_id() );
100
+
101
+ Cartflows_Tracking::send_ga_data_if_enabled( $order->get_id() );
102
+
103
+ return $order_recieve_url;
104
+ }
105
+
106
+ /**
107
+ * Cancel and redirect to checkout
108
+ *
109
+ * @param string $return_url url.
110
+ * @since 1.0.0
111
+ */
112
+ public function redirect_to_checkout_on_cancel( $return_url ) {
113
+
114
+ if ( _is_wcf_doing_checkout_ajax() ) {
115
+
116
+ $checkout_id = wcf()->utils->get_checkout_id_from_post_data();
117
+
118
+ if ( ! $checkout_id ) {
119
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
120
+ }
121
+ } else {
122
+ $checkout_id = wcf()->utils->get_checkout_id_from_order( $order->get_id() );
123
+ }
124
+
125
+ if ( $checkout_id ) {
126
+
127
+ $return_url = add_query_arg(
128
+ array(
129
+ 'cancel_order' => 'true',
130
+ '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ),
131
+ ),
132
+ get_permalink( $checkout_id )
133
+ );
134
+ }
135
+
136
+ return $return_url;
137
+ }
138
+
139
+
140
+ /**
141
+ * Remove theme styles.
142
+ *
143
+ * @since 1.0.0
144
+ */
145
+ public function remove_theme_styles() {
146
+
147
+ if ( Cartflows_Compatibility::get_instance()->is_compatibility_theme_enabled() ) {
148
+ return;
149
+ }
150
+
151
+ $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
152
+
153
+ $page_template = apply_filters( 'cartflows_page_template', $page_template );
154
+
155
+ if ( ! _wcf_supported_template( $page_template ) ) {
156
+ return;
157
+ }
158
+
159
+ // get all styles data.
160
+ global $wp_styles;
161
+ global $wp_scripts;
162
+
163
+ $get_stylesheet = 'themes/' . get_stylesheet() . '/';
164
+ $get_template = 'themes/' . get_template() . '/';
165
+
166
+ $remove_styles = apply_filters( 'cartflows_remove_theme_styles', true );
167
+
168
+ if ( $remove_styles ) {
169
+
170
+ // loop over all of the registered scripts..
171
+ foreach ( $wp_styles->registered as $handle => $data ) {
172
+
173
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
174
+
175
+ // remove it.
176
+ wp_deregister_style( $handle );
177
+ wp_dequeue_style( $handle );
178
+ }
179
+ }
180
+ }
181
+
182
+ $remove_scripts = apply_filters( 'cartflows_remove_theme_scripts', true );
183
+
184
+ if ( $remove_scripts ) {
185
+
186
+ // loop over all of the registered scripts.
187
+ foreach ( $wp_scripts->registered as $handle => $data ) {
188
+
189
+ if ( strpos( $data->src, $get_template ) !== false || strpos( $data->src, $get_stylesheet ) !== false ) {
190
+
191
+ // remove it.
192
+ wp_deregister_script( $handle );
193
+ wp_dequeue_script( $handle );
194
+ }
195
+ }
196
+ }
197
+
198
+ }
199
+
200
+ /**
201
+ * Update main order data in transient.
202
+ *
203
+ * @param array $woo_styles new styles array.
204
+ * @since 1.0.0
205
+ * @return array.
206
+ */
207
+ public function woo_default_css( $woo_styles ) {
208
+
209
+ $woo_styles = array(
210
+ 'woocommerce-layout' => array(
211
+ 'src' => plugins_url( 'assets/css/woocommerce-layout.css', WC_PLUGIN_FILE ),
212
+ 'deps' => '',
213
+ 'version' => WC_VERSION,
214
+ 'media' => 'all',
215
+ 'has_rtl' => true,
216
+ ),
217
+ 'woocommerce-smallscreen' => array(
218
+ 'src' => plugins_url( 'assets/css/woocommerce-smallscreen.css', WC_PLUGIN_FILE ),
219
+ 'deps' => 'woocommerce-layout',
220
+ 'version' => WC_VERSION,
221
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'woocommerce_style_smallscreen_breakpoint', '768px' ) . ')',
222
+ 'has_rtl' => true,
223
+ ),
224
+ 'woocommerce-general' => array(
225
+ 'src' => plugins_url( 'assets/css/woocommerce.css', WC_PLUGIN_FILE ),
226
+ 'deps' => '',
227
+ 'version' => WC_VERSION,
228
+ 'media' => 'all',
229
+ 'has_rtl' => true,
230
+ ),
231
+ );
232
+
233
+ return $woo_styles;
234
+ }
235
+
236
+ /**
237
+ * Init Actions.
238
+ *
239
+ * @since 1.0.0
240
+ */
241
+ public function init_actions() {
242
+
243
+ if ( wcf()->utils->is_step_post_type() ) {
244
+
245
+ global $post;
246
+
247
+ $GLOBALS['wcf_step'] = wcf_get_step( $post->ID );
248
+
249
+ do_action( 'cartflows_wp', $post->ID );
250
+
251
+ $this->set_flow_session();
252
+ }
253
+ }
254
+
255
+ /**
256
+ * Set flow session.
257
+ *
258
+ * @since 1.0.0
259
+ */
260
+ public function set_flow_session() {
261
+
262
+ global $wp;
263
+
264
+ add_action( 'wp_head', array( $this, 'noindex_flow' ) );
265
+
266
+ wcf()->utils->do_not_cache();
267
+
268
+ if ( _is_wcf_thankyou_type() ) {
269
+ /* Set key to support pixel */
270
+ if ( isset( $_GET['wcf-key'] ) ) { //phpcs:ignore
271
+
272
+ $wcf_key = sanitize_text_field( wp_unslash( $_GET['wcf-key'] ) ); //phpcs:ignore
273
+
274
+ $_GET['key'] = $wcf_key;
275
+ $_REQUEST['key'] = $wcf_key;
276
+ }
277
+
278
+ if ( isset( $_GET['wcf-order'] ) ) { //phpcs:ignore
279
+
280
+ $wcf_order = intval( wp_unslash( $_GET['wcf-order'] ) ); //phpcs:ignore
281
+
282
+ $_GET['order'] = $wcf_order;
283
+ $_REQUEST['order'] = $wcf_order;
284
+ $_GET['order-received'] = $wcf_order;
285
+ $_REQUEST['order-received'] = $wcf_order;
286
+
287
+ $wp->set_query_var( 'order-received', $wcf_order );
288
+ }
289
+ }
290
+ }
291
+
292
+ /**
293
+ * Add noindex, nofollow.
294
+ *
295
+ * @since 1.0.0
296
+ */
297
+ public function noindex_flow() {
298
+
299
+ $common = Cartflows_Helper::get_common_settings();
300
+
301
+ if ( 'enable' === $common['disallow_indexing'] ) {
302
+ echo '<meta name="robots" content="noindex,nofollow">';
303
+ }
304
+ }
305
+
306
+ /**
307
+ * WP Actions.
308
+ *
309
+ * @since 1.0.0
310
+ */
311
+ public function wp_actions() {
312
+
313
+ if ( wcf()->utils->is_step_post_type() ) {
314
+
315
+ if ( ! wcf()->is_woo_active && wcf()->utils->check_is_woo_required_page() ) {
316
+ wp_die( ' This page requires WooCommerce plugin installed and activated!', 'WooCommerce Required' );
317
+ }
318
+
319
+ /* CSS Compatibility for All theme */
320
+ add_filter( 'woocommerce_enqueue_styles', array( $this, 'woo_default_css' ), 9999 );
321
+
322
+ add_action( 'wp_enqueue_scripts', array( $this, 'remove_theme_styles' ), 9999 );
323
+ add_action( 'wp_enqueue_scripts', array( $this, 'global_flow_scripts' ), 20 );
324
+
325
+ /* Load woo templates from plugin */
326
+ add_filter( 'woocommerce_locate_template', array( $this, 'override_woo_template' ), 20, 3 );
327
+
328
+ /* Add version class to body in frontend. */
329
+ add_filter( 'body_class', array( $this, 'add_cartflows_lite_version_to_body' ) );
330
+
331
+ /* Custom Script Option */
332
+ add_action( 'wp_head', array( $this, 'custom_script_option' ) );
333
+
334
+ /* Remove the action applied by the Flatsome theme */
335
+ if ( Cartflows_Compatibility::get_instance()->is_flatsome_enabled() ) {
336
+ $this->remove_flatsome_action();
337
+ }
338
+ }
339
+ }
340
+
341
+ /**
342
+ * Function for facebook pixel.
343
+ */
344
+ public function facebook_pixel_init() {
345
+
346
+ $facebook_settings = Cartflows_Helper::get_facebook_settings();
347
+ if ( 'enable' === $facebook_settings['facebook_pixel_tracking'] ) {
348
+
349
+ $facebook_id = $facebook_settings['facebook_pixel_id'];
350
+ echo '<!-- Facebook Pixel Script By CartFlows -->';
351
+ $fb_script = "<script type='text/javascript'>
352
+ !function(f,b,e,v,n,t,s)
353
+ {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
354
+ n.callMethod.apply(n,arguments):n.queue.push(arguments)};
355
+ if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
356
+ n.queue=[];t=b.createElement(e);t.async=!0;
357
+ t.src=v;s=b.getElementsByTagName(e)[0];
358
+ s.parentNode.insertBefore(t,s)}(window, document,'script',
359
+ 'https://connect.facebook.net/en_US/fbevents.js');
360
+ </script>
361
+ <noscript><img height='1' width='1' style='display:none' src='https://www.facebook.com/tr?id=" . $facebook_id . "&ev=PageView&noscript=1'/></noscript>";
362
+
363
+ $fb_page_view = "<script type='text/javascript'>
364
+ fbq('init', $facebook_id);
365
+ fbq('track', 'PageView', {'plugin': 'CartFlows'});
366
+ </script>";
367
+
368
+ if ( 'enable' === $facebook_settings['facebook_pixel_tracking_for_site'] && ! wcf()->utils->is_step_post_type() ) {
369
+ echo $fb_script;
370
+ echo $fb_page_view;
371
+ } else {
372
+ echo $fb_script;
373
+ }
374
+ echo '<!-- End Facebook Pixel Script By CartFlows -->';
375
+ }
376
+
377
+ }
378
+
379
+ /**
380
+ * Debug Data Setting Actions.
381
+ *
382
+ * @since 1.1.14
383
+ */
384
+ public function debug_data_setting_actions() {
385
+
386
+ add_filter( 'cartflows_load_min_assets', array( $this, 'allow_load_minify' ) );
387
+ }
388
+
389
+ /**
390
+ * Get/Set the allow minify option.
391
+ *
392
+ * @since 1.1.14
393
+ */
394
+ public function allow_load_minify() {
395
+ $debug_data = Cartflows_Helper::get_debug_settings();
396
+ $allow_minified = $debug_data['allow_minified_files'];
397
+ $allow_minify = false;
398
+
399
+ if ( 'enable' === $allow_minified ) {
400
+ $allow_minify = true;
401
+ }
402
+
403
+ return $allow_minify;
404
+ }
405
+
406
+ /**
407
+ * Global flow scripts.
408
+ *
409
+ * @since 1.0.0
410
+ */
411
+ public function global_flow_scripts() {
412
+
413
+ global $post, $wcf_step;
414
+
415
+ $flow = $wcf_step->get_flow_id();
416
+ $current_step = $wcf_step->get_current_step();
417
+ $control_step = $wcf_step->get_control_step();
418
+ $next_step_link = '';
419
+ $compatibility = Cartflows_Compatibility::get_instance();
420
+
421
+ if ( _is_wcf_landing_type() ) {
422
+
423
+ $next_step_id = $wcf_step->get_direct_next_step_id();
424
+ $next_step_link = get_permalink( $next_step_id );
425
+ }
426
+
427
+ $page_template = get_post_meta( $current_step, '_wp_page_template', true );
428
+
429
+ $fb_active = Cartflows_Helper::get_facebook_settings();
430
+ $ga_active = Cartflows_Helper::get_google_analytics_settings();
431
+ $params = array();
432
+ $ga_param = array();
433
+
434
+ if ( 'enable' === $fb_active['facebook_pixel_tracking'] && Cartflows_Loader::get_instance()->is_woo_active ) {
435
+
436
+ $params = Cartflows_Helper::prepare_cart_data_fb_response();
437
+ }
438
+
439
+ if ( 'enable' === $ga_active['enable_google_analytics'] ) {
440
+ $ga_param = Cartflows_Tracking::get_ga_items_list();
441
+ }
442
+
443
+ $localize = array(
444
+ 'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ),
445
+ 'is_pb_preview' => $compatibility->is_page_builder_preview(),
446
+ 'current_theme' => $compatibility->get_current_theme(),
447
+ 'current_flow' => $flow,
448
+ 'current_step' => $current_step,
449
+ 'control_step' => $control_step,
450
+ 'next_step' => $next_step_link,
451
+ 'page_template' => $page_template,
452
+ 'is_checkout_page' => _is_wcf_checkout_type(),
453
+ 'params' => $params,
454
+ 'fb_active' => $fb_active,
455
+ 'wcf_ga_active' => $ga_active,
456
+ 'ga_param' => $ga_param,
457
+ );
458
+
459
+ $localize = apply_filters( 'global_cartflows_js_localize', $localize );
460
+
461
+ $localize_script = '<!-- script to print the admin localized variables -->';
462
+ $localize_script .= '<script type="text/javascript">';
463
+ $localize_script .= 'var cartflows = ' . wp_json_encode( $localize ) . ';';
464
+ $localize_script .= '</script>';
465
+
466
+ echo $localize_script;
467
+
468
+ if ( _wcf_supported_template( $page_template ) ) {
469
+
470
+ wp_enqueue_style( 'wcf-normalize-frontend-global', wcf()->utils->get_css_url( 'cartflows-normalize' ), array(), CARTFLOWS_VER );
471
+ }
472
+
473
+ wp_enqueue_style( 'wcf-frontend-global', wcf()->utils->get_css_url( 'frontend' ), array(), CARTFLOWS_VER );
474
+
475
+ wp_enqueue_script(
476
+ 'wcf-frontend-global',
477
+ wcf()->utils->get_js_url( 'frontend' ),
478
+ array( 'jquery', 'jquery-cookie' ),
479
+ CARTFLOWS_VER,
480
+ false
481
+ );
482
+ }
483
+
484
+ /**
485
+ * Custom Script in head.
486
+ *
487
+ * @since 1.0.0
488
+ */
489
+ public function custom_script_option() {
490
+
491
+ /* Add custom script to header in frontend. */
492
+ $script = $this->get_custom_script();
493
+ if ( '' !== $script ) {
494
+ if ( false === strpos( $script, '<script' ) ) {
495
+ $script = '<script>' . $script . '</script>';
496
+ }
497
+ echo '<!-- Custom CartFlows Script -->';
498
+ echo $script;
499
+ echo '<!-- End Custom CartFlows Script -->';
500
+ }
501
+ }
502
+
503
+ /**
504
+ * Override woo templates.
505
+ *
506
+ * @param string $template new Template full path.
507
+ * @param string $template_name Template name.
508
+ * @param string $template_path Template Path.
509
+ * @since 1.1.5
510
+ * @return string.
511
+ */
512
+ public function override_woo_template( $template, $template_name, $template_path ) {
513
+
514
+ global $woocommerce;
515
+
516
+ $_template = $template;
517
+
518
+ $plugin_path = CARTFLOWS_DIR . 'woocommerce/template/';
519
+
520
+ if ( file_exists( $plugin_path . $template_name ) ) {
521
+ $template = $plugin_path . $template_name;
522
+ }
523
+
524
+ if ( ! $template ) {
525
+ $template = $_template;
526
+ }
527
+
528
+ return $template;
529
+ }
530
+
531
+ /**
532
+ * Remove the action applied by the Flatsome theme.
533
+ *
534
+ * @since 1.1.5
535
+ * @return void.
536
+ */
537
+ public function remove_flatsome_action() {
538
+
539
+ // Remove action where flatsome dequeued the woocommerce's default styles.
540
+ remove_action( 'wp_enqueue_scripts', 'flatsome_woocommerce_scripts_styles', 98 );
541
+ }
542
+
543
+ /**
544
+ * Add version class to body in frontend.
545
+ *
546
+ * @since 1.1.5
547
+ * @param array $classes classes.
548
+ * @return array $classes classes.
549
+ */
550
+ public function add_cartflows_lite_version_to_body( $classes ) {
551
+
552
+ $classes[] = 'cartflows-' . CARTFLOWS_VER;
553
+
554
+ return $classes;
555
+
556
+ }
557
+
558
+ /**
559
+ * Get custom script data.
560
+ *
561
+ * @since 1.0.0
562
+ */
563
+ public function get_custom_script() {
564
+
565
+ global $post;
566
+
567
+ $script = get_post_meta( $post->ID, 'wcf-custom-script', true );
568
+
569
+ return $script;
570
+ }
571
+
572
+
573
+ /**
574
+ * Set appropriate filter sctions.
575
+ *
576
+ * @since 1.1.14
577
+ */
578
+ public function setup_optin_checkout_filter() {
579
+
580
+ if ( _is_wcf_doing_optin_ajax() ) {
581
+ /* Modify the optin order received url to go next step */
582
+ remove_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_to_thankyou_page' ), 10, 2 );
583
+ add_filter( 'woocommerce_get_checkout_order_received_url', array( $this, 'redirect_optin_to_next_step' ), 10, 2 );
584
+ }
585
+ }
586
+
587
+ /**
588
+ * Redirect to thank page if upsell not exists
589
+ *
590
+ * @param string $order_recieve_url url.
591
+ * @param object $order order object.
592
+ * @since 1.0.0
593
+ */
594
+ public function redirect_optin_to_next_step( $order_recieve_url, $order ) {
595
+
596
+ /* Only for optin page */
597
+ wcf()->logger->log( 'Start-' . __CLASS__ . '::' . __FUNCTION__ );
598
+ wcf()->logger->log( 'Only for optin page' );
599
+
600
+ if ( _is_wcf_doing_optin_ajax() ) {
601
+
602
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
603
+
604
+ if ( ! $optin_id ) {
605
+ $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
606
+ }
607
+ } else {
608
+ $optin_id = wcf()->utils->get_optin_id_from_order( $order->get_id() );
609
+ }
610
+
611
+ wcf()->logger->log( 'Optin ID : ' . $optin_id );
612
+
613
+ if ( $optin_id ) {
614
+
615
+ $wcf_step_obj = wcf_get_step( $optin_id );
616
+ $next_step_id = $wcf_step_obj->get_direct_next_step_id();
617
+
618
+ if ( $next_step_id ) {
619
+
620
+ $order_recieve_url = get_permalink( $next_step_id );
621
+ $query_param = array(
622
+ 'wcf-key' => $order->get_order_key(),
623
+ 'wcf-order' => $order->get_id(),
624
+ );
625
+
626
+ if ( 'yes' === wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-fields' ) ) {
627
+
628
+ $fields_string = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-pass-specific-fields' );
629
+
630
+ $fields = array_map( 'trim', explode( ',', $fields_string ) );
631
+
632
+ if ( is_array( $fields ) ) {
633
+
634
+ $order_id = $order->get_id();
635
+
636
+ foreach ( $fields as $in => $key ) {
637
+ switch ( $key ) {
638
+ case 'first_name':
639
+ $query_param[ $key ] = $order->get_billing_first_name();
640
+ break;
641
+ case 'last_name':
642
+ $query_param[ $key ] = $order->get_billing_last_name();
643
+ break;
644
+ case 'email':
645
+ $query_param[ $key ] = $order->get_billing_email();
646
+ break;
647
+ default:
648
+ $query_param[ $key ] = get_post_meta( $order_id, '_billing_' . $key, true );
649
+ break;
650
+ }
651
+ }
652
+ }
653
+ }
654
+
655
+ $order_recieve_url = add_query_arg(
656
+ $query_param,
657
+ $order_recieve_url
658
+ );
659
+ }
660
+ }
661
+
662
+ wcf()->logger->log( 'End-' . __CLASS__ . '::' . __FUNCTION__ );
663
+
664
+ return $order_recieve_url;
665
+ }
666
+ }
667
+
668
+ /**
669
+ * Prepare if class 'Cartflows_Frontend' exist.
670
+ * Kicking this off by calling 'get_instance()' method
671
+ */
672
+ Cartflows_Frontend::get_instance();
classes/class-cartflows-functions.php CHANGED
@@ -1,539 +1,555 @@
1
- <?php
2
- /**
3
- * CartFlows Functions.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- /**
13
- * Fatal error mb_strpos fallback.
14
- *
15
- * @param string $string string where to find.
16
- * @param string $search string to search.
17
- * @since 1.0.0
18
- */
19
- function wcf_mb_strpos( $string, $search ) {
20
-
21
- if ( function_exists( 'mb_strpos' ) ) {
22
- return mb_strpos( $string, $search, 0, 'utf-8' );
23
- } else {
24
- return strpos( $string, $search );
25
- }
26
- }
27
-
28
- /**
29
- * Check if cartflows pro activated.
30
- *
31
- * @since 1.0.0
32
- */
33
- function _is_cartflows_pro() {
34
-
35
- if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
36
- return true;
37
- }
38
-
39
- return false;
40
-
41
- }
42
-
43
- /**
44
- * Returns pro version number.
45
- *
46
- * @param int $version version number.
47
- * @since 1.0.0
48
- */
49
- function _is_cartflows_pro_ver_less_than( $version ) {
50
-
51
- if ( defined( 'CARTFLOWS_PRO_VER' ) && version_compare( CARTFLOWS_PRO_VER, $version, '<' ) ) {
52
- return true;
53
- }
54
-
55
- return false;
56
- }
57
-
58
- /**
59
- * Returns step id.
60
- *
61
- * @since 1.0.0
62
- */
63
- function _get_wcf_post_id() {
64
-
65
- global $post;
66
-
67
- if ( isset( $post->ID ) ) {
68
- return $post->ID;
69
- }
70
-
71
- return 0;
72
- }
73
-
74
- /**
75
- * Returns step id.
76
- *
77
- * @since 1.0.0
78
- */
79
- function _get_wcf_step_id() {
80
-
81
- if ( wcf()->utils->is_step_post_type() ) {
82
-
83
- global $post;
84
-
85
- return $post->ID;
86
- }
87
-
88
- return false;
89
- }
90
-
91
- /**
92
- * Check if it is a landing page?
93
- *
94
- * @since 1.0.0
95
- */
96
- function _is_wcf_landing_type() {
97
-
98
- if ( wcf()->utils->is_step_post_type() ) {
99
-
100
- global $post;
101
-
102
- if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
103
-
104
- return true;
105
- }
106
- }
107
-
108
- return false;
109
- }
110
-
111
- /**
112
- * Returns landing id.
113
- *
114
- * @since 1.0.0
115
- */
116
- function _get_wcf_landing_id() {
117
-
118
- if ( _is_wcf_landing_type() ) {
119
-
120
- global $post;
121
-
122
- return $post->ID;
123
- }
124
-
125
- return false;
126
- }
127
-
128
- /**
129
- * Is custom checkout?
130
- *
131
- * @param int $checkout_id checkout ID.
132
- * @since 1.0.0
133
- */
134
- function _is_wcf_meta_custom_checkout( $checkout_id ) {
135
-
136
- $is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
137
-
138
- if ( 'yes' === $is_custom ) {
139
-
140
- return true;
141
- }
142
-
143
- return false;
144
- }
145
-
146
- /**
147
- * Check if page is cartflow checkout.
148
- *
149
- * @since 1.0.0
150
- * @return bool
151
- */
152
- function _is_wcf_checkout_type() {
153
-
154
- if ( wcf()->utils->is_step_post_type() ) {
155
-
156
- global $post;
157
-
158
- if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
159
-
160
- return true;
161
- }
162
- }
163
-
164
- return false;
165
- }
166
-
167
- /**
168
- * Check if AJAX call is in progress.
169
- *
170
- * @since 1.0.0
171
- * @return bool
172
- */
173
- function _is_wcf_doing_checkout_ajax() {
174
-
175
- if ( wp_doing_ajax() || isset( $_GET['wc-ajax'] ) ) { //phpcs:ignore
176
-
177
- if ( isset( $_GET['wc-ajax'] ) && //phpcs:ignore
178
- isset( $_POST['_wcf_checkout_id'] ) //phpcs:ignore
179
- ) {
180
- return true;
181
- }
182
- }
183
-
184
- return false;
185
- }
186
-
187
- /**
188
- * Check if optin AJAX call is in progress.
189
- *
190
- * @since 1.0.0
191
- * @return bool
192
- */
193
- function _is_wcf_doing_optin_ajax() {
194
-
195
- if ( wp_doing_ajax() || isset( $_GET['wc-ajax'] ) ) { //phpcs:ignore
196
-
197
- if ( isset( $_GET['wc-ajax'] ) && //phpcs:ignore
198
- isset( $_POST['_wcf_optin_id'] ) //phpcs:ignore
199
- ) {
200
- return true;
201
- }
202
- }
203
-
204
- return false;
205
- }
206
-
207
- /**
208
- * Returns checkout ID.
209
- *
210
- * @since 1.0.0
211
- * @return int/bool
212
- */
213
- function _get_wcf_checkout_id() {
214
-
215
- if ( _is_wcf_checkout_type() ) {
216
-
217
- global $post;
218
-
219
- return $post->ID;
220
- }
221
-
222
- return false;
223
- }
224
-
225
- /**
226
- * Check if it is checkout shortcode.
227
- *
228
- * @since 1.0.0
229
- * @return bool
230
- */
231
- function _is_wcf_checkout_shortcode() {
232
-
233
- global $post;
234
-
235
- if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
236
-
237
- return true;
238
- }
239
-
240
- return false;
241
- }
242
-
243
- /**
244
- * Check if it is checkout shortcode.
245
- *
246
- * @since 1.0.0
247
- * @param string $content shortcode content.
248
- * @return bool
249
- */
250
- function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
251
-
252
- $checkout_id = 0;
253
-
254
- if ( ! empty( $content ) ) {
255
-
256
- $regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
257
-
258
- preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
259
-
260
- if ( ! empty( $regex_matches ) ) {
261
-
262
- if ( 'cartflows_checkout' == $regex_matches[2] ) {
263
-
264
- $attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
265
- $attribure_str = str_replace( '"', '', $attribure_str );
266
-
267
- $attributes = wp_parse_args( $attribure_str );
268
-
269
- if ( isset( $attributes['id'] ) ) {
270
- $checkout_id = $attributes['id'];
271
- }
272
- }
273
- }
274
- }
275
-
276
- return $checkout_id;
277
- }
278
-
279
- /**
280
- * Check if post type is upsell.
281
- *
282
- * @since 1.0.0
283
- * @return bool
284
- */
285
- function _is_wcf_upsell_type() {
286
-
287
- if ( wcf()->utils->is_step_post_type() ) {
288
-
289
- global $post;
290
-
291
- if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
292
-
293
- return true;
294
- }
295
- }
296
-
297
- return false;
298
- }
299
-
300
- /**
301
- * Returns upsell ID.
302
- *
303
- * @since 1.0.0
304
- * @return int/bool
305
- */
306
- function _get_wcf_upsell_id() {
307
-
308
- if ( _is_wcf_upsell_type() ) {
309
-
310
- global $post;
311
-
312
- return $post->ID;
313
- }
314
-
315
- return false;
316
- }
317
-
318
- /**
319
- * Check if post is of type downsell.
320
- *
321
- * @since 1.0.0
322
- * @return int/bool
323
- */
324
- function _is_wcf_downsell_type() {
325
-
326
- if ( wcf()->utils->is_step_post_type() ) {
327
-
328
- global $post;
329
-
330
- if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
331
-
332
- return true;
333
- }
334
- }
335
-
336
- return false;
337
- }
338
-
339
- /**
340
- * Get downsell page ID.
341
- *
342
- * @since 1.0.0
343
- * @return int/bool
344
- */
345
- function _get_wcf_downsell_id() {
346
-
347
- if ( _is_wcf_downsell_type() ) {
348
-
349
- global $post;
350
-
351
- return $post->ID;
352
- }
353
-
354
- return false;
355
- }
356
-
357
- /**
358
- * Check if page is of thank you type.
359
- *
360
- * @since 1.0.0
361
- * @return int/bool
362
- */
363
- function _is_wcf_thankyou_type() {
364
-
365
- if ( wcf()->utils->is_step_post_type() ) {
366
-
367
- global $post;
368
-
369
- if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
370
-
371
- return true;
372
- }
373
- }
374
-
375
- return false;
376
- }
377
-
378
- /**
379
- * Get thank you page ID.
380
- *
381
- * @since 1.0.0
382
- * @return int/bool
383
- */
384
- function _get_wcf_thankyou_id() {
385
-
386
- if ( _is_wcf_thankyou_type() ) {
387
-
388
- global $post;
389
-
390
- return $post->ID;
391
- }
392
-
393
- return false;
394
- }
395
-
396
-
397
- /**
398
- * Check if post type is upsell.
399
- *
400
- * @since 1.0.0
401
- * @return bool
402
- */
403
- function _is_wcf_base_offer_type() {
404
-
405
- if ( wcf()->utils->is_step_post_type() ) {
406
-
407
- global $post;
408
-
409
- $step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
410
-
411
- if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
412
-
413
- return true;
414
- }
415
- }
416
-
417
- return false;
418
- }
419
-
420
- /**
421
- * Returns upsell ID.
422
- *
423
- * @since 1.0.0
424
- * @return int/bool
425
- */
426
- function _get_wcf_base_offer_id() {
427
-
428
- if ( _is_wcf_base_offer_type() ) {
429
-
430
- global $post;
431
-
432
- return $post->ID;
433
- }
434
-
435
- return false;
436
- }
437
-
438
- /**
439
- * Check if page is of optin type.
440
- *
441
- * @since 1.0.0
442
- * @return int/bool
443
- */
444
- function _is_wcf_optin_type() {
445
-
446
- if ( wcf()->utils->is_step_post_type() ) {
447
-
448
- global $post;
449
-
450
- if ( 'optin' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
451
-
452
- return true;
453
- }
454
- }
455
-
456
- return false;
457
- }
458
-
459
- /**
460
- * Get optin page ID.
461
- *
462
- * @since 1.0.0
463
- * @return int/bool
464
- */
465
- function _get_wcf_optin_id() {
466
-
467
- if ( _is_wcf_optin_type() ) {
468
-
469
- global $post;
470
-
471
- return $post->ID;
472
- }
473
-
474
- return false;
475
- }
476
-
477
- /**
478
- * Define a constant if it is not already defined.
479
- *
480
- * @since 3.0.0
481
- * @param string $name Constant name.
482
- * @param mixed $value Value.
483
- */
484
- function wcf_maybe_define_constant( $name, $value ) {
485
- if ( ! defined( $name ) ) {
486
- define( $name, $value );
487
- }
488
- }
489
-
490
-
491
- if ( ! function_exists( 'wp_body_open' ) ) {
492
- /**
493
- * Fire the wp_body_open action.
494
- *
495
- * Added for backwards compatibility to support WordPress versions prior to 5.2.0.
496
- */
497
- function wp_body_open() {
498
- /**
499
- * Triggered after the opening <body> tag.
500
- */
501
- do_action( 'wp_body_open' );
502
- }
503
- }
504
-
505
- /**
506
- * Check if type is optin by id.
507
- *
508
- * @param int $post_id post id.
509
- *
510
- * @return int/bool
511
- * @since 1.0.0
512
- */
513
- function _wcf_check_is_optin_by_id( $post_id ) {
514
-
515
- if ( 'optin' === get_post_meta( $post_id, 'wcf-step-type', true ) ) {
516
-
517
- return true;
518
- }
519
-
520
- return false;
521
- }
522
-
523
- /**
524
- * Supported Page Template
525
- *
526
- * @param string $page_template current page template.
527
- *
528
- * @return int/bool
529
- * @since 1.5.7
530
- */
531
- function _wcf_supported_template( $page_template ) {
532
-
533
- if ( in_array( $page_template, array( 'cartflows-default', 'cartflows-canvas' ), true ) ) {
534
-
535
- return true;
536
- }
537
-
538
- return false;
539
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Functions.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Fatal error mb_strpos fallback.
14
+ *
15
+ * @param string $string string where to find.
16
+ * @param string $search string to search.
17
+ * @since 1.0.0
18
+ */
19
+ function wcf_mb_strpos( $string, $search ) {
20
+
21
+ if ( function_exists( 'mb_strpos' ) ) {
22
+ return mb_strpos( $string, $search, 0, 'utf-8' );
23
+ } else {
24
+ return strpos( $string, $search );
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Check if cartflows pro activated.
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ function _is_cartflows_pro() {
34
+
35
+ if ( defined( 'CARTFLOWS_PRO_FILE' ) ) {
36
+ return true;
37
+ }
38
+
39
+ return false;
40
+
41
+ }
42
+
43
+ /**
44
+ * Returns pro version number.
45
+ *
46
+ * @param int $version version number.
47
+ * @since 1.0.0
48
+ */
49
+ function _is_cartflows_pro_ver_less_than( $version ) {
50
+
51
+ if ( defined( 'CARTFLOWS_PRO_VER' ) && version_compare( CARTFLOWS_PRO_VER, $version, '<' ) ) {
52
+ return true;
53
+ }
54
+
55
+ return false;
56
+ }
57
+
58
+ /**
59
+ * Returns step id.
60
+ *
61
+ * @since 1.0.0
62
+ */
63
+ function _get_wcf_post_id() {
64
+
65
+ global $post;
66
+
67
+ if ( isset( $post->ID ) ) {
68
+ return $post->ID;
69
+ }
70
+
71
+ return 0;
72
+ }
73
+
74
+ /**
75
+ * Returns step id.
76
+ *
77
+ * @since 1.0.0
78
+ */
79
+ function _get_wcf_step_id() {
80
+
81
+ if ( wcf()->utils->is_step_post_type() ) {
82
+
83
+ global $post;
84
+
85
+ return $post->ID;
86
+ }
87
+
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * Check if it is a landing page?
93
+ *
94
+ * @since 1.0.0
95
+ */
96
+ function _is_wcf_landing_type() {
97
+
98
+ if ( wcf()->utils->is_step_post_type() ) {
99
+
100
+ global $post;
101
+
102
+ if ( 'landing' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
103
+
104
+ return true;
105
+ }
106
+ }
107
+
108
+ return false;
109
+ }
110
+
111
+ /**
112
+ * Returns landing id.
113
+ *
114
+ * @since 1.0.0
115
+ */
116
+ function _get_wcf_landing_id() {
117
+
118
+ if ( _is_wcf_landing_type() ) {
119
+
120
+ global $post;
121
+
122
+ return $post->ID;
123
+ }
124
+
125
+ return false;
126
+ }
127
+
128
+ /**
129
+ * Is custom checkout?
130
+ *
131
+ * @param int $checkout_id checkout ID.
132
+ * @since 1.0.0
133
+ */
134
+ function _is_wcf_meta_custom_checkout( $checkout_id ) {
135
+
136
+ $is_custom = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-custom-checkout-fields' );
137
+
138
+ if ( 'yes' === $is_custom ) {
139
+
140
+ return true;
141
+ }
142
+
143
+ return false;
144
+ }
145
+
146
+ /**
147
+ * Check if page is cartflow checkout.
148
+ *
149
+ * @since 1.0.0
150
+ * @return bool
151
+ */
152
+ function _is_wcf_checkout_type() {
153
+
154
+ if ( wcf()->utils->is_step_post_type() ) {
155
+
156
+ global $post;
157
+
158
+ if ( 'checkout' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
159
+
160
+ return true;
161
+ }
162
+ }
163
+
164
+ return false;
165
+ }
166
+
167
+ /**
168
+ * Check if AJAX call is in progress.
169
+ *
170
+ * @since 1.0.0
171
+ * @return bool
172
+ */
173
+ function _is_wcf_doing_checkout_ajax() {
174
+
175
+ if ( wp_doing_ajax() || isset( $_GET['wc-ajax'] ) ) { //phpcs:ignore
176
+
177
+ if ( isset( $_GET['wc-ajax'] ) && //phpcs:ignore
178
+ isset( $_POST['_wcf_checkout_id'] ) //phpcs:ignore
179
+ ) {
180
+ return true;
181
+ }
182
+ }
183
+
184
+ return false;
185
+ }
186
+
187
+ /**
188
+ * Check if optin AJAX call is in progress.
189
+ *
190
+ * @since 1.0.0
191
+ * @return bool
192
+ */
193
+ function _is_wcf_doing_optin_ajax() {
194
+
195
+ if ( wp_doing_ajax() || isset( $_GET['wc-ajax'] ) ) { //phpcs:ignore
196
+
197
+ if ( isset( $_GET['wc-ajax'] ) && //phpcs:ignore
198
+ isset( $_POST['_wcf_optin_id'] ) //phpcs:ignore
199
+ ) {
200
+ return true;
201
+ }
202
+ }
203
+
204
+ return false;
205
+ }
206
+
207
+ /**
208
+ * Returns checkout ID.
209
+ *
210
+ * @since 1.0.0
211
+ * @return int/bool
212
+ */
213
+ function _get_wcf_checkout_id() {
214
+
215
+ if ( _is_wcf_checkout_type() ) {
216
+
217
+ global $post;
218
+
219
+ return $post->ID;
220
+ }
221
+
222
+ return false;
223
+ }
224
+
225
+ /**
226
+ * Check if it is checkout shortcode.
227
+ *
228
+ * @since 1.0.0
229
+ * @return bool
230
+ */
231
+ function _is_wcf_checkout_shortcode() {
232
+
233
+ global $post;
234
+
235
+ if ( ! empty( $post ) && has_shortcode( $post->post_content, 'cartflows_checkout' ) ) {
236
+
237
+ return true;
238
+ }
239
+
240
+ return false;
241
+ }
242
+
243
+ /**
244
+ * Check if it is checkout shortcode.
245
+ *
246
+ * @since 1.0.0
247
+ * @param string $content shortcode content.
248
+ * @return bool
249
+ */
250
+ function _get_wcf_checkout_id_from_shortcode( $content = '' ) {
251
+
252
+ $checkout_id = 0;
253
+
254
+ if ( ! empty( $content ) ) {
255
+
256
+ $regex_pattern = get_shortcode_regex( array( 'cartflows_checkout' ) );
257
+
258
+ preg_match( '/' . $regex_pattern . '/s', $content, $regex_matches );
259
+
260
+ if ( ! empty( $regex_matches ) ) {
261
+
262
+ if ( 'cartflows_checkout' == $regex_matches[2] ) {
263
+
264
+ $attribure_str = str_replace( ' ', '&', trim( $regex_matches[3] ) );
265
+ $attribure_str = str_replace( '"', '', $attribure_str );
266
+
267
+ $attributes = wp_parse_args( $attribure_str );
268
+
269
+ if ( isset( $attributes['id'] ) ) {
270
+ $checkout_id = $attributes['id'];
271
+ }
272
+ }
273
+ }
274
+ }
275
+
276
+ return $checkout_id;
277
+ }
278
+
279
+ /**
280
+ * Check if post type is upsell.
281
+ *
282
+ * @since 1.0.0
283
+ * @return bool
284
+ */
285
+ function _is_wcf_upsell_type() {
286
+
287
+ if ( wcf()->utils->is_step_post_type() ) {
288
+
289
+ global $post;
290
+
291
+ if ( 'upsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
292
+
293
+ return true;
294
+ }
295
+ }
296
+
297
+ return false;
298
+ }
299
+
300
+ /**
301
+ * Returns upsell ID.
302
+ *
303
+ * @since 1.0.0
304
+ * @return int/bool
305
+ */
306
+ function _get_wcf_upsell_id() {
307
+
308
+ if ( _is_wcf_upsell_type() ) {
309
+
310
+ global $post;
311
+
312
+ return $post->ID;
313
+ }
314
+
315
+ return false;
316
+ }
317
+
318
+ /**
319
+ * Check if post is of type downsell.
320
+ *
321
+ * @since 1.0.0
322
+ * @return int/bool
323
+ */
324
+ function _is_wcf_downsell_type() {
325
+
326
+ if ( wcf()->utils->is_step_post_type() ) {
327
+
328
+ global $post;
329
+
330
+ if ( 'downsell' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
331
+
332
+ return true;
333
+ }
334
+ }
335
+
336
+ return false;
337
+ }
338
+
339
+ /**
340
+ * Get downsell page ID.
341
+ *
342
+ * @since 1.0.0
343
+ * @return int/bool
344
+ */
345
+ function _get_wcf_downsell_id() {
346
+
347
+ if ( _is_wcf_downsell_type() ) {
348
+
349
+ global $post;
350
+
351
+ return $post->ID;
352
+ }
353
+
354
+ return false;
355
+ }
356
+
357
+ /**
358
+ * Check if page is of thank you type.
359
+ *
360
+ * @since 1.0.0
361
+ * @return int/bool
362
+ */
363
+ function _is_wcf_thankyou_type() {
364
+
365
+ if ( wcf()->utils->is_step_post_type() ) {
366
+
367
+ global $post;
368
+
369
+ if ( 'thankyou' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
370
+
371
+ return true;
372
+ }
373
+ }
374
+
375
+ return false;
376
+ }
377
+
378
+ /**
379
+ * Get thank you page ID.
380
+ *
381
+ * @since 1.0.0
382
+ * @return int/bool
383
+ */
384
+ function _get_wcf_thankyou_id() {
385
+
386
+ if ( _is_wcf_thankyou_type() ) {
387
+
388
+ global $post;
389
+
390
+ return $post->ID;
391
+ }
392
+
393
+ return false;
394
+ }
395
+
396
+
397
+ /**
398
+ * Check if post type is upsell.
399
+ *
400
+ * @since 1.0.0
401
+ * @return bool
402
+ */
403
+ function _is_wcf_base_offer_type() {
404
+
405
+ if ( wcf()->utils->is_step_post_type() ) {
406
+
407
+ global $post;
408
+
409
+ $step_type = get_post_meta( $post->ID, 'wcf-step-type', true );
410
+
411
+ if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
412
+
413
+ return true;
414
+ }
415
+ }
416
+
417
+ return false;
418
+ }
419
+
420
+ /**
421
+ * Returns upsell ID.
422
+ *
423
+ * @since 1.0.0
424
+ * @return int/bool
425
+ */
426
+ function _get_wcf_base_offer_id() {
427
+
428
+ if ( _is_wcf_base_offer_type() ) {
429
+
430
+ global $post;
431
+
432
+ return $post->ID;
433
+ }
434
+
435
+ return false;
436
+ }
437
+
438
+ /**
439
+ * Check if page is of optin type.
440
+ *
441
+ * @since 1.0.0
442
+ * @return int/bool
443
+ */
444
+ function _is_wcf_optin_type() {
445
+
446
+ if ( wcf()->utils->is_step_post_type() ) {
447
+
448
+ global $post;
449
+
450
+ if ( 'optin' === get_post_meta( $post->ID, 'wcf-step-type', true ) ) {
451
+
452
+ return true;
453
+ }
454
+ }
455
+
456
+ return false;
457
+ }
458
+
459
+ /**
460
+ * Get optin page ID.
461
+ *
462
+ * @since 1.0.0
463
+ * @return int/bool
464
+ */
465
+ function _get_wcf_optin_id() {
466
+
467
+ if ( _is_wcf_optin_type() ) {
468
+
469
+ global $post;
470
+
471
+ return $post->ID;
472
+ }
473
+
474
+ return false;
475
+ }
476
+
477
+ /**
478
+ * Define a constant if it is not already defined.
479
+ *
480
+ * @since 3.0.0
481
+ * @param string $name Constant name.
482
+ * @param mixed $value Value.
483
+ */
484
+ function wcf_maybe_define_constant( $name, $value ) {
485
+ if ( ! defined( $name ) ) {
486
+ define( $name, $value );
487
+ }
488
+ }
489
+
490
+
491
+ if ( ! function_exists( 'wp_body_open' ) ) {
492
+ /**
493
+ * Fire the wp_body_open action.
494
+ *
495
+ * Added for backwards compatibility to support WordPress versions prior to 5.2.0.
496
+ */
497
+ function wp_body_open() {
498
+ /**
499
+ * Triggered after the opening <body> tag.
500
+ */
501
+ do_action( 'wp_body_open' );
502
+ }
503
+ }
504
+
505
+ /**
506
+ * Check if type is optin by id.
507
+ *
508
+ * @param int $post_id post id.
509
+ *
510
+ * @return int/bool
511
+ * @since 1.0.0
512
+ */
513
+ function _wcf_check_is_optin_by_id( $post_id ) {
514
+
515
+ if ( 'optin' === get_post_meta( $post_id, 'wcf-step-type', true ) ) {
516
+
517
+ return true;
518
+ }
519
+
520
+ return false;
521
+ }
522
+
523
+ /**
524
+ * Supported Page Template
525
+ *
526
+ * @param string $page_template current page template.
527
+ *
528
+ * @return int/bool
529
+ * @since 1.5.7
530
+ */
531
+ function _wcf_supported_template( $page_template ) {
532
+
533
+ if ( in_array( $page_template, array( 'cartflows-default', 'cartflows-canvas' ), true ) ) {
534
+
535
+ return true;
536
+ }
537
+
538
+ return false;
539
+ }
540
+
541
+ /**
542
+ * Get get step object.
543
+ *
544
+ * @param int $step_id current step ID.
545
+ * @since 1.5.9
546
+ */
547
+ function wcf_get_step( $step_id ) {
548
+
549
+ if ( ! isset( wcf()->wcf_step_objs[ $step_id ] ) ) {
550
+
551
+ wcf()->wcf_step_objs[ $step_id ] = new Cartflows_Step_Factory( $step_id );
552
+ }
553
+
554
+ return wcf()->wcf_step_objs[ $step_id ];
555
+ }
classes/class-cartflows-loader.php CHANGED
@@ -1,583 +1,599 @@
1
- <?php
2
- /**
3
- * CartFlows Loader.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- if ( ! class_exists( 'Cartflows_Loader' ) ) {
9
-
10
- /**
11
- * Class Cartflows_Loader.
12
- */
13
- final class Cartflows_Loader {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var instance
19
- */
20
- private static $instance = null;
21
-
22
- /**
23
- * Member Variable
24
- *
25
- * @var utils
26
- */
27
- public $utils = null;
28
-
29
- /**
30
- * Member Variable
31
- *
32
- * @var logger
33
- */
34
- public $logger = null;
35
-
36
- /**
37
- * Member Variable
38
- *
39
- * @var options
40
- */
41
- public $options = null;
42
-
43
- /**
44
- * Member Variable
45
- *
46
- * @var meta
47
- */
48
- public $meta = null;
49
-
50
- /**
51
- * Member Variable
52
- *
53
- * @var Tracking_Data
54
- */
55
- public $alldata;
56
-
57
- /**
58
- * Member Variable
59
- *
60
- * @var flow
61
- */
62
- public $flow = null;
63
-
64
- /**
65
- * Member Variable
66
- *
67
- * @var assets_vars
68
- */
69
- public $assets_vars = null;
70
-
71
- /**
72
- * Member Variable
73
- *
74
- * @var assets_vars
75
- */
76
-
77
- public $is_woo_active = true;
78
-
79
- /**
80
- * Initiator
81
- */
82
- public static function get_instance() {
83
-
84
- if ( is_null( self::$instance ) ) {
85
-
86
- self::$instance = new self();
87
-
88
- /**
89
- * CartFlows loaded.
90
- *
91
- * Fires when Cartflows was fully loaded and instantiated.
92
- *
93
- * @since 1.0.0
94
- */
95
- do_action( 'cartflows_loaded' );
96
- }
97
-
98
- return self::$instance;
99
- }
100
-
101
- /**
102
- * Constructor
103
- */
104
- public function __construct() {
105
-
106
- $this->define_constants();
107
-
108
- // Activation hook.
109
- register_activation_hook( CARTFLOWS_FILE, array( $this, 'activation_reset' ) );
110
-
111
- // deActivation hook.
112
- register_deactivation_hook( CARTFLOWS_FILE, array( $this, 'deactivation_reset' ) );
113
-
114
- add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
115
- add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
116
- }
117
-
118
- /**
119
- * Defines all constants
120
- *
121
- * @since 1.0.0
122
- */
123
- public function define_constants() {
124
-
125
- define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
126
- define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
127
- define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
128
- define( 'CARTFLOWS_VER', '1.5.14' );
129
- define( 'CARTFLOWS_SLUG', 'cartflows' );
130
- define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
131
-
132
- define( 'CARTFLOWS_FLOW_POST_TYPE', 'cartflows_flow' );
133
- define( 'CARTFLOWS_STEP_POST_TYPE', 'cartflows_step' );
134
-
135
- if ( ! defined( 'CARTFLOWS_SERVER_URL' ) ) {
136
- define( 'CARTFLOWS_SERVER_URL', 'https://my.cartflows.com/' );
137
- }
138
- define( 'CARTFLOWS_DOMAIN_URL', 'https://cartflows.com/' );
139
- define( 'CARTFLOWS_TEMPLATES_URL', 'https://templates.cartflows.com/' );
140
- define( 'CARTFLOWS_TAXONOMY_STEP_TYPE', 'cartflows_step_type' );
141
- define( 'CARTFLOWS_TAXONOMY_STEP_FLOW', 'cartflows_step_flow' );
142
-
143
- if ( ! defined( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER' ) ) {
144
- define( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER', 'cartflows_step_page_builder' );
145
- }
146
- if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER' ) ) {
147
- define( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER', 'cartflows_flow_page_builder' );
148
- }
149
- if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY' ) ) {
150
- define( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY', 'cartflows_flow_category' );
151
- }
152
-
153
- if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
154
-
155
- $upload_dir = wp_upload_dir( null, false );
156
-
157
- define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
158
- }
159
- }
160
-
161
- /**
162
- * Loads plugin files.
163
- *
164
- * @since 1.0.0
165
- *
166
- * @return void
167
- */
168
- public function load_plugin() {
169
-
170
- $this->load_helper_files_components();
171
- $this->load_core_files();
172
- $this->load_core_components();
173
-
174
- add_action( 'wp_loaded', array( $this, 'initialize' ) );
175
- add_action( 'cartflows_pro_init', array( $this, 'after_cartflows_pro_init' ) );
176
-
177
- if ( ! $this->is_woo_active ) {
178
- add_action( 'admin_notices', array( $this, 'fails_to_load' ) );
179
- }
180
-
181
- /**
182
- * CartFlows Init.
183
- *
184
- * Fires when Cartflows is instantiated.
185
- *
186
- * @since 1.0.0
187
- */
188
- do_action( 'cartflows_init' );
189
- }
190
-
191
- /**
192
- * After CartFlows Pro init.
193
- *
194
- * @since 1.1.19
195
- *
196
- * @return void
197
- */
198
- public function after_cartflows_pro_init() {
199
-
200
- if ( ! is_admin() ) {
201
- return;
202
- }
203
-
204
- if ( version_compare( CARTFLOWS_PRO_VER, '1.5.4', '<' ) ) {
205
- add_action( 'admin_notices', array( $this, 'required_cartflows_pro_notice' ) );
206
- }
207
- }
208
-
209
- /**
210
- * Required CartFlows Pro Notice.
211
- *
212
- * @since 1.1.19
213
- *
214
- * @return void
215
- */
216
- public function required_cartflows_pro_notice() {
217
-
218
- $required_pro_version = '1.5.4';
219
-
220
- $class = 'notice notice-warning';
221
- /* translators: %s: html tags */
222
- $message = sprintf( __( 'You are using an older version of %1$sCartFlows Pro%2$s. Please update %1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher.', 'cartflows' ), '<strong>', '</strong>', $required_pro_version );
223
-
224
- printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
225
- }
226
-
227
- /**
228
- * Load Helper Files and Components.
229
- *
230
- * @since 1.0.0
231
- *
232
- * @return void
233
- */
234
- public function load_helper_files_components() {
235
-
236
- $this->is_woo_active = function_exists( 'WC' );
237
-
238
- /* Public Utils */
239
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-utils.php';
240
-
241
- /* Public Global Namespace Function */
242
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
243
-
244
- /* Admin Helper */
245
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
246
-
247
- /* Meta Default Values */
248
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-default-meta.php';
249
-
250
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-tracking.php';
251
-
252
- if ( is_admin() ) {
253
- require_once CARTFLOWS_DIR . 'classes/lib/notices/class-astra-notices.php';
254
- }
255
-
256
- if ( ! class_exists( 'BSF_Analytics_Loader' ) ) {
257
- require_once CARTFLOWS_DIR . '/admin/bsf-analytics/class-bsf-analytics-loader.php';
258
- }
259
-
260
- $bsf_analytics = BSF_Analytics_Loader::get_instance();
261
-
262
- $bsf_analytics->set_entity(
263
- array(
264
- 'cf' => array(
265
- 'product_name' => 'CartFlows',
266
- 'usage_doc_link' => 'https://my.cartflows.com/usage-tracking/',
267
- 'path' => CARTFLOWS_DIR . 'admin/bsf-analytics',
268
- 'author' => 'CartFlows Inc',
269
- ),
270
- )
271
- );
272
-
273
- $this->utils = Cartflows_Utils::get_instance();
274
- $this->options = Cartflows_Default_Meta::get_instance();
275
- $this->alldata = Cartflows_Tracking::get_instance();
276
- }
277
-
278
- /**
279
- * Init hooked function.
280
- *
281
- * @since 1.0.0
282
- *
283
- * @return void
284
- */
285
- public function initialize() {
286
- $this->assets_vars = $this->utils->get_assets_path();
287
- }
288
-
289
- /**
290
- * Load Core Files.
291
- *
292
- * @since 1.0.0
293
- *
294
- * @return void
295
- */
296
- public function load_core_files() {
297
-
298
- /* Update compatibility. */
299
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-update.php';
300
-
301
- /* Page builder compatibilty class */
302
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-compatibility.php';
303
-
304
- /* Theme support */
305
- if ( $this->is_woo_active ) {
306
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-theme-support.php';
307
- }
308
-
309
- /* Admin Meta Fields*/
310
- include_once CARTFLOWS_DIR . 'classes/fields/typography/class-cartflows-font-families.php';
311
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta-fields.php';
312
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta.php';
313
-
314
- /* Cloning */
315
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-cloning.php';
316
-
317
- /* Admin Settings */
318
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin.php';
319
-
320
- /* Logger */
321
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-interface.php';
322
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler.php';
323
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-file.php';
324
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-levels.php';
325
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-logger-interface.php';
326
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-wc-logger.php';
327
-
328
- /* Core Modules */
329
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-logger.php';
330
-
331
- /* Frontend Global */
332
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-frontend.php';
333
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-flow-frontend.php';
334
-
335
- /* Modules */
336
- include_once CARTFLOWS_DIR . 'modules/flow/class-cartflows-flow.php';
337
- include_once CARTFLOWS_DIR . 'modules/landing/class-cartflows-landing.php';
338
-
339
- if ( $this->is_woo_active ) {
340
- include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
341
- include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
342
- include_once CARTFLOWS_DIR . 'modules/optin/class-cartflows-optin.php';
343
- }
344
-
345
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
346
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
347
-
348
- include_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-batch-process.php';
349
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer.php';
350
-
351
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-wizard.php';
352
-
353
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-metabox.php';
354
-
355
- include_once CARTFLOWS_DIR . 'classes/deprecated/deprecated-hooks.php';
356
-
357
- }
358
-
359
- /**
360
- * Load Core Components.
361
- *
362
- * @since 1.0.0
363
- *
364
- * @return void
365
- */
366
- public function load_core_components() {
367
-
368
- $this->meta = Cartflows_Meta_Fields::get_instance();
369
- $this->logger = Cartflows_Logger::get_instance();
370
- $this->flow = Cartflows_Flow_Frontend::get_instance();
371
- }
372
-
373
- /**
374
- * Create files/directories.
375
- */
376
- public function create_files() {
377
-
378
- // Install files and folders for uploading files and prevent hotlinking.
379
- $upload_dir = wp_upload_dir();
380
-
381
- $files = array(
382
- array(
383
- 'base' => CARTFLOWS_LOG_DIR,
384
- 'file' => '.htaccess',
385
- 'content' => 'deny from all',
386
- ),
387
- array(
388
- 'base' => CARTFLOWS_LOG_DIR,
389
- 'file' => 'index.html',
390
- 'content' => '',
391
- ),
392
- );
393
-
394
- foreach ( $files as $file ) {
395
- if ( wp_mkdir_p( $file['base'] ) && ! file_exists( trailingslashit( $file['base'] ) . $file['file'] ) ) {
396
- $file_handle = @fopen( trailingslashit( $file['base'] ) . $file['file'], 'w' ); // phpcs:ignore
397
- if ( $file_handle ) {
398
- fwrite( $file_handle, $file['content'] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite
399
- fclose( $file_handle ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
400
- }
401
- }
402
- }
403
- }
404
- /**
405
- * Load CartFlows Pro Text Domain.
406
- * This will load the translation textdomain depending on the file priorities.
407
- * 1. Global Languages /wp-content/languages/cartflows/ folder
408
- * 2. Local dorectory /wp-content/plugins/cartflows/languages/ folder
409
- *
410
- * @since 1.0.3
411
- * @return void
412
- */
413
- public function load_cf_textdomain() {
414
-
415
- // Default languages directory for CartFlows Pro.
416
- $lang_dir = CARTFLOWS_DIR . 'languages/';
417
-
418
- /**
419
- * Filters the languages directory path to use for CartFlows Pro.
420
- *
421
- * @param string $lang_dir The languages directory path.
422
- */
423
- $lang_dir = apply_filters( 'cartflows_languages_directory', $lang_dir );
424
-
425
- // Traditional WordPress plugin locale filter.
426
- global $wp_version;
427
-
428
- $get_locale = get_locale();
429
-
430
- if ( $wp_version >= 4.7 ) {
431
- $get_locale = get_user_locale();
432
- }
433
-
434
- /**
435
- * Language Locale for CartFlows Pro
436
- *
437
- * @var $get_locale The locale to use.
438
- * Uses get_user_locale()` in WordPress 4.7 or greater,
439
- * otherwise uses `get_locale()`.
440
- */
441
- $locale = apply_filters( 'plugin_locale', $get_locale, 'cartflows' );
442
- $mofile = sprintf( '%1$s-%2$s.mo', 'cartflows', $locale );
443
-
444
- // Setup paths to current locale file.
445
- $mofile_local = $lang_dir . $mofile;
446
- $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
447
-
448
- if ( file_exists( $mofile_global ) ) {
449
- // Look in global /wp-content/languages/cartflows/ folder.
450
- load_textdomain( 'cartflows', $mofile_global );
451
- } elseif ( file_exists( $mofile_local ) ) {
452
- // Look in local /wp-content/plugins/cartflows/languages/ folder.
453
- load_textdomain( 'cartflows', $mofile_local );
454
- } else {
455
- // Load the default language files.
456
- load_plugin_textdomain( 'cartflows', false, $lang_dir );
457
- }
458
- }
459
-
460
- /**
461
- * Fires admin notice when Elementor is not installed and activated.
462
- *
463
- * @since 1.0.0
464
- *
465
- * @return void
466
- */
467
- public function fails_to_load() {
468
-
469
- $screen = get_current_screen();
470
-
471
- if ( ! wcf()->utils->is_step_post_type() ) {
472
- return;
473
- }
474
-
475
- if ( ! wcf()->utils->check_is_woo_required_page() ) {
476
- return;
477
- }
478
-
479
- $skip_notice = false;
480
-
481
- wp_localize_script( 'wcf-global-admin', 'cartflows_woo', array( 'show_update_post' => $skip_notice ) );
482
-
483
- $class = 'notice notice-warning';
484
- /* translators: %s: html tags */
485
- $message = sprintf( __( 'This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & activated.', 'cartflows' ), '<strong>', '</strong>' );
486
-
487
- $plugin = 'woocommerce/woocommerce.php';
488
-
489
- if ( _is_woo_installed() ) {
490
- if ( ! current_user_can( 'activate_plugins' ) ) {
491
- return;
492
- }
493
-
494
- $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
495
- $button_label = __( 'Activate WooCommerce', 'cartflows' );
496
-
497
- } else {
498
- if ( ! current_user_can( 'install_plugins' ) ) {
499
- return;
500
- }
501
-
502
- $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
503
- $button_label = __( 'Install WooCommerce', 'cartflows' );
504
- }
505
-
506
- $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
507
-
508
- printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), $message, $button );
509
- }
510
-
511
- /**
512
- * Activation Reset
513
- */
514
- public function activation_reset() {
515
-
516
- if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
517
-
518
- $upload_dir = wp_upload_dir( null, false );
519
-
520
- define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
521
- }
522
-
523
- $this->create_files();
524
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
525
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
526
- include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
527
- include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
528
-
529
- Cartflows_Flow_Post_Type::get_instance()->flow_post_type();
530
- Cartflows_Step_Post_Type::get_instance()->step_post_type();
531
- flush_rewrite_rules();
532
- }
533
-
534
- /**
535
- * Deactivation Reset
536
- */
537
- public function deactivation_reset() {
538
- }
539
-
540
- /**
541
- * Logger Class Instance
542
- */
543
- public function logger() {
544
- return Cartflows_Logger::get_instance();
545
- }
546
-
547
-
548
- }
549
-
550
- /**
551
- * Prepare if class 'Cartflows_Loader' exist.
552
- * Kicking this off by calling 'get_instance()' method
553
- */
554
- Cartflows_Loader::get_instance();
555
- }
556
-
557
- /**
558
- * Get global class.
559
- *
560
- * @return object
561
- */
562
- function wcf() {
563
- return Cartflows_Loader::get_instance();
564
- }
565
-
566
-
567
- if ( ! function_exists( '_is_woo_installed' ) ) {
568
-
569
- /**
570
- * Is woocommerce plugin installed.
571
- *
572
- * @since 1.0.0
573
- *
574
- * @access public
575
- */
576
- function _is_woo_installed() {
577
-
578
- $path = 'woocommerce/woocommerce.php';
579
- $plugins = get_plugins();
580
-
581
- return isset( $plugins[ $path ] );
582
- }
583
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Loader.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_Loader' ) ) {
9
+
10
+ /**
11
+ * Class Cartflows_Loader.
12
+ */
13
+ final class Cartflows_Loader {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var instance
19
+ */
20
+ private static $instance = null;
21
+
22
+ /**
23
+ * Member Variable
24
+ *
25
+ * @var utils
26
+ */
27
+ public $utils = null;
28
+
29
+ /**
30
+ * Member Variable
31
+ *
32
+ * @var logger
33
+ */
34
+ public $logger = null;
35
+
36
+ /**
37
+ * Member Variable
38
+ *
39
+ * @var options
40
+ */
41
+ public $options = null;
42
+
43
+ /**
44
+ * Member Variable
45
+ *
46
+ * @var meta
47
+ */
48
+ public $meta = null;
49
+
50
+ /**
51
+ * Member Variable
52
+ *
53
+ * @var Tracking_Data
54
+ */
55
+ public $alldata;
56
+
57
+ /**
58
+ * Member Variable
59
+ *
60
+ * @var flow
61
+ */
62
+ public $flow = null;
63
+
64
+ /**
65
+ * Member Variable
66
+ *
67
+ * @var wcf_step_objs
68
+ */
69
+
70
+ public $wcf_step_objs = array();
71
+
72
+ /**
73
+ * Member Variable
74
+ *
75
+ * @var assets_vars
76
+ */
77
+ public $assets_vars = null;
78
+
79
+ /**
80
+ * Member Variable
81
+ *
82
+ * @var assets_vars
83
+ */
84
+
85
+ public $is_woo_active = true;
86
+
87
+ /**
88
+ * Initiator
89
+ */
90
+ public static function get_instance() {
91
+
92
+ if ( is_null( self::$instance ) ) {
93
+
94
+ self::$instance = new self();
95
+
96
+ /**
97
+ * CartFlows loaded.
98
+ *
99
+ * Fires when Cartflows was fully loaded and instantiated.
100
+ *
101
+ * @since 1.0.0
102
+ */
103
+ do_action( 'cartflows_loaded' );
104
+ }
105
+
106
+ return self::$instance;
107
+ }
108
+
109
+ /**
110
+ * Constructor
111
+ */
112
+ public function __construct() {
113
+
114
+ $this->define_constants();
115
+
116
+ // Activation hook.
117
+ register_activation_hook( CARTFLOWS_FILE, array( $this, 'activation_reset' ) );
118
+
119
+ // deActivation hook.
120
+ register_deactivation_hook( CARTFLOWS_FILE, array( $this, 'deactivation_reset' ) );
121
+
122
+ add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
123
+ add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
124
+ }
125
+
126
+ /**
127
+ * Defines all constants
128
+ *
129
+ * @since 1.0.0
130
+ */
131
+ public function define_constants() {
132
+
133
+ define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
134
+ define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
135
+ define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
136
+ define( 'CARTFLOWS_VER', '1.5.15' );
137
+ define( 'CARTFLOWS_SLUG', 'cartflows' );
138
+ define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
139
+
140
+ define( 'CARTFLOWS_FLOW_POST_TYPE', 'cartflows_flow' );
141
+ define( 'CARTFLOWS_STEP_POST_TYPE', 'cartflows_step' );
142
+
143
+ if ( ! defined( 'CARTFLOWS_SERVER_URL' ) ) {
144
+ define( 'CARTFLOWS_SERVER_URL', 'https://my.cartflows.com/' );
145
+ }
146
+ define( 'CARTFLOWS_DOMAIN_URL', 'https://cartflows.com/' );
147
+ define( 'CARTFLOWS_TEMPLATES_URL', 'https://templates.cartflows.com/' );
148
+ define( 'CARTFLOWS_TAXONOMY_STEP_TYPE', 'cartflows_step_type' );
149
+ define( 'CARTFLOWS_TAXONOMY_STEP_FLOW', 'cartflows_step_flow' );
150
+
151
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER' ) ) {
152
+ define( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER', 'cartflows_step_page_builder' );
153
+ }
154
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER' ) ) {
155
+ define( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER', 'cartflows_flow_page_builder' );
156
+ }
157
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY' ) ) {
158
+ define( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY', 'cartflows_flow_category' );
159
+ }
160
+
161
+ if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
162
+
163
+ $upload_dir = wp_upload_dir( null, false );
164
+
165
+ define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
166
+ }
167
+
168
+ $GLOBALS['wcf_step'] = null;
169
+ }
170
+
171
+ /**
172
+ * Loads plugin files.
173
+ *
174
+ * @since 1.0.0
175
+ *
176
+ * @return void
177
+ */
178
+ public function load_plugin() {
179
+
180
+ $this->load_helper_files_components();
181
+ $this->load_core_files();
182
+ $this->load_core_components();
183
+
184
+ add_action( 'wp_loaded', array( $this, 'initialize' ) );
185
+ add_action( 'cartflows_pro_init', array( $this, 'after_cartflows_pro_init' ) );
186
+
187
+ if ( ! $this->is_woo_active ) {
188
+ add_action( 'admin_notices', array( $this, 'fails_to_load' ) );
189
+ }
190
+
191
+ /**
192
+ * CartFlows Init.
193
+ *
194
+ * Fires when Cartflows is instantiated.
195
+ *
196
+ * @since 1.0.0
197
+ */
198
+ do_action( 'cartflows_init' );
199
+ }
200
+
201
+ /**
202
+ * After CartFlows Pro init.
203
+ *
204
+ * @since 1.1.19
205
+ *
206
+ * @return void
207
+ */
208
+ public function after_cartflows_pro_init() {
209
+
210
+ if ( ! is_admin() ) {
211
+ return;
212
+ }
213
+
214
+ if ( version_compare( CARTFLOWS_PRO_VER, '1.5.8', '<' ) ) {
215
+ add_action( 'admin_notices', array( $this, 'required_cartflows_pro_notice' ) );
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Required CartFlows Pro Notice.
221
+ *
222
+ * @since 1.1.19
223
+ *
224
+ * @return void
225
+ */
226
+ public function required_cartflows_pro_notice() {
227
+
228
+ $required_pro_version = '1.5.8';
229
+
230
+ $class = 'notice notice-warning';
231
+ /* translators: %s: html tags */
232
+ $message = sprintf( __( 'You are using an older version of %1$sCartFlows Pro%2$s. Please update %1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher.', 'cartflows' ), '<strong>', '</strong>', $required_pro_version );
233
+
234
+ printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
235
+ }
236
+
237
+ /**
238
+ * Load Helper Files and Components.
239
+ *
240
+ * @since 1.0.0
241
+ *
242
+ * @return void
243
+ */
244
+ public function load_helper_files_components() {
245
+
246
+ $this->is_woo_active = function_exists( 'WC' );
247
+
248
+ /* Public Utils */
249
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-utils.php';
250
+
251
+ /* Public Global Namespace Function */
252
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
253
+
254
+ /* Admin Helper */
255
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
256
+
257
+ /* Factory objects */
258
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-step-factory.php';
259
+
260
+ /* Meta Default Values */
261
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-default-meta.php';
262
+
263
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-tracking.php';
264
+
265
+ if ( is_admin() ) {
266
+ require_once CARTFLOWS_DIR . 'classes/lib/notices/class-astra-notices.php';
267
+ }
268
+
269
+ if ( ! class_exists( 'BSF_Analytics_Loader' ) ) {
270
+ require_once CARTFLOWS_DIR . '/admin/bsf-analytics/class-bsf-analytics-loader.php';
271
+ }
272
+
273
+ $bsf_analytics = BSF_Analytics_Loader::get_instance();
274
+
275
+ $bsf_analytics->set_entity(
276
+ array(
277
+ 'cf' => array(
278
+ 'product_name' => 'CartFlows',
279
+ 'usage_doc_link' => 'https://my.cartflows.com/usage-tracking/',
280
+ 'path' => CARTFLOWS_DIR . 'admin/bsf-analytics',
281
+ 'author' => 'CartFlows Inc',
282
+ ),
283
+ )
284
+ );
285
+
286
+ $this->utils = Cartflows_Utils::get_instance();
287
+ $this->options = Cartflows_Default_Meta::get_instance();
288
+ $this->alldata = Cartflows_Tracking::get_instance();
289
+ }
290
+
291
+ /**
292
+ * Init hooked function.
293
+ *
294
+ * @since 1.0.0
295
+ *
296
+ * @return void
297
+ */
298
+ public function initialize() {
299
+ $this->assets_vars = $this->utils->get_assets_path();
300
+ }
301
+
302
+ /**
303
+ * Load Core Files.
304
+ *
305
+ * @since 1.0.0
306
+ *
307
+ * @return void
308
+ */
309
+ public function load_core_files() {
310
+
311
+ /* Update compatibility. */
312
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-update.php';
313
+
314
+ /* Page builder compatibilty class */
315
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-compatibility.php';
316
+
317
+ /* Theme support */
318
+ if ( $this->is_woo_active ) {
319
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-theme-support.php';
320
+ }
321
+
322
+ /* Admin Meta Fields*/
323
+ include_once CARTFLOWS_DIR . 'classes/fields/typography/class-cartflows-font-families.php';
324
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta-fields.php';
325
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta.php';
326
+
327
+ if ( is_admin() ) {
328
+ /* Cloning */
329
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-cloning.php';
330
+
331
+ /* Admin Settings */
332
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin.php';
333
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-stats.php';
334
+ }
335
+
336
+ /* Logger */
337
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-interface.php';
338
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler.php';
339
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-file.php';
340
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-levels.php';
341
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-logger-interface.php';
342
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-wc-logger.php';
343
+
344
+ /* Core Modules */
345
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-logger.php';
346
+
347
+ /* Frontend Global */
348
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-frontend.php';
349
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-flow-frontend.php';
350
+
351
+ /* Modules */
352
+ include_once CARTFLOWS_DIR . 'modules/flow/class-cartflows-flow.php';
353
+ include_once CARTFLOWS_DIR . 'modules/landing/class-cartflows-landing.php';
354
+
355
+ if ( $this->is_woo_active ) {
356
+ include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
357
+ include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
358
+ include_once CARTFLOWS_DIR . 'modules/optin/class-cartflows-optin.php';
359
+ }
360
+
361
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
362
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
363
+
364
+ include_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-batch-process.php';
365
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer.php';
366
+
367
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-wizard.php';
368
+
369
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-metabox.php';
370
+
371
+ include_once CARTFLOWS_DIR . 'classes/deprecated/deprecated-hooks.php';
372
+
373
+ }
374
+
375
+ /**
376
+ * Load Core Components.
377
+ *
378
+ * @since 1.0.0
379
+ *
380
+ * @return void
381
+ */
382
+ public function load_core_components() {
383
+
384
+ $this->meta = Cartflows_Meta_Fields::get_instance();
385
+ $this->logger = Cartflows_Logger::get_instance();
386
+ $this->flow = Cartflows_Flow_Frontend::get_instance();
387
+ }
388
+
389
+ /**
390
+ * Create files/directories.
391
+ */
392
+ public function create_files() {
393
+
394
+ // Install files and folders for uploading files and prevent hotlinking.
395
+ $upload_dir = wp_upload_dir();
396
+
397
+ $files = array(
398
+ array(
399
+ 'base' => CARTFLOWS_LOG_DIR,
400
+ 'file' => '.htaccess',
401
+ 'content' => 'deny from all',
402
+ ),
403
+ array(
404
+ 'base' => CARTFLOWS_LOG_DIR,
405
+ 'file' => 'index.html',
406
+ 'content' => '',
407
+ ),
408
+ );
409
+
410
+ foreach ( $files as $file ) {
411
+ if ( wp_mkdir_p( $file['base'] ) && ! file_exists( trailingslashit( $file['base'] ) . $file['file'] ) ) {
412
+ $file_handle = @fopen( trailingslashit( $file['base'] ) . $file['file'], 'w' ); // phpcs:ignore
413
+ if ( $file_handle ) {
414
+ fwrite( $file_handle, $file['content'] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite
415
+ fclose( $file_handle ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
416
+ }
417
+ }
418
+ }
419
+ }
420
+ /**
421
+ * Load CartFlows Pro Text Domain.
422
+ * This will load the translation textdomain depending on the file priorities.
423
+ * 1. Global Languages /wp-content/languages/cartflows/ folder
424
+ * 2. Local dorectory /wp-content/plugins/cartflows/languages/ folder
425
+ *
426
+ * @since 1.0.3
427
+ * @return void
428
+ */
429
+ public function load_cf_textdomain() {
430
+
431
+ // Default languages directory for CartFlows Pro.
432
+ $lang_dir = CARTFLOWS_DIR . 'languages/';
433
+
434
+ /**
435
+ * Filters the languages directory path to use for CartFlows Pro.
436
+ *
437
+ * @param string $lang_dir The languages directory path.
438
+ */
439
+ $lang_dir = apply_filters( 'cartflows_languages_directory', $lang_dir );
440
+
441
+ // Traditional WordPress plugin locale filter.
442
+ global $wp_version;
443
+
444
+ $get_locale = get_locale();
445
+
446
+ if ( $wp_version >= 4.7 ) {
447
+ $get_locale = get_user_locale();
448
+ }
449
+
450
+ /**
451
+ * Language Locale for CartFlows Pro
452
+ *
453
+ * @var $get_locale The locale to use.
454
+ * Uses get_user_locale()` in WordPress 4.7 or greater,
455
+ * otherwise uses `get_locale()`.
456
+ */
457
+ $locale = apply_filters( 'plugin_locale', $get_locale, 'cartflows' );
458
+ $mofile = sprintf( '%1$s-%2$s.mo', 'cartflows', $locale );
459
+
460
+ // Setup paths to current locale file.
461
+ $mofile_local = $lang_dir . $mofile;
462
+ $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
463
+
464
+ if ( file_exists( $mofile_global ) ) {
465
+ // Look in global /wp-content/languages/cartflows/ folder.
466
+ load_textdomain( 'cartflows', $mofile_global );
467
+ } elseif ( file_exists( $mofile_local ) ) {
468
+ // Look in local /wp-content/plugins/cartflows/languages/ folder.
469
+ load_textdomain( 'cartflows', $mofile_local );
470
+ } else {
471
+ // Load the default language files.
472
+ load_plugin_textdomain( 'cartflows', false, $lang_dir );
473
+ }
474
+ }
475
+
476
+ /**
477
+ * Fires admin notice when Elementor is not installed and activated.
478
+ *
479
+ * @since 1.0.0
480
+ *
481
+ * @return void
482
+ */
483
+ public function fails_to_load() {
484
+
485
+ $screen = get_current_screen();
486
+
487
+ if ( ! wcf()->utils->is_step_post_type() ) {
488
+ return;
489
+ }
490
+
491
+ if ( ! wcf()->utils->check_is_woo_required_page() ) {
492
+ return;
493
+ }
494
+
495
+ $skip_notice = false;
496
+
497
+ wp_localize_script( 'wcf-global-admin', 'cartflows_woo', array( 'show_update_post' => $skip_notice ) );
498
+
499
+ $class = 'notice notice-warning';
500
+ /* translators: %s: html tags */
501
+ $message = sprintf( __( 'This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & activated.', 'cartflows' ), '<strong>', '</strong>' );
502
+
503
+ $plugin = 'woocommerce/woocommerce.php';
504
+
505
+ if ( _is_woo_installed() ) {
506
+ if ( ! current_user_can( 'activate_plugins' ) ) {
507
+ return;
508
+ }
509
+
510
+ $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
511
+ $button_label = __( 'Activate WooCommerce', 'cartflows' );
512
+
513
+ } else {
514
+ if ( ! current_user_can( 'install_plugins' ) ) {
515
+ return;
516
+ }
517
+
518
+ $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
519
+ $button_label = __( 'Install WooCommerce', 'cartflows' );
520
+ }
521
+
522
+ $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
523
+
524
+ printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), $message, $button );
525
+ }
526
+
527
+ /**
528
+ * Activation Reset
529
+ */
530
+ public function activation_reset() {
531
+
532
+ if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
533
+
534
+ $upload_dir = wp_upload_dir( null, false );
535
+
536
+ define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
537
+ }
538
+
539
+ $this->create_files();
540
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
541
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
542
+ include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
543
+ include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
544
+
545
+ Cartflows_Flow_Post_Type::get_instance()->flow_post_type();
546
+ Cartflows_Step_Post_Type::get_instance()->step_post_type();
547
+ flush_rewrite_rules();
548
+ }
549
+
550
+ /**
551
+ * Deactivation Reset
552
+ */
553
+ public function deactivation_reset() {
554
+ }
555
+
556
+ /**
557
+ * Logger Class Instance
558
+ */
559
+ public function logger() {
560
+ return Cartflows_Logger::get_instance();
561
+ }
562
+
563
+
564
+ }
565
+
566
+ /**
567
+ * Prepare if class 'Cartflows_Loader' exist.
568
+ * Kicking this off by calling 'get_instance()' method
569
+ */
570
+ Cartflows_Loader::get_instance();
571
+ }
572
+
573
+ /**
574
+ * Get global class.
575
+ *
576
+ * @return object
577
+ */
578
+ function wcf() {
579
+ return Cartflows_Loader::get_instance();
580
+ }
581
+
582
+
583
+ if ( ! function_exists( '_is_woo_installed' ) ) {
584
+
585
+ /**
586
+ * Is woocommerce plugin installed.
587
+ *
588
+ * @since 1.0.0
589
+ *
590
+ * @access public
591
+ */
592
+ function _is_woo_installed() {
593
+
594
+ $path = 'woocommerce/woocommerce.php';
595
+ $plugins = get_plugins();
596
+
597
+ return isset( $plugins[ $path ] );
598
+ }
599
+ }
classes/class-cartflows-meta-fields.php CHANGED
@@ -1,1039 +1,1046 @@
1
- <?php
2
- /**
3
- * Meta Fields.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Class Cartflows_Meta_Fields.
10
- */
11
- class Cartflows_Meta_Fields {
12
-
13
- /**
14
- * Instance
15
- *
16
- * @var $instance
17
- */
18
- private static $instance;
19
-
20
- /**
21
- * Initiator
22
- */
23
- public static function get_instance() {
24
- if ( ! isset( self::$instance ) ) {
25
- self::$instance = new self();
26
- }
27
-
28
- return self::$instance;
29
- }
30
-
31
- /**
32
- * Constructor
33
- */
34
- public function __construct() {
35
-
36
- /* Add Scripts */
37
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_meta_scripts' ), 20 );
38
-
39
- add_action( 'wp_ajax_wcf_json_search_coupons', array( $this, 'json_search_coupons' ) );
40
-
41
- add_action( 'wp_ajax_wcf_json_search_products_and_variations', array( $this, 'json_search_products' ) );
42
-
43
- add_action( 'wp_ajax_wcf_json_search_pages', array( $this, 'json_search_pages' ) );
44
-
45
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
46
- }
47
-
48
- /**
49
- * Admin meta scripts
50
- */
51
- public function admin_meta_scripts() {
52
-
53
- global $pagenow;
54
- global $post;
55
-
56
- $screen = get_current_screen();
57
-
58
- if (
59
- ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
60
- wcf()->utils->is_step_post_type( $screen->post_type )
61
- ) {
62
-
63
- wp_enqueue_style( 'woocommerce_admin_styles' );
64
-
65
- wp_enqueue_script( 'select2' );
66
- wp_enqueue_script( 'wc-enhanced-select' );
67
-
68
- wp_enqueue_script(
69
- 'wcf-admin-meta',
70
- CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
71
- array( 'jquery', 'wp-color-picker' ),
72
- CARTFLOWS_VER,
73
- true
74
- );
75
-
76
- wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
77
- wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
78
-
79
- $localize = array(
80
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
81
- 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
82
- 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
83
- 'font_weights' => array(
84
- '100' => __( 'Thin 100', 'cartflows' ),
85
- '200' => __( 'Extra-Light 200', 'cartflows' ),
86
- '300' => __( 'Light 300', 'cartflows' ),
87
- '400' => __( 'Normal 400', 'cartflows' ),
88
- '500' => __( 'Medium 500', 'cartflows' ),
89
- '600' => __( 'Semi-Bold 600', 'cartflows' ),
90
- '700' => __( 'Bold 700', 'cartflows' ),
91
- '800' => __( 'Extra-Bold 800', 'cartflows' ),
92
- '900' => __( 'Ultra-Bold 900', 'cartflows' ),
93
- ),
94
- );
95
-
96
- wp_localize_script( 'jquery', 'wcf', apply_filters( 'wcf_js_localize', $localize ) );
97
-
98
- do_action( 'cartflows_admin_meta_scripts' );
99
- }
100
- }
101
-
102
- /**
103
- * Function to search products.
104
- */
105
- public function json_search_products() {
106
-
107
- check_admin_referer( 'wcf-json-search-products-and-variations', 'security' );
108
-
109
- global $wpdb;
110
-
111
- // get search term.
112
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
113
-
114
- if ( empty( $term ) ) {
115
- die();
116
- }
117
-
118
- // CartFlows supported product types.
119
- $supported_product_types = array( 'simple', 'variable', 'variation', 'subscription', 'variable-subscription', 'subscription_variation', 'course' );
120
-
121
- // Allowed product types.
122
- if ( isset( $_GET['allowed'] ) && ! empty( $_GET['allowed'] ) ) {
123
-
124
- $allowed_product_types = sanitize_text_field( ( wp_unslash( $_GET['allowed'] ) ) );
125
-
126
- $allowed_product_types = $this->sanitize_data_attributes( $allowed_product_types );
127
-
128
- $supported_product_types = $allowed_product_types;
129
- }
130
-
131
- // Include product types.
132
- if ( isset( $_GET['included'] ) && ! empty( $_GET['included'] ) ) {
133
-
134
- $include_product_types = sanitize_text_field( ( wp_unslash( $_GET['included'] ) ) );
135
-
136
- $include_product_types = $this->sanitize_data_attributes( $include_product_types );
137
-
138
- $supported_product_types = array_merge( $supported_product_types, $include_product_types );
139
- }
140
-
141
- // Exclude product types.
142
- if ( isset( $_GET['excluded'] ) && ! empty( $_GET['excluded'] ) ) {
143
-
144
- $excluded_product_types = sanitize_text_field( ( wp_unslash( $_GET['excluded'] ) ) );
145
-
146
- $excluded_product_types = $this->sanitize_data_attributes( $excluded_product_types );
147
-
148
- $supported_product_types = array_diff( $supported_product_types, $excluded_product_types );
149
- }
150
-
151
- // Get all products data.
152
- $data = WC_Data_Store::load( 'product' );
153
- $ids = $data->search_products( $term, '', true, false, 11 );
154
-
155
- // Get all product objects.
156
- $product_objects = array_filter( array_map( 'wc_get_product', $ids ), 'wc_products_array_filter_readable' );
157
-
158
- // Remove the product objects whose product type are not in supported array.
159
- $product_objects = array_filter(
160
- $product_objects,
161
- function ( $arr ) use ( $supported_product_types ) {
162
- return $arr && is_a( $arr, 'WC_Product' ) && in_array( $arr->get_type(), $supported_product_types, true );
163
- }
164
- );
165
-
166
- $products_found = array();
167
-
168
- foreach ( $product_objects as $product_object ) {
169
- $formatted_name = $product_object->get_formatted_name();
170
- $managing_stock = $product_object->managing_stock();
171
-
172
- if ( $managing_stock && ! empty( $_GET['display_stock'] ) ) {
173
- $stock_amount = $product_object->get_stock_quantity();
174
- /* Translators: %d stock amount */
175
- $formatted_name .= ' &ndash; ' . sprintf( __( 'Stock: %d', 'cartflows' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) );
176
- }
177
-
178
- $products_found[ $product_object->get_id() ] = rawurldecode( $formatted_name );
179
-
180
- }
181
-
182
- wp_send_json( $products_found );
183
- }
184
-
185
- /**
186
- * Function to sanitize the product type data attribute.
187
- *
188
- * @param array $product_types product types.
189
- */
190
- public function sanitize_data_attributes( $product_types = array() ) {
191
-
192
- if ( ! is_array( $product_types ) ) {
193
- $product_types = explode( ',', $product_types );
194
- }
195
-
196
- // Sanitize the excluded types against valid product types.
197
- foreach ( $product_types as $index => $value ) {
198
- $product_types[ $index ] = strtolower( trim( $value ) );
199
- }
200
- return $product_types;
201
- }
202
-
203
- /**
204
- * Function to search coupons
205
- */
206
- public function json_search_coupons() {
207
-
208
- check_admin_referer( 'wcf-json-search-coupons', 'security' );
209
-
210
- global $wpdb;
211
-
212
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
213
-
214
- if ( empty( $term ) ) {
215
- die();
216
- }
217
-
218
- $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
219
-
220
- if ( false === $posts ) {
221
- $posts = $wpdb->get_results( // phpcs:ignore
222
- $wpdb->prepare(
223
- "SELECT *
224
- FROM {$wpdb->prefix}posts
225
- WHERE post_type = %s
226
- AND post_title LIKE %s
227
- AND post_status = %s",
228
- 'shop_coupon',
229
- $wpdb->esc_like( $term ) . '%',
230
- 'publish'
231
- )
232
- );
233
- wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
234
- }
235
-
236
- $coupons_found = array();
237
- $all_discount_types = wc_get_coupon_types();
238
-
239
- if ( $posts ) {
240
- foreach ( $posts as $post ) {
241
-
242
- $discount_type = get_post_meta( $post->ID, 'discount_type', true );
243
-
244
- if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
245
- $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
246
- }
247
- }
248
- }
249
-
250
- wp_send_json( $coupons_found );
251
- }
252
-
253
- /**
254
- * Function to search coupons
255
- */
256
- public function json_search_pages() {
257
-
258
- check_ajax_referer( 'wcf-json-search-pages', 'security' );
259
-
260
- $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
261
-
262
- if ( empty( $term ) ) {
263
- die( 'not found' );
264
- }
265
-
266
- $search_string = $term;
267
- $data = array();
268
- $result = array();
269
-
270
- add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
271
-
272
- $query = new WP_Query(
273
- array(
274
- 's' => $search_string,
275
- 'post_type' => 'page',
276
- 'posts_per_page' => -1,
277
- )
278
- );
279
-
280
- if ( $query->have_posts() ) {
281
- while ( $query->have_posts() ) {
282
- $query->the_post();
283
- $title = get_the_title();
284
- $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
285
- $id = get_the_id();
286
- $data[] = array(
287
- 'id' => $id,
288
- 'text' => $title,
289
- );
290
- }
291
- }
292
-
293
- if ( is_array( $data ) && ! empty( $data ) ) {
294
- $result[] = array(
295
- 'text' => '',
296
- 'children' => $data,
297
- );
298
- }
299
-
300
- wp_reset_postdata();
301
-
302
- // return the result in json.
303
- wp_send_json( $result );
304
- }
305
-
306
- /**
307
- * Search only titles.
308
- *
309
- * @param string $search Field data.
310
- * @param object $wp_query Query.
311
- *
312
- * @return array.
313
- */
314
- public function search_only_titles( $search, $wp_query ) {
315
- if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
316
- global $wpdb;
317
-
318
- $q = $wp_query->query_vars;
319
- $n = ! empty( $q['exact'] ) ? '' : '%';
320
-
321
- $search = array();
322
-
323
- foreach ( (array) $q['search_terms'] as $term ) {
324
- $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
325
- }
326
-
327
- if ( ! is_user_logged_in() ) {
328
- $search[] = "$wpdb->posts.post_password = ''";
329
- }
330
-
331
- $search = ' AND ' . implode( ' AND ', $search );
332
- }
333
-
334
- return $search;
335
- }
336
-
337
- /**
338
- * Get field.
339
- *
340
- * @param array $field_data Field data.
341
- * @param string $field_content Field content.
342
- *
343
- * @return string field.
344
- */
345
- public function get_field( $field_data, $field_content ) {
346
-
347
- $field_data['generated_content'] = $field_content;
348
-
349
- return $this->get_meta_field_template(
350
- 'get-field.php',
351
- $field_data
352
- );
353
- }
354
-
355
- /**
356
- * Text field.
357
- *
358
- * @param array $field_data Field data.
359
- *
360
- * @return string field.
361
- */
362
- public function get_text_field( $field_data ) {
363
-
364
- $value = $field_data['value'];
365
-
366
- $attr = '';
367
-
368
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
369
-
370
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
371
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
372
- }
373
- }
374
-
375
- $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . esc_attr( $value ) . '" ' . $attr . '>';
376
-
377
- return $this->get_field( $field_data, $field_content );
378
- }
379
-
380
- /**
381
- * Shortcode field.
382
- *
383
- * @param array $field_data Field data.
384
- *
385
- * @return string field.
386
- */
387
- public function get_shortcode_field( $field_data ) {
388
-
389
- $attr = '';
390
-
391
- $attr_fields = array(
392
- 'readonly' => 'readonly',
393
- 'onfocus' => 'this.select()',
394
- 'onmouseup' => 'return false',
395
- );
396
-
397
- if ( $attr_fields && is_array( $attr_fields ) ) {
398
-
399
- foreach ( $attr_fields as $attr_key => $attr_value ) {
400
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
401
- }
402
- }
403
-
404
- $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
405
-
406
- return $this->get_field( $field_data, $field_content );
407
- }
408
-
409
- /**
410
- * Display field.
411
- *
412
- * @param array $field_data Field data.
413
- *
414
- * @return string field.
415
- */
416
- public function get_display_field( $field_data ) {
417
-
418
- $field_content = $field_data['content'];
419
-
420
- return $this->get_field( $field_data, $field_content );
421
- }
422
-
423
- /**
424
- * Hr linke field.
425
- *
426
- * @param array $field_data Field data.
427
- *
428
- * @return string field.
429
- */
430
- public function get_hr_line_field( $field_data ) {
431
-
432
- $field_data = array(
433
- 'name' => 'wcf-hr-line',
434
- 'content' => '<hr>',
435
- );
436
-
437
- $field_content = $field_data['content'];
438
-
439
- return $this->get_field( $field_data, $field_content );
440
- }
441
-
442
- /**
443
- * Number field.
444
- *
445
- * @param array $field_data Field data.
446
- *
447
- * @return string field.
448
- */
449
- public function get_number_field( $field_data ) {
450
-
451
- $value = $field_data['value'];
452
-
453
- $attr = '';
454
-
455
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
456
-
457
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
458
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
459
- }
460
- }
461
-
462
- $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
463
-
464
- return $this->get_field( $field_data, $field_content );
465
- }
466
-
467
- /**
468
- * Hidden field.
469
- *
470
- * @param array $field_data Field data.
471
- *
472
- * @return string field.
473
- */
474
- public function get_hidden_field( $field_data ) {
475
-
476
- $value = $field_data['value'];
477
-
478
- $attr = '';
479
-
480
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
481
-
482
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
483
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
484
- }
485
- }
486
-
487
- $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
488
-
489
- return $this->get_field( $field_data, $field_content );
490
- }
491
-
492
- /**
493
- * Text area field.
494
- *
495
- * @param array $field_data Field data.
496
- *
497
- * @return string field.
498
- */
499
- public function get_area_field( $field_data ) {
500
-
501
- $value = $field_data['value'];
502
-
503
- $attr = '';
504
-
505
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
506
-
507
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
508
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
509
- }
510
- }
511
-
512
- $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50" ' . $attr . '>';
513
- $field_content .= $value;
514
- $field_content .= '</textarea>';
515
-
516
- return $this->get_field( $field_data, $field_content );
517
- }
518
-
519
- /**
520
- * Only checkbox field.
521
- *
522
- * @param array $field_data Field data.
523
- *
524
- * @return string field.
525
- */
526
- public function get_only_checkbox_field( $field_data ) {
527
-
528
- $value = $field_data['value'];
529
-
530
- $field_content = '';
531
- if ( isset( $field_data['before'] ) ) {
532
- $field_content .= '<span>' . $field_data['before'] . '</span>';
533
- }
534
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
535
- $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
536
-
537
- if ( isset( $field_data['after'] ) ) {
538
- $field_content .= '<span>' . $field_data['after'] . '</span>';
539
- }
540
-
541
- if ( isset( $field_data['after_html'] ) ) {
542
- $field_content .= '<span>' . $field_data['after_html'] . '</span>';
543
- }
544
-
545
- return $field_content;
546
- }
547
-
548
- /**
549
- * Checkbox field.
550
- *
551
- * @param array $field_data Field data.
552
- *
553
- * @return string field.
554
- */
555
- public function get_checkbox_field( $field_data ) {
556
-
557
- $value = $field_data['value'];
558
-
559
- $field_content = '';
560
- if ( isset( $field_data['before'] ) ) {
561
- $field_content .= '<span>' . $field_data['before'] . '</span>';
562
- }
563
-
564
- $toggle_data = '';
565
- if ( isset( $field_data['toggle'] ) ) {
566
- $toggle_data .= 'toggle="' . htmlspecialchars( wp_json_encode( $field_data['toggle'] ) ) . '"'; //phpcs:ignore
567
- }
568
-
569
- $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
570
- $field_content .= '<input type="checkbox" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . ' ' . $toggle_data . '>';
571
-
572
- if ( isset( $field_data['after'] ) ) {
573
- $field_content .= '<span>' . $field_data['after'] . '</span>';
574
- }
575
-
576
- return $this->get_field( $field_data, $field_content );
577
- }
578
-
579
- /**
580
- * Radio field.
581
- *
582
- * @param array $field_data Field data.
583
- *
584
- * @return string field.
585
- */
586
- public function get_radio_field( $field_data ) {
587
-
588
- $value = $field_data['value'];
589
- $field_content = '';
590
-
591
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
592
-
593
- foreach ( $field_data['options'] as $data_key => $data_value ) {
594
-
595
- $field_content .= '<div class="wcf-radio-option">';
596
- $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
597
- $field_content .= $data_value;
598
- $field_content .= '</div>';
599
- }
600
- }
601
-
602
- return $this->get_field( $field_data, $field_content );
603
- }
604
-
605
- /**
606
- * Font family field.
607
- *
608
- * @param array $field_data Field data.
609
- *
610
- * @return string field.
611
- */
612
- public function get_font_family_field( $field_data ) {
613
-
614
- $value = $field_data['value'];
615
-
616
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
617
-
618
- $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
619
-
620
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
621
-
622
- $field_content .= '<optgroup label="Other System Fonts">';
623
- foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
624
- $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
625
- }
626
- $field_content .= '</optgroup>';
627
- $field_content .= '<optgroup label="Google">';
628
- foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
629
- $variants = wcf_get_prop( $single_font, '0' );
630
- $category = wcf_get_prop( $single_font, '1' );
631
- $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
632
- $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
633
- }
634
- $field_content .= '</optgroup>';
635
-
636
- $field_content .= '</select>';
637
-
638
- return $this->get_field( $field_data, $field_content );
639
- }
640
-
641
- /**
642
- * Font weight field.
643
- *
644
- * @param array $field_data Field data.
645
- *
646
- * @return string field.
647
- */
648
- public function get_font_weight_field( $field_data ) {
649
-
650
- $value = $field_data['value'];
651
-
652
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
653
-
654
- $field_content = '<select data-selected="' . esc_attr( $value ) . '" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
655
-
656
- $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
657
-
658
- $field_content .= '</select>';
659
-
660
- return $this->get_field( $field_data, $field_content );
661
- }
662
-
663
- /**
664
- * Select field.
665
- *
666
- * @param array $field_data Field data.
667
- *
668
- * @return string field.
669
- */
670
- public function get_select_field( $field_data ) {
671
-
672
- $value = $field_data['value'];
673
- $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
674
-
675
- $field_content = '<select name="' . $field_data['name'] . '">';
676
-
677
- if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
678
-
679
- foreach ( $field_data['options'] as $data_key => $data_value ) {
680
-
681
- $disabled = '';
682
-
683
- if ( array_key_exists( $data_key, $pro_options ) ) {
684
- $disabled = 'disabled ';
685
- $data_value = $pro_options[ $data_key ];
686
- }
687
-
688
- $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled . '>' . $data_value . '</option>';
689
- }
690
- }
691
-
692
- $field_content .= '</select>';
693
-
694
- if ( isset( $field_data['after'] ) ) {
695
- $field_content .= '<span>' . $field_data['after'] . '</span>';
696
- }
697
-
698
- return $this->get_field( $field_data, $field_content );
699
- }
700
-
701
- /**
702
- * Color picker field.
703
- *
704
- * @param array $field_data Field data.
705
- *
706
- * @return string field.
707
- */
708
- public function get_color_picker_field( $field_data ) {
709
-
710
- $value = $field_data['value'];
711
-
712
- $field_data['field_type'] = 'color-picker';
713
-
714
- $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
715
-
716
- return $this->get_field( $field_data, $field_content );
717
- }
718
-
719
- /**
720
- * Product selection field.
721
- *
722
- * @param array $field_data Field data.
723
- *
724
- * @return string field.
725
- */
726
- public function get_product_selection_field( $field_data ) {
727
-
728
- $value = $field_data['value'];
729
- $excluded = '';
730
- $allowed = '';
731
- $included = '';
732
-
733
- if ( isset( $field_data['excluded_product_types'] ) && is_array( $field_data['excluded_product_types'] ) && ! empty( $field_data['excluded_product_types'] ) ) {
734
- $excluded = html_entity_decode( implode( ',', $field_data['excluded_product_types'] ), ENT_COMPAT, 'UTF-8' );
735
- }
736
- if ( isset( $field_data['allowed_product_types'] ) && is_array( $field_data['allowed_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
737
- $allowed = html_entity_decode( implode( ',', $field_data['allowed_product_types'] ), ENT_COMPAT, 'UTF-8' );
738
- }
739
- if ( isset( $field_data['include_product_types'] ) && is_array( $field_data['include_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
740
- $included = html_entity_decode( implode( ',', $field_data['include_product_types'] ), ENT_COMPAT, 'UTF-8' );
741
- }
742
-
743
- $multiple = '';
744
-
745
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
746
- $multiple = ' multiple="multiple"';
747
- }
748
-
749
- $allow_clear = '';
750
-
751
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
752
- $allow_clear = ' data-allow_clear="allow_clear"';
753
- }
754
-
755
- $field_content = '<select
756
- name="' . $field_data['name'] . '[]"
757
- class="wcf-product-search" ' . $multiple . $allow_clear . '
758
- data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
759
- data-action="wcf_json_search_products_and_variations"
760
- data-excluded_product_types ="' . $excluded . '"
761
- data-allowed_product_types ="' . $allowed . '"
762
- data-include_product_types ="' . $included . '">';
763
-
764
- if ( is_array( $value ) && ! empty( $value ) ) {
765
-
766
- foreach ( $value as $data_key => $product_id ) {
767
-
768
- $product = wc_get_product( $product_id );
769
-
770
- // posts.
771
- if ( ! empty( $product ) ) {
772
- $post_title = $product->get_name() . ' (#' . $product_id . ')';
773
-
774
- $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
775
- }
776
- }
777
- }
778
- $field_content .= '</select>';
779
-
780
- return $this->get_field( $field_data, $field_content );
781
- }
782
-
783
- /**
784
- * Coupon selection field.
785
- *
786
- * @param array $field_data Field data.
787
- *
788
- * @return string field.
789
- */
790
- public function get_coupon_selection_field( $field_data ) {
791
-
792
- $value = $field_data['value'];
793
-
794
- $multiple = '';
795
-
796
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
797
- $multiple = ' multiple="multiple"';
798
- }
799
-
800
- $allow_clear = '';
801
-
802
- if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
803
- $allow_clear = ' data-allow_clear="allow_clear"';
804
- }
805
-
806
- $field_content = '<select
807
- name="' . $field_data['name'] . '[]"
808
- class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
809
- data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
810
- data-action="wcf_json_search_coupons">';
811
-
812
- if ( is_array( $value ) && ! empty( $value ) ) {
813
-
814
- $all_discount_types = wc_get_coupon_types();
815
-
816
- foreach ( $value as $coupon_title ) {
817
-
818
- $coupon = new WC_Coupon( $coupon_title );
819
-
820
- $discount_type = $coupon->get_discount_type();
821
-
822
- if ( isset( $discount_type ) && $discount_type ) {
823
- $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
824
- }
825
-
826
- $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
827
- }
828
- }
829
-
830
- $field_content .= '</select>';
831
-
832
- return $this->get_field( $field_data, $field_content );
833
- }
834
-
835
- /**
836
- * Page selction field.
837
- *
838
- * @param array $field_data Field data.
839
- *
840
- * @return string field.
841
- */
842
- public function get_page_selection_field( $field_data ) {
843
-
844
- $value = $field_data['value'];
845
-
846
- $multiple = '';
847
-
848
- if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
849
- $multiple = 'multiple="multiple"';
850
- }
851
-
852
- $field_content = '<select
853
- name="' . $field_data['name'] . '[]"
854
- class="wcf-search-pages" ' . $multiple . '"
855
- data-action="wcf_json_search_pages">';
856
-
857
- if ( is_array( $value ) && ! empty( $value ) ) {
858
-
859
- foreach ( $value as $data_key => $data_value ) {
860
-
861
- $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
862
- }
863
- }
864
-
865
- $field_content .= '</select>';
866
-
867
- return $this->get_field( $field_data, $field_content );
868
- }
869
-
870
- /**
871
- * Get section field.
872
- *
873
- * @param array $field_data Field data.
874
- *
875
- * @return string field.
876
- */
877
- public function get_section( $field_data ) {
878
- $field_html = '<div class="wcf-field-row wcf-field-section">';
879
- $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
880
- $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
881
-
882
- if ( isset( $field_data['help'] ) ) {
883
- $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
884
- }
885
- $field_html .= '</div>';
886
- $field_html .= '</div>';
887
- return $field_html;
888
- }
889
-
890
- /**
891
- * Description field.
892
- *
893
- * @param array $field_data Field data.
894
- *
895
- * @return string field.
896
- */
897
- public function get_description_field( $field_data ) {
898
-
899
- $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
900
- $field_html .= '<div class="wcf-field-desc-content">';
901
- $field_html .= $field_data['content'];
902
- $field_html .= '</div>';
903
- $field_html .= '</div>';
904
-
905
- return $field_html;
906
- }
907
-
908
- /**
909
- * Product selection repeater field.
910
- *
911
- * @param array $field_data Field data.
912
- *
913
- * @return string field.
914
- */
915
- public function get_product_selection_repeater( $field_data ) {
916
-
917
- return $this->get_meta_field_template(
918
- 'get-product-selection-repeater.php',
919
- $field_data
920
- );
921
- }
922
-
923
- /**
924
- * Generate product repeater html.
925
- *
926
- * @param string $id ID.
927
- * @param string $options Options.
928
- * @param array $selected_data Discount_data.
929
- *
930
- * @return string field.
931
- */
932
- public function generate_product_repeater_html( $id, $options = '', $selected_data = '' ) {
933
-
934
- ob_start();
935
-
936
- include CARTFLOWS_DIR . 'includes/meta-fields/generate-product-repeater.php';
937
-
938
- return ob_get_clean();
939
- }
940
-
941
- /**
942
- * Image field.
943
- *
944
- * @param array $field_data Field data.
945
- *
946
- * @return string field.
947
- */
948
- public function get_image_field( $field_data ) {
949
-
950
- global $post;
951
- $value = $field_data['value'];
952
-
953
- $attr = '';
954
-
955
- if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
956
-
957
- foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
958
- $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
959
- }
960
- }
961
-
962
- $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
963
-
964
- $field_content = '<div id="wcf-image-preview" style="' . $display_preview_box . '">';
965
-
966
- if ( isset( $value ) ) {
967
-
968
- $field_content .= '<img src="' . $field_data['value'] . '" class="saved-image" name="' . $field_data['name'] . '" width="150">';
969
- }
970
-
971
- $field_content .= '</div>';
972
-
973
- $image_data = htmlentities( serialize( get_post_meta( $post->ID, $field_data['name'] . '-obj' ) ) ); // phpcs:ignore
974
-
975
- $field_content .= '<input type="hidden" id="' . $field_data['name'] . '" class="wcf-image" name="' . $field_data['name'] . '" value="' . $value . '">'; // phpcs:ignore
976
-
977
- $field_content .= '<input type="hidden" id="' . $field_data['name'] . '-obj' . '" class="wcf-image-obj" name="' . $field_data['name'] . '-obj' . '" value="' . $image_data . '">'; // phpcs:ignore
978
-
979
- $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
980
-
981
- $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
982
-
983
- $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="' . $display_remove_button . '">Remove Image</button>';
984
-
985
- return $this->get_field( $field_data, $field_content );
986
- }
987
-
988
- /**
989
- * Localize variables in admin
990
- *
991
- * @param array $vars variables.
992
- */
993
- public function localize_vars( $vars ) {
994
-
995
- $ajax_actions = array(
996
- 'wcf_json_search_pages',
997
- 'wcf_json_search_coupons',
998
- 'wcf_json_search_products_and_variations',
999
- );
1000
-
1001
- foreach ( $ajax_actions as $action ) {
1002
-
1003
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1004
- }
1005
-
1006
- /* Add product from iframe */
1007
- $product_src = esc_url_raw(
1008
- add_query_arg(
1009
- array(
1010
- 'post_type' => 'product',
1011
- 'wcf-woo-iframe' => 'true',
1012
- ),
1013
- admin_url( 'post-new.php' )
1014
- )
1015
- );
1016
-
1017
- $vars['create_product_src'] = $product_src;
1018
- /* Add product from iframe End */
1019
-
1020
- return $vars;
1021
- }
1022
-
1023
- /**
1024
- * Get meta field template.
1025
- *
1026
- * @param string $template file name.
1027
- * @param array $field_data Field data.
1028
- *
1029
- * @return string.
1030
- */
1031
- public function get_meta_field_template( $template, $field_data ) {
1032
-
1033
- ob_start();
1034
-
1035
- include CARTFLOWS_DIR . 'includes/meta-fields/' . $template;
1036
-
1037
- return ob_get_clean();
1038
- }
1039
- }
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Meta Fields.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Class Cartflows_Meta_Fields.
10
+ */
11
+ class Cartflows_Meta_Fields {
12
+
13
+ /**
14
+ * Instance
15
+ *
16
+ * @var $instance
17
+ */
18
+ private static $instance;
19
+
20
+ /**
21
+ * Initiator
22
+ */
23
+ public static function get_instance() {
24
+ if ( ! isset( self::$instance ) ) {
25
+ self::$instance = new self();
26
+ }
27
+
28
+ return self::$instance;
29
+ }
30
+
31
+ /**
32
+ * Constructor
33
+ */
34
+ public function __construct() {
35
+
36
+ /* Add Scripts */
37
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_meta_scripts' ), 20 );
38
+
39
+ add_action( 'wp_ajax_wcf_json_search_coupons', array( $this, 'json_search_coupons' ) );
40
+
41
+ add_action( 'wp_ajax_wcf_json_search_products_and_variations', array( $this, 'json_search_products' ) );
42
+
43
+ add_action( 'wp_ajax_wcf_json_search_pages', array( $this, 'json_search_pages' ) );
44
+
45
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
46
+ }
47
+
48
+ /**
49
+ * Admin meta scripts
50
+ */
51
+ public function admin_meta_scripts() {
52
+
53
+ global $pagenow;
54
+ global $post;
55
+
56
+ $localize = array(
57
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
58
+ 'google_fonts' => CartFlows_Font_Families::get_google_fonts(),
59
+ 'system_fonts' => CartFlows_Font_Families::get_system_fonts(),
60
+ 'font_weights' => array(
61
+ '100' => __( 'Thin 100', 'cartflows' ),
62
+ '200' => __( 'Extra-Light 200', 'cartflows' ),
63
+ '300' => __( 'Light 300', 'cartflows' ),
64
+ '400' => __( 'Normal 400', 'cartflows' ),
65
+ '500' => __( 'Medium 500', 'cartflows' ),
66
+ '600' => __( 'Semi-Bold 600', 'cartflows' ),
67
+ '700' => __( 'Bold 700', 'cartflows' ),
68
+ '800' => __( 'Extra-Bold 800', 'cartflows' ),
69
+ '900' => __( 'Ultra-Bold 900', 'cartflows' ),
70
+ ),
71
+ );
72
+
73
+ $localize = apply_filters( 'wcf_js_localize', $localize );
74
+
75
+ $localize_script = '<!-- script to print the admin localized variables -->';
76
+ $localize_script .= '<script type="text/javascript">';
77
+ $localize_script .= 'var wcf = ' . wp_json_encode( $localize ) . ';';
78
+ $localize_script .= '</script>';
79
+
80
+ echo $localize_script;
81
+
82
+ $screen = get_current_screen();
83
+
84
+ if (
85
+ ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) &&
86
+ wcf()->utils->is_step_post_type( $screen->post_type )
87
+ ) {
88
+
89
+ wp_enqueue_style( 'woocommerce_admin_styles' );
90
+
91
+ wp_enqueue_script( 'select2' );
92
+ wp_enqueue_script( 'wc-enhanced-select' );
93
+
94
+ wp_enqueue_script(
95
+ 'wcf-admin-meta',
96
+ CARTFLOWS_URL . 'admin/meta-assets/js/admin-edit.js',
97
+ array( 'jquery', 'wp-color-picker' ),
98
+ CARTFLOWS_VER,
99
+ true
100
+ );
101
+
102
+ wp_enqueue_style( 'wcf-admin-meta', CARTFLOWS_URL . 'admin/meta-assets/css/admin-edit.css', array( 'wp-color-picker' ), CARTFLOWS_VER );
103
+ wp_style_add_data( 'wcf-admin-meta', 'rtl', 'replace' );
104
+
105
+ do_action( 'cartflows_admin_meta_scripts' );
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Function to search products.
111
+ */
112
+ public function json_search_products() {
113
+
114
+ check_admin_referer( 'wcf-json-search-products-and-variations', 'security' );
115
+
116
+ global $wpdb;
117
+
118
+ // get search term.
119
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
120
+
121
+ if ( empty( $term ) ) {
122
+ die();
123
+ }
124
+
125
+ // CartFlows supported product types.
126
+ $supported_product_types = array( 'simple', 'variable', 'variation', 'subscription', 'variable-subscription', 'subscription_variation', 'course' );
127
+
128
+ // Allowed product types.
129
+ if ( isset( $_GET['allowed'] ) && ! empty( $_GET['allowed'] ) ) {
130
+
131
+ $allowed_product_types = sanitize_text_field( ( wp_unslash( $_GET['allowed'] ) ) );
132
+
133
+ $allowed_product_types = $this->sanitize_data_attributes( $allowed_product_types );
134
+
135
+ $supported_product_types = $allowed_product_types;
136
+ }
137
+
138
+ // Include product types.
139
+ if ( isset( $_GET['included'] ) && ! empty( $_GET['included'] ) ) {
140
+
141
+ $include_product_types = sanitize_text_field( ( wp_unslash( $_GET['included'] ) ) );
142
+
143
+ $include_product_types = $this->sanitize_data_attributes( $include_product_types );
144
+
145
+ $supported_product_types = array_merge( $supported_product_types, $include_product_types );
146
+ }
147
+
148
+ // Exclude product types.
149
+ if ( isset( $_GET['excluded'] ) && ! empty( $_GET['excluded'] ) ) {
150
+
151
+ $excluded_product_types = sanitize_text_field( ( wp_unslash( $_GET['excluded'] ) ) );
152
+
153
+ $excluded_product_types = $this->sanitize_data_attributes( $excluded_product_types );
154
+
155
+ $supported_product_types = array_diff( $supported_product_types, $excluded_product_types );
156
+ }
157
+
158
+ // Get all products data.
159
+ $data = WC_Data_Store::load( 'product' );
160
+ $ids = $data->search_products( $term, '', true, false, 11 );
161
+
162
+ // Get all product objects.
163
+ $product_objects = array_filter( array_map( 'wc_get_product', $ids ), 'wc_products_array_filter_readable' );
164
+
165
+ // Remove the product objects whose product type are not in supported array.
166
+ $product_objects = array_filter(
167
+ $product_objects,
168
+ function ( $arr ) use ( $supported_product_types ) {
169
+ return $arr && is_a( $arr, 'WC_Product' ) && in_array( $arr->get_type(), $supported_product_types, true );
170
+ }
171
+ );
172
+
173
+ $products_found = array();
174
+
175
+ foreach ( $product_objects as $product_object ) {
176
+ $formatted_name = $product_object->get_formatted_name();
177
+ $managing_stock = $product_object->managing_stock();
178
+
179
+ if ( $managing_stock && ! empty( $_GET['display_stock'] ) ) {
180
+ $stock_amount = $product_object->get_stock_quantity();
181
+ /* Translators: %d stock amount */
182
+ $formatted_name .= ' &ndash; ' . sprintf( __( 'Stock: %d', 'cartflows' ), wc_format_stock_quantity_for_display( $stock_amount, $product_object ) );
183
+ }
184
+
185
+ $products_found[ $product_object->get_id() ] = rawurldecode( $formatted_name );
186
+
187
+ }
188
+
189
+ wp_send_json( $products_found );
190
+ }
191
+
192
+ /**
193
+ * Function to sanitize the product type data attribute.
194
+ *
195
+ * @param array $product_types product types.
196
+ */
197
+ public function sanitize_data_attributes( $product_types = array() ) {
198
+
199
+ if ( ! is_array( $product_types ) ) {
200
+ $product_types = explode( ',', $product_types );
201
+ }
202
+
203
+ // Sanitize the excluded types against valid product types.
204
+ foreach ( $product_types as $index => $value ) {
205
+ $product_types[ $index ] = strtolower( trim( $value ) );
206
+ }
207
+ return $product_types;
208
+ }
209
+
210
+ /**
211
+ * Function to search coupons
212
+ */
213
+ public function json_search_coupons() {
214
+
215
+ check_admin_referer( 'wcf-json-search-coupons', 'security' );
216
+
217
+ global $wpdb;
218
+
219
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
220
+
221
+ if ( empty( $term ) ) {
222
+ die();
223
+ }
224
+
225
+ $posts = wp_cache_get( 'wcf_search_coupons', 'wcf_funnel_Cart' );
226
+
227
+ if ( false === $posts ) {
228
+ $posts = $wpdb->get_results( // phpcs:ignore
229
+ $wpdb->prepare(
230
+ "SELECT *
231
+ FROM {$wpdb->prefix}posts
232
+ WHERE post_type = %s
233
+ AND post_title LIKE %s
234
+ AND post_status = %s",
235
+ 'shop_coupon',
236
+ $wpdb->esc_like( $term ) . '%',
237
+ 'publish'
238
+ )
239
+ );
240
+ wp_cache_set( 'wcf_search_coupons', $posts, 'wcf_funnel_Cart' );
241
+ }
242
+
243
+ $coupons_found = array();
244
+ $all_discount_types = wc_get_coupon_types();
245
+
246
+ if ( $posts ) {
247
+ foreach ( $posts as $post ) {
248
+
249
+ $discount_type = get_post_meta( $post->ID, 'discount_type', true );
250
+
251
+ if ( ! empty( $all_discount_types[ $discount_type ] ) ) {
252
+ $coupons_found[ get_the_title( $post->ID ) ] = get_the_title( $post->ID ) . ' (Type: ' . $all_discount_types[ $discount_type ] . ')';
253
+ }
254
+ }
255
+ }
256
+
257
+ wp_send_json( $coupons_found );
258
+ }
259
+
260
+ /**
261
+ * Function to search coupons
262
+ */
263
+ public function json_search_pages() {
264
+
265
+ check_ajax_referer( 'wcf-json-search-pages', 'security' );
266
+
267
+ $term = (string) urldecode( sanitize_text_field( wp_unslash( $_GET['term'] ) ) ); // phpcs:ignore
268
+
269
+ if ( empty( $term ) ) {
270
+ die( 'not found' );
271
+ }
272
+
273
+ $search_string = $term;
274
+ $data = array();
275
+ $result = array();
276
+
277
+ add_filter( 'posts_search', array( $this, 'search_only_titles' ), 10, 2 );
278
+
279
+ $query = new WP_Query(
280
+ array(
281
+ 's' => $search_string,
282
+ 'post_type' => 'page',
283
+ 'posts_per_page' => -1,
284
+ )
285
+ );
286
+
287
+ if ( $query->have_posts() ) {
288
+ while ( $query->have_posts() ) {
289
+ $query->the_post();
290
+ $title = get_the_title();
291
+ $title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
292
+ $id = get_the_id();
293
+ $data[] = array(
294
+ 'id' => $id,
295
+ 'text' => $title,
296
+ );
297
+ }
298
+ }
299
+
300
+ if ( is_array( $data ) && ! empty( $data ) ) {
301
+ $result[] = array(
302
+ 'text' => '',
303
+ 'children' => $data,
304
+ );
305
+ }
306
+
307
+ wp_reset_postdata();
308
+
309
+ // return the result in json.
310
+ wp_send_json( $result );
311
+ }
312
+
313
+ /**
314
+ * Search only titles.
315
+ *
316
+ * @param string $search Field data.
317
+ * @param object $wp_query Query.
318
+ *
319
+ * @return array.
320
+ */
321
+ public function search_only_titles( $search, $wp_query ) {
322
+ if ( ! empty( $search ) && ! empty( $wp_query->query_vars['search_terms'] ) ) {
323
+ global $wpdb;
324
+
325
+ $q = $wp_query->query_vars;
326
+ $n = ! empty( $q['exact'] ) ? '' : '%';
327
+
328
+ $search = array();
329
+
330
+ foreach ( (array) $q['search_terms'] as $term ) {
331
+ $search[] = $wpdb->prepare( "$wpdb->posts.post_title LIKE %s", $n . $wpdb->esc_like( $term ) . $n );
332
+ }
333
+
334
+ if ( ! is_user_logged_in() ) {
335
+ $search[] = "$wpdb->posts.post_password = ''";
336
+ }
337
+
338
+ $search = ' AND ' . implode( ' AND ', $search );
339
+ }
340
+
341
+ return $search;
342
+ }
343
+
344
+ /**
345
+ * Get field.
346
+ *
347
+ * @param array $field_data Field data.
348
+ * @param string $field_content Field content.
349
+ *
350
+ * @return string field.
351
+ */
352
+ public function get_field( $field_data, $field_content ) {
353
+
354
+ $field_data['generated_content'] = $field_content;
355
+
356
+ return $this->get_meta_field_template(
357
+ 'get-field.php',
358
+ $field_data
359
+ );
360
+ }
361
+
362
+ /**
363
+ * Text field.
364
+ *
365
+ * @param array $field_data Field data.
366
+ *
367
+ * @return string field.
368
+ */
369
+ public function get_text_field( $field_data ) {
370
+
371
+ $value = $field_data['value'];
372
+
373
+ $attr = '';
374
+
375
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
376
+
377
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
378
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
379
+ }
380
+ }
381
+
382
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . esc_attr( $value ) . '" ' . $attr . '>';
383
+
384
+ return $this->get_field( $field_data, $field_content );
385
+ }
386
+
387
+ /**
388
+ * Shortcode field.
389
+ *
390
+ * @param array $field_data Field data.
391
+ *
392
+ * @return string field.
393
+ */
394
+ public function get_shortcode_field( $field_data ) {
395
+
396
+ $attr = '';
397
+
398
+ $attr_fields = array(
399
+ 'readonly' => 'readonly',
400
+ 'onfocus' => 'this.select()',
401
+ 'onmouseup' => 'return false',
402
+ );
403
+
404
+ if ( $attr_fields && is_array( $attr_fields ) ) {
405
+
406
+ foreach ( $attr_fields as $attr_key => $attr_value ) {
407
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
408
+ }
409
+ }
410
+
411
+ $field_content = '<input type="text" name="' . $field_data['name'] . '" value="' . $field_data['content'] . '" ' . $attr . '>';
412
+
413
+ return $this->get_field( $field_data, $field_content );
414
+ }
415
+
416
+ /**
417
+ * Display field.
418
+ *
419
+ * @param array $field_data Field data.
420
+ *
421
+ * @return string field.
422
+ */
423
+ public function get_display_field( $field_data ) {
424
+
425
+ $field_content = $field_data['content'];
426
+
427
+ return $this->get_field( $field_data, $field_content );
428
+ }
429
+
430
+ /**
431
+ * Hr linke field.
432
+ *
433
+ * @param array $field_data Field data.
434
+ *
435
+ * @return string field.
436
+ */
437
+ public function get_hr_line_field( $field_data ) {
438
+
439
+ $field_data = array(
440
+ 'name' => 'wcf-hr-line',
441
+ 'content' => '<hr>',
442
+ );
443
+
444
+ $field_content = $field_data['content'];
445
+
446
+ return $this->get_field( $field_data, $field_content );
447
+ }
448
+
449
+ /**
450
+ * Number field.
451
+ *
452
+ * @param array $field_data Field data.
453
+ *
454
+ * @return string field.
455
+ */
456
+ public function get_number_field( $field_data ) {
457
+
458
+ $value = $field_data['value'];
459
+
460
+ $attr = '';
461
+
462
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
463
+
464
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
465
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
466
+ }
467
+ }
468
+
469
+ $field_content = '<input type="number" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
470
+
471
+ return $this->get_field( $field_data, $field_content );
472
+ }
473
+
474
+ /**
475
+ * Hidden field.
476
+ *
477
+ * @param array $field_data Field data.
478
+ *
479
+ * @return string field.
480
+ */
481
+ public function get_hidden_field( $field_data ) {
482
+
483
+ $value = $field_data['value'];
484
+
485
+ $attr = '';
486
+
487
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
488
+
489
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
490
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
491
+ }
492
+ }
493
+
494
+ $field_content = '<input type="hidden" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="' . $value . '" ' . $attr . '>';
495
+
496
+ return $this->get_field( $field_data, $field_content );
497
+ }
498
+
499
+ /**
500
+ * Text area field.
501
+ *
502
+ * @param array $field_data Field data.
503
+ *
504
+ * @return string field.
505
+ */
506
+ public function get_area_field( $field_data ) {
507
+
508
+ $value = $field_data['value'];
509
+
510
+ $attr = '';
511
+
512
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
513
+
514
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
515
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
516
+ }
517
+ }
518
+
519
+ $field_content = '<textarea name="' . $field_data['name'] . '" rows="10" cols="50" ' . $attr . '>';
520
+ $field_content .= $value;
521
+ $field_content .= '</textarea>';
522
+
523
+ return $this->get_field( $field_data, $field_content );
524
+ }
525
+
526
+ /**
527
+ * Only checkbox field.
528
+ *
529
+ * @param array $field_data Field data.
530
+ *
531
+ * @return string field.
532
+ */
533
+ public function get_only_checkbox_field( $field_data ) {
534
+
535
+ $value = $field_data['value'];
536
+
537
+ $field_content = '';
538
+ if ( isset( $field_data['before'] ) ) {
539
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
540
+ }
541
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
542
+ $field_content .= '<input type="checkbox" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . '>';
543
+
544
+ if ( isset( $field_data['after'] ) ) {
545
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
546
+ }
547
+
548
+ if ( isset( $field_data['after_html'] ) ) {
549
+ $field_content .= '<span>' . $field_data['after_html'] . '</span>';
550
+ }
551
+
552
+ return $field_content;
553
+ }
554
+
555
+ /**
556
+ * Checkbox field.
557
+ *
558
+ * @param array $field_data Field data.
559
+ *
560
+ * @return string field.
561
+ */
562
+ public function get_checkbox_field( $field_data ) {
563
+
564
+ $value = $field_data['value'];
565
+
566
+ $field_content = '';
567
+ if ( isset( $field_data['before'] ) ) {
568
+ $field_content .= '<span>' . $field_data['before'] . '</span>';
569
+ }
570
+
571
+ $toggle_data = '';
572
+ if ( isset( $field_data['toggle'] ) ) {
573
+ $toggle_data .= 'toggle="' . htmlspecialchars( wp_json_encode( $field_data['toggle'] ) ) . '"'; //phpcs:ignore
574
+ }
575
+
576
+ $field_content .= '<input type="hidden" name="' . $field_data['name'] . '" value="no">';
577
+ $field_content .= '<input type="checkbox" id="' . $field_data['name'] . '" name="' . $field_data['name'] . '" value="yes" ' . checked( 'yes', $value, false ) . ' ' . $toggle_data . '>';
578
+
579
+ if ( isset( $field_data['after'] ) ) {
580
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
581
+ }
582
+
583
+ return $this->get_field( $field_data, $field_content );
584
+ }
585
+
586
+ /**
587
+ * Radio field.
588
+ *
589
+ * @param array $field_data Field data.
590
+ *
591
+ * @return string field.
592
+ */
593
+ public function get_radio_field( $field_data ) {
594
+
595
+ $value = $field_data['value'];
596
+ $field_content = '';
597
+
598
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
599
+
600
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
601
+
602
+ $field_content .= '<div class="wcf-radio-option">';
603
+ $field_content .= '<input type="radio" name="' . $field_data['name'] . '" value="' . $data_key . '" ' . checked( $data_key, $value, false ) . '>';
604
+ $field_content .= $data_value;
605
+ $field_content .= '</div>';
606
+ }
607
+ }
608
+
609
+ return $this->get_field( $field_data, $field_content );
610
+ }
611
+
612
+ /**
613
+ * Font family field.
614
+ *
615
+ * @param array $field_data Field data.
616
+ *
617
+ * @return string field.
618
+ */
619
+ public function get_font_family_field( $field_data ) {
620
+
621
+ $value = $field_data['value'];
622
+
623
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
624
+
625
+ $field_content = '<select class="wcf-field-font-family" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
626
+
627
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
628
+
629
+ $field_content .= '<optgroup label="Other System Fonts">';
630
+ foreach ( CartFlows_Font_Families::get_system_fonts() as $name => $variants ) {
631
+ $field_content .= '<option value="' . esc_attr( $name ) . '" ' . selected( $name, $value, false ) . '>' . esc_attr( $name ) . '</option>';
632
+ }
633
+ $field_content .= '</optgroup>';
634
+ $field_content .= '<optgroup label="Google">';
635
+ foreach ( CartFlows_Font_Families::get_google_fonts() as $name => $single_font ) {
636
+ $variants = wcf_get_prop( $single_font, '0' );
637
+ $category = wcf_get_prop( $single_font, '1' );
638
+ $font_value = '\'' . esc_attr( $name ) . '\', ' . esc_attr( $category );
639
+ $field_content .= '<option value="' . esc_attr( $font_value ) . '" ' . selected( $font_value, $value, false ) . '>' . esc_attr( $name ) . '</option>';
640
+ }
641
+ $field_content .= '</optgroup>';
642
+
643
+ $field_content .= '</select>';
644
+
645
+ return $this->get_field( $field_data, $field_content );
646
+ }
647
+
648
+ /**
649
+ * Font weight field.
650
+ *
651
+ * @param array $field_data Field data.
652
+ *
653
+ * @return string field.
654
+ */
655
+ public function get_font_weight_field( $field_data ) {
656
+
657
+ $value = $field_data['value'];
658
+
659
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
660
+
661
+ $field_content = '<select data-selected="' . esc_attr( $value ) . '" class="wcf-field-font-weight" data-for="' . $field_data['for'] . '" name="' . $field_data['name'] . '">';
662
+
663
+ $field_content .= '<option value="" ' . selected( '', $value, false ) . '>Default</option>';
664
+
665
+ $field_content .= '</select>';
666
+
667
+ return $this->get_field( $field_data, $field_content );
668
+ }
669
+
670
+ /**
671
+ * Select field.
672
+ *
673
+ * @param array $field_data Field data.
674
+ *
675
+ * @return string field.
676
+ */
677
+ public function get_select_field( $field_data ) {
678
+
679
+ $value = $field_data['value'];
680
+ $pro_options = isset( $field_data['pro-options'] ) ? $field_data['pro-options'] : array();
681
+
682
+ $field_content = '<select name="' . $field_data['name'] . '">';
683
+
684
+ if ( is_array( $field_data['options'] ) && ! empty( $field_data['options'] ) ) {
685
+
686
+ foreach ( $field_data['options'] as $data_key => $data_value ) {
687
+
688
+ $disabled = '';
689
+
690
+ if ( array_key_exists( $data_key, $pro_options ) ) {
691
+ $disabled = 'disabled ';
692
+ $data_value = $pro_options[ $data_key ];
693
+ }
694
+
695
+ $field_content .= '<option value="' . $data_key . '" ' . selected( $value, $data_key, false ) . ' ' . $disabled . '>' . $data_value . '</option>';
696
+ }
697
+ }
698
+
699
+ $field_content .= '</select>';
700
+
701
+ if ( isset( $field_data['after'] ) ) {
702
+ $field_content .= '<span>' . $field_data['after'] . '</span>';
703
+ }
704
+
705
+ return $this->get_field( $field_data, $field_content );
706
+ }
707
+
708
+ /**
709
+ * Color picker field.
710
+ *
711
+ * @param array $field_data Field data.
712
+ *
713
+ * @return string field.
714
+ */
715
+ public function get_color_picker_field( $field_data ) {
716
+
717
+ $value = $field_data['value'];
718
+
719
+ $field_data['field_type'] = 'color-picker';
720
+
721
+ $field_content = '<input class="wcf-color-picker" type="text" name="' . $field_data['name'] . '" value="' . $value . '">';
722
+
723
+ return $this->get_field( $field_data, $field_content );
724
+ }
725
+
726
+ /**
727
+ * Product selection field.
728
+ *
729
+ * @param array $field_data Field data.
730
+ *
731
+ * @return string field.
732
+ */
733
+ public function get_product_selection_field( $field_data ) {
734
+
735
+ $value = $field_data['value'];
736
+ $excluded = '';
737
+ $allowed = '';
738
+ $included = '';
739
+
740
+ if ( isset( $field_data['excluded_product_types'] ) && is_array( $field_data['excluded_product_types'] ) && ! empty( $field_data['excluded_product_types'] ) ) {
741
+ $excluded = html_entity_decode( implode( ',', $field_data['excluded_product_types'] ), ENT_COMPAT, 'UTF-8' );
742
+ }
743
+ if ( isset( $field_data['allowed_product_types'] ) && is_array( $field_data['allowed_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
744
+ $allowed = html_entity_decode( implode( ',', $field_data['allowed_product_types'] ), ENT_COMPAT, 'UTF-8' );
745
+ }
746
+ if ( isset( $field_data['include_product_types'] ) && is_array( $field_data['include_product_types'] ) && ! empty( $field_data['allowed_product_types'] ) ) {
747
+ $included = html_entity_decode( implode( ',', $field_data['include_product_types'] ), ENT_COMPAT, 'UTF-8' );
748
+ }
749
+
750
+ $multiple = '';
751
+
752
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
753
+ $multiple = ' multiple="multiple"';
754
+ }
755
+
756
+ $allow_clear = '';
757
+
758
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
759
+ $allow_clear = ' data-allow_clear="allow_clear"';
760
+ }
761
+
762
+ $field_content = '<select
763
+ name="' . $field_data['name'] . '[]"
764
+ class="wcf-product-search" ' . $multiple . $allow_clear . '
765
+ data-placeholder="' . __( 'Search for a product&hellip;', 'cartflows' ) . '"
766
+ data-action="wcf_json_search_products_and_variations"
767
+ data-excluded_product_types ="' . $excluded . '"
768
+ data-allowed_product_types ="' . $allowed . '"
769
+ data-include_product_types ="' . $included . '">';
770
+
771
+ if ( is_array( $value ) && ! empty( $value ) ) {
772
+
773
+ foreach ( $value as $data_key => $product_id ) {
774
+
775
+ $product = wc_get_product( $product_id );
776
+
777
+ // posts.
778
+ if ( ! empty( $product ) ) {
779
+ $post_title = $product->get_name() . ' (#' . $product_id . ')';
780
+
781
+ $field_content .= '<option value="' . $product_id . '" selected="selected" >' . $post_title . '</option>';
782
+ }
783
+ }
784
+ }
785
+ $field_content .= '</select>';
786
+
787
+ return $this->get_field( $field_data, $field_content );
788
+ }
789
+
790
+ /**
791
+ * Coupon selection field.
792
+ *
793
+ * @param array $field_data Field data.
794
+ *
795
+ * @return string field.
796
+ */
797
+ public function get_coupon_selection_field( $field_data ) {
798
+
799
+ $value = $field_data['value'];
800
+
801
+ $multiple = '';
802
+
803
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
804
+ $multiple = ' multiple="multiple"';
805
+ }
806
+
807
+ $allow_clear = '';
808
+
809
+ if ( isset( $field_data['allow_clear'] ) && $field_data['allow_clear'] ) {
810
+ $allow_clear = ' data-allow_clear="allow_clear"';
811
+ }
812
+
813
+ $field_content = '<select
814
+ name="' . $field_data['name'] . '[]"
815
+ class="wc-coupon-search wcf-coupon-search" ' . $multiple . $allow_clear . '
816
+ data-placeholder="' . __( 'Search for a coupon&hellip;', 'cartflows' ) . '"
817
+ data-action="wcf_json_search_coupons">';
818
+
819
+ if ( is_array( $value ) && ! empty( $value ) ) {
820
+
821
+ $all_discount_types = wc_get_coupon_types();
822
+
823
+ foreach ( $value as $coupon_title ) {
824
+
825
+ $coupon = new WC_Coupon( $coupon_title );
826
+
827
+ $discount_type = $coupon->get_discount_type();
828
+
829
+ if ( isset( $discount_type ) && $discount_type ) {
830
+ $discount_type = ' ( Type: ' . $all_discount_types[ $discount_type ] . ' )';
831
+ }
832
+
833
+ $field_content .= '<option value="' . $coupon_title . '" selected="selected">' . $coupon_title . $discount_type . '</option>';
834
+ }
835
+ }
836
+
837
+ $field_content .= '</select>';
838
+
839
+ return $this->get_field( $field_data, $field_content );
840
+ }
841
+
842
+ /**
843
+ * Page selction field.
844
+ *
845
+ * @param array $field_data Field data.
846
+ *
847
+ * @return string field.
848
+ */
849
+ public function get_page_selection_field( $field_data ) {
850
+
851
+ $value = $field_data['value'];
852
+
853
+ $multiple = '';
854
+
855
+ if ( isset( $field_data['multiple'] ) && $field_data['multiple'] ) {
856
+ $multiple = 'multiple="multiple"';
857
+ }
858
+
859
+ $field_content = '<select
860
+ name="' . $field_data['name'] . '[]"
861
+ class="wcf-search-pages" ' . $multiple . '"
862
+ data-action="wcf_json_search_pages">';
863
+
864
+ if ( is_array( $value ) && ! empty( $value ) ) {
865
+
866
+ foreach ( $value as $data_key => $data_value ) {
867
+
868
+ $field_content .= '<option value="' . $data_value . '">' . get_the_title( $data_value ) . '</option>';
869
+ }
870
+ }
871
+
872
+ $field_content .= '</select>';
873
+
874
+ return $this->get_field( $field_data, $field_content );
875
+ }
876
+
877
+ /**
878
+ * Get section field.
879
+ *
880
+ * @param array $field_data Field data.
881
+ *
882
+ * @return string field.
883
+ */
884
+ public function get_section( $field_data ) {
885
+ $field_html = '<div class="wcf-field-row wcf-field-section">';
886
+ $field_html .= '<div class="wcf-field-section-heading" colspan="2">';
887
+ $field_html .= '<label>' . esc_html( $field_data['label'] ) . '</label>';
888
+
889
+ if ( isset( $field_data['help'] ) ) {
890
+ $field_html .= '<i class="wcf-field-heading-help dashicons dashicons-editor-help" title="' . esc_attr( $field_data['help'] ) . '"></i>';
891
+ }
892
+ $field_html .= '</div>';
893
+ $field_html .= '</div>';
894
+ return $field_html;
895
+ }
896
+
897
+ /**
898
+ * Description field.
899
+ *
900
+ * @param array $field_data Field data.
901
+ *
902
+ * @return string field.
903
+ */
904
+ public function get_description_field( $field_data ) {
905
+
906
+ $field_html = '<div class="wcf-field-row wcf-field-desc ' . $field_data['name'] . '">';
907
+ $field_html .= '<div class="wcf-field-desc-content">';
908
+ $field_html .= $field_data['content'];
909
+ $field_html .= '</div>';
910
+ $field_html .= '</div>';
911
+
912
+ return $field_html;
913
+ }
914
+
915
+ /**
916
+ * Product selection repeater field.
917
+ *
918
+ * @param array $field_data Field data.
919
+ *
920
+ * @return string field.
921
+ */
922
+ public function get_product_selection_repeater( $field_data ) {
923
+
924
+ return $this->get_meta_field_template(
925
+ 'get-product-selection-repeater.php',
926
+ $field_data
927
+ );
928
+ }
929
+
930
+ /**
931
+ * Generate product repeater html.
932
+ *
933
+ * @param string $id ID.
934
+ * @param string $options Options.
935
+ * @param array $selected_data Discount_data.
936
+ *
937
+ * @return string field.
938
+ */
939
+ public function generate_product_repeater_html( $id, $options = '', $selected_data = '' ) {
940
+
941
+ ob_start();
942
+
943
+ include CARTFLOWS_DIR . 'includes/meta-fields/generate-product-repeater.php';
944
+
945
+ return ob_get_clean();
946
+ }
947
+
948
+ /**
949
+ * Image field.
950
+ *
951
+ * @param array $field_data Field data.
952
+ *
953
+ * @return string field.
954
+ */
955
+ public function get_image_field( $field_data ) {
956
+
957
+ global $post;
958
+ $value = $field_data['value'];
959
+
960
+ $attr = '';
961
+
962
+ if ( isset( $field_data['attr'] ) && is_array( $field_data['attr'] ) ) {
963
+
964
+ foreach ( $field_data['attr'] as $attr_key => $attr_value ) {
965
+ $attr .= ' ' . $attr_key . '="' . $attr_value . '"';
966
+ }
967
+ }
968
+
969
+ $display_preview_box = ( isset( $value ) && '' != $value ) ? 'display:block;' : 'display:none';
970
+
971
+ $field_content = '<div id="wcf-image-preview" style="' . $display_preview_box . '">';
972
+
973
+ if ( isset( $value ) ) {
974
+
975
+ $field_content .= '<img src="' . $field_data['value'] . '" class="saved-image" name="' . $field_data['name'] . '" width="150">';
976
+ }
977
+
978
+ $field_content .= '</div>';
979
+
980
+ $image_data = htmlentities( serialize( get_post_meta( $post->ID, $field_data['name'] . '-obj' ) ) ); // phpcs:ignore
981
+
982
+ $field_content .= '<input type="hidden" id="' . $field_data['name'] . '" class="wcf-image" name="' . $field_data['name'] . '" value="' . $value . '">'; // phpcs:ignore
983
+
984
+ $field_content .= '<input type="hidden" id="' . $field_data['name'] . '-obj' . '" class="wcf-image-obj" name="' . $field_data['name'] . '-obj' . '" value="' . $image_data . '">'; // phpcs:ignore
985
+
986
+ $field_content .= '<button type="button" ' . $attr . ' class="wcf-select-image button-secondary">Select Image</button>';
987
+
988
+ $display_remove_button = ( isset( $value ) && '' != $value ) ? 'display:inline-block; margin-left: 5px;' : 'display:none';
989
+
990
+ $field_content .= '<button type="button" class="wcf-remove-image button-secondary" style="' . $display_remove_button . '">Remove Image</button>';
991
+
992
+ return $this->get_field( $field_data, $field_content );
993
+ }
994
+
995
+ /**
996
+ * Localize variables in admin
997
+ *
998
+ * @param array $vars variables.
999
+ */
1000
+ public function localize_vars( $vars ) {
1001
+
1002
+ $ajax_actions = array(
1003
+ 'wcf_json_search_pages',
1004
+ 'wcf_json_search_coupons',
1005
+ 'wcf_json_search_products_and_variations',
1006
+ );
1007
+
1008
+ foreach ( $ajax_actions as $action ) {
1009
+
1010
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1011
+ }
1012
+
1013
+ /* Add product from iframe */
1014
+ $product_src = esc_url_raw(
1015
+ add_query_arg(
1016
+ array(
1017
+ 'post_type' => 'product',
1018
+ 'wcf-woo-iframe' => 'true',
1019
+ ),
1020
+ admin_url( 'post-new.php' )
1021
+ )
1022
+ );
1023
+
1024
+ $vars['create_product_src'] = $product_src;
1025
+ /* Add product from iframe End */
1026
+
1027
+ return $vars;
1028
+ }
1029
+
1030
+ /**
1031
+ * Get meta field template.
1032
+ *
1033
+ * @param string $template file name.
1034
+ * @param array $field_data Field data.
1035
+ *
1036
+ * @return string.
1037
+ */
1038
+ public function get_meta_field_template( $template, $field_data ) {
1039
+
1040
+ ob_start();
1041
+
1042
+ include CARTFLOWS_DIR . 'includes/meta-fields/' . $template;
1043
+
1044
+ return ob_get_clean();
1045
+ }
1046
+ }
classes/class-cartflows-stats.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Stats
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Stats
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Stats {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+ if ( ! isset( self::$instance ) ) {
27
+ self::$instance = new self();
28
+ }
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor
34
+ */
35
+ public function __construct() {
36
+
37
+ add_action( 'wp_ajax_cartflows_fetch_stats', array( $this, 'fetch_stats' ) );
38
+ }
39
+
40
+ /**
41
+ * Get stats.
42
+ */
43
+ public function fetch_stats() {
44
+
45
+ check_ajax_referer( 'wcf-fetch-stats', 'security' );
46
+
47
+ $filter = filter_input( INPUT_POST, 'filter', FILTER_SANITIZE_STRING );
48
+
49
+ if ( ! $filter ) {
50
+ $filter = 'week';
51
+ }
52
+
53
+ $from_date = gmdate( 'Y-m-d' );
54
+ $to_date = gmdate( 'Y-m-d' );
55
+ $to_date = date( 'Y-m-d H:i:s', strtotime( $to_date . '23:59:59' ) ); //phpcs:ignore
56
+
57
+ switch ( $filter ) {
58
+
59
+ case 'today':
60
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
61
+ break;
62
+ case 'yesterday':
63
+ $yesterday = gmdate( 'Y-m-d', strtotime( '-1 days' ) );
64
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $yesterday . '00:00:00' ) ); //phpcs:ignore
65
+ $to_date = date( 'Y-m-d H:i:s', strtotime( $yesterday . '23:59:59' ) ); //phpcs:ignore
66
+ break;
67
+ case 'week':
68
+ $from_date = gmdate( 'Y-m-d', strtotime( '-7 days' ) );
69
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
70
+ break;
71
+ case 'month':
72
+ $from_date = gmdate( 'Y-m-d', strtotime( '-1 months' ) );
73
+ $from_date = date( 'Y-m-d H:i:s', strtotime( $from_date . '00:00:00' ) ); //phpcs:ignore
74
+ break;
75
+ case 'custom':
76
+ $to_date = $to_date ? $to_date : gmdate( 'Y-m-d' );
77
+ $from_date = $from_date ? $from_date : $to_date;
78
+ break;
79
+ default:
80
+ }
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Kicking this off by calling 'get_instance()' method
86
+ */
87
+ Cartflows_Stats::get_instance();
classes/class-cartflows-step-factory.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Get current step data - factory.
4
+ *
5
+ * @package cartflows
6
+ */
7
+
8
+ /**
9
+ * Step factory
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Step_Factory {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var int step_id
19
+ */
20
+ private $step_id;
21
+
22
+ /**
23
+ * Member Variable
24
+ *
25
+ * @var int control_step_id
26
+ */
27
+ private $control_step_id;
28
+
29
+ /**
30
+ * Member Variable
31
+ *
32
+ * @var int flow_id
33
+ */
34
+ private $flow_id;
35
+
36
+
37
+ /**
38
+ * Member Variable
39
+ *
40
+ * @var string step_type
41
+ */
42
+ private $step_type;
43
+
44
+ /**
45
+ * Member Variable
46
+ *
47
+ * @var int flow_steps
48
+ */
49
+ private $flow_steps;
50
+
51
+ /**
52
+ * Member Variable
53
+ *
54
+ * @var int flow_steps
55
+ */
56
+ private $flow_steps_map;
57
+
58
+ /**
59
+ * Member Variable
60
+ *
61
+ * @var int ab_test
62
+ */
63
+ private $ab_test;
64
+
65
+ /**
66
+ * Member Variable
67
+ *
68
+ * @var int all_variations
69
+ */
70
+ private $all_variations;
71
+
72
+ /**
73
+ * Member Variable
74
+ *
75
+ * @var array show_variations
76
+ */
77
+ private $show_variations;
78
+
79
+ /**
80
+ * Member Variable
81
+ *
82
+ * @var int show_variation_id
83
+ */
84
+ private $show_variation_id;
85
+
86
+ /**
87
+ * Constructor
88
+ *
89
+ * @param int $id step id.
90
+ */
91
+ public function __construct( $id = null ) {
92
+
93
+ if ( null !== $id ) {
94
+
95
+ /* Data from step */
96
+ $this->step_id = intval( $id );
97
+ $this->step_type = get_post_meta( $this->step_id, 'wcf-step-type', true );
98
+ /* Data from flow */
99
+ $this->flow_id = get_post_meta( $this->step_id, 'wcf-flow-id', true );
100
+ $this->flow_steps = get_post_meta( $this->flow_id, 'wcf-steps', true );
101
+
102
+ /* If Ab test */
103
+ $this->ab_test = get_post_meta( $this->step_id, 'wcf-ab-test', true );
104
+ $this->control_step_id = $this->step_id;
105
+
106
+ if ( $this->ab_test ) {
107
+
108
+ $control_step_id = get_post_meta( $this->step_id, 'wcf-control-step', true );
109
+
110
+ if ( ! empty( $control_step_id ) ) {
111
+ $this->control_step_id = intval( $control_step_id );
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Is ab test enable
119
+ */
120
+ public function is_ab_test_enable() {
121
+
122
+ if ( $this->ab_test ) {
123
+
124
+ return true;
125
+ }
126
+
127
+ return false;
128
+ }
129
+
130
+ /**
131
+ * Get flow id
132
+ */
133
+ public function get_flow_id() {
134
+ return $this->flow_id;
135
+ }
136
+
137
+ /**
138
+ * Get step id
139
+ */
140
+ public function get_step_id() {
141
+ return $this->step_id;
142
+ }
143
+
144
+ /**
145
+ * Get step type
146
+ */
147
+ public function get_step_type() {
148
+ return $this->step_type;
149
+ }
150
+
151
+ /**
152
+ * Get control step id
153
+ */
154
+ public function get_current_step() {
155
+ return $this->step_id;
156
+ }
157
+
158
+ /**
159
+ * Get control step id
160
+ */
161
+ public function get_control_step() {
162
+ return $this->control_step_id;
163
+ }
164
+
165
+ /**
166
+ * Get flow steps
167
+ */
168
+ public function get_flow_steps() {
169
+ return $this->flow_steps;
170
+ }
171
+
172
+ /**
173
+ * Set flow steps map
174
+ */
175
+ public function set_flow_steps_map() {
176
+
177
+ }
178
+
179
+ /**
180
+ * Check for thank you page
181
+ *
182
+ * @return bool
183
+ */
184
+ public function is_thankyou_page() {
185
+
186
+ $step_type = $this->get_step_type();
187
+
188
+ if ( 'thankyou' === $step_type ) {
189
+
190
+ return true;
191
+ }
192
+
193
+ return false;
194
+ }
195
+
196
+ /**
197
+ * Check for checkout page
198
+ *
199
+ * @return bool
200
+ */
201
+ public function is_checkout_page() {
202
+
203
+ $step_type = $this->get_step_type();
204
+
205
+ if ( 'checkout' === $step_type ) {
206
+
207
+ return true;
208
+ }
209
+
210
+ return false;
211
+ }
212
+
213
+ /**
214
+ * Get direct next step id.
215
+ *
216
+ * @since x.x.x
217
+ *
218
+ * @return bool|int
219
+ */
220
+ public function get_direct_next_step_id() {
221
+
222
+ $next_step_id = false;
223
+
224
+ if ( $this->flow_id ) {
225
+
226
+ $flow_steps = $this->get_flow_steps();
227
+ $control_step = $this->get_control_step();
228
+
229
+ if ( is_array( $flow_steps ) ) {
230
+
231
+ foreach ( $flow_steps as $index => $data ) {
232
+
233
+ if ( intval( $data['id'] ) === $control_step ) {
234
+
235
+ $next_step_index = $index + 1;
236
+
237
+ if ( isset( $flow_steps[ $next_step_index ] ) ) {
238
+
239
+ $next_step_id = intval( $flow_steps[ $next_step_index ]['id'] );
240
+ }
241
+
242
+ break;
243
+ }
244
+ }
245
+ }
246
+ }
247
+
248
+ return $next_step_id;
249
+ }
250
+ }
classes/class-cartflows-update.php CHANGED
@@ -74,10 +74,6 @@ if ( ! class_exists( 'Cartflows_Update' ) ) :
74
  $this->changed_wp_templates();
75
  }
76
 
77
- if ( version_compare( $saved_version, '1.5.13', '<' ) ) {
78
- $this->update_usage_tracking_option();
79
- }
80
-
81
  // Update auto saved version number.
82
  update_option( 'cartflows-version', CARTFLOWS_VER );
83
 
@@ -103,24 +99,6 @@ if ( ! class_exists( 'Cartflows_Update' ) ) :
103
  wcf()->create_files();
104
  }
105
 
106
- /**
107
- * Update usage tracking option.
108
- *
109
- * @since 1.0.0
110
- * @return void
111
- */
112
- public function update_usage_tracking_option() {
113
-
114
- $bsf_usage_tracking = get_site_option( 'bsf_analytics_optin' );
115
-
116
- $cf_usage_tracking = get_site_option( 'cf_analytics_optin' );
117
-
118
- if ( isset( $bsf_usage_tracking ) && 'yes' === $bsf_usage_tracking && false === $cf_usage_tracking ) {
119
- update_site_option( 'cf_analytics_optin', 'yes' );
120
- }
121
-
122
- }
123
-
124
  /**
125
  * Init
126
  *
74
  $this->changed_wp_templates();
75
  }
76
 
 
 
 
 
77
  // Update auto saved version number.
78
  update_option( 'cartflows-version', CARTFLOWS_VER );
79
 
99
  wcf()->create_files();
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  /**
103
  * Init
104
  *
classes/class-cartflows-utils.php CHANGED
@@ -1,591 +1,581 @@
1
- <?php
2
- /**
3
- * Utils.
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit; // Exit if accessed directly.
10
- }
11
-
12
- /**
13
- * Class Cartflows_Utils.
14
- */
15
- class Cartflows_Utils {
16
-
17
- /**
18
- * Member Variable
19
- *
20
- * @var instance
21
- */
22
- private static $instance;
23
-
24
- /**
25
- * Member Variable
26
- *
27
- * @var checkout_products
28
- */
29
- public $checkout_products = array();
30
-
31
-
32
- /**
33
- * Initiator
34
- */
35
- public static function get_instance() {
36
- if ( ! isset( self::$instance ) ) {
37
- self::$instance = new self();
38
- }
39
- return self::$instance;
40
- }
41
-
42
- /**
43
- * Constructor
44
- */
45
- public function __construct() {
46
- }
47
-
48
- /**
49
- * Get current post type
50
- *
51
- * @param string $post_type post type.
52
- * @return string
53
- */
54
- public function current_post_type( $post_type = '' ) {
55
-
56
- if ( '' === $post_type ) {
57
- $post_type = get_post_type();
58
- }
59
-
60
- return $post_type;
61
- }
62
-
63
- /**
64
- * Check if post type is of step.
65
- *
66
- * @param string $post_type post type.
67
- * @return bool
68
- */
69
- public function is_step_post_type( $post_type = '' ) {
70
-
71
- if ( $this->get_step_post_type() === $this->current_post_type( $post_type ) ) {
72
-
73
- return true;
74
- }
75
-
76
- return false;
77
- }
78
-
79
- /**
80
- * Check if post type is of flow.
81
- *
82
- * @param string $post_type post type.
83
- * @return bool
84
- */
85
- public function is_flow_post_type( $post_type = '' ) {
86
-
87
- if ( $this->get_flow_post_type() === $this->current_post_type( $post_type ) ) {
88
-
89
- return true;
90
- }
91
-
92
- return false;
93
- }
94
-
95
- /**
96
- * Get post type of step.
97
- *
98
- * @return string
99
- */
100
- public function get_step_post_type() {
101
-
102
- return CARTFLOWS_STEP_POST_TYPE;
103
- }
104
-
105
- /**
106
- * Get post type of flow.
107
- *
108
- * @return string
109
- */
110
- public function get_flow_post_type() {
111
-
112
- return CARTFLOWS_FLOW_POST_TYPE;
113
- }
114
-
115
- /**
116
- * Get flow id
117
- *
118
- * @return int
119
- */
120
- public function get_flow_id() {
121
-
122
- global $post;
123
-
124
- return get_post_meta( $post->ID, 'wcf-flow-id', true );
125
- }
126
-
127
- /**
128
- * Get flow id by step
129
- *
130
- * @param int $step_id step ID.
131
- * @return int
132
- */
133
- public function get_flow_id_from_step_id( $step_id ) {
134
-
135
- return get_post_meta( $step_id, 'wcf-flow-id', true );
136
- }
137
-
138
- /**
139
- * Get flow steps by id
140
- *
141
- * @param int $flow_id flow ID.
142
- * @return int
143
- */
144
- public function get_flow_steps( $flow_id ) {
145
-
146
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
147
-
148
- if ( is_array( $steps ) && ! empty( $steps ) ) {
149
- return $steps;
150
- }
151
-
152
- return false;
153
- }
154
-
155
- /**
156
- * Get template type of step
157
- *
158
- * @param int $step_id step ID.
159
- * @return int
160
- */
161
- public function get_step_type( $step_id ) {
162
-
163
- return get_post_meta( $step_id, 'wcf-step-type', true );
164
- }
165
-
166
- /**
167
- * Get next id for step
168
- *
169
- * @param int $flow_id flow ID.
170
- * @param int $step_id step ID.
171
- * @return bool
172
- */
173
- public function get_next_step_id( $flow_id, $step_id ) {
174
-
175
- $steps = $this->get_flow_steps( $flow_id );
176
- $step_id = intval( $step_id );
177
-
178
- if ( ! $steps ) {
179
- return false;
180
- }
181
-
182
- foreach ( $steps as $i => $step ) {
183
-
184
- if ( intval( $step['id'] ) === $step_id ) {
185
-
186
- $next_i = $i + 1;
187
-
188
- if ( isset( $steps[ $next_i ] ) ) {
189
-
190
- $navigation = $steps[ $next_i ];
191
-
192
- return intval( $navigation['id'] );
193
- }
194
-
195
- break;
196
- }
197
- }
198
-
199
- return false;
200
- }
201
-
202
- /**
203
- * Get next id for step
204
- *
205
- * @param int $order_id order ID.
206
- * @return int
207
- */
208
- public function get_flow_id_from_order( $order_id ) {
209
-
210
- $flow_id = get_post_meta( $order_id, '_wcf_flow_id', true );
211
-
212
- return intval( $flow_id );
213
- }
214
-
215
- /**
216
- * Get checkout id for order
217
- *
218
- * @param int $order_id order ID.
219
- * @return int
220
- */
221
- public function get_checkout_id_from_order( $order_id ) {
222
-
223
- $checkout_id = get_post_meta( $order_id, '_wcf_checkout_id', true );
224
-
225
- return intval( $checkout_id );
226
- }
227
-
228
- /**
229
- * We are using this function mostly in ajax on checkout page
230
- *
231
- * @return bool
232
- */
233
- public function get_checkout_id_from_post_data() {
234
-
235
- if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore
236
-
237
- $checkout_id = filter_var( wp_unslash( $_POST['_wcf_checkout_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
238
-
239
- return intval( $checkout_id );
240
- }
241
-
242
- return false;
243
- }
244
-
245
- /**
246
- * We are using this function mostly in ajax on checkout page
247
- *
248
- * @return bool
249
- */
250
- public function get_flow_id_from_post_data() {
251
-
252
- if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
253
-
254
- $flow_id = filter_var( wp_unslash( $_POST['_wcf_flow_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
255
-
256
- return intval( $flow_id );
257
- }
258
-
259
- return false;
260
- }
261
-
262
- /**
263
- * Get optin id for order
264
- *
265
- * @param int $order_id order ID.
266
- * @return int
267
- */
268
- public function get_optin_id_from_order( $order_id ) {
269
-
270
- $optin_id = get_post_meta( $order_id, '_wcf_optin_id', true );
271
-
272
- return intval( $optin_id );
273
- }
274
-
275
- /**
276
- * We are using this function mostly in ajax on checkout page
277
- *
278
- * @return bool
279
- */
280
- public function get_optin_id_from_post_data() {
281
-
282
- if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
283
-
284
- $optin_id = filter_var( wp_unslash( $_POST['_wcf_optin_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
285
-
286
- return intval( $optin_id );
287
- }
288
-
289
- return false;
290
- }
291
-
292
- /**
293
- * Check for thank you page
294
- *
295
- * @param int $step_id step ID.
296
- * @return bool
297
- */
298
- public function check_is_thankyou_page( $step_id ) {
299
-
300
- $step_type = $this->get_step_type( $step_id );
301
-
302
- if ( 'thankyou' === $step_type ) {
303
-
304
- return true;
305
- }
306
-
307
- return false;
308
- }
309
-
310
- /**
311
- * Check for offer page
312
- *
313
- * @param int $step_id step ID.
314
- * @return bool
315
- */
316
- public function check_is_offer_page( $step_id ) {
317
-
318
- $step_type = $this->get_step_type( $step_id );
319
-
320
- if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
321
-
322
- return true;
323
- }
324
-
325
- return false;
326
- }
327
-
328
- /**
329
- * Check if loaded page requires woo.
330
- *
331
- * @return bool
332
- */
333
- public function check_is_woo_required_page() {
334
-
335
- global $post;
336
- $step_id = $post->ID;
337
- $woo_not_required_type = array( 'landing' );
338
- $step_type = $this->get_step_type( $step_id );
339
- return ( ! in_array( $step_type, $woo_not_required_type, true ) );
340
- }
341
-
342
- /**
343
- * Define constant for cache
344
- *
345
- * @return void
346
- */
347
- public function do_not_cache() {
348
-
349
- global $post;
350
-
351
- if ( ! apply_filters( 'cartflows_do_not_cache_step', true, $post->ID ) ) {
352
- return;
353
- }
354
-
355
- wcf_maybe_define_constant( 'DONOTCACHEPAGE', true );
356
- wcf_maybe_define_constant( 'DONOTCACHEOBJECT', true );
357
- wcf_maybe_define_constant( 'DONOTCACHEDB', true );
358
-
359
- nocache_headers();
360
- }
361
-
362
- /**
363
- * Get linking url
364
- *
365
- * @param array $args query args.
366
- * @return string
367
- */
368
- public function get_linking_url( $args = array() ) {
369
-
370
- $url = get_home_url();
371
-
372
- $url = add_query_arg( $args, $url );
373
-
374
- return $url;
375
- }
376
-
377
- /**
378
- * Get assets urls
379
- *
380
- * @return array
381
- * @since 1.1.6
382
- */
383
- public function get_assets_path() {
384
-
385
- $rtl = '';
386
-
387
- if ( is_rtl() ) {
388
- $rtl = '-rtl';
389
- }
390
-
391
- $file_prefix = '';
392
- $dir_name = '';
393
-
394
- $is_min = apply_filters( 'cartflows_load_min_assets', false );
395
-
396
- if ( $is_min ) {
397
- $file_prefix = '.min';
398
- $dir_name = 'min-';
399
- }
400
-
401
- $js_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'js/';
402
- $css_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'css/';
403
-
404
- return array(
405
- 'css' => $css_gen_path,
406
- 'js' => $js_gen_path,
407
- 'file_prefix' => $file_prefix,
408
- 'rtl' => $rtl,
409
- );
410
- }
411
-
412
- /**
413
- * Get assets css url
414
- *
415
- * @param string $file file name.
416
- * @return string
417
- * @since 1.1.6
418
- */
419
- public function get_css_url( $file ) {
420
-
421
- $assets_vars = wcf()->assets_vars;
422
-
423
- $url = $assets_vars['css'] . $file . $assets_vars['rtl'] . $assets_vars['file_prefix'] . '.css';
424
-
425
- return $url;
426
- }
427
-
428
- /**
429
- * Get assets js url
430
- *
431
- * @param string $file file name.
432
- * @return string
433
- * @since 1.1.6
434
- */
435
- public function get_js_url( $file ) {
436
-
437
- $assets_vars = wcf()->assets_vars;
438
-
439
- $url = $assets_vars['js'] . $file . $assets_vars['file_prefix'] . '.js';
440
-
441
- return $url;
442
- }
443
-
444
- /**
445
- * Get unique id.
446
- *
447
- * @param int $length Length.
448
- *
449
- * @return string
450
- */
451
- public function get_unique_id( $length = 8 ) {
452
-
453
- return substr( md5( microtime() ), 0, $length );
454
- }
455
-
456
- /**
457
- * Get selected checkout products and data
458
- *
459
- * @param int $checkout_id Checkout id..
460
- * @param array $saved_products Saved product.
461
- *
462
- * @return array
463
- */
464
- public function get_selected_checkout_products( $checkout_id = '', $saved_products = array() ) {
465
-
466
- if ( empty( $checkout_id ) ) {
467
-
468
- global $post;
469
-
470
- $checkout_id = $post->ID;
471
- }
472
-
473
- if ( ! isset( $this->checkout_products[ $checkout_id ] ) ) {
474
-
475
- if ( ! empty( $saved_products ) ) {
476
-
477
- $products = $saved_products;
478
- } else {
479
-
480
- $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' );
481
- }
482
-
483
- $verify_url_data = false;
484
- $default_add_to_cart = false;
485
- $default_ids = array();
486
- $default_add_to_cart = true;
487
-
488
- if ( isset( $_GET['wcf-default'] ) ) { //phpcs:ignore
489
- //phpcs:ignore WordPress.Security.NonceVerification.Recommended
490
- $default_sequence = sanitize_text_field( wp_unslash( $_GET['wcf-default'] ) );
491
- $default_ids = array_map( 'intval', explode( ',', $default_sequence ) );
492
- $verify_url_data = true;
493
- }
494
-
495
- if ( is_array( $products ) ) {
496
-
497
- foreach ( $products as $in => $data ) {
498
-
499
- if ( $verify_url_data ) {
500
-
501
- $default_add_to_cart = false;
502
- $sequence = $in + 1;
503
-
504
- if ( in_array( $sequence, $default_ids, true ) ) {
505
- $default_add_to_cart = true;
506
- }
507
- }
508
-
509
- $default_data = array(
510
- 'quantity' => 1,
511
- 'discount_type' => '',
512
- 'discount_value' => '',
513
- 'unique_id' => $this->get_unique_id(),
514
- 'add_to_cart' => $default_add_to_cart,
515
- );
516
-
517
- $products[ $in ] = wp_parse_args( $products[ $in ], $default_data );
518
- }
519
- }
520
-
521
- $this->checkout_products[ $checkout_id ] = $products;
522
- }
523
-
524
- return $this->checkout_products[ $checkout_id ];
525
- }
526
-
527
- /**
528
- * Get selected checkout products and data
529
- *
530
- * @param int $checkout_id Checkout id..
531
- * @param array $products_data Saved product.
532
- *
533
- * @return array
534
- */
535
- public function set_selcted_checkout_products( $checkout_id = '', $products_data = array() ) {
536
-
537
- if ( empty( $checkout_id ) ) {
538
-
539
- global $post;
540
-
541
- $checkout_id = $post->ID;
542
- }
543
-
544
- if ( isset( $this->checkout_products[ $checkout_id ] ) ) {
545
-
546
- $products = $this->checkout_products[ $checkout_id ];
547
- } else {
548
- $products = $this->get_selected_checkout_products( $checkout_id );
549
- }
550
-
551
- if ( is_array( $products ) && ! empty( $products_data ) ) {
552
-
553
- foreach ( $products as $in => $data ) {
554
-
555
- if ( isset( $products_data[ $in ] ) ) {
556
- $products[ $in ] = wp_parse_args( $products_data[ $in ], $products[ $in ] );
557
- }
558
- }
559
- }
560
-
561
- $this->checkout_products[ $checkout_id ] = $products;
562
-
563
- return $this->checkout_products[ $checkout_id ];
564
- }
565
- }
566
-
567
- /**
568
- * Get a specific property of an array without needing to check if that property exists.
569
- *
570
- * Provide a default value if you want to return a specific value if the property is not set.
571
- *
572
- * @param array $array Array from which the property's value should be retrieved.
573
- * @param string $prop Name of the property to be retrieved.
574
- * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
575
- *
576
- * @return null|string|mixed The value
577
- */
578
- function wcf_get_prop( $array, $prop, $default = null ) {
579
-
580
- if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
581
- return $default;
582
- }
583
-
584
- if ( isset( $array[ $prop ] ) ) {
585
- $value = $array[ $prop ];
586
- } else {
587
- $value = '';
588
- }
589
-
590
- return empty( $value ) && null !== $default ? $default : $value;
591
- }
1
+ <?php
2
+ /**
3
+ * Utils.
4
+ *
5
+ * @package CARTFLOWS
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ /**
13
+ * Class Cartflows_Utils.
14
+ */
15
+ class Cartflows_Utils {
16
+
17
+ /**
18
+ * Member Variable
19
+ *
20
+ * @var instance
21
+ */
22
+ private static $instance;
23
+
24
+ /**
25
+ * Member Variable
26
+ *
27
+ * @var checkout_products
28
+ */
29
+ public $checkout_products = array();
30
+
31
+
32
+ /**
33
+ * Initiator
34
+ */
35
+ public static function get_instance() {
36
+ if ( ! isset( self::$instance ) ) {
37
+ self::$instance = new self();
38
+ }
39
+ return self::$instance;
40
+ }
41
+
42
+ /**
43
+ * Constructor
44
+ */
45
+ public function __construct() {
46
+ }
47
+
48
+ /**
49
+ * Get current post type
50
+ *
51
+ * @param string $post_type post type.
52
+ * @return string
53
+ */
54
+ public function current_post_type( $post_type = '' ) {
55
+
56
+ if ( '' === $post_type ) {
57
+ $post_type = get_post_type();
58
+ }
59
+
60
+ return $post_type;
61
+ }
62
+
63
+ /**
64
+ * Check if post type is of step.
65
+ *
66
+ * @param string $post_type post type.
67
+ * @return bool
68
+ */
69
+ public function is_step_post_type( $post_type = '' ) {
70
+
71
+ if ( $this->get_step_post_type() === $this->current_post_type( $post_type ) ) {
72
+
73
+ return true;
74
+ }
75
+
76
+ return false;
77
+ }
78
+
79
+ /**
80
+ * Check if post type is of flow.
81
+ *
82
+ * @param string $post_type post type.
83
+ * @return bool
84
+ */
85
+ public function is_flow_post_type( $post_type = '' ) {
86
+
87
+ if ( $this->get_flow_post_type() === $this->current_post_type( $post_type ) ) {
88
+
89
+ return true;
90
+ }
91
+
92
+ return false;
93
+ }
94
+
95
+ /**
96
+ * Get post type of step.
97
+ *
98
+ * @return string
99
+ */
100
+ public function get_step_post_type() {
101
+
102
+ return CARTFLOWS_STEP_POST_TYPE;
103
+ }
104
+
105
+ /**
106
+ * Get post type of flow.
107
+ *
108
+ * @return string
109
+ */
110
+ public function get_flow_post_type() {
111
+
112
+ return CARTFLOWS_FLOW_POST_TYPE;
113
+ }
114
+
115
+ /**
116
+ * Get flow id
117
+ *
118
+ * @return int
119
+ */
120
+ public function get_flow_id() {
121
+
122
+ global $post;
123
+
124
+ return get_post_meta( $post->ID, 'wcf-flow-id', true );
125
+ }
126
+
127
+ /**
128
+ * Get flow id by step
129
+ *
130
+ * @param int $step_id step ID.
131
+ * @return int
132
+ */
133
+ public function get_flow_id_from_step_id( $step_id ) {
134
+
135
+ return get_post_meta( $step_id, 'wcf-flow-id', true );
136
+ }
137
+
138
+ /**
139
+ * Get flow steps by id
140
+ *
141
+ * @param int $flow_id flow ID.
142
+ * @return int
143
+ */
144
+ public function get_flow_steps( $flow_id ) {
145
+
146
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
147
+
148
+ if ( is_array( $steps ) && ! empty( $steps ) ) {
149
+ return $steps;
150
+ }
151
+
152
+ return false;
153
+ }
154
+
155
+ /**
156
+ * Get template type of step
157
+ *
158
+ * @param int $step_id step ID.
159
+ * @return int
160
+ */
161
+ public function get_step_type( $step_id ) {
162
+
163
+ return get_post_meta( $step_id, 'wcf-step-type', true );
164
+ }
165
+
166
+ /**
167
+ * Get next id for step
168
+ *
169
+ * @param int $flow_id flow ID.
170
+ * @param int $step_id step ID.
171
+ * @return bool
172
+ */
173
+ public function get_next_step_id( $flow_id, $step_id ) {
174
+
175
+ $wcf_step_obj = wcf_get_step( $step_id );
176
+ $next_step_id = $wcf_step_obj->get_direct_next_step_id();
177
+
178
+ return $next_step_id;
179
+ }
180
+
181
+ /**
182
+ * Get next id for step
183
+ *
184
+ * @param int $order_id order ID.
185
+ * @return int
186
+ */
187
+ public function get_flow_id_from_order( $order_id ) {
188
+
189
+ $flow_id = get_post_meta( $order_id, '_wcf_flow_id', true );
190
+
191
+ return intval( $flow_id );
192
+ }
193
+
194
+ /**
195
+ * Get checkout id for order
196
+ *
197
+ * @param int $order_id order ID.
198
+ * @return int
199
+ */
200
+ public function get_checkout_id_from_order( $order_id ) {
201
+
202
+ $checkout_id = get_post_meta( $order_id, '_wcf_checkout_id', true );
203
+
204
+ return intval( $checkout_id );
205
+ }
206
+
207
+ /**
208
+ * We are using this function mostly in ajax on checkout page
209
+ *
210
+ * @return bool
211
+ */
212
+ public function get_checkout_id_from_post_data() {
213
+
214
+ if ( isset( $_POST['_wcf_checkout_id'] ) ) { //phpcs:ignore
215
+
216
+ $checkout_id = filter_var( wp_unslash( $_POST['_wcf_checkout_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
217
+
218
+ return intval( $checkout_id );
219
+ }
220
+
221
+ return false;
222
+ }
223
+
224
+ /**
225
+ * We are using this function mostly in ajax on checkout page
226
+ *
227
+ * @return bool
228
+ */
229
+ public function get_flow_id_from_post_data() {
230
+
231
+ if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
232
+
233
+ $flow_id = filter_var( wp_unslash( $_POST['_wcf_flow_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
234
+
235
+ return intval( $flow_id );
236
+ }
237
+
238
+ return false;
239
+ }
240
+
241
+ /**
242
+ * Get optin id for order
243
+ *
244
+ * @param int $order_id order ID.
245
+ * @return int
246
+ */
247
+ public function get_optin_id_from_order( $order_id ) {
248
+
249
+ $optin_id = get_post_meta( $order_id, '_wcf_optin_id', true );
250
+
251
+ return intval( $optin_id );
252
+ }
253
+
254
+ /**
255
+ * We are using this function mostly in ajax on checkout page
256
+ *
257
+ * @return bool
258
+ */
259
+ public function get_optin_id_from_post_data() {
260
+
261
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
262
+
263
+ $optin_id = filter_var( wp_unslash( $_POST['_wcf_optin_id'] ), FILTER_SANITIZE_NUMBER_INT ); //phpcs:ignore
264
+
265
+ return intval( $optin_id );
266
+ }
267
+
268
+ return false;
269
+ }
270
+
271
+ /**
272
+ * Check for thank you page
273
+ *
274
+ * @param int $step_id step ID.
275
+ * @return bool
276
+ */
277
+ public function check_is_thankyou_page( $step_id ) {
278
+
279
+ $step_type = $this->get_step_type( $step_id );
280
+
281
+ if ( 'thankyou' === $step_type ) {
282
+
283
+ return true;
284
+ }
285
+
286
+ return false;
287
+ }
288
+
289
+ /**
290
+ * Check for offer page
291
+ *
292
+ * @param int $step_id step ID.
293
+ * @return bool
294
+ */
295
+ public function check_is_offer_page( $step_id ) {
296
+
297
+ $step_type = $this->get_step_type( $step_id );
298
+
299
+ if ( 'upsell' === $step_type || 'downsell' === $step_type ) {
300
+
301
+ return true;
302
+ }
303
+
304
+ return false;
305
+ }
306
+
307
+ /**
308
+ * Check if loaded page requires woo.
309
+ *
310
+ * @return bool
311
+ */
312
+ public function check_is_woo_required_page() {
313
+
314
+ global $post;
315
+ $step_id = $post->ID;
316
+ $woo_not_required_type = array( 'landing' );
317
+ $step_type = $this->get_step_type( $step_id );
318
+ return ( ! in_array( $step_type, $woo_not_required_type, true ) );
319
+ }
320
+
321
+ /**
322
+ * Define constant for cache
323
+ *
324
+ * @return void
325
+ */
326
+ public function do_not_cache() {
327
+
328
+ global $post;
329
+
330
+ if ( ! apply_filters( 'cartflows_do_not_cache_step', true, $post->ID ) ) {
331
+ return;
332
+ }
333
+
334
+ wcf_maybe_define_constant( 'DONOTCACHEPAGE', true );
335
+ wcf_maybe_define_constant( 'DONOTCACHEOBJECT', true );
336
+ wcf_maybe_define_constant( 'DONOTCACHEDB', true );
337
+
338
+ nocache_headers();
339
+ }
340
+
341
+ /**
342
+ * Get linking url
343
+ *
344
+ * @param array $args query args.
345
+ * @return string
346
+ */
347
+ public function get_linking_url( $args = array() ) {
348
+
349
+ $url = get_home_url();
350
+
351
+ $url = add_query_arg( $args, $url );
352
+
353
+ return $url;
354
+ }
355
+
356
+ /**
357
+ * Get assets urls
358
+ *
359
+ * @return array
360
+ * @since 1.1.6
361
+ */
362
+ public function get_assets_path() {
363
+
364
+ $rtl = '';
365
+
366
+ if ( is_rtl() ) {
367
+ $rtl = '-rtl';
368
+ }
369
+
370
+ $file_prefix = '';
371
+ $dir_name = '';
372
+
373
+ $is_min = apply_filters( 'cartflows_load_min_assets', false );
374
+
375
+ if ( $is_min ) {
376
+ $file_prefix = '.min';
377
+ $dir_name = 'min-';
378
+ }
379
+
380
+ $js_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'js/';
381
+ $css_gen_path = CARTFLOWS_URL . 'assets/' . $dir_name . 'css/';
382
+
383
+ return array(
384
+ 'css' => $css_gen_path,
385
+ 'js' => $js_gen_path,
386
+ 'file_prefix' => $file_prefix,
387
+ 'rtl' => $rtl,
388
+ );
389
+ }
390
+
391
+ /**
392
+ * Get assets css url
393
+ *
394
+ * @param string $file file name.
395
+ * @return string
396
+ * @since 1.1.6
397
+ */
398
+ public function get_css_url( $file ) {
399
+
400
+ $assets_vars = wcf()->assets_vars;
401
+
402
+ $url = $assets_vars['css'] . $file . $assets_vars['rtl'] . $assets_vars['file_prefix'] . '.css';
403
+
404
+ return $url;
405
+ }
406
+
407
+ /**
408
+ * Get assets js url
409
+ *
410
+ * @param string $file file name.
411
+ * @return string
412
+ * @since 1.1.6
413
+ */
414
+ public function get_js_url( $file ) {
415
+
416
+ $assets_vars = wcf()->assets_vars;
417
+
418
+ $url = $assets_vars['js'] . $file . $assets_vars['file_prefix'] . '.js';
419
+
420
+ return $url;
421
+ }
422
+
423
+ /**
424
+ * Get unique id.
425
+ *
426
+ * @param int $length Length.
427
+ *
428
+ * @return string
429
+ */
430
+ public function get_unique_id( $length = 8 ) {
431
+
432
+ return substr( md5( microtime() ), 0, $length );
433
+ }
434
+
435
+ /**
436
+ * Get selected checkout products and data
437
+ *
438
+ * @param int $checkout_id Checkout id..
439
+ * @param array $saved_products Saved product.
440
+ *
441
+ * @return array
442
+ */
443
+ public function get_selected_checkout_products( $checkout_id = '', $saved_products = array() ) {
444
+
445
+ if ( empty( $checkout_id ) ) {
446
+
447
+ global $post;
448
+
449
+ $checkout_id = $post->ID;
450
+ }
451
+
452
+ if ( ! isset( $this->checkout_products[ $checkout_id ] ) ) {
453
+
454
+ if ( ! empty( $saved_products ) ) {
455
+
456
+ $products = $saved_products;
457
+ } else {
458
+
459
+ $products = wcf()->options->get_checkout_meta_value( $checkout_id, 'wcf-checkout-products' );
460
+ }
461
+
462
+ $verify_url_data = false;
463
+ $default_add_to_cart = false;
464
+ $default_ids = array();
465
+ $default_add_to_cart = true;
466
+
467
+ if ( isset( $_GET['wcf-default'] ) ) { //phpcs:ignore
468
+ //phpcs:ignore WordPress.Security.NonceVerification.Recommended
469
+ $default_sequence = sanitize_text_field( wp_unslash( $_GET['wcf-default'] ) );
470
+ $default_ids = array_map( 'intval', explode( ',', $default_sequence ) );
471
+ $verify_url_data = true;
472
+ }
473
+
474
+ if ( is_array( $products ) ) {
475
+
476
+ foreach ( $products as $in => $data ) {
477
+
478
+ if ( $verify_url_data ) {
479
+
480
+ $default_add_to_cart = false;
481
+ $sequence = $in + 1;
482
+
483
+ if ( in_array( $sequence, $default_ids, true ) ) {
484
+ $default_add_to_cart = true;
485
+ }
486
+ }
487
+
488
+ $default_data = array(
489
+ 'quantity' => 1,
490
+ 'discount_type' => '',
491
+ 'discount_value' => '',
492
+ 'unique_id' => $this->get_unique_id(),
493
+ 'add_to_cart' => $default_add_to_cart,
494
+ );
495
+
496
+ $products[ $in ] = wp_parse_args( $products[ $in ], $default_data );
497
+ }
498
+ }
499
+
500
+ $this->checkout_products[ $checkout_id ] = $products;
501
+ }
502
+
503
+ return $this->checkout_products[ $checkout_id ];
504
+ }
505
+
506
+ /**
507
+ * Get selected checkout products and data
508
+ *
509
+ * @param int $checkout_id Checkout id..
510
+ * @param array $products_data Saved product.
511
+ *
512
+ * @return array
513
+ */
514
+ public function set_selcted_checkout_products( $checkout_id = '', $products_data = array() ) {
515
+
516
+ if ( empty( $checkout_id ) ) {
517
+
518
+ global $post;
519
+
520
+ $checkout_id = $post->ID;
521
+ }
522
+
523
+ if ( isset( $this->checkout_products[ $checkout_id ] ) ) {
524
+
525
+ $products = $this->checkout_products[ $checkout_id ];
526
+ } else {
527
+ $products = $this->get_selected_checkout_products( $checkout_id );
528
+ }
529
+
530
+ if ( is_array( $products ) && ! empty( $products_data ) ) {
531
+
532
+ foreach ( $products as $in => $data ) {
533
+
534
+ if ( isset( $products_data[ $in ] ) ) {
535
+ $products[ $in ] = wp_parse_args( $products_data[ $in ], $products[ $in ] );
536
+ }
537
+ }
538
+ }
539
+
540
+ $this->checkout_products[ $checkout_id ] = $products;
541
+
542
+ return $this->checkout_products[ $checkout_id ];
543
+ }
544
+
545
+ /**
546
+ * Clear Installed Page Builder Cache
547
+ */
548
+ public function clear_cache() {
549
+
550
+ // Clear 'Elementor' file cache.
551
+ if ( class_exists( '\Elementor\Plugin' ) ) {
552
+ Elementor\Plugin::$instance->files_manager->clear_cache();
553
+ }
554
+ }
555
+ }
556
+
557
+ /**
558
+ * Get a specific property of an array without needing to check if that property exists.
559
+ *
560
+ * Provide a default value if you want to return a specific value if the property is not set.
561
+ *
562
+ * @param array $array Array from which the property's value should be retrieved.
563
+ * @param string $prop Name of the property to be retrieved.
564
+ * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
565
+ *
566
+ * @return null|string|mixed The value
567
+ */
568
+ function wcf_get_prop( $array, $prop, $default = null ) {
569
+
570
+ if ( ! is_array( $array ) && ! ( is_object( $array ) && $array instanceof ArrayAccess ) ) {
571
+ return $default;
572
+ }
573
+
574
+ if ( isset( $array[ $prop ] ) ) {
575
+ $value = $array[ $prop ];
576
+ } else {
577
+ $value = '';
578
+ }
579
+
580
+ return empty( $value ) && null !== $default ? $default : $value;
581
+ }
 
 
 
 
 
 
 
 
 
 
classes/class-cartflows-wizard.php CHANGED
@@ -312,7 +312,7 @@ if ( ! class_exists( 'CartFlows_Wizard' ) ) :
312
  <div class="cartflows-setup-actions step">
313
  <div class="button-prev-wrap">
314
  </div>
315
- <div class="button-next-wrap">
316
  <input type="submit" class="uct-activate button-primary button button-large " value="<?php esc_html_e( 'Lets Go »', 'cartflows' ); ?>" name="save_step" />
317
  </div>
318
  <?php wp_nonce_field( 'cartflow-setup' ); ?>
@@ -417,7 +417,13 @@ if ( ! class_exists( 'CartFlows_Wizard' ) ) :
417
  </tr>
418
  </table>
419
  <p><?php esc_html_e( 'While CartFlows Should work with most page builders, we offer templates for the above page builders.', 'cartflows' ); ?></p>
 
 
 
 
 
420
 
 
421
  <div class="cartflows-setup-actions step">
422
  <div class="button-prev-wrap">
423
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
@@ -456,7 +462,7 @@ if ( ! class_exists( 'CartFlows_Wizard' ) ) :
456
 
457
  <span>
458
  <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
459
- <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce', 'cartflows' ); ?></a>,
460
  <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce Cart Abandonment Recovery', 'cartflows' ); ?></a>
461
 
462
  </span>
312
  <div class="cartflows-setup-actions step">
313
  <div class="button-prev-wrap">
314
  </div>
315
+ <div class="wcf-usage-tracking" >
316
  <input type="submit" class="uct-activate button-primary button button-large " value="<?php esc_html_e( 'Lets Go »', 'cartflows' ); ?>" name="save_step" />
317
  </div>
318
  <?php wp_nonce_field( 'cartflow-setup' ); ?>
417
  </tr>
418
  </table>
419
  <p><?php esc_html_e( 'While CartFlows Should work with most page builders, we offer templates for the above page builders.', 'cartflows' ); ?></p>
420
+ <div class="cartflows-setup-extra-notice">
421
+ <span>
422
+ <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
423
+ <a target="_blank" id="wcf-page-builder" href="https://wordpress.org/plugins/elementor/"> <?php esc_html_e( 'Elementor', 'cartflows' ); ?></a>
424
+ </span>
425
 
426
+ </div>
427
  <div class="cartflows-setup-actions step">
428
  <div class="button-prev-wrap">
429
  <a href="<?php echo esc_url( $this->get_prev_step_link() ); ?>" class="button-primary button button-large button-prev" ><?php esc_html_e( '« Previous', 'cartflows' ); ?></a>
462
 
463
  <span>
464
  <?php esc_html_e( 'The following plugin will be installed and activated for you:', 'cartflows' ); ?>
465
+ <a target="_blank" href="https://wordpress.org/plugins/woocommerce/"> <?php esc_html_e( 'WooCommerce', 'cartflows' ); ?></a>,
466
  <a target="_blank" href="https://wordpress.org/plugins/woo-cart-abandonment-recovery/"> <?php esc_html_e( 'WooCommerce Cart Abandonment Recovery', 'cartflows' ); ?></a>
467
 
468
  </span>
includes/admin/cartflows-admin-header.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * CartFlows Admin Header.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <div class="wcf-menu-page-header">
10
+ <div class="wcf-container wcf-flex">
11
+ <div class="wcf-title">
12
+ <span class="screen-reader-text"><?php echo esc_attr( CARTFLOWS_PLUGIN_NAME ); ?></span>
13
+ <img class="wcf-logo" src="<?php echo esc_attr( CARTFLOWS_URL ) . 'assets/images/cartflows-logo.svg'; ?>" />
14
+ </div>
15
+ <div class="wcf-top-links">
16
+ <?php
17
+ esc_attr_e( 'Generate More Leads & More Sales', 'cartflows' );
18
+ ?>
19
+ </div>
20
+ </div>
21
+ </div>
includes/admin/cartflows-admin.php CHANGED
@@ -16,7 +16,7 @@
16
  </div>
17
  <div class="wcf-top-links">
18
  <?php
19
- esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
20
  ?>
21
  </div>
22
  </div>
16
  </div>
17
  <div class="wcf-top-links">
18
  <?php
19
+ esc_attr_e( 'Generate More Leads & More Sales', 'cartflows' );
20
  ?>
21
  </div>
22
  </div>
includes/admin/cartflows-general-bck.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * General Setting Form
4
- *
5
- * @package CARTFLOWS
6
- */
7
-
8
- $extensions = array(
9
- 'common' => array(
10
- 'title' => __( 'Selec', 'cartflows' ),
11
- 'setting_url' => admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings' ),
12
- ),
13
- );
14
-
15
- ?>
16
-
17
- <div class="wcf-container wcf-<?php echo $action; ?>">
18
- <div id="poststuff">
19
- <div id="post-body" class="columns-2">
20
- <div id="post-body-content">
21
- <!-- All WordPress Notices below header -->
22
- <h1 class="screen-reader-text"> <?php esc_html_e( 'General', 'cartflows' ); ?> </h1>
23
- <div class="widgets postbox">
24
- <h2 class="hndle wcf-flex wcf-widgets-heading"><span><?php esc_html_e( 'Welcome', 'cartflows' ); ?></span>
25
- </h2>
26
- <div class="inside">
27
- <ul class="wcf-setting-tab-wrapper" >
28
- <?php
29
-
30
- foreach ( $extensions as $key => $data ) {
31
- echo '<li id="' . esc_attr( $key ) . '" class="wcf-setting-tab ' . esc_attr( $key ) . '">';
32
- echo '<a class="wcf-tab-title" href="#" target="_blank" rel="noopener">' . esc_attr( $data['title'] ) . '</a>';
33
- echo '<div class="wcf-tab-link-wrapper">';
34
- echo '<a class="wcf-tab-link" href="' . esc_url( $data['setting_url'] ) . '">' . esc_html__( 'Settings', 'cartflows' ) . '</a>';
35
- echo '</div>';
36
- echo '</li>';
37
- }
38
- ?>
39
- </ul>
40
- </div>
41
- </div>
42
- </div>
43
- </div>
44
- <!-- /post-body -->
45
- <br class="clear">
46
- </div>
47
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/cartflows-general.php CHANGED
@@ -1,525 +1,507 @@
1
- <?php
2
- /**
3
- * General settings
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $settings = Cartflows_Helper::get_common_settings();
9
-
10
- $debug_data = Cartflows_Helper::get_debug_settings();
11
-
12
- $permalink_settings = Cartflows_Helper::get_permalink_settings();
13
-
14
- $google_analytics_settings = Cartflows_Helper::get_google_analytics_settings();
15
-
16
- $facebook_settings = Cartflows_Helper::get_facebook_settings();
17
-
18
- $debug_on = ( isset( $_GET['debug'] ) ) ? sanitize_text_field( wp_unslash( $_GET['debug'] ) ) : 'false'; //phpcs:ignore
19
-
20
- $error_log = filter_input( INPUT_GET, 'cartflows-error-log', FILTER_VALIDATE_BOOLEAN );
21
- ?>
22
-
23
-
24
- <?php if ( $error_log ) : ?>
25
- <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
26
- <?php Cartflows_Logger::status_logs_file(); ?>
27
- </div>
28
- <?php else : ?>
29
- <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
30
- <input type="hidden" name="action" value="wcf_save_common_settings">
31
- <h1 class="screen-reader-text"><?php esc_html_e( 'General Settings', 'cartflows' ); ?></h1>
32
-
33
- <div id="poststuff">
34
- <div id="post-body" class="columns-2">
35
- <div id="post-body-content">
36
-
37
- <!-- Getting Started -->
38
- <div class="postbox introduction">
39
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
40
- <span><?php esc_html_e( 'Getting Started', 'cartflows' ); ?></span>
41
- </h2>
42
- <div class="inside">
43
- <div class="iframe-wrap">
44
- <iframe width="560" height="315" src="https://www.youtube.com/embed/SlE0moPKjMY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
45
- </div>
46
- <p>
47
- <?php
48
- esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
49
- ?>
50
- </p>
51
- </div>
52
- </div>
53
- <!-- Getting Started -->
54
-
55
- <!-- General Settings -->
56
- <div class="general-settings-form postbox">
57
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
58
- <span><?php esc_html_e( 'General Settings', 'cartflows' ); ?></span>
59
- </h2>
60
- <div class="inside">
61
- <form method="post" class="wrap wcf-clear" action="" >
62
- <div class="form-wrap">
63
- <?php
64
-
65
- do_action( 'cartflows_before_settings_fields', $settings );
66
-
67
- echo Cartflows_Admin_Fields::checkobox_field(
68
- array(
69
- 'id' => 'wcf_disallow_indexing',
70
- 'name' => '_cartflows_common[disallow_indexing]',
71
- 'title' => __( 'Disallow search engines from indexing flows', 'cartflows' ),
72
- 'value' => $settings['disallow_indexing'],
73
- )
74
- );
75
-
76
- if ( wcf()->is_woo_active ) {
77
- echo Cartflows_Admin_Fields::flow_checkout_selection_field(
78
- array(
79
- 'id' => 'wcf_global_checkout',
80
- 'name' => '_cartflows_common[global_checkout]',
81
- 'title' => __( 'Global Checkout', 'cartflows' ),
82
- 'value' => $settings['global_checkout'],
83
- )
84
- );
85
- }
86
- echo Cartflows_Admin_Fields::select_field(
87
- array(
88
- 'id' => 'wcf_default_page_builder',
89
- 'name' => '_cartflows_common[default_page_builder]',
90
- 'title' => __( 'Show Templates designed with', 'cartflows' ),
91
- 'description' => __( 'CartFlows offers flow templates that can be imported in one click. These templates are available in few different page builders. Please choose your preferred page builder from the list so you will only see templates that are made using that page builder..', 'cartflows' ),
92
- 'value' => $settings['default_page_builder'],
93
- 'options' => array(
94
- 'elementor' => __( 'Elementor', 'cartflows' ),
95
- 'beaver-builder' => __( 'Beaver Builder', 'cartflows' ),
96
- 'divi' => __( 'Divi', 'cartflows' ),
97
- 'gutenberg' => __( 'Gutenberg', 'cartflows' ),
98
- 'other' => __( 'Other', 'cartflows' ),
99
- ),
100
- )
101
- );
102
-
103
- do_action( 'cartflows_after_settings_fields', $settings );
104
-
105
- ?>
106
- </div>
107
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
108
- <?php wp_nonce_field( 'cartflows-common-settings', 'cartflows-common-settings-nonce' ); ?>
109
- </form>
110
- </div>
111
- </div>
112
- <!-- General Settings -->
113
-
114
- <?php do_action( 'cartflows_after_general_settings' ); ?>
115
-
116
- <!-- Permalink Settings -->
117
- <div class="general-settingss-form postbox">
118
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
119
- <span><?php esc_html_e( 'Permalink Settings', 'cartflows' ); ?></span>
120
- </h2>
121
- <div class="inside">
122
- <form method="post" class="wrap wcf-clear" action="" >
123
- <div class="form-wrap wcf_permalink_settings">
124
- <?php
125
-
126
- echo Cartflows_Admin_Fields::radio_field(
127
- array(
128
- 'id' => 'permalink_structure',
129
- 'name' => '_cartflows_permalink[permalink_structure]',
130
- 'value' => $permalink_settings['permalink_structure'],
131
- 'options' => array(
132
- '' =>
133
- array(
134
- 'label' => __( 'Default', 'cartflows' ),
135
- 'description' => 'Default WordPress Permalink',
136
- ),
137
-
138
- '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
139
- array(
140
- 'label' => __( 'Flow and Step Slug', 'cartflows' ),
141
- 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
142
- ),
143
-
144
- '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%' =>
145
- array(
146
- 'label' => __( 'Flow Slug', 'cartflows' ),
147
- 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/%stepname%/',
148
- ),
149
-
150
- '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
151
- array(
152
- 'label' => __( 'Step Slug', 'cartflows' ),
153
- 'description' => get_site_url() . '/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
154
- ),
155
- ),
156
- )
157
- );
158
- ?>
159
- <hr/>
160
- <?php
161
-
162
- echo Cartflows_Admin_Fields::title_field(
163
- array(
164
- 'title' => __( 'Post Type Permalink Base', 'cartflows' ),
165
- )
166
- );
167
-
168
- echo Cartflows_Admin_Fields::text_field(
169
- array(
170
- 'id' => 'wcf_permalink_step_base',
171
- 'name' => '_cartflows_permalink[permalink]',
172
- 'title' => __( 'Step Base', 'cartflows' ),
173
- 'value' => $permalink_settings['permalink'],
174
- 'placeholder' => CARTFLOWS_STEP_POST_TYPE,
175
- )
176
- );
177
-
178
- echo Cartflows_Admin_Fields::text_field(
179
- array(
180
- 'id' => 'wcf_permalink_flow_base',
181
- 'name' => '_cartflows_permalink[permalink_flow_base]',
182
- 'title' => __( 'Flow Base', 'cartflows' ),
183
- 'value' => $permalink_settings['permalink_flow_base'],
184
- 'placeholder' => CARTFLOWS_FLOW_POST_TYPE,
185
- )
186
- );
187
-
188
- ?>
189
-
190
-
191
- </div>
192
- <p>
193
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
194
- <?php submit_button( __( 'Set Default', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'reset', false ); ?>
195
- <?php wp_nonce_field( 'cartflows-permalink-settings', 'cartflows-permalink-settings-nonce' ); ?>
196
- </p>
197
-
198
-
199
- </form>
200
- </div>
201
- </div>
202
- <!-- Permalink Settings -->
203
-
204
- <!-- Facebook Pixel Tracking -->
205
- <div class="general-settingss-form postbox">
206
- <h2 class="wcf-facebook-hndle wcf-normal-cusror ui-sortable-handle hndle">
207
-
208
- <span><?php esc_html_e( 'Facebook Pixel Settings', 'cartflows' ); ?></span>
209
- </h2>
210
-
211
- <form method="post" class="wrap wcf-clear" action="">
212
- <div class="form-wrap">
213
- <input type="hidden" name="action" value="wcf_save_facebook_pixel_settings">
214
- <div id="post-body">
215
-
216
- <div class="inside">
217
- <div class="form-wrap">
218
- <?php
219
- echo Cartflows_Admin_Fields::checkobox_field(
220
- array(
221
- 'id' => 'wcf_facebook_pixel_tracking',
222
- 'name' => '_cartflows_facebook[facebook_pixel_tracking]',
223
- 'title' => __( 'Enable Facebook Pixel Tracking', 'cartflows' ),
224
- 'value' => $facebook_settings['facebook_pixel_tracking'],
225
- )
226
- );
227
-
228
- echo "<div class='wcf-fb-pixel-wrapper'>";
229
- ?>
230
- <hr/>
231
- <?php
232
- echo Cartflows_Admin_Fields::checkobox_field(
233
- array(
234
- 'id' => 'wcf_facebook_pixel_tracking_for_site',
235
- 'name' => '_cartflows_facebook[facebook_pixel_tracking_for_site]',
236
- 'title' => __( 'Enable for the whole site', 'cartflows' ),
237
- 'value' => $facebook_settings['facebook_pixel_tracking_for_site'],
238
- )
239
- );
240
-
241
- echo Cartflows_Admin_Fields::title_field(
242
- array(
243
- 'title' => '',
244
- 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
245
- )
246
- );
247
- ?>
248
- <hr/>
249
- <?php
250
- echo Cartflows_Admin_Fields::text_field(
251
- array(
252
- 'id' => 'wcf_facebook_pixel_id',
253
- 'name' => '_cartflows_facebook[facebook_pixel_id]',
254
- 'title' => __( 'Enter Facebook pixel ID', 'cartflows' ),
255
- 'value' => $facebook_settings['facebook_pixel_id'],
256
- )
257
- );
258
-
259
-
260
- echo Cartflows_Admin_Fields::title_field(
261
- array(
262
- 'title' => __( 'Enable Events:', 'cartflows' ),
263
- )
264
- );
265
-
266
-
267
- echo Cartflows_Admin_Fields::checkobox_field(
268
- array(
269
- 'id' => 'wcf_facebook_pixel_initiate_checkout',
270
- 'name' => '_cartflows_facebook[facebook_pixel_initiate_checkout]',
271
- 'title' => __( 'Initiate Checkout', 'cartflows' ),
272
- 'value' => $facebook_settings['facebook_pixel_initiate_checkout'],
273
- )
274
- );
275
-
276
- echo Cartflows_Admin_Fields::checkobox_field(
277
- array(
278
- 'id' => 'wcf_facebook_pixel_add_payment_info',
279
- 'name' => '_cartflows_facebook[facebook_pixel_add_payment_info]',
280
- 'title' => __( 'Add Payment Info', 'cartflows' ),
281
- 'value' => $facebook_settings['facebook_pixel_add_payment_info'],
282
- )
283
- );
284
-
285
- echo Cartflows_Admin_Fields::checkobox_field(
286
- array(
287
- 'id' => 'wcf_facebook_pixel_purchase_complete',
288
- 'name' => '_cartflows_facebook[facebook_pixel_purchase_complete]',
289
- 'title' => __( 'Purchase Complete', 'cartflows' ),
290
- 'value' => $facebook_settings['facebook_pixel_purchase_complete'],
291
- )
292
- );
293
-
294
- echo '</div>';
295
-
296
- ?>
297
- </div>
298
-
299
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-facebook-setting-save-btn button-primary button', 'submit', false ); ?>
300
- <?php wp_nonce_field( 'cartflows-facebook-settings', 'cartflows-facebook-settings-nonce' ); ?>
301
- </div>
302
- </div>
303
- </div>
304
- </form>
305
- </div>
306
- <!-- Facebook Pixel Tracking -->
307
-
308
- <!-- Google Analytics Tracking -->
309
- <div class="general-settingss-form postbox">
310
- <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
311
- <span><?php esc_html_e( 'Google Analytics Settings', 'cartflows' ); ?></span>
312
- </h2>
313
- <div class="inside">
314
- <form method="post" class="wrap wcf-clear" action="" >
315
- <div class="form-wrap">
316
- <?php
317
-
318
- echo Cartflows_Admin_Fields::checkobox_field(
319
- array(
320
- 'id' => 'enable_google-analytics-id',
321
- 'name' => '_cartflows_google_analytics[enable_google_analytics]',
322
- 'title' => __( 'Enable Google Analytics Tracking', 'cartflows' ),
323
- 'value' => $google_analytics_settings['enable_google_analytics'],
324
- )
325
- );
326
-
327
- echo "<div class='wcf-google-analytics-wrapper'>";
328
- ?>
329
- <hr/>
330
- <?php
331
- echo Cartflows_Admin_Fields::checkobox_field(
332
- array(
333
- 'id' => 'enable_google_analytics_for_site',
334
- 'name' => '_cartflows_google_analytics[enable_google_analytics_for_site]',
335
- 'title' => __( 'Enable for the whole website', 'cartflows' ),
336
- 'value' => $google_analytics_settings['enable_google_analytics_for_site'],
337
- )
338
- );
339
-
340
- echo Cartflows_Admin_Fields::title_field(
341
- array(
342
- 'title' => '',
343
- 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
344
- )
345
- );
346
- ?>
347
- <hr/>
348
- <?php
349
- echo Cartflows_Admin_Fields::text_field(
350
- array(
351
- 'id' => 'google-analytics-id',
352
- 'name' => '_cartflows_google_analytics[google_analytics_id]',
353
- 'title' => __( 'Google Analytics ID', 'cartflows' ),
354
- 'value' => $google_analytics_settings['google_analytics_id'],
355
- 'description' => __( 'Log into your <a href="https://analytics.google.com/" target="_blank">google analytics account</a> to find your ID. eg: UA-XXXXXX-X&period;', 'cartflows' ),
356
- )
357
- );
358
-
359
- echo Cartflows_Admin_Fields::title_field(
360
- array(
361
- 'title' => __( 'Enable Events:', 'cartflows' ),
362
- )
363
- );
364
-
365
- echo Cartflows_Admin_Fields::checkobox_field(
366
- array(
367
- 'id' => 'enable_begin_checkout',
368
- 'name' => '_cartflows_google_analytics[enable_begin_checkout]',
369
- 'title' => __( 'Begin Checkout', 'cartflows' ),
370
- 'value' => $google_analytics_settings['enable_begin_checkout'],
371
- )
372
- );
373
-
374
- echo Cartflows_Admin_Fields::checkobox_field(
375
- array(
376
- 'id' => 'enable_add_to_cart',
377
- 'name' => '_cartflows_google_analytics[enable_add_to_cart]',
378
- 'title' => __( 'Add To Cart', 'cartflows' ),
379
- 'value' => $google_analytics_settings['enable_add_to_cart'],
380
- )
381
- );
382
-
383
- echo Cartflows_Admin_Fields::checkobox_field(
384
- array(
385
- 'id' => 'enable_add_payment_info',
386
- 'name' => '_cartflows_google_analytics[enable_add_payment_info]',
387
- 'title' => __( 'Add Payment Info', 'cartflows' ),
388
- 'value' => $google_analytics_settings['enable_add_payment_info'],
389
- )
390
- );
391
-
392
- echo Cartflows_Admin_Fields::checkobox_field(
393
- array(
394
- 'id' => 'enable_purchase_event',
395
- 'name' => '_cartflows_google_analytics[enable_purchase_event]',
396
- 'title' => __( 'Purchase', 'cartflows' ),
397
- 'value' => $google_analytics_settings['enable_purchase_event'],
398
- )
399
- );
400
-
401
- echo Cartflows_Admin_Fields::title_field(
402
- array(
403
- 'title' => '',
404
- 'description' => __( 'Google Analytics not working correctly? <a href="https://cartflows.com/docs/troubleshooting-google-analytics-tracking-issues/" > Click here </a> to know more. ', 'cartflows' ),
405
- )
406
- );
407
-
408
- do_action( 'cartflows_google_analytics_admin_fields', $google_analytics_settings );
409
-
410
- echo '</div>';
411
- ?>
412
-
413
-
414
- </div>
415
- <p>
416
- <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
417
- <?php wp_nonce_field( 'cartflows-google-analytics-settings', 'cartflows-google-analytics-settings-nonce' ); ?>
418
- </p>
419
-
420
-
421
- </form>
422
- </div>
423
- </div>
424
- <!-- Google Analytics Tracking -->
425
-
426
- <?php do_action( 'cartflows_register_general_settings' ); ?>
427
-
428
- </div>
429
-
430
- <!-- Right Sidebar -->
431
- <div class="postbox-container" id="postbox-container-1">
432
- <div id="side-sortables">
433
-
434
- <div class="postbox">
435
- <h2 class="hndle">
436
- <span class="dashicons dashicons-book"></span>
437
- <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
438
- </h2>
439
- <div class="inside">
440
- <p>
441
- <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
442
- </p>
443
- <p>
444
- <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
445
- </p>
446
- </div>
447
- </div>
448
-
449
- <div class="postbox">
450
- <h2 class="hndle">
451
- <span class="dashicons dashicons-groups"></span>
452
- <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
453
- </h2>
454
- <div class="inside">
455
- <p>
456
- <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
457
- </p>
458
- <p>
459
- <a href="<?php echo esc_url( 'https://www.facebook.com/groups/cartflows/' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Join Our Facebook Group »', 'cartflows' ); ?></a>
460
- </p>
461
- </div>
462
- </div>
463
-
464
- <div class="postbox">
465
- <h2 class="hndle">
466
- <span class="dashicons dashicons-sos"></span>
467
- <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
468
- </h2>
469
- <div class="inside">
470
- <p>
471
- <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
472
- </p>
473
- <p>
474
- <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
475
- </p>
476
- </div>
477
- </div>
478
- <?php
479
- if ( 'true' == $debug_on ) {
480
- ?>
481
- <div class="postbox">
482
- <h2 class="hndle">
483
- <span class="dashicons dashicons-editor-code"></span>
484
- <span><?php esc_html_e( 'Load Minified CSS', 'cartflows' ); ?></span>
485
- </h2>
486
- <div class="inside">
487
- <form method="post" class="wrap wcf-clear" action="">
488
- <p>
489
- <?php esc_html_e( 'Load the Minified CSS from here. Just Enable it by checking the below given checkbox.', 'cartflows' ); ?>
490
- </p>
491
- <?php
492
- echo Cartflows_Admin_Fields::checkobox_field(
493
- array(
494
- 'id' => 'allow_minified_files',
495
- 'name' => '_cartflows_debug_data[allow_minified_files]',
496
- 'title' => __( 'Load minified CSS & JS Files', 'cartflows' ),
497
- 'value' => $debug_data['allow_minified_files'],
498
- )
499
- );
500
- ?>
501
- <?php submit_button( __( 'Save', 'cartflows' ), 'button-primary button', 'submit', false ); ?>
502
- <?php wp_nonce_field( 'cartflows-debug-settings', 'cartflows-debug-settings-nonce' ); ?>
503
- </form>
504
- </div>
505
- </div>
506
- <?php
507
- }
508
- ?>
509
- </div>
510
- </div>
511
- <!-- Right Sidebar -->
512
-
513
- </div>
514
- <!-- /post-body -->
515
- <br class="clear">
516
- </div>
517
- </div>
518
- <?php endif; ?>
519
-
520
- <?php
521
- /**
522
- * Loads Zapier settings admin view.
523
- */
524
- do_action( 'cartflows_after_settings' );
525
- ?>
1
+ <?php
2
+ /**
3
+ * General settings
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $settings = Cartflows_Helper::get_common_settings();
9
+
10
+ $debug_data = Cartflows_Helper::get_debug_settings();
11
+
12
+ $permalink_settings = Cartflows_Helper::get_permalink_settings();
13
+
14
+ $google_analytics_settings = Cartflows_Helper::get_google_analytics_settings();
15
+
16
+ $facebook_settings = Cartflows_Helper::get_facebook_settings();
17
+
18
+ $debug_on = ( isset( $_GET['debug'] ) ) ? sanitize_text_field( wp_unslash( $_GET['debug'] ) ) : 'false'; //phpcs:ignore
19
+
20
+ $error_log = filter_input( INPUT_GET, 'cartflows-error-log', FILTER_VALIDATE_BOOLEAN );
21
+ ?>
22
+
23
+
24
+ <?php if ( $error_log ) : ?>
25
+ <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
26
+ <?php Cartflows_Logger::status_logs_file(); ?>
27
+ </div>
28
+ <?php else : ?>
29
+ <div class="wrap wcf-addon-wrap wcf-clear wcf-container">
30
+ <input type="hidden" name="action" value="wcf_save_common_settings">
31
+ <h1 class="screen-reader-text"><?php esc_html_e( 'General Settings', 'cartflows' ); ?></h1>
32
+
33
+ <div id="poststuff">
34
+ <div id="post-body" class="columns-2">
35
+ <div id="post-body-content">
36
+
37
+ <!-- General Settings -->
38
+ <div class="general-settings-form postbox">
39
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
40
+ <span><?php esc_html_e( 'General Settings', 'cartflows' ); ?></span>
41
+ </h2>
42
+ <div class="inside">
43
+ <form method="post" class="wrap wcf-clear" action="" >
44
+ <div class="form-wrap">
45
+ <?php
46
+
47
+ do_action( 'cartflows_before_settings_fields', $settings );
48
+
49
+ echo Cartflows_Admin_Fields::checkobox_field(
50
+ array(
51
+ 'id' => 'wcf_disallow_indexing',
52
+ 'name' => '_cartflows_common[disallow_indexing]',
53
+ 'title' => __( 'Disallow search engines from indexing flows', 'cartflows' ),
54
+ 'value' => $settings['disallow_indexing'],
55
+ )
56
+ );
57
+
58
+ if ( wcf()->is_woo_active ) {
59
+ echo Cartflows_Admin_Fields::flow_checkout_selection_field(
60
+ array(
61
+ 'id' => 'wcf_global_checkout',
62
+ 'name' => '_cartflows_common[global_checkout]',
63
+ 'title' => __( 'Global Checkout', 'cartflows' ),
64
+ 'value' => $settings['global_checkout'],
65
+ )
66
+ );
67
+ }
68
+ echo Cartflows_Admin_Fields::select_field(
69
+ array(
70
+ 'id' => 'wcf_default_page_builder',
71
+ 'name' => '_cartflows_common[default_page_builder]',
72
+ 'title' => __( 'Show Templates designed with', 'cartflows' ),
73
+ 'description' => __( 'CartFlows offers flow templates that can be imported in one click. These templates are available in few different page builders. Please choose your preferred page builder from the list so you will only see templates that are made using that page builder..', 'cartflows' ),
74
+ 'value' => $settings['default_page_builder'],
75
+ 'options' => array(
76
+ 'elementor' => __( 'Elementor', 'cartflows' ),
77
+ 'beaver-builder' => __( 'Beaver Builder', 'cartflows' ),
78
+ 'divi' => __( 'Divi', 'cartflows' ),
79
+ 'gutenberg' => __( 'Gutenberg', 'cartflows' ),
80
+ 'other' => __( 'Other', 'cartflows' ),
81
+ ),
82
+ )
83
+ );
84
+
85
+ do_action( 'cartflows_after_settings_fields', $settings );
86
+
87
+ ?>
88
+ </div>
89
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
90
+ <?php wp_nonce_field( 'cartflows-common-settings', 'cartflows-common-settings-nonce' ); ?>
91
+ </form>
92
+ </div>
93
+ </div>
94
+ <!-- General Settings -->
95
+
96
+ <?php do_action( 'cartflows_after_general_settings' ); ?>
97
+
98
+ <!-- Permalink Settings -->
99
+ <div class="general-settingss-form postbox">
100
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
101
+ <span><?php esc_html_e( 'Permalink Settings', 'cartflows' ); ?></span>
102
+ </h2>
103
+ <div class="inside">
104
+ <form method="post" class="wrap wcf-clear" action="" >
105
+ <div class="form-wrap wcf_permalink_settings">
106
+ <?php
107
+
108
+ echo Cartflows_Admin_Fields::radio_field(
109
+ array(
110
+ 'id' => 'permalink_structure',
111
+ 'name' => '_cartflows_permalink[permalink_structure]',
112
+ 'value' => $permalink_settings['permalink_structure'],
113
+ 'options' => array(
114
+ '' =>
115
+ array(
116
+ 'label' => __( 'Default', 'cartflows' ),
117
+ 'description' => 'Default WordPress Permalink',
118
+ ),
119
+
120
+ '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
121
+ array(
122
+ 'label' => __( 'Flow and Step Slug', 'cartflows' ),
123
+ 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
124
+ ),
125
+
126
+ '/' . CARTFLOWS_FLOW_POST_TYPE . '/%flowname%' =>
127
+ array(
128
+ 'label' => __( 'Flow Slug', 'cartflows' ),
129
+ 'description' => get_site_url() . '/<code>' . CARTFLOWS_FLOW_POST_TYPE . '</code>/%flowname%/%stepname%/',
130
+ ),
131
+
132
+ '/%flowname%/' . CARTFLOWS_STEP_POST_TYPE =>
133
+ array(
134
+ 'label' => __( 'Step Slug', 'cartflows' ),
135
+ 'description' => get_site_url() . '/%flowname%/<code>' . CARTFLOWS_STEP_POST_TYPE . '</code>/%stepname%/',
136
+ ),
137
+ ),
138
+ )
139
+ );
140
+ ?>
141
+ <hr/>
142
+ <?php
143
+
144
+ echo Cartflows_Admin_Fields::title_field(
145
+ array(
146
+ 'title' => __( 'Post Type Permalink Base', 'cartflows' ),
147
+ )
148
+ );
149
+
150
+ echo Cartflows_Admin_Fields::text_field(
151
+ array(
152
+ 'id' => 'wcf_permalink_step_base',
153
+ 'name' => '_cartflows_permalink[permalink]',
154
+ 'title' => __( 'Step Base', 'cartflows' ),
155
+ 'value' => $permalink_settings['permalink'],
156
+ 'placeholder' => CARTFLOWS_STEP_POST_TYPE,
157
+ )
158
+ );
159
+
160
+ echo Cartflows_Admin_Fields::text_field(
161
+ array(
162
+ 'id' => 'wcf_permalink_flow_base',
163
+ 'name' => '_cartflows_permalink[permalink_flow_base]',
164
+ 'title' => __( 'Flow Base', 'cartflows' ),
165
+ 'value' => $permalink_settings['permalink_flow_base'],
166
+ 'placeholder' => CARTFLOWS_FLOW_POST_TYPE,
167
+ )
168
+ );
169
+
170
+ ?>
171
+
172
+
173
+ </div>
174
+ <p>
175
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
176
+ <?php submit_button( __( 'Set Default', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'reset', false ); ?>
177
+ <?php wp_nonce_field( 'cartflows-permalink-settings', 'cartflows-permalink-settings-nonce' ); ?>
178
+ </p>
179
+
180
+
181
+ </form>
182
+ </div>
183
+ </div>
184
+ <!-- Permalink Settings -->
185
+
186
+ <!-- Facebook Pixel Tracking -->
187
+ <div class="general-settingss-form postbox">
188
+ <h2 class="wcf-facebook-hndle wcf-normal-cusror ui-sortable-handle hndle">
189
+
190
+ <span><?php esc_html_e( 'Facebook Pixel Settings', 'cartflows' ); ?></span>
191
+ </h2>
192
+
193
+ <form method="post" class="wrap wcf-clear" action="">
194
+ <div class="form-wrap">
195
+ <input type="hidden" name="action" value="wcf_save_facebook_pixel_settings">
196
+ <div id="post-body">
197
+
198
+ <div class="inside">
199
+ <div class="form-wrap">
200
+ <?php
201
+ echo Cartflows_Admin_Fields::checkobox_field(
202
+ array(
203
+ 'id' => 'wcf_facebook_pixel_tracking',
204
+ 'name' => '_cartflows_facebook[facebook_pixel_tracking]',
205
+ 'title' => __( 'Enable Facebook Pixel Tracking', 'cartflows' ),
206
+ 'value' => $facebook_settings['facebook_pixel_tracking'],
207
+ )
208
+ );
209
+
210
+ echo "<div class='wcf-fb-pixel-wrapper'>";
211
+ ?>
212
+ <hr/>
213
+ <?php
214
+ echo Cartflows_Admin_Fields::checkobox_field(
215
+ array(
216
+ 'id' => 'wcf_facebook_pixel_tracking_for_site',
217
+ 'name' => '_cartflows_facebook[facebook_pixel_tracking_for_site]',
218
+ 'title' => __( 'Enable for the whole site', 'cartflows' ),
219
+ 'value' => $facebook_settings['facebook_pixel_tracking_for_site'],
220
+ )
221
+ );
222
+
223
+ echo Cartflows_Admin_Fields::title_field(
224
+ array(
225
+ 'title' => '',
226
+ 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
227
+ )
228
+ );
229
+ ?>
230
+ <hr/>
231
+ <?php
232
+ echo Cartflows_Admin_Fields::text_field(
233
+ array(
234
+ 'id' => 'wcf_facebook_pixel_id',
235
+ 'name' => '_cartflows_facebook[facebook_pixel_id]',
236
+ 'title' => __( 'Enter Facebook pixel ID', 'cartflows' ),
237
+ 'value' => $facebook_settings['facebook_pixel_id'],
238
+ )
239
+ );
240
+
241
+
242
+ echo Cartflows_Admin_Fields::title_field(
243
+ array(
244
+ 'title' => __( 'Enable Events:', 'cartflows' ),
245
+ )
246
+ );
247
+
248
+
249
+ echo Cartflows_Admin_Fields::checkobox_field(
250
+ array(
251
+ 'id' => 'wcf_facebook_pixel_initiate_checkout',
252
+ 'name' => '_cartflows_facebook[facebook_pixel_initiate_checkout]',
253
+ 'title' => __( 'Initiate Checkout', 'cartflows' ),
254
+ 'value' => $facebook_settings['facebook_pixel_initiate_checkout'],
255
+ )
256
+ );
257
+
258
+ echo Cartflows_Admin_Fields::checkobox_field(
259
+ array(
260
+ 'id' => 'wcf_facebook_pixel_add_payment_info',
261
+ 'name' => '_cartflows_facebook[facebook_pixel_add_payment_info]',
262
+ 'title' => __( 'Add Payment Info', 'cartflows' ),
263
+ 'value' => $facebook_settings['facebook_pixel_add_payment_info'],
264
+ )
265
+ );
266
+
267
+ echo Cartflows_Admin_Fields::checkobox_field(
268
+ array(
269
+ 'id' => 'wcf_facebook_pixel_purchase_complete',
270
+ 'name' => '_cartflows_facebook[facebook_pixel_purchase_complete]',
271
+ 'title' => __( 'Purchase Complete', 'cartflows' ),
272
+ 'value' => $facebook_settings['facebook_pixel_purchase_complete'],
273
+ )
274
+ );
275
+
276
+ echo '</div>';
277
+
278
+ ?>
279
+ </div>
280
+
281
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-facebook-setting-save-btn button-primary button', 'submit', false ); ?>
282
+ <?php wp_nonce_field( 'cartflows-facebook-settings', 'cartflows-facebook-settings-nonce' ); ?>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ </form>
287
+ </div>
288
+ <!-- Facebook Pixel Tracking -->
289
+
290
+ <!-- Google Analytics Tracking -->
291
+ <div class="general-settingss-form postbox">
292
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
293
+ <span><?php esc_html_e( 'Google Analytics Settings', 'cartflows' ); ?></span>
294
+ </h2>
295
+ <div class="inside">
296
+ <form method="post" class="wrap wcf-clear" action="" >
297
+ <div class="form-wrap">
298
+ <?php
299
+
300
+ echo Cartflows_Admin_Fields::checkobox_field(
301
+ array(
302
+ 'id' => 'enable_google-analytics-id',
303
+ 'name' => '_cartflows_google_analytics[enable_google_analytics]',
304
+ 'title' => __( 'Enable Google Analytics Tracking', 'cartflows' ),
305
+ 'value' => $google_analytics_settings['enable_google_analytics'],
306
+ )
307
+ );
308
+
309
+ echo "<div class='wcf-google-analytics-wrapper'>";
310
+ ?>
311
+ <hr/>
312
+ <?php
313
+ echo Cartflows_Admin_Fields::checkobox_field(
314
+ array(
315
+ 'id' => 'enable_google_analytics_for_site',
316
+ 'name' => '_cartflows_google_analytics[enable_google_analytics_for_site]',
317
+ 'title' => __( 'Enable for the whole website', 'cartflows' ),
318
+ 'value' => $google_analytics_settings['enable_google_analytics_for_site'],
319
+ )
320
+ );
321
+
322
+ echo Cartflows_Admin_Fields::title_field(
323
+ array(
324
+ 'title' => '',
325
+ 'description' => __( 'If this option is unchecked, it will only apply to CartFlows steps.', 'cartflows' ),
326
+ )
327
+ );
328
+ ?>
329
+ <hr/>
330
+ <?php
331
+ echo Cartflows_Admin_Fields::text_field(
332
+ array(
333
+ 'id' => 'google-analytics-id',
334
+ 'name' => '_cartflows_google_analytics[google_analytics_id]',
335
+ 'title' => __( 'Google Analytics ID', 'cartflows' ),
336
+ 'value' => $google_analytics_settings['google_analytics_id'],
337
+ 'description' => __( 'Log into your <a href="https://analytics.google.com/" target="_blank">google analytics account</a> to find your ID. eg: UA-XXXXXX-X&period;', 'cartflows' ),
338
+ )
339
+ );
340
+
341
+ echo Cartflows_Admin_Fields::title_field(
342
+ array(
343
+ 'title' => __( 'Enable Events:', 'cartflows' ),
344
+ )
345
+ );
346
+
347
+ echo Cartflows_Admin_Fields::checkobox_field(
348
+ array(
349
+ 'id' => 'enable_begin_checkout',
350
+ 'name' => '_cartflows_google_analytics[enable_begin_checkout]',
351
+ 'title' => __( 'Begin Checkout', 'cartflows' ),
352
+ 'value' => $google_analytics_settings['enable_begin_checkout'],
353
+ )
354
+ );
355
+
356
+ echo Cartflows_Admin_Fields::checkobox_field(
357
+ array(
358
+ 'id' => 'enable_add_to_cart',
359
+ 'name' => '_cartflows_google_analytics[enable_add_to_cart]',
360
+ 'title' => __( 'Add To Cart', 'cartflows' ),
361
+ 'value' => $google_analytics_settings['enable_add_to_cart'],
362
+ )
363
+ );
364
+
365
+ echo Cartflows_Admin_Fields::checkobox_field(
366
+ array(
367
+ 'id' => 'enable_add_payment_info',
368
+ 'name' => '_cartflows_google_analytics[enable_add_payment_info]',
369
+ 'title' => __( 'Add Payment Info', 'cartflows' ),
370
+ 'value' => $google_analytics_settings['enable_add_payment_info'],
371
+ )
372
+ );
373
+
374
+ echo Cartflows_Admin_Fields::checkobox_field(
375
+ array(
376
+ 'id' => 'enable_purchase_event',
377
+ 'name' => '_cartflows_google_analytics[enable_purchase_event]',
378
+ 'title' => __( 'Purchase', 'cartflows' ),
379
+ 'value' => $google_analytics_settings['enable_purchase_event'],
380
+ )
381
+ );
382
+
383
+ echo Cartflows_Admin_Fields::title_field(
384
+ array(
385
+ 'title' => '',
386
+ 'description' => __( 'Google Analytics not working correctly? <a href="https://cartflows.com/docs/troubleshooting-google-analytics-tracking-issues/" > Click here </a> to know more. ', 'cartflows' ),
387
+ )
388
+ );
389
+
390
+ do_action( 'cartflows_google_analytics_admin_fields', $google_analytics_settings );
391
+
392
+ echo '</div>';
393
+ ?>
394
+
395
+
396
+ </div>
397
+ <p>
398
+ <?php submit_button( __( 'Save Changes', 'cartflows' ), 'cartflows-common-setting-save-btn button-primary button', 'submit', false ); ?>
399
+ <?php wp_nonce_field( 'cartflows-google-analytics-settings', 'cartflows-google-analytics-settings-nonce' ); ?>
400
+ </p>
401
+
402
+
403
+ </form>
404
+ </div>
405
+ </div>
406
+ <!-- Google Analytics Tracking -->
407
+
408
+ <?php do_action( 'cartflows_register_general_settings' ); ?>
409
+
410
+ </div>
411
+
412
+ <!-- Right Sidebar -->
413
+ <div class="postbox-container" id="postbox-container-1">
414
+ <div id="side-sortables">
415
+
416
+ <div class="postbox">
417
+ <h2 class="hndle">
418
+ <span class="dashicons dashicons-book"></span>
419
+ <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
420
+ </h2>
421
+ <div class="inside">
422
+ <p>
423
+ <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
424
+ </p>
425
+ <p>
426
+ <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
427
+ </p>
428
+ </div>
429
+ </div>
430
+
431
+ <div class="postbox">
432
+ <h2 class="hndle">
433
+ <span class="dashicons dashicons-groups"></span>
434
+ <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
435
+ </h2>
436
+ <div class="inside">
437
+ <p>
438
+ <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
439
+ </p>
440
+ <p>
441
+ <a href="<?php echo esc_url( 'https://www.facebook.com/groups/cartflows/' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Join Our Facebook Group »', 'cartflows' ); ?></a>
442
+ </p>
443
+ </div>
444
+ </div>
445
+
446
+ <div class="postbox">
447
+ <h2 class="hndle">
448
+ <span class="dashicons dashicons-sos"></span>
449
+ <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
450
+ </h2>
451
+ <div class="inside">
452
+ <p>
453
+ <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
454
+ </p>
455
+ <p>
456
+ <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
457
+ </p>
458
+ </div>
459
+ </div>
460
+ <?php
461
+ if ( 'true' == $debug_on ) {
462
+ ?>
463
+ <div class="postbox">
464
+ <h2 class="hndle">
465
+ <span class="dashicons dashicons-editor-code"></span>
466
+ <span><?php esc_html_e( 'Load Minified CSS', 'cartflows' ); ?></span>
467
+ </h2>
468
+ <div class="inside">
469
+ <form method="post" class="wrap wcf-clear" action="">
470
+ <p>
471
+ <?php esc_html_e( 'Load the Minified CSS from here. Just Enable it by checking the below given checkbox.', 'cartflows' ); ?>
472
+ </p>
473
+ <?php
474
+ echo Cartflows_Admin_Fields::checkobox_field(
475
+ array(
476
+ 'id' => 'allow_minified_files',
477
+ 'name' => '_cartflows_debug_data[allow_minified_files]',
478
+ 'title' => __( 'Load minified CSS & JS Files', 'cartflows' ),
479
+ 'value' => $debug_data['allow_minified_files'],
480
+ )
481
+ );
482
+ ?>
483
+ <?php submit_button( __( 'Save', 'cartflows' ), 'button-primary button', 'submit', false ); ?>
484
+ <?php wp_nonce_field( 'cartflows-debug-settings', 'cartflows-debug-settings-nonce' ); ?>
485
+ </form>
486
+ </div>
487
+ </div>
488
+ <?php
489
+ }
490
+ ?>
491
+ </div>
492
+ </div>
493
+ <!-- Right Sidebar -->
494
+
495
+ </div>
496
+ <!-- /post-body -->
497
+ <br class="clear">
498
+ </div>
499
+ </div>
500
+ <?php endif; ?>
501
+
502
+ <?php
503
+ /**
504
+ * Loads Zapier settings admin view.
505
+ */
506
+ do_action( 'cartflows_after_settings' );
507
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/cartflows-home.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Home overview
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+
10
+ <div class="wrap wcf-clear wcf-container">
11
+ <h1 class="screen-reader-text"><?php esc_html_e( 'Home', 'cartflows' ); ?></h1>
12
+ <div id="poststuff">
13
+
14
+ <div id="post-body" class="columns-2">
15
+ <div id="post-body-content">
16
+
17
+ <!-- Getting Started -->
18
+ <div class="postbox introduction">
19
+ <h2 class="hndle wcf-normal-cusror ui-sortable-handle">
20
+ <span><?php esc_html_e( 'Getting Started', 'cartflows' ); ?></span>
21
+ </h2>
22
+ <div class="inside">
23
+ <div class="iframe-wrap">
24
+ <iframe width="560" height="315" src="https://www.youtube.com/embed/SlE0moPKjMY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
25
+ </div>
26
+ <p>
27
+ <?php
28
+ esc_attr_e( 'Modernizing WordPress eCommerce!', 'cartflows' );
29
+ ?>
30
+ </p>
31
+ </div>
32
+ </div>
33
+ <!-- Getting Started -->
34
+ </div>
35
+
36
+ <!-- Right Sidebar -->
37
+ <div class="postbox-container" id="postbox-container-1">
38
+ <div id="side-sortables">
39
+
40
+ <div class="postbox">
41
+ <h2 class="hndle">
42
+ <span class="dashicons dashicons-book"></span>
43
+ <span><?php esc_html_e( 'Knowledge Base', 'cartflows' ); ?></span>
44
+ </h2>
45
+ <div class="inside">
46
+ <p>
47
+ <?php esc_html_e( 'Not sure how something works? Take a peek at the knowledge base and learn.', 'cartflows' ); ?>
48
+ </p>
49
+ <p>
50
+ <a href="<?php echo esc_url( 'https://cartflows.com/docs' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Visit Knowledge Base »', 'cartflows' ); ?></a>
51
+ </p>
52
+ </div>
53
+ </div>
54
+
55
+ <div class="postbox">
56
+ <h2 class="hndle">
57
+ <span class="dashicons dashicons-groups"></span>
58
+ <span><?php esc_html_e( 'Community', 'cartflows' ); ?></span>
59
+ </h2>
60
+ <div class="inside">
61
+ <p>
62
+ <?php esc_html_e( 'Join the community of super helpful CartFlows users. Say hello, ask questions, give feedback and help each other!', 'cartflows' ); ?>
63
+ </p>
64
+ <p>
65
+ <a href="<?php echo esc_url( 'https://www.facebook.com/groups/cartflows/' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Join Our Facebook Group »', 'cartflows' ); ?></a>
66
+ </p>
67
+ </div>
68
+ </div>
69
+
70
+ <div class="postbox">
71
+ <h2 class="hndle">
72
+ <span class="dashicons dashicons-sos"></span>
73
+ <span><?php esc_html_e( 'Five Star Support', 'cartflows' ); ?></span>
74
+ </h2>
75
+ <div class="inside">
76
+ <p>
77
+ <?php esc_html_e( 'Got a question? Get in touch with CartFlows developers. We\'re happy to help!', 'cartflows' ); ?>
78
+ </p>
79
+ <p>
80
+ <a href="<?php echo esc_url( 'https://cartflows.com/contact' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Submit a Ticket »', 'cartflows' ); ?></a>
81
+ </p>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ <!-- Right Sidebar -->
87
+
88
+ </div>
89
+ <!-- /post-body -->
90
+ <br class="clear">
91
+ </div>
92
+ </div>
languages/cartflows.pot CHANGED
@@ -1,2119 +1,2159 @@
1
- # Copyright (C) 2020 CartFlows Inc
2
- # This file is distributed under the same license as the CartFlows package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: CartFlows 1.5.13\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2020-07-21 06:58:49+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=utf-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "Language: en\n"
15
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
- "X-Poedit-Country: United States\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: "
19
- "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
- "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
- "X-Poedit-Basepath: ../\n"
22
- "X-Poedit-SearchPath-0: .\n"
23
- "X-Poedit-Bookmarks: \n"
24
- "X-Textdomain-Support: yes\n"
25
- "X-Generator: grunt-wp-i18n 1.0.3\n"
26
-
27
- #: admin/bsf-analytics/class-bsf-analytics.php:229
28
- #. translators: %s product name
29
- msgid ""
30
- "Want to help make <strong>%1s</strong> even more awesome? Allow us to "
31
- "collect non-sensitive diagnostic data and usage information. "
32
- msgstr ""
33
-
34
- #: admin/bsf-analytics/class-bsf-analytics.php:232
35
- msgid "This will be applicable for all sites from the network."
36
- msgstr ""
37
-
38
- #: admin/bsf-analytics/class-bsf-analytics.php:256
39
- #. translators: %s usage doc link
40
- msgid " Know More."
41
- msgstr ""
42
-
43
- #: admin/bsf-analytics/class-bsf-analytics.php:264
44
- msgid "Yes! Allow it"
45
- msgstr ""
46
-
47
- #: admin/bsf-analytics/class-bsf-analytics.php:273
48
- msgid "No Thanks"
49
- msgstr ""
50
-
51
- #: admin/bsf-analytics/class-bsf-analytics.php:353
52
- msgid "Every two days"
53
- msgstr ""
54
-
55
- #: admin/bsf-analytics/class-bsf-analytics.php:412
56
- msgid "Usage Tracking"
57
- msgstr ""
58
-
59
- #: admin/bsf-analytics/class-bsf-analytics.php:459
60
- msgid " This will be applicable for all sites from the network."
61
- msgstr ""
62
-
63
- #: admin/bsf-analytics/class-bsf-analytics.php:464
64
- msgid "Learn More."
65
- msgstr ""
66
-
67
- #: classes/batch-process/class-cartflows-importer-elementor.php:44
68
- msgid "Invalid content."
69
- msgstr ""
70
-
71
- #: classes/batch-process/class-cartflows-importer-elementor.php:56
72
- msgid "Invalid content. Expected an array."
73
- msgstr ""
74
-
75
- #: classes/batch-process/helpers/class-wp-background-process.php:435
76
- msgid "Every %d Minutes"
77
- msgstr ""
78
-
79
- #: classes/class-cartflows-admin-fields.php:235
80
- msgid "Select"
81
- msgstr ""
82
-
83
- #: classes/class-cartflows-admin-fields.php:238
84
- msgid "No Checkout Steps"
85
- msgstr ""
86
-
87
- #: classes/class-cartflows-admin-fields.php:264
88
- #. translators: %s: link
89
- msgid ""
90
- "Be sure not to add any product in above selected Global Checkout step. "
91
- "Please read information about how to set up Global Checkout %1$shere%2$s."
92
- msgstr ""
93
-
94
- #: classes/class-cartflows-admin.php:153 classes/class-cartflows-admin.php:154
95
- #: includes/admin/cartflows-general-bck.php:34
96
- #: modules/optin/classes/class-cartflows-optin-meta.php:150
97
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
98
- msgid "Settings"
99
- msgstr ""
100
-
101
- #: classes/class-cartflows-admin.php:440
102
- msgid "Installing and activating.."
103
- msgstr ""
104
-
105
- #: classes/class-cartflows-admin.php:441
106
- msgid "There was an error with the installation of plugin."
107
- msgstr ""
108
-
109
- #: classes/class-cartflows-admin.php:495
110
- msgid "Flows Library"
111
- msgstr ""
112
-
113
- #: classes/class-cartflows-admin.php:502
114
- #: modules/flow/view/meta-flow-steps.php:156
115
- msgid "Ready Templates"
116
- msgstr ""
117
-
118
- #: classes/class-cartflows-admin.php:505
119
- #: modules/flow/view/meta-flow-steps.php:159
120
- msgid "Create Your Own"
121
- msgstr ""
122
-
123
- #: classes/class-cartflows-admin.php:516
124
- #: modules/flow/view/meta-flow-steps.php:171
125
- msgid "Search Sites"
126
- msgstr ""
127
-
128
- #: classes/class-cartflows-admin.php:517
129
- #: modules/flow/view/meta-flow-steps.php:172
130
- msgid "Search Flow..."
131
- msgstr ""
132
-
133
- #: classes/class-cartflows-admin.php:534
134
- msgid "Design Your Flow"
135
- msgstr ""
136
-
137
- #: classes/class-cartflows-admin.php:535
138
- #: classes/class-cartflows-importer.php:665
139
- #: classes/class-cartflows-importer.php:764
140
- #: modules/flow/view/meta-flow-steps.php:202
141
- msgid "Learn How"
142
- msgstr ""
143
-
144
- #: classes/class-cartflows-api.php:369
145
- msgid "Request successfully processed!"
146
- msgstr ""
147
-
148
- #: classes/class-cartflows-cloning.php:423
149
- msgid "Clone this flow"
150
- msgstr ""
151
-
152
- #: classes/class-cartflows-cloning.php:423
153
- #: modules/flow/view/meta-flow-steps.php:115
154
- msgid "Clone"
155
- msgstr ""
156
-
157
- #: classes/class-cartflows-default-meta.php:745
158
- #: modules/optin/classes/class-cartflows-optin-meta.php:490
159
- msgid "Submit"
160
- msgstr ""
161
-
162
- #: classes/class-cartflows-flow-frontend.php:53
163
- msgid ""
164
- "Test mode is active — which displays random products for previewing. It can "
165
- "be deactivated from the flow settings in the admin dashboard."
166
- msgstr ""
167
-
168
- #: classes/class-cartflows-flow-frontend.php:58
169
- msgid "Click here to disable it"
170
- msgstr ""
171
-
172
- #: classes/class-cartflows-importer.php:81
173
- msgid "Export this flow"
174
- msgstr ""
175
-
176
- #: classes/class-cartflows-importer.php:81 includes/exporter.php:18
177
- msgid "Export"
178
- msgstr ""
179
-
180
- #: classes/class-cartflows-importer.php:92
181
- msgid "Flow Export"
182
- msgstr ""
183
-
184
- #: classes/class-cartflows-importer.php:93
185
- msgid "Flow Import"
186
- msgstr ""
187
-
188
- #: classes/class-cartflows-importer.php:104
189
- msgid "No post to export has been supplied!"
190
- msgstr ""
191
-
192
- #: classes/class-cartflows-importer.php:278
193
- msgid "Please upload a valid .json file"
194
- msgstr ""
195
-
196
- #: classes/class-cartflows-importer.php:284
197
- msgid "Please upload a file to import"
198
- msgstr ""
199
-
200
- #: classes/class-cartflows-importer.php:506
201
- msgid "Successfully imported flows."
202
- msgstr ""
203
-
204
- #: classes/class-cartflows-importer.php:538
205
- msgid "Loading Steps"
206
- msgstr ""
207
-
208
- #: classes/class-cartflows-importer.php:540
209
- msgid "Getting steps from the cloud. Please wait for the moment."
210
- msgstr ""
211
-
212
- #: classes/class-cartflows-importer.php:551
213
- msgid "Searching Template.."
214
- msgstr ""
215
-
216
- #: classes/class-cartflows-importer.php:553
217
- msgid "Getting templates from the cloud. Please wait for the moment."
218
- msgstr ""
219
-
220
- #: classes/class-cartflows-importer.php:562
221
- msgid "Importing.."
222
- msgstr ""
223
-
224
- #: classes/class-cartflows-importer.php:571
225
- #: classes/class-cartflows-importer.php:611
226
- msgid "Imported"
227
- msgstr ""
228
-
229
- #: classes/class-cartflows-importer.php:572
230
- #: classes/class-cartflows-importer.php:612
231
- msgid "Thanks for patience"
232
- msgstr ""
233
-
234
- #: classes/class-cartflows-importer.php:581
235
- #: classes/class-cartflows-importer.php:593
236
- msgid "Coming Soon!"
237
- msgstr ""
238
-
239
- #: classes/class-cartflows-importer.php:612
240
- msgid "Redirecting to the Elementor edit window."
241
- msgstr ""
242
-
243
- #: classes/class-cartflows-importer.php:658
244
- #: classes/class-cartflows-importer.php:774
245
- msgid "Pro"
246
- msgstr ""
247
-
248
- #: classes/class-cartflows-importer.php:699
249
- #: classes/class-cartflows-importer.php:806
250
- msgid "Activate License"
251
- msgstr ""
252
-
253
- #: classes/class-cartflows-importer.php:701
254
- #: classes/class-cartflows-importer.php:808
255
- #: modules/flow/classes/class-cartflows-flow-meta.php:474
256
- msgid "Get Pro"
257
- msgstr ""
258
-
259
- #: classes/class-cartflows-importer.php:726
260
- msgid "Create"
261
- msgstr ""
262
-
263
- #: classes/class-cartflows-importer.php:825
264
- msgid "Under Maintenance.."
265
- msgstr ""
266
-
267
- #: classes/class-cartflows-importer.php:826
268
- msgid ""
269
- "If you are seeing this message, most likely our servers are under routine "
270
- "maintenance and we will be back shortly."
271
- msgstr ""
272
-
273
- #: classes/class-cartflows-importer.php:827
274
- msgid ""
275
- "In rare case, it is possible your website is having trouble connecting with "
276
- "ours. If you need help, please feel free to get in touch with us from our "
277
- "website.."
278
- msgstr ""
279
-
280
- #: classes/class-cartflows-importer.php:857
281
- #. translators: %s: Plugin string
282
- msgid ""
283
- "%1$s to see CartFlows templates. If you prefer another page builder tool, "
284
- "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
285
- msgstr ""
286
-
287
- #: classes/class-cartflows-importer.php:872
288
- msgid "All"
289
- msgstr ""
290
-
291
- #: classes/class-cartflows-importer.php:875
292
- msgid "Select Step Type"
293
- msgstr ""
294
-
295
- #: classes/class-cartflows-importer.php:959
296
- msgid "Import from Cloud"
297
- msgstr ""
298
-
299
- #: classes/class-cartflows-importer.php:1267
300
- msgid "Sales Landing"
301
- msgstr ""
302
-
303
- #: classes/class-cartflows-importer.php:1271
304
- #: modules/flow/classes/class-cartflows-step-post-type.php:253
305
- #: modules/flow/view/meta-flow-steps.php:12
306
- msgid "Checkout (Woo)"
307
- msgstr ""
308
-
309
- #: classes/class-cartflows-importer.php:1275
310
- #: modules/flow/classes/class-cartflows-step-post-type.php:260
311
- #: modules/flow/view/meta-flow-steps.php:13
312
- msgid "Thank You (Woo)"
313
- msgstr ""
314
-
315
- #: classes/class-cartflows-importer.php:1283
316
- #: modules/flow/classes/class-cartflows-step-post-type.php:239
317
- #: modules/flow/view/meta-flow-steps.php:11
318
- msgid "Landing"
319
- msgstr ""
320
-
321
- #: classes/class-cartflows-importer.php:1287
322
- msgid "Thank You"
323
- msgstr ""
324
-
325
- #: classes/class-cartflows-importer.php:1397
326
- #. translators: %s: template ID
327
- msgid "Invalid template id %1$s or post id %2$s."
328
- msgstr ""
329
-
330
- #: classes/class-cartflows-importer.php:1472
331
- #. translators: %s: flow ID
332
- msgid "Invalid flow id %1$s OR step type %2$s."
333
- msgstr ""
334
-
335
- #: classes/class-cartflows-importer.php:1597
336
- msgid ""
337
- "Elementor is not activated. Please activate plugin Elementor Page Builder "
338
- "to import the step."
339
- msgstr ""
340
-
341
- #: classes/class-cartflows-importer.php:1700
342
- msgid "Action failed. Invalid Security Nonce."
343
- msgstr ""
344
-
345
- #: classes/class-cartflows-importer.php:1707
346
- msgid "User have not plugin install permissions."
347
- msgstr ""
348
-
349
- #: classes/class-cartflows-importer.php:1729
350
- msgid "Plugin Successfully Activated"
351
- msgstr ""
352
-
353
- #: classes/class-cartflows-learndash-compatibility.php:86
354
- msgid "None"
355
- msgstr ""
356
-
357
- #: classes/class-cartflows-learndash-compatibility.php:113
358
- #. translators: 1: anchor start, 2: anchor close
359
- msgid ""
360
- "Non-enrolled students will redirect to the selected CartFlows template. If "
361
- "you have not created any Flow already, add new Flow from %1$shere%2$s."
362
- msgstr ""
363
-
364
- #: classes/class-cartflows-learndash-compatibility.php:119
365
- msgid "Select CartFlows Template for this Course"
366
- msgstr ""
367
-
368
- #: classes/class-cartflows-loader.php:222
369
- #. translators: %s: html tags
370
- msgid ""
371
- "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
372
- "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
373
- msgstr ""
374
-
375
- #: classes/class-cartflows-loader.php:485
376
- #. translators: %s: html tags
377
- msgid ""
378
- "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
379
- "activated."
380
- msgstr ""
381
-
382
- #: classes/class-cartflows-loader.php:495
383
- msgid "Activate WooCommerce"
384
- msgstr ""
385
-
386
- #: classes/class-cartflows-loader.php:503
387
- msgid "Install WooCommerce"
388
- msgstr ""
389
-
390
- #: classes/class-cartflows-logger.php:161
391
- msgid "Action failed. Please refresh the page and retry."
392
- msgstr ""
393
-
394
- #: classes/class-cartflows-meta-fields.php:84
395
- msgid "Thin 100"
396
- msgstr ""
397
-
398
- #: classes/class-cartflows-meta-fields.php:85
399
- msgid "Extra-Light 200"
400
- msgstr ""
401
-
402
- #: classes/class-cartflows-meta-fields.php:86
403
- msgid "Light 300"
404
- msgstr ""
405
-
406
- #: classes/class-cartflows-meta-fields.php:87
407
- msgid "Normal 400"
408
- msgstr ""
409
-
410
- #: classes/class-cartflows-meta-fields.php:88
411
- msgid "Medium 500"
412
- msgstr ""
413
-
414
- #: classes/class-cartflows-meta-fields.php:89
415
- msgid "Semi-Bold 600"
416
- msgstr ""
417
-
418
- #: classes/class-cartflows-meta-fields.php:90
419
- msgid "Bold 700"
420
- msgstr ""
421
-
422
- #: classes/class-cartflows-meta-fields.php:91
423
- msgid "Extra-Bold 800"
424
- msgstr ""
425
-
426
- #: classes/class-cartflows-meta-fields.php:92
427
- msgid "Ultra-Bold 900"
428
- msgstr ""
429
-
430
- #: classes/class-cartflows-meta-fields.php:175
431
- #. Translators: %d stock amount
432
- msgid "Stock: %d"
433
- msgstr ""
434
-
435
- #: classes/class-cartflows-meta-fields.php:758
436
- #: includes/meta-fields/generate-product-repeater.php:30
437
- msgid "Search for a product&hellip;"
438
- msgstr ""
439
-
440
- #: classes/class-cartflows-meta-fields.php:809
441
- msgid "Search for a coupon&hellip;"
442
- msgstr ""
443
-
444
- #: classes/class-cartflows-meta.php:34
445
- msgid "Update"
446
- msgstr ""
447
-
448
- #: classes/class-cartflows-meta.php:42
449
- #: modules/flow/classes/class-cartflows-flow-meta.php:95
450
- #: modules/flow/classes/class-cartflows-flow-meta.php:733
451
- msgid "Back to edit Flow"
452
- msgstr ""
453
-
454
- #: classes/class-cartflows-meta.php:63
455
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:198
456
- #: modules/landing/classes/class-cartflows-landing-meta.php:136
457
- #: modules/optin/classes/class-cartflows-optin-meta.php:156
458
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:154
459
- msgid "Custom Script"
460
- msgstr ""
461
-
462
- #: classes/class-cartflows-meta.php:66
463
- msgid ""
464
- "Custom script lets you add your own custom script on front end of this flow "
465
- "page."
466
- msgstr ""
467
-
468
- #: classes/class-cartflows-metabox.php:59
469
- msgid "Flow Details"
470
- msgstr ""
471
-
472
- #: classes/class-cartflows-wizard.php:94
473
- msgid "Thanks for installing and using CartFlows!"
474
- msgstr ""
475
-
476
- #: classes/class-cartflows-wizard.php:95
477
- msgid ""
478
- "It is easy to use the CartFlows. Please use the setup wizard to quick start "
479
- "setup."
480
- msgstr ""
481
-
482
- #: classes/class-cartflows-wizard.php:97
483
- msgid "Start Wizard"
484
- msgstr ""
485
-
486
- #: classes/class-cartflows-wizard.php:98
487
- msgid "Skip Setup"
488
- msgstr ""
489
-
490
- #: classes/class-cartflows-wizard.php:128
491
- #: includes/admin/cartflows-general-bck.php:24
492
- msgid "Welcome"
493
- msgstr ""
494
-
495
- #: classes/class-cartflows-wizard.php:133
496
- msgid "Page Builder"
497
- msgstr ""
498
-
499
- #: classes/class-cartflows-wizard.php:137
500
- msgid "Checkout"
501
- msgstr ""
502
-
503
- #: classes/class-cartflows-wizard.php:141
504
- msgid "Training"
505
- msgstr ""
506
-
507
- #: classes/class-cartflows-wizard.php:145
508
- msgid "Ready!"
509
- msgstr ""
510
-
511
- #: classes/class-cartflows-wizard.php:220
512
- msgid "CartFlows Setup"
513
- msgstr ""
514
-
515
- #: classes/class-cartflows-wizard.php:246
516
- msgid "Exit Setup Wizard"
517
- msgstr ""
518
-
519
- #: classes/class-cartflows-wizard.php:299
520
- msgid "Welcome to CartFlows!"
521
- msgstr ""
522
-
523
- #: classes/class-cartflows-wizard.php:300
524
- msgid ""
525
- "Thank you for choosing CartFlows to get more leads, increase conversions, & "
526
- "maximize profits. This short setup wizard will guide you though configuring "
527
- "CartFlows and creating your first funnel."
528
- msgstr ""
529
-
530
- #: classes/class-cartflows-wizard.php:304
531
- msgid "Let&#x27;s Build it better!"
532
- msgstr ""
533
-
534
- #: classes/class-cartflows-wizard.php:305
535
- msgid ""
536
- "Get improved features and faster fixes by sharing non-sensitive data via "
537
- "usage tracking that shows us how CartFlows is used. No personal data is "
538
- "tracked or stored."
539
- msgstr ""
540
-
541
- #: classes/class-cartflows-wizard.php:306
542
- msgid "Learn More"
543
- msgstr ""
544
-
545
- #: classes/class-cartflows-wizard.php:309
546
- msgid "Yes, I am in."
547
- msgstr ""
548
-
549
- #: classes/class-cartflows-wizard.php:316
550
- msgid "Lets Go »"
551
- msgstr ""
552
-
553
- #: classes/class-cartflows-wizard.php:344
554
- msgid "Page Builder Setup"
555
- msgstr ""
556
-
557
- #: classes/class-cartflows-wizard.php:345
558
- msgid "Please select a page builder you would like to use with CartFlows."
559
- msgstr ""
560
-
561
- #: classes/class-cartflows-wizard.php:350
562
- msgid "Select Page Builder"
563
- msgstr ""
564
-
565
- #: classes/class-cartflows-wizard.php:357
566
- #: includes/admin/cartflows-general.php:94
567
- msgid "Elementor"
568
- msgstr ""
569
-
570
- #: classes/class-cartflows-wizard.php:367
571
- msgid "Beaver Builder Plugin (Lite Version)"
572
- msgstr ""
573
-
574
- #: classes/class-cartflows-wizard.php:377
575
- #: includes/admin/cartflows-general.php:96
576
- msgid "Divi"
577
- msgstr ""
578
-
579
- #: classes/class-cartflows-wizard.php:387
580
- #: includes/admin/cartflows-general.php:97
581
- msgid "Gutenberg"
582
- msgstr ""
583
-
584
- #: classes/class-cartflows-wizard.php:397
585
- #: includes/admin/cartflows-general.php:98
586
- msgid "Other"
587
- msgstr ""
588
-
589
- #: classes/class-cartflows-wizard.php:419
590
- msgid ""
591
- "While CartFlows Should work with most page builders, we offer templates for "
592
- "the above page builders."
593
- msgstr ""
594
-
595
- #: classes/class-cartflows-wizard.php:423
596
- #: classes/class-cartflows-wizard.php:468
597
- #: classes/class-cartflows-wizard.php:678
598
- msgid "« Previous"
599
- msgstr ""
600
-
601
- #: classes/class-cartflows-wizard.php:426
602
- msgid "Skip this step"
603
- msgstr ""
604
-
605
- #: classes/class-cartflows-wizard.php:427
606
- msgid "Next »"
607
- msgstr ""
608
-
609
- #: classes/class-cartflows-wizard.php:446
610
- msgid "Choose a checkout"
611
- msgstr ""
612
-
613
- #: classes/class-cartflows-wizard.php:449
614
- msgid ""
615
- "While CartFlows is designed to use WooCommerce sell digital and physical "
616
- "products, not all funnels need a checkout system."
617
- msgstr ""
618
-
619
- #: classes/class-cartflows-wizard.php:451
620
- msgid ""
621
- "Would you like to install WooCommerce to sell digital and physical products "
622
- "in your funnels?"
623
- msgstr ""
624
-
625
- #: classes/class-cartflows-wizard.php:458
626
- msgid "The following plugin will be installed and activated for you:"
627
- msgstr ""
628
-
629
- #: classes/class-cartflows-wizard.php:459
630
- msgid "WooCommerce"
631
- msgstr ""
632
-
633
- #: classes/class-cartflows-wizard.php:460
634
- msgid "WooCommerce Cart Abandonment Recovery"
635
- msgstr ""
636
-
637
- #: classes/class-cartflows-wizard.php:471
638
- #: classes/class-cartflows-wizard.php:681
639
- msgid "No thanks"
640
- msgstr ""
641
-
642
- #: classes/class-cartflows-wizard.php:472
643
- msgid "Yes"
644
- msgstr ""
645
-
646
- #: classes/class-cartflows-wizard.php:614
647
- msgid "Congratulations, You Did It!"
648
- msgstr ""
649
-
650
- #: classes/class-cartflows-wizard.php:621
651
- msgid ""
652
- "CartFlows is ready to use on your website. You've successfully completed "
653
- "the setup process and all that is left for you to do is create your first "
654
- "flow."
655
- msgstr ""
656
-
657
- #: classes/class-cartflows-wizard.php:635
658
- msgid "Create a flow"
659
- msgstr ""
660
-
661
- #: classes/class-cartflows-wizard.php:652
662
- msgid "Exclusive CartFlows Training Course Offer"
663
- msgstr ""
664
-
665
- #: classes/class-cartflows-wizard.php:663
666
- msgid ""
667
- "We want you to get off to a great start using CartFlows, so we would like "
668
- "to give access to our exclusive training course."
669
- msgstr ""
670
-
671
- #: classes/class-cartflows-wizard.php:664
672
- msgid "Get access to this couse, for free, by entering your email below."
673
- msgstr ""
674
-
675
- #: classes/class-cartflows-wizard.php:666
676
- msgid "Enter Email address"
677
- msgstr ""
678
-
679
- #: classes/class-cartflows-wizard.php:682
680
- msgid "Allow"
681
- msgstr ""
682
-
683
- #: classes/lib/notices/class-astra-notices.php:125
684
- msgid "WordPress Nonce not validated."
685
- msgstr ""
686
-
687
- #: classes/logger/class-cartflows-log-handler-file.php:351
688
- #: classes/logger/class-cartflows-log-handler-file.php:371
689
- msgid "This method should not be called before plugins_loaded."
690
- msgstr ""
691
-
692
- #: classes/logger/class-cartflows-wc-logger.php:58
693
- #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
694
- msgid "The provided handler %1$s does not implement %2$s."
695
- msgstr ""
696
-
697
- #: classes/logger/class-cartflows-wc-logger.php:136
698
- #. translators: 1: Cartflows_WC_Logger::log 2: level
699
- msgid "%1$s was called with an invalid level \"%2$s\"."
700
- msgstr ""
701
-
702
- #: includes/admin/cartflows-admin.php:19
703
- #: includes/admin/cartflows-general.php:48
704
- msgid "Modernizing WordPress eCommerce!"
705
- msgstr ""
706
-
707
- #: includes/admin/cartflows-admin.php:29
708
- msgid "Settings saved successfully."
709
- msgstr ""
710
-
711
- #: includes/admin/cartflows-error-log.php:36
712
- msgid "%1$s at %2$s"
713
- msgstr ""
714
-
715
- #: includes/admin/cartflows-error-log.php:41
716
- #: modules/flow/classes/class-cartflows-flow-post-type.php:225
717
- #: modules/flow/view/meta-flow-steps.php:104
718
- msgid "View"
719
- msgstr ""
720
-
721
- #: includes/admin/cartflows-error-log.php:65
722
- msgid "Delete log"
723
- msgstr ""
724
-
725
- #: includes/admin/cartflows-error-log.php:70
726
- msgid "There are currently no logs to view."
727
- msgstr ""
728
-
729
- #: includes/admin/cartflows-general-bck.php:10
730
- msgid "Selec"
731
- msgstr ""
732
-
733
- #: includes/admin/cartflows-general-bck.php:22
734
- msgid "General"
735
- msgstr ""
736
-
737
- #: includes/admin/cartflows-general.php:31
738
- #: includes/admin/cartflows-general.php:58
739
- msgid "General Settings"
740
- msgstr ""
741
-
742
- #: includes/admin/cartflows-general.php:40
743
- msgid "Getting Started"
744
- msgstr ""
745
-
746
- #: includes/admin/cartflows-general.php:71
747
- msgid "Disallow search engines from indexing flows"
748
- msgstr ""
749
-
750
- #: includes/admin/cartflows-general.php:81
751
- #: modules/flow/view/meta-flow-steps.php:93
752
- msgid "Global Checkout"
753
- msgstr ""
754
-
755
- #: includes/admin/cartflows-general.php:90
756
- msgid "Show Templates designed with"
757
- msgstr ""
758
-
759
- #: includes/admin/cartflows-general.php:91
760
- msgid ""
761
- "CartFlows offers flow templates that can be imported in one click. These "
762
- "templates are available in few different page builders. Please choose your "
763
- "preferred page builder from the list so you will only see templates that "
764
- "are made using that page builder.."
765
- msgstr ""
766
-
767
- #: includes/admin/cartflows-general.php:95
768
- msgid "Beaver Builder"
769
- msgstr ""
770
-
771
- #: includes/admin/cartflows-general.php:107
772
- #: includes/admin/cartflows-general.php:193
773
- #: includes/admin/cartflows-general.php:299
774
- #: includes/admin/cartflows-general.php:416
775
- msgid "Save Changes"
776
- msgstr ""
777
-
778
- #: includes/admin/cartflows-general.php:119
779
- msgid "Permalink Settings"
780
- msgstr ""
781
-
782
- #: includes/admin/cartflows-general.php:134
783
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:647
784
- #: modules/optin/classes/class-cartflows-optin-meta.php:383
785
- msgid "Default"
786
- msgstr ""
787
-
788
- #: includes/admin/cartflows-general.php:140
789
- msgid "Flow and Step Slug"
790
- msgstr ""
791
-
792
- #: includes/admin/cartflows-general.php:146
793
- msgid "Flow Slug"
794
- msgstr ""
795
-
796
- #: includes/admin/cartflows-general.php:152
797
- msgid "Step Slug"
798
- msgstr ""
799
-
800
- #: includes/admin/cartflows-general.php:164
801
- msgid "Post Type Permalink Base"
802
- msgstr ""
803
-
804
- #: includes/admin/cartflows-general.php:172
805
- msgid "Step Base"
806
- msgstr ""
807
-
808
- #: includes/admin/cartflows-general.php:182
809
- msgid "Flow Base"
810
- msgstr ""
811
-
812
- #: includes/admin/cartflows-general.php:194
813
- msgid "Set Default"
814
- msgstr ""
815
-
816
- #: includes/admin/cartflows-general.php:208
817
- msgid "Facebook Pixel Settings"
818
- msgstr ""
819
-
820
- #: includes/admin/cartflows-general.php:223
821
- msgid "Enable Facebook Pixel Tracking"
822
- msgstr ""
823
-
824
- #: includes/admin/cartflows-general.php:236
825
- msgid "Enable for the whole site"
826
- msgstr ""
827
-
828
- #: includes/admin/cartflows-general.php:244
829
- #: includes/admin/cartflows-general.php:343
830
- msgid "If this option is unchecked, it will only apply to CartFlows steps."
831
- msgstr ""
832
-
833
- #: includes/admin/cartflows-general.php:254
834
- msgid "Enter Facebook pixel ID"
835
- msgstr ""
836
-
837
- #: includes/admin/cartflows-general.php:262
838
- #: includes/admin/cartflows-general.php:361
839
- msgid "Enable Events:"
840
- msgstr ""
841
-
842
- #: includes/admin/cartflows-general.php:271
843
- msgid "Initiate Checkout"
844
- msgstr ""
845
-
846
- #: includes/admin/cartflows-general.php:280
847
- #: includes/admin/cartflows-general.php:387
848
- msgid "Add Payment Info"
849
- msgstr ""
850
-
851
- #: includes/admin/cartflows-general.php:289
852
- msgid "Purchase Complete"
853
- msgstr ""
854
-
855
- #: includes/admin/cartflows-general.php:311
856
- msgid "Google Analytics Settings"
857
- msgstr ""
858
-
859
- #: includes/admin/cartflows-general.php:322
860
- msgid "Enable Google Analytics Tracking"
861
- msgstr ""
862
-
863
- #: includes/admin/cartflows-general.php:335
864
- msgid "Enable for the whole website"
865
- msgstr ""
866
-
867
- #: includes/admin/cartflows-general.php:353
868
- msgid "Google Analytics ID"
869
- msgstr ""
870
-
871
- #: includes/admin/cartflows-general.php:355
872
- msgid ""
873
- "Log into your <a href=\"https://analytics.google.com/\" "
874
- "target=\"_blank\">google analytics account</a> to find your ID. eg: "
875
- "UA-XXXXXX-X&period;"
876
- msgstr ""
877
-
878
- #: includes/admin/cartflows-general.php:369
879
- msgid "Begin Checkout"
880
- msgstr ""
881
-
882
- #: includes/admin/cartflows-general.php:378
883
- msgid "Add To Cart"
884
- msgstr ""
885
-
886
- #: includes/admin/cartflows-general.php:396
887
- msgid "Purchase"
888
- msgstr ""
889
-
890
- #: includes/admin/cartflows-general.php:404
891
- msgid ""
892
- "Google Analytics not working correctly? <a "
893
- "href=\"https://cartflows.com/docs/troubleshooting-google-analytics-tracking-"
894
- "issues/\" > Click here </a> to know more. "
895
- msgstr ""
896
-
897
- #: includes/admin/cartflows-general.php:437
898
- msgid "Knowledge Base"
899
- msgstr ""
900
-
901
- #: includes/admin/cartflows-general.php:441
902
- msgid "Not sure how something works? Take a peek at the knowledge base and learn."
903
- msgstr ""
904
-
905
- #: includes/admin/cartflows-general.php:444
906
- msgid "Visit Knowledge Base »"
907
- msgstr ""
908
-
909
- #: includes/admin/cartflows-general.php:452
910
- msgid "Community"
911
- msgstr ""
912
-
913
- #: includes/admin/cartflows-general.php:456
914
- msgid ""
915
- "Join the community of super helpful CartFlows users. Say hello, ask "
916
- "questions, give feedback and help each other!"
917
- msgstr ""
918
-
919
- #: includes/admin/cartflows-general.php:459
920
- msgid "Join Our Facebook Group »"
921
- msgstr ""
922
-
923
- #: includes/admin/cartflows-general.php:467
924
- msgid "Five Star Support"
925
- msgstr ""
926
-
927
- #: includes/admin/cartflows-general.php:471
928
- msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
929
- msgstr ""
930
-
931
- #: includes/admin/cartflows-general.php:474
932
- msgid "Submit a Ticket »"
933
- msgstr ""
934
-
935
- #: includes/admin/cartflows-general.php:484
936
- msgid "Load Minified CSS"
937
- msgstr ""
938
-
939
- #: includes/admin/cartflows-general.php:489
940
- msgid ""
941
- "Load the Minified CSS from here. Just Enable it by checking the below given "
942
- "checkbox."
943
- msgstr ""
944
-
945
- #: includes/admin/cartflows-general.php:496
946
- msgid "Load minified CSS & JS Files"
947
- msgstr ""
948
-
949
- #: includes/admin/cartflows-general.php:501
950
- msgid "Save"
951
- msgstr ""
952
-
953
- #: includes/exporter.php:12
954
- msgid "Export Flows to a JSON file"
955
- msgstr ""
956
-
957
- #: includes/exporter.php:13
958
- msgid ""
959
- "This tool allows you to generate and download a JSON file containing a list "
960
- "of all flows."
961
- msgstr ""
962
-
963
- #: includes/importer.php:12
964
- msgid "Import Flows to a JSON file"
965
- msgstr ""
966
-
967
- #: includes/importer.php:13
968
- msgid "This tool allows you to import the flows from the JSON file."
969
- msgstr ""
970
-
971
- #: includes/importer.php:21
972
- msgid "Import"
973
- msgstr ""
974
-
975
- #: includes/meta-fields/generate-product-repeater.php:36
976
- msgid "Remove"
977
- msgstr ""
978
-
979
- #: includes/meta-fields/generate-product-repeater.php:51
980
- msgid "Product Quantity"
981
- msgstr ""
982
-
983
- #: includes/meta-fields/generate-product-repeater.php:65
984
- msgid "Discount Type"
985
- msgstr ""
986
-
987
- #: includes/meta-fields/generate-product-repeater.php:69
988
- msgid "Select Discount Type"
989
- msgstr ""
990
-
991
- #: includes/meta-fields/generate-product-repeater.php:70
992
- msgid "Original"
993
- msgstr ""
994
-
995
- #: includes/meta-fields/generate-product-repeater.php:71
996
- msgid "Percentage"
997
- msgstr ""
998
-
999
- #: includes/meta-fields/generate-product-repeater.php:72
1000
- msgid "Price"
1001
- msgstr ""
1002
-
1003
- #: includes/meta-fields/generate-product-repeater.php:83
1004
- msgid "Discount Value"
1005
- msgstr ""
1006
-
1007
- #: includes/meta-fields/generate-product-repeater.php:85
1008
- msgid "Discount value will apply for each quantity of product."
1009
- msgstr ""
1010
-
1011
- #: includes/meta-fields/get-product-selection-repeater.php:112
1012
- msgid "Add New Product"
1013
- msgstr ""
1014
-
1015
- #: includes/meta-fields/get-product-selection-repeater.php:113
1016
- msgid "Create Product"
1017
- msgstr ""
1018
-
1019
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:284
1020
- #: modules/optin/classes/class-cartflows-optin-markup.php:146
1021
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:90
1022
- msgid ""
1023
- "WooCommerce functions do not exist. If you are in an IFrame, please reload "
1024
- "it."
1025
- msgstr ""
1026
-
1027
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:285
1028
- #: modules/optin/classes/class-cartflows-optin-markup.php:147
1029
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:91
1030
- msgid "Click Here to Reload"
1031
- msgstr ""
1032
-
1033
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:303
1034
- msgid "Checkout ID not found"
1035
- msgstr ""
1036
-
1037
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:366
1038
- #: modules/checkout/templates/embed/checkout-template-simple.php:25
1039
- #: modules/checkout/templates/wcf-template.php:36
1040
- #: modules/optin/templates/optin-template-simple.php:25
1041
- msgid "Your cart is currently empty."
1042
- msgstr ""
1043
-
1044
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:432
1045
- msgid ""
1046
- "No product is selected. Please select products from the checkout meta "
1047
- "settings to continue."
1048
- msgstr ""
1049
-
1050
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:521
1051
- msgid "Variations Not set"
1052
- msgstr ""
1053
-
1054
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:529
1055
- msgid "This product can't be purchased"
1056
- msgstr ""
1057
-
1058
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:974
1059
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1017
1060
- msgid "Coupon Code"
1061
- msgstr ""
1062
-
1063
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:975
1064
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1026
1065
- msgid "Apply"
1066
- msgstr ""
1067
-
1068
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1182
1069
- msgid "Sorry there was a problem removing this coupon."
1070
- msgstr ""
1071
-
1072
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1185
1073
- msgid "Coupon has been removed."
1074
- msgstr ""
1075
-
1076
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1204
1077
- msgid "Sorry there was a problem removing "
1078
- msgstr ""
1079
-
1080
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1207
1081
- msgid " has been removed."
1082
- msgstr ""
1083
-
1084
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:65
1085
- msgid "Checkout Layout"
1086
- msgstr ""
1087
-
1088
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
1089
- #: modules/landing/classes/class-cartflows-landing-meta.php:130
1090
- #: modules/optin/classes/class-cartflows-optin-meta.php:126
1091
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
1092
- msgid "Shortcodes"
1093
- msgstr ""
1094
-
1095
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
1096
- #: modules/optin/classes/class-cartflows-optin-meta.php:132
1097
- msgid "Select Product"
1098
- msgstr ""
1099
-
1100
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:162
1101
- msgid "Product Options"
1102
- msgstr ""
1103
-
1104
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:168
1105
- msgid "Order Bump"
1106
- msgstr ""
1107
-
1108
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:174
1109
- msgid "Checkout Offer"
1110
- msgstr ""
1111
-
1112
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:180
1113
- msgid "Checkout Design"
1114
- msgstr ""
1115
-
1116
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
1117
- msgid "Checkout Fields"
1118
- msgstr ""
1119
-
1120
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
1121
- msgid "Checkout Settings"
1122
- msgstr ""
1123
-
1124
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:209
1125
- msgid "Logo (Optional)"
1126
- msgstr ""
1127
-
1128
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:270
1129
- #. translators: %s: link
1130
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
1131
- msgstr ""
1132
-
1133
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:281
1134
- #. translators: %s: link.
1135
- msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
1136
- msgstr ""
1137
-
1138
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:309
1139
- msgid "Add this shortcode to your checkout page"
1140
- msgstr ""
1141
-
1142
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:345
1143
- #. translators: %s: link
1144
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
1145
- msgstr ""
1146
-
1147
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:372
1148
- #. translators: %s: link
1149
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1150
- msgstr ""
1151
-
1152
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:382
1153
- #. translators: %s: link
1154
- msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1155
- msgstr ""
1156
-
1157
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:409
1158
- #. translators: %s: link
1159
- msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
1160
- msgstr ""
1161
-
1162
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:419
1163
- #. translators: %s: link
1164
- msgid ""
1165
- "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
1166
- "feature"
1167
- msgstr ""
1168
-
1169
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
1170
- #. translators: %s: link
1171
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1172
- msgstr ""
1173
-
1174
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1175
- #: modules/optin/classes/class-cartflows-optin-meta.php:270
1176
- #. translators: %s: link
1177
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1178
- msgstr ""
1179
-
1180
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:492
1181
- msgid "Place Order Button Text"
1182
- msgstr ""
1183
-
1184
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:496
1185
- msgid "Place order"
1186
- msgstr ""
1187
-
1188
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
1189
- msgid "It will change the Place Order Button text on checkout page."
1190
- msgstr ""
1191
-
1192
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:508
1193
- msgid "Enable cart editing on checkout"
1194
- msgstr ""
1195
-
1196
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:516
1197
- #. translators: %s: link
1198
- msgid "Users will able to remove products from the checkout page."
1199
- msgstr ""
1200
-
1201
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:546
1202
- msgid "One Column (Available in CartFlows Pro) "
1203
- msgstr ""
1204
-
1205
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:547
1206
- msgid "Two Step (Available in CartFlows Pro) "
1207
- msgstr ""
1208
-
1209
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:553
1210
- msgid "Checkout Skin"
1211
- msgstr ""
1212
-
1213
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:557
1214
- msgid "One Column"
1215
- msgstr ""
1216
-
1217
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:558
1218
- msgid "Two Column"
1219
- msgstr ""
1220
-
1221
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
1222
- msgid "Two Step"
1223
- msgstr ""
1224
-
1225
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:568
1226
- #: modules/optin/classes/class-cartflows-optin-meta.php:346
1227
- msgid "Primary Color"
1228
- msgstr ""
1229
-
1230
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:577
1231
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:612
1232
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:658
1233
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:750
1234
- #: modules/optin/classes/class-cartflows-optin-meta.php:355
1235
- #: modules/optin/classes/class-cartflows-optin-meta.php:394
1236
- #: modules/optin/classes/class-cartflows-optin-meta.php:506
1237
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:209
1238
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:240
1239
- msgid "Font Family"
1240
- msgstr ""
1241
-
1242
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:585
1243
- msgid "Advance Options"
1244
- msgstr ""
1245
-
1246
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:597
1247
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:225
1248
- msgid "Heading"
1249
- msgstr ""
1250
-
1251
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
1252
- msgid "Heading Color"
1253
- msgstr ""
1254
-
1255
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:621
1256
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:667
1257
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:759
1258
- #: modules/optin/classes/class-cartflows-optin-meta.php:403
1259
- #: modules/optin/classes/class-cartflows-optin-meta.php:515
1260
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:249
1261
- msgid "Font Weight"
1262
- msgstr ""
1263
-
1264
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:629
1265
- #: modules/optin/classes/class-cartflows-optin-meta.php:366
1266
- msgid "Input Fields"
1267
- msgstr ""
1268
-
1269
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1270
- #: modules/optin/classes/class-cartflows-optin-meta.php:373
1271
- msgid "Floating Labels (Available in CartFlows Pro)"
1272
- msgstr ""
1273
-
1274
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:643
1275
- #: modules/optin/classes/class-cartflows-optin-meta.php:379
1276
- msgid "Style"
1277
- msgstr ""
1278
-
1279
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:648
1280
- #: modules/optin/classes/class-cartflows-optin-meta.php:384
1281
- msgid "Floating Labels"
1282
- msgstr ""
1283
-
1284
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:675
1285
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:767
1286
- #: modules/optin/classes/class-cartflows-optin-meta.php:411
1287
- #: modules/optin/classes/class-cartflows-optin-meta.php:523
1288
- msgid "Size"
1289
- msgstr ""
1290
-
1291
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:679
1292
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:771
1293
- #: modules/optin/classes/class-cartflows-optin-meta.php:415
1294
- #: modules/optin/classes/class-cartflows-optin-meta.php:527
1295
- msgid "Extra Small"
1296
- msgstr ""
1297
-
1298
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:680
1299
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:772
1300
- #: modules/optin/classes/class-cartflows-optin-meta.php:416
1301
- #: modules/optin/classes/class-cartflows-optin-meta.php:528
1302
- msgid "Small"
1303
- msgstr ""
1304
-
1305
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1306
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:773
1307
- #: modules/optin/classes/class-cartflows-optin-meta.php:417
1308
- #: modules/optin/classes/class-cartflows-optin-meta.php:529
1309
- msgid "Medium"
1310
- msgstr ""
1311
-
1312
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:682
1313
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:774
1314
- #: modules/optin/classes/class-cartflows-optin-meta.php:418
1315
- #: modules/optin/classes/class-cartflows-optin-meta.php:530
1316
- msgid "Large"
1317
- msgstr ""
1318
-
1319
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:683
1320
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:775
1321
- #: modules/optin/classes/class-cartflows-optin-meta.php:419
1322
- #: modules/optin/classes/class-cartflows-optin-meta.php:531
1323
- msgid "Extra Large"
1324
- msgstr ""
1325
-
1326
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:684
1327
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:776
1328
- #: modules/optin/classes/class-cartflows-optin-meta.php:420
1329
- #: modules/optin/classes/class-cartflows-optin-meta.php:532
1330
- msgid "Custom"
1331
- msgstr ""
1332
-
1333
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:691
1334
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:783
1335
- #: modules/optin/classes/class-cartflows-optin-meta.php:427
1336
- #: modules/optin/classes/class-cartflows-optin-meta.php:539
1337
- msgid "Top Bottom Spacing"
1338
- msgstr ""
1339
-
1340
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:699
1341
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:791
1342
- #: modules/optin/classes/class-cartflows-optin-meta.php:435
1343
- #: modules/optin/classes/class-cartflows-optin-meta.php:547
1344
- msgid "Left Right Spacing"
1345
- msgstr ""
1346
-
1347
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:707
1348
- #: modules/optin/classes/class-cartflows-optin-meta.php:451
1349
- msgid "Text / Placeholder Color"
1350
- msgstr ""
1351
-
1352
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:715
1353
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:815
1354
- #: modules/optin/classes/class-cartflows-optin-meta.php:459
1355
- #: modules/optin/classes/class-cartflows-optin-meta.php:584
1356
- msgid "Background Color"
1357
- msgstr ""
1358
-
1359
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:723
1360
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:831
1361
- #: modules/optin/classes/class-cartflows-optin-meta.php:467
1362
- #: modules/optin/classes/class-cartflows-optin-meta.php:600
1363
- msgid "Border Color"
1364
- msgstr ""
1365
-
1366
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:730
1367
- #: modules/optin/classes/class-cartflows-optin-meta.php:443
1368
- msgid "Label Color"
1369
- msgstr ""
1370
-
1371
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:743
1372
- msgid "Buttons"
1373
- msgstr ""
1374
-
1375
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:799
1376
- #: modules/optin/classes/class-cartflows-optin-meta.php:568
1377
- msgid "Text Color"
1378
- msgstr ""
1379
-
1380
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:807
1381
- #: modules/optin/classes/class-cartflows-optin-meta.php:576
1382
- msgid "Text Hover Color"
1383
- msgstr ""
1384
-
1385
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:823
1386
- #: modules/optin/classes/class-cartflows-optin-meta.php:592
1387
- msgid "Background Hover Color"
1388
- msgstr ""
1389
-
1390
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:839
1391
- #: modules/optin/classes/class-cartflows-optin-meta.php:608
1392
- msgid "Border Hover Color"
1393
- msgstr ""
1394
-
1395
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:852
1396
- msgid "Sections"
1397
- msgstr ""
1398
-
1399
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:858
1400
- msgid "Highlight Area Background Color"
1401
- msgstr ""
1402
-
1403
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:897
1404
- msgid "Header Logo"
1405
- msgstr ""
1406
-
1407
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:905
1408
- msgid "Logo Width (In px)"
1409
- msgstr ""
1410
-
1411
- #: modules/checkout/templates/wcf-template.php:46
1412
- msgid "Copyright &copy;"
1413
- msgstr ""
1414
-
1415
- #: modules/checkout/templates/wcf-template.php:50
1416
- msgid "All Rights Reserved"
1417
- msgstr ""
1418
-
1419
- #: modules/flow/classes/class-cartflows-flow-meta.php:263
1420
- #. translators: %s flow id
1421
- msgid "Step not deleted for flow - %s"
1422
- msgstr ""
1423
-
1424
- #: modules/flow/classes/class-cartflows-flow-meta.php:294
1425
- #. translators: %s flow id
1426
- msgid "Step deleted for flow - %s"
1427
- msgstr ""
1428
-
1429
- #: modules/flow/classes/class-cartflows-flow-meta.php:322
1430
- #. translators: %s flow id
1431
- msgid "Steps not sorted for flow - %s"
1432
- msgstr ""
1433
-
1434
- #: modules/flow/classes/class-cartflows-flow-meta.php:345
1435
- #. translators: %s flow id
1436
- msgid "Steps sorted for flow - %s"
1437
- msgstr ""
1438
-
1439
- #: modules/flow/classes/class-cartflows-flow-meta.php:456
1440
- msgid "Analytics"
1441
- msgstr ""
1442
-
1443
- #: modules/flow/classes/class-cartflows-flow-meta.php:473
1444
- #. translators: %s: link
1445
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1446
- msgstr ""
1447
-
1448
- #: modules/flow/classes/class-cartflows-flow-meta.php:491
1449
- msgid "Flow Settings"
1450
- msgstr ""
1451
-
1452
- #: modules/flow/classes/class-cartflows-flow-meta.php:576
1453
- msgid "Enable Test Mode"
1454
- msgstr ""
1455
-
1456
- #: modules/flow/classes/class-cartflows-flow-meta.php:583
1457
- msgid ""
1458
- "If you are using WooCommerce plugin then test mode will add random products "
1459
- "in your flow, so you can preview it easily while testing."
1460
- msgstr ""
1461
-
1462
- #: modules/flow/classes/class-cartflows-flow-meta.php:702
1463
- #: modules/flow/view/meta-flow-steps.php:133
1464
- msgid "Add New Step"
1465
- msgstr ""
1466
-
1467
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1468
- msgid "Flow: "
1469
- msgstr ""
1470
-
1471
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1472
- msgid "Name: "
1473
- msgstr ""
1474
-
1475
- #: modules/flow/classes/class-cartflows-flow-post-type.php:101
1476
- msgid "Search Flows"
1477
- msgstr ""
1478
-
1479
- #: modules/flow/classes/class-cartflows-flow-post-type.php:102
1480
- msgid "All Flows"
1481
- msgstr ""
1482
-
1483
- #: modules/flow/classes/class-cartflows-flow-post-type.php:103
1484
- msgid "Edit Flow"
1485
- msgstr ""
1486
-
1487
- #: modules/flow/classes/class-cartflows-flow-post-type.php:104
1488
- msgid "View Flow"
1489
- msgstr ""
1490
-
1491
- #: modules/flow/classes/class-cartflows-flow-post-type.php:105
1492
- #: modules/flow/classes/class-cartflows-flow-post-type.php:107
1493
- #: modules/flow/classes/class-cartflows-step-post-type.php:167
1494
- #: modules/flow/classes/class-cartflows-step-post-type.php:169
1495
- msgid "Add New"
1496
- msgstr ""
1497
-
1498
- #: modules/flow/classes/class-cartflows-flow-post-type.php:106
1499
- msgid "Update Flow"
1500
- msgstr ""
1501
-
1502
- #: modules/flow/classes/class-cartflows-flow-post-type.php:108
1503
- msgid "New Flow Name"
1504
- msgstr ""
1505
-
1506
- #: modules/flow/classes/class-cartflows-flow-post-type.php:190
1507
- msgid "Upgrade to CartFlows Pro"
1508
- msgstr ""
1509
-
1510
- #: modules/flow/classes/class-cartflows-flow-post-type.php:209
1511
- msgid "Slug"
1512
- msgstr ""
1513
-
1514
- #: modules/flow/classes/class-cartflows-flow-post-type.php:332
1515
- msgid "Flows"
1516
- msgstr ""
1517
-
1518
- #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1519
- #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1520
- #: modules/flow/classes/class-cartflows-step-post-type.php:401
1521
- #: modules/flow/classes/class-cartflows-step-post-type.php:407
1522
- #. translators: %s: singular custom post type name
1523
- msgid "%s updated."
1524
- msgstr ""
1525
-
1526
- #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1527
- #: modules/flow/classes/class-cartflows-step-post-type.php:403
1528
- #. translators: %s: singular custom post type name
1529
- msgid "Custom %s updated."
1530
- msgstr ""
1531
-
1532
- #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1533
- #: modules/flow/classes/class-cartflows-step-post-type.php:405
1534
- #. translators: %s: singular custom post type name
1535
- msgid "Custom %s deleted."
1536
- msgstr ""
1537
-
1538
- #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1539
- #: modules/flow/classes/class-cartflows-step-post-type.php:409
1540
- #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1541
- #. the revision
1542
- msgid "%1$s restored to revision from %2$s"
1543
- msgstr ""
1544
-
1545
- #: modules/flow/classes/class-cartflows-flow-post-type.php:364
1546
- #: modules/flow/classes/class-cartflows-step-post-type.php:411
1547
- #. translators: %s: singular custom post type name
1548
- msgid "%s published."
1549
- msgstr ""
1550
-
1551
- #: modules/flow/classes/class-cartflows-flow-post-type.php:366
1552
- #: modules/flow/classes/class-cartflows-step-post-type.php:413
1553
- #. translators: %s: singular custom post type name
1554
- msgid "%s saved."
1555
- msgstr ""
1556
-
1557
- #: modules/flow/classes/class-cartflows-flow-post-type.php:368
1558
- #: modules/flow/classes/class-cartflows-step-post-type.php:415
1559
- #. translators: %s: singular custom post type name
1560
- msgid "%s submitted."
1561
- msgstr ""
1562
-
1563
- #: modules/flow/classes/class-cartflows-flow-post-type.php:370
1564
- #: modules/flow/classes/class-cartflows-step-post-type.php:417
1565
- #. translators: %s: singular custom post type name
1566
- msgid "%s scheduled for."
1567
- msgstr ""
1568
-
1569
- #: modules/flow/classes/class-cartflows-flow-post-type.php:372
1570
- #: modules/flow/classes/class-cartflows-step-post-type.php:419
1571
- #. translators: %s: singular custom post type name
1572
- msgid "%s draft updated."
1573
- msgstr ""
1574
-
1575
- #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1576
- #: modules/widgets/class-cartflows-next-step.php:78
1577
- msgid "Next Step"
1578
- msgstr ""
1579
-
1580
- #: modules/flow/classes/class-cartflows-step-post-type.php:163
1581
- msgid "Search Steps"
1582
- msgstr ""
1583
-
1584
- #: modules/flow/classes/class-cartflows-step-post-type.php:164
1585
- msgid "All Steps"
1586
- msgstr ""
1587
-
1588
- #: modules/flow/classes/class-cartflows-step-post-type.php:165
1589
- #: modules/flow/view/meta-flow-steps.php:106
1590
- msgid "Edit Step"
1591
- msgstr ""
1592
-
1593
- #: modules/flow/classes/class-cartflows-step-post-type.php:166
1594
- #: modules/flow/view/meta-flow-steps.php:102
1595
- msgid "View Step"
1596
- msgstr ""
1597
-
1598
- #: modules/flow/classes/class-cartflows-step-post-type.php:168
1599
- msgid "Update Step"
1600
- msgstr ""
1601
-
1602
- #: modules/flow/classes/class-cartflows-step-post-type.php:170
1603
- msgid "New Step Name"
1604
- msgstr ""
1605
-
1606
- #: modules/flow/classes/class-cartflows-step-post-type.php:211
1607
- msgid "Step Type"
1608
- msgstr ""
1609
-
1610
- #: modules/flow/classes/class-cartflows-step-post-type.php:221
1611
- msgid "Step Flow"
1612
- msgstr ""
1613
-
1614
- #: modules/flow/classes/class-cartflows-step-post-type.php:246
1615
- #: modules/flow/view/meta-flow-steps.php:16
1616
- msgid "Optin (Woo)"
1617
- msgstr ""
1618
-
1619
- #: modules/flow/classes/class-cartflows-step-post-type.php:267
1620
- #: modules/flow/view/meta-flow-steps.php:14
1621
- msgid "Upsell (Woo)"
1622
- msgstr ""
1623
-
1624
- #: modules/flow/classes/class-cartflows-step-post-type.php:274
1625
- #: modules/flow/view/meta-flow-steps.php:15
1626
- msgid "Downsell (Woo)"
1627
- msgstr ""
1628
-
1629
- #: modules/flow/view/meta-flow-steps.php:85
1630
- msgid "No Product Assigned"
1631
- msgstr ""
1632
-
1633
- #: modules/flow/view/meta-flow-steps.php:89
1634
- msgid "Global Checkout - Remove selected checkout product"
1635
- msgstr ""
1636
-
1637
- #: modules/flow/view/meta-flow-steps.php:108
1638
- msgid "Edit"
1639
- msgstr ""
1640
-
1641
- #: modules/flow/view/meta-flow-steps.php:113
1642
- msgid "Clone Step"
1643
- msgstr ""
1644
-
1645
- #: modules/flow/view/meta-flow-steps.php:118
1646
- msgid "Delete Step"
1647
- msgstr ""
1648
-
1649
- #: modules/flow/view/meta-flow-steps.php:120
1650
- msgid "Delete"
1651
- msgstr ""
1652
-
1653
- #: modules/flow/view/meta-flow-steps.php:149
1654
- msgid "Steps Library"
1655
- msgstr ""
1656
-
1657
- #: modules/flow/view/meta-flow-steps.php:198
1658
- msgid "Create Step"
1659
- msgstr ""
1660
-
1661
- #: modules/flow/view/meta-flow-steps.php:200
1662
- msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1663
- msgstr ""
1664
-
1665
- #: modules/landing/classes/class-cartflows-landing-meta.php:66
1666
- msgid "Landing Page Settings"
1667
- msgstr ""
1668
-
1669
- #: modules/landing/classes/class-cartflows-landing-meta.php:169
1670
- msgid "Next Step Link"
1671
- msgstr ""
1672
-
1673
- #: modules/optin/classes/class-cartflows-optin-markup.php:165
1674
- msgid "Please place shortcode on Optin step-type only."
1675
- msgstr ""
1676
-
1677
- #: modules/optin/classes/class-cartflows-optin-markup.php:225
1678
- msgid ""
1679
- "No product is selected. Please select a Simple, Virtual and Free product "
1680
- "from the meta settings."
1681
- msgstr ""
1682
-
1683
- #: modules/optin/classes/class-cartflows-optin-markup.php:242
1684
- msgid "Please update the selected product's price to zero (0)."
1685
- msgstr ""
1686
-
1687
- #: modules/optin/classes/class-cartflows-optin-markup.php:251
1688
- #: modules/optin/classes/class-cartflows-optin-markup.php:255
1689
- msgid "Please select a Simple, Virtual and Free product."
1690
- msgstr ""
1691
-
1692
- #: modules/optin/classes/class-cartflows-optin-meta.php:65
1693
- msgid "Optin Settings"
1694
- msgstr ""
1695
-
1696
- #: modules/optin/classes/class-cartflows-optin-meta.php:138
1697
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1698
- msgid "Design"
1699
- msgstr ""
1700
-
1701
- #: modules/optin/classes/class-cartflows-optin-meta.php:144
1702
- msgid "Form Fields"
1703
- msgstr ""
1704
-
1705
- #: modules/optin/classes/class-cartflows-optin-meta.php:213
1706
- msgid "Add this shortcode to your optin page"
1707
- msgstr ""
1708
-
1709
- #: modules/optin/classes/class-cartflows-optin-meta.php:238
1710
- msgid "Select Free Product"
1711
- msgstr ""
1712
-
1713
- #: modules/optin/classes/class-cartflows-optin-meta.php:239
1714
- msgid "Select Free and Virtual product only."
1715
- msgstr ""
1716
-
1717
- #: modules/optin/classes/class-cartflows-optin-meta.php:293
1718
- msgid "Pass Fields as URL Parameters"
1719
- msgstr ""
1720
-
1721
- #: modules/optin/classes/class-cartflows-optin-meta.php:296
1722
- msgid "Enable"
1723
- msgstr ""
1724
-
1725
- #: modules/optin/classes/class-cartflows-optin-meta.php:297
1726
- msgid ""
1727
- "You can pass specific fields from the form to next step as URL query "
1728
- "parameters."
1729
- msgstr ""
1730
-
1731
- #: modules/optin/classes/class-cartflows-optin-meta.php:308
1732
- msgid "Enter form field"
1733
- msgstr ""
1734
-
1735
- #: modules/optin/classes/class-cartflows-optin-meta.php:311
1736
- #: modules/optin/classes/class-cartflows-optin-meta.php:321
1737
- msgid "Enter comma seprated field name. E.g. first_name, last_name"
1738
- msgstr ""
1739
-
1740
- #: modules/optin/classes/class-cartflows-optin-meta.php:313
1741
- msgid "Fields to pass, separated by commas"
1742
- msgstr ""
1743
-
1744
- #: modules/optin/classes/class-cartflows-optin-meta.php:323
1745
- #. translators: %s: link
1746
- msgid ""
1747
- "You can pass field value as a URL parameter to the next step. %1$sClick "
1748
- "here%2$s for more information."
1749
- msgstr ""
1750
-
1751
- #: modules/optin/classes/class-cartflows-optin-meta.php:480
1752
- msgid "Submit Button"
1753
- msgstr ""
1754
-
1755
- #: modules/optin/classes/class-cartflows-optin-meta.php:486
1756
- msgid "Button Text"
1757
- msgstr ""
1758
-
1759
- #: modules/optin/classes/class-cartflows-optin-meta.php:497
1760
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1761
- msgid "Font Size"
1762
- msgstr ""
1763
-
1764
- #: modules/optin/classes/class-cartflows-optin-meta.php:555
1765
- msgid "Position"
1766
- msgstr ""
1767
-
1768
- #: modules/optin/classes/class-cartflows-optin-meta.php:559
1769
- msgid "Left"
1770
- msgstr ""
1771
-
1772
- #: modules/optin/classes/class-cartflows-optin-meta.php:560
1773
- msgid "Center"
1774
- msgstr ""
1775
-
1776
- #: modules/optin/classes/class-cartflows-optin-meta.php:561
1777
- msgid "Right"
1778
- msgstr ""
1779
-
1780
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1781
- msgid "Thank You Page Settings"
1782
- msgstr ""
1783
-
1784
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1785
- msgid "Edit Fields"
1786
- msgstr ""
1787
-
1788
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:182
1789
- msgid "Order Details"
1790
- msgstr ""
1791
-
1792
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:194
1793
- msgid "Text"
1794
- msgstr ""
1795
-
1796
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:200
1797
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:231
1798
- msgid "Color"
1799
- msgstr ""
1800
-
1801
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:257
1802
- msgid "Advanced Options"
1803
- msgstr ""
1804
-
1805
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:267
1806
- msgid "Container Width (In px)"
1807
- msgstr ""
1808
-
1809
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1810
- msgid "Section Background Color"
1811
- msgstr ""
1812
-
1813
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:289
1814
- msgid "Enable Order Overview "
1815
- msgstr ""
1816
-
1817
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:297
1818
- msgid "Enable Order Details "
1819
- msgstr ""
1820
-
1821
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:305
1822
- msgid "Enable Billing Details "
1823
- msgstr ""
1824
-
1825
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:313
1826
- msgid "Enable Shipping Details "
1827
- msgstr ""
1828
-
1829
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:329
1830
- msgid "Thank You Page Text"
1831
- msgstr ""
1832
-
1833
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
1834
- #: woocommerce/template/checkout/thankyou.php:41
1835
- #: woocommerce/template/checkout/thankyou.php:83
1836
- msgid "Thank you. Your order has been received."
1837
- msgstr ""
1838
-
1839
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:335
1840
- msgid "It will change the default text on thank you page."
1841
- msgstr ""
1842
-
1843
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:343
1844
- msgid "Redirect After Purchase"
1845
- msgstr ""
1846
-
1847
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:352
1848
- msgid "Redirect Link"
1849
- msgstr ""
1850
-
1851
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:356
1852
- msgid "https://"
1853
- msgstr ""
1854
-
1855
- #: modules/widgets/class-cartflows-next-step.php:24
1856
- msgid "CartFlows Next Step"
1857
- msgstr ""
1858
-
1859
- #: modules/widgets/class-cartflows-next-step.php:26
1860
- msgid "Next Step Widgets"
1861
- msgstr ""
1862
-
1863
- #: modules/widgets/class-cartflows-next-step.php:106
1864
- msgid "New title"
1865
- msgstr ""
1866
-
1867
- #: modules/widgets/class-cartflows-next-step.php:123
1868
- msgid "Title:"
1869
- msgstr ""
1870
-
1871
- #: modules/widgets/class-cartflows-next-step.php:127
1872
- msgid "Flow ID:"
1873
- msgstr ""
1874
-
1875
- #: modules/widgets/class-cartflows-next-step.php:131
1876
- msgid "Step ID:"
1877
- msgstr ""
1878
-
1879
- #: woocommerce/template/cart/cart-shipping.php:51
1880
- #. Translators: $s shipping destination.
1881
- msgid "Estimate for %s."
1882
- msgstr ""
1883
-
1884
- #: woocommerce/template/cart/cart-shipping.php:52
1885
- msgid "Change address"
1886
- msgstr ""
1887
-
1888
- #: woocommerce/template/cart/cart-shipping.php:54
1889
- msgid "This is only an estimate. Prices will be updated during checkout."
1890
- msgstr ""
1891
-
1892
- #: woocommerce/template/cart/cart-shipping.php:61
1893
- msgid "Enter your address to view shipping options."
1894
- msgstr ""
1895
-
1896
- #: woocommerce/template/cart/cart-shipping.php:63
1897
- msgid ""
1898
- "There are no shipping methods available. Please ensure that your address "
1899
- "has been entered correctly, or contact us if you need any help."
1900
- msgstr ""
1901
-
1902
- #: woocommerce/template/cart/cart-shipping.php:66
1903
- #. Translators: $s shipping destination.
1904
- msgid "No shipping options were found for %s."
1905
- msgstr ""
1906
-
1907
- #: woocommerce/template/cart/cart-shipping.php:67
1908
- msgid "Enter a different address"
1909
- msgstr ""
1910
-
1911
- #: woocommerce/template/checkout/form-billing.php:27
1912
- msgid "Billing &amp; Shipping"
1913
- msgstr ""
1914
-
1915
- #: woocommerce/template/checkout/form-billing.php:31
1916
- msgid "Billing details"
1917
- msgstr ""
1918
-
1919
- #: woocommerce/template/checkout/form-billing.php:59
1920
- msgid "Create an account?"
1921
- msgstr ""
1922
-
1923
- #: woocommerce/template/checkout/form-checkout.php:26
1924
- msgid "You must be logged in to checkout."
1925
- msgstr ""
1926
-
1927
- #: woocommerce/template/checkout/form-checkout.php:52
1928
- msgid "Your order"
1929
- msgstr ""
1930
-
1931
- #: woocommerce/template/checkout/form-coupon.php:26
1932
- msgid "Have a coupon?"
1933
- msgstr ""
1934
-
1935
- #: woocommerce/template/checkout/form-coupon.php:26
1936
- msgid "Click here to enter your code"
1937
- msgstr ""
1938
-
1939
- #: woocommerce/template/checkout/form-coupon.php:31
1940
- msgid "If you have a coupon code, please apply it below."
1941
- msgstr ""
1942
-
1943
- #: woocommerce/template/checkout/form-coupon.php:34
1944
- msgid "Coupon code"
1945
- msgstr ""
1946
-
1947
- #: woocommerce/template/checkout/form-coupon.php:38
1948
- msgid "Apply coupon"
1949
- msgstr ""
1950
-
1951
- #: woocommerce/template/checkout/form-login.php:26
1952
- msgid "Returning customer?"
1953
- msgstr ""
1954
-
1955
- #: woocommerce/template/checkout/form-login.php:26
1956
- msgid "Click here to login"
1957
- msgstr ""
1958
-
1959
- #: woocommerce/template/checkout/form-login.php:32
1960
- msgid ""
1961
- "If you have shopped with us before, please enter your details below. If you "
1962
- "are a new customer, please proceed to the Billing &amp; Shipping section."
1963
- msgstr ""
1964
-
1965
- #: woocommerce/template/checkout/form-shipping.php:26
1966
- msgid "Ship to a different address?"
1967
- msgstr ""
1968
-
1969
- #: woocommerce/template/checkout/form-shipping.php:57
1970
- msgid "Additional information"
1971
- msgstr ""
1972
-
1973
- #: woocommerce/template/checkout/payment.php:33
1974
- msgid ""
1975
- "Sorry, it seems that there are no available payment methods for your state. "
1976
- "Please contact us if you require assistance or wish to make alternate "
1977
- "arrangements."
1978
- msgstr ""
1979
-
1980
- #: woocommerce/template/checkout/payment.php:33
1981
- msgid "Please fill in your details above to see available payment methods."
1982
- msgstr ""
1983
-
1984
- #: woocommerce/template/checkout/payment.php:42
1985
- #. translators: $1 and $2 opening and closing emphasis tags respectively
1986
- msgid ""
1987
- "Since your browser does not support JavaScript, or it is disabled, please "
1988
- "ensure you click the %1$sUpdate Totals%2$s button before placing your "
1989
- "order. You may be charged more than the amount stated above if you fail to "
1990
- "do so."
1991
- msgstr ""
1992
-
1993
- #: woocommerce/template/checkout/payment.php:44
1994
- msgid "Update totals"
1995
- msgstr ""
1996
-
1997
- #: woocommerce/template/checkout/review-order.php:26
1998
- #: woocommerce/template/order/order-details.php:51
1999
- msgid "Product"
2000
- msgstr ""
2001
-
2002
- #: woocommerce/template/checkout/review-order.php:27
2003
- #: woocommerce/template/checkout/review-order.php:107
2004
- #: woocommerce/template/order/order-details.php:52
2005
- msgid "Total"
2006
- msgstr ""
2007
-
2008
- #: woocommerce/template/checkout/review-order.php:60
2009
- msgid "Subtotal"
2010
- msgstr ""
2011
-
2012
- #: woocommerce/template/checkout/thankyou.php:30
2013
- msgid ""
2014
- "Unfortunately your order cannot be processed as the originating "
2015
- "bank/merchant has declined your transaction. Please attempt your purchase "
2016
- "again."
2017
- msgstr ""
2018
-
2019
- #: woocommerce/template/checkout/thankyou.php:33
2020
- msgid "Pay"
2021
- msgstr ""
2022
-
2023
- #: woocommerce/template/checkout/thankyou.php:35
2024
- msgid "My account"
2025
- msgstr ""
2026
-
2027
- #: woocommerce/template/checkout/thankyou.php:46
2028
- msgid "Order number:"
2029
- msgstr ""
2030
-
2031
- #: woocommerce/template/checkout/thankyou.php:51
2032
- msgid "Date:"
2033
- msgstr ""
2034
-
2035
- #: woocommerce/template/checkout/thankyou.php:57
2036
- msgid "Email:"
2037
- msgstr ""
2038
-
2039
- #: woocommerce/template/checkout/thankyou.php:63
2040
- msgid "Total:"
2041
- msgstr ""
2042
-
2043
- #: woocommerce/template/checkout/thankyou.php:69
2044
- msgid "Payment method:"
2045
- msgstr ""
2046
-
2047
- #: woocommerce/template/global/form-login.php:34
2048
- msgid "Username or email"
2049
- msgstr ""
2050
-
2051
- #: woocommerce/template/global/form-login.php:38
2052
- msgid "Password"
2053
- msgstr ""
2054
-
2055
- #: woocommerce/template/global/form-login.php:48
2056
- msgid "Login"
2057
- msgstr ""
2058
-
2059
- #: woocommerce/template/global/form-login.php:53
2060
- msgid "Remember me"
2061
- msgstr ""
2062
-
2063
- #: woocommerce/template/global/form-login.php:57
2064
- msgid "Lost your password?"
2065
- msgstr ""
2066
-
2067
- #: woocommerce/template/order/order-details.php:45
2068
- msgid "Order details"
2069
- msgstr ""
2070
-
2071
- #: woocommerce/template/order/order-details.php:93
2072
- msgid "Note:"
2073
- msgstr ""
2074
-
2075
- #. Plugin Name of the plugin/theme
2076
- msgid "CartFlows"
2077
- msgstr ""
2078
-
2079
- #. Author URI of the plugin/theme
2080
- msgid "https://cartflows.com/"
2081
- msgstr ""
2082
-
2083
- #. Description of the plugin/theme
2084
- msgid "Create beautiful checkout pages & sales flows for WooCommerce."
2085
- msgstr ""
2086
-
2087
- #. Author of the plugin/theme
2088
- msgid "CartFlows Inc"
2089
- msgstr ""
2090
-
2091
- #: modules/flow/classes/class-cartflows-flow-post-type.php:99
2092
- msgctxt "flow general name"
2093
- msgid "Flows"
2094
- msgstr ""
2095
-
2096
- #: modules/flow/classes/class-cartflows-flow-post-type.php:100
2097
- msgctxt "flow singular name"
2098
- msgid "Flow"
2099
- msgstr ""
2100
-
2101
- #: modules/flow/classes/class-cartflows-step-post-type.php:161
2102
- msgctxt "flow step general name"
2103
- msgid "Steps"
2104
- msgstr ""
2105
-
2106
- #: modules/flow/classes/class-cartflows-step-post-type.php:162
2107
- msgctxt "flow step singular name"
2108
- msgid "Step"
2109
- msgstr ""
2110
-
2111
- #: modules/flow/classes/class-cartflows-step-post-type.php:315
2112
- msgctxt "cartflows"
2113
- msgid "CartFlows — Boxed"
2114
- msgstr ""
2115
-
2116
- #: modules/flow/classes/class-cartflows-step-post-type.php:316
2117
- msgctxt "cartflows"
2118
- msgid "Template for Page Builders"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2119
  msgstr ""
1
+ # Copyright (C) 2020 CartFlows Inc
2
+ # This file is distributed under the same license as the CartFlows package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: CartFlows 1.5.15\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2020-08-12 08:20:50+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "Language: en\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Country: United States\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: "
19
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
+ "X-Poedit-Basepath: ../\n"
22
+ "X-Poedit-SearchPath-0: .\n"
23
+ "X-Poedit-Bookmarks: \n"
24
+ "X-Textdomain-Support: yes\n"
25
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
26
+
27
+ #: admin/bsf-analytics/class-bsf-analytics.php:211
28
+ #. translators: %s product name
29
+ msgid ""
30
+ "Want to help make <strong>%1s</strong> even more awesome? Allow us to "
31
+ "collect non-sensitive diagnostic data and usage information. "
32
+ msgstr ""
33
+
34
+ #: admin/bsf-analytics/class-bsf-analytics.php:214
35
+ msgid "This will be applicable for all sites from the network."
36
+ msgstr ""
37
+
38
+ #: admin/bsf-analytics/class-bsf-analytics.php:238
39
+ #. translators: %s usage doc link
40
+ msgid " Know More."
41
+ msgstr ""
42
+
43
+ #: admin/bsf-analytics/class-bsf-analytics.php:246
44
+ msgid "Yes! Allow it"
45
+ msgstr ""
46
+
47
+ #: admin/bsf-analytics/class-bsf-analytics.php:255
48
+ msgid "No Thanks"
49
+ msgstr ""
50
+
51
+ #: admin/bsf-analytics/class-bsf-analytics.php:359
52
+ msgid "Usage Tracking"
53
+ msgstr ""
54
+
55
+ #: admin/bsf-analytics/class-bsf-analytics.php:403
56
+ #. translators: %s Product title
57
+ msgid "Allow %s products to track non-sensitive usage tracking data."
58
+ msgstr ""
59
+
60
+ #: admin/bsf-analytics/class-bsf-analytics.php:406
61
+ msgid " This will be applicable for all sites from the network."
62
+ msgstr ""
63
+
64
+ #: admin/bsf-analytics/class-bsf-analytics.php:411
65
+ msgid "Learn More."
66
+ msgstr ""
67
+
68
+ #: classes/batch-process/class-cartflows-importer-elementor.php:44
69
+ msgid "Invalid content."
70
+ msgstr ""
71
+
72
+ #: classes/batch-process/class-cartflows-importer-elementor.php:56
73
+ msgid "Invalid content. Expected an array."
74
+ msgstr ""
75
+
76
+ #: classes/batch-process/helpers/class-wp-background-process.php:435
77
+ msgid "Every %d Minutes"
78
+ msgstr ""
79
+
80
+ #: classes/class-cartflows-admin-fields.php:235
81
+ msgid "Select"
82
+ msgstr ""
83
+
84
+ #: classes/class-cartflows-admin-fields.php:238
85
+ msgid "No Checkout Steps"
86
+ msgstr ""
87
+
88
+ #: classes/class-cartflows-admin-fields.php:264
89
+ #. translators: %s: link
90
+ msgid ""
91
+ "Be sure not to add any product in above selected Global Checkout step. "
92
+ "Please read information about how to set up Global Checkout %1$shere%2$s."
93
+ msgstr ""
94
+
95
+ #: classes/class-cartflows-admin.php:159 includes/admin/cartflows-home.php:11
96
+ msgid "Home"
97
+ msgstr ""
98
+
99
+ #: classes/class-cartflows-admin.php:164 classes/class-cartflows-admin.php:165
100
+ #: modules/optin/classes/class-cartflows-optin-meta.php:150
101
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
102
+ msgid "Settings"
103
+ msgstr ""
104
+
105
+ #: classes/class-cartflows-admin.php:453
106
+ msgid "Installing and activating.."
107
+ msgstr ""
108
+
109
+ #: classes/class-cartflows-admin.php:454
110
+ msgid "There was an error with the installation of plugin."
111
+ msgstr ""
112
+
113
+ #: classes/class-cartflows-admin.php:516
114
+ msgid "Flows Library"
115
+ msgstr ""
116
+
117
+ #: classes/class-cartflows-admin.php:523
118
+ #: modules/flow/view/view-remote-importer.php:26
119
+ msgid "Ready Templates"
120
+ msgstr ""
121
+
122
+ #: classes/class-cartflows-admin.php:526
123
+ #: modules/flow/view/view-remote-importer.php:29
124
+ msgid "Create Your Own"
125
+ msgstr ""
126
+
127
+ #: classes/class-cartflows-admin.php:537
128
+ #: modules/flow/view/view-remote-importer.php:41
129
+ msgid "Search Sites"
130
+ msgstr ""
131
+
132
+ #: classes/class-cartflows-admin.php:538
133
+ #: modules/flow/view/view-remote-importer.php:42
134
+ msgid "Search Flow..."
135
+ msgstr ""
136
+
137
+ #: classes/class-cartflows-admin.php:555
138
+ msgid "Design Your Flow"
139
+ msgstr ""
140
+
141
+ #: classes/class-cartflows-admin.php:556
142
+ #: classes/class-cartflows-importer.php:665
143
+ #: classes/class-cartflows-importer.php:764
144
+ #: modules/flow/view/view-remote-importer.php:72
145
+ msgid "Learn How"
146
+ msgstr ""
147
+
148
+ #: classes/class-cartflows-api.php:369
149
+ msgid "Request successfully processed!"
150
+ msgstr ""
151
+
152
+ #: classes/class-cartflows-cloning.php:284
153
+ #. translators: %s flow id
154
+ msgid "Can't clone this step - %1$s. Flow - %2$s"
155
+ msgstr ""
156
+
157
+ #: classes/class-cartflows-cloning.php:401
158
+ #. translators: %s flow id
159
+ msgid "Step - %1$s cloned. Flow - %2$s"
160
+ msgstr ""
161
+
162
+ #: classes/class-cartflows-cloning.php:427
163
+ msgid "Clone this flow"
164
+ msgstr ""
165
+
166
+ #: classes/class-cartflows-cloning.php:427
167
+ #: modules/flow/classes/class-cartflows-flow-meta.php:824
168
+ msgid "Clone"
169
+ msgstr ""
170
+
171
+ #: classes/class-cartflows-default-meta.php:745
172
+ #: modules/optin/classes/class-cartflows-optin-meta.php:490
173
+ msgid "Submit"
174
+ msgstr ""
175
+
176
+ #: classes/class-cartflows-flow-frontend.php:53
177
+ msgid ""
178
+ "Test mode is active — which displays random products for previewing. It can "
179
+ "be deactivated from the flow settings in the admin dashboard."
180
+ msgstr ""
181
+
182
+ #: classes/class-cartflows-flow-frontend.php:58
183
+ msgid "Click here to disable it"
184
+ msgstr ""
185
+
186
+ #: classes/class-cartflows-importer.php:81
187
+ msgid "Export this flow"
188
+ msgstr ""
189
+
190
+ #: classes/class-cartflows-importer.php:81 includes/exporter.php:18
191
+ msgid "Export"
192
+ msgstr ""
193
+
194
+ #: classes/class-cartflows-importer.php:92
195
+ msgid "Flow Export"
196
+ msgstr ""
197
+
198
+ #: classes/class-cartflows-importer.php:93
199
+ msgid "Flow Import"
200
+ msgstr ""
201
+
202
+ #: classes/class-cartflows-importer.php:104
203
+ msgid "No post to export has been supplied!"
204
+ msgstr ""
205
+
206
+ #: classes/class-cartflows-importer.php:278
207
+ msgid "Please upload a valid .json file"
208
+ msgstr ""
209
+
210
+ #: classes/class-cartflows-importer.php:284
211
+ msgid "Please upload a file to import"
212
+ msgstr ""
213
+
214
+ #: classes/class-cartflows-importer.php:506
215
+ msgid "Successfully imported flows."
216
+ msgstr ""
217
+
218
+ #: classes/class-cartflows-importer.php:538
219
+ msgid "Loading Steps"
220
+ msgstr ""
221
+
222
+ #: classes/class-cartflows-importer.php:540
223
+ msgid "Getting steps from the cloud. Please wait for the moment."
224
+ msgstr ""
225
+
226
+ #: classes/class-cartflows-importer.php:551
227
+ msgid "Searching Template.."
228
+ msgstr ""
229
+
230
+ #: classes/class-cartflows-importer.php:553
231
+ msgid "Getting templates from the cloud. Please wait for the moment."
232
+ msgstr ""
233
+
234
+ #: classes/class-cartflows-importer.php:562
235
+ msgid "Importing.."
236
+ msgstr ""
237
+
238
+ #: classes/class-cartflows-importer.php:571
239
+ #: classes/class-cartflows-importer.php:611
240
+ msgid "Imported"
241
+ msgstr ""
242
+
243
+ #: classes/class-cartflows-importer.php:572
244
+ #: classes/class-cartflows-importer.php:612
245
+ msgid "Thanks for patience"
246
+ msgstr ""
247
+
248
+ #: classes/class-cartflows-importer.php:581
249
+ #: classes/class-cartflows-importer.php:593
250
+ msgid "Coming Soon!"
251
+ msgstr ""
252
+
253
+ #: classes/class-cartflows-importer.php:612
254
+ msgid "Redirecting to the Elementor edit window."
255
+ msgstr ""
256
+
257
+ #: classes/class-cartflows-importer.php:658
258
+ #: classes/class-cartflows-importer.php:774
259
+ msgid "Pro"
260
+ msgstr ""
261
+
262
+ #: classes/class-cartflows-importer.php:699
263
+ #: classes/class-cartflows-importer.php:806
264
+ msgid "Activate License"
265
+ msgstr ""
266
+
267
+ #: classes/class-cartflows-importer.php:701
268
+ #: classes/class-cartflows-importer.php:808
269
+ #: modules/flow/classes/class-cartflows-flow-meta.php:503
270
+ msgid "Get Pro"
271
+ msgstr ""
272
+
273
+ #: classes/class-cartflows-importer.php:726
274
+ msgid "Create"
275
+ msgstr ""
276
+
277
+ #: classes/class-cartflows-importer.php:825
278
+ msgid "Under Maintenance.."
279
+ msgstr ""
280
+
281
+ #: classes/class-cartflows-importer.php:826
282
+ msgid ""
283
+ "If you are seeing this message, most likely our servers are under routine "
284
+ "maintenance and we will be back shortly."
285
+ msgstr ""
286
+
287
+ #: classes/class-cartflows-importer.php:827
288
+ msgid ""
289
+ "In rare case, it is possible your website is having trouble connecting with "
290
+ "ours. If you need help, please feel free to get in touch with us from our "
291
+ "website.."
292
+ msgstr ""
293
+
294
+ #: classes/class-cartflows-importer.php:857
295
+ #. translators: %s: Plugin string
296
+ msgid ""
297
+ "%1$s to see CartFlows templates. If you prefer another page builder tool, "
298
+ "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
299
+ msgstr ""
300
+
301
+ #: classes/class-cartflows-importer.php:872
302
+ msgid "All"
303
+ msgstr ""
304
+
305
+ #: classes/class-cartflows-importer.php:875
306
+ msgid "Select Step Type"
307
+ msgstr ""
308
+
309
+ #: classes/class-cartflows-importer.php:959
310
+ msgid "Import from Cloud"
311
+ msgstr ""
312
+
313
+ #: classes/class-cartflows-importer.php:1267
314
+ msgid "Sales Landing"
315
+ msgstr ""
316
+
317
+ #: classes/class-cartflows-importer.php:1271
318
+ #: modules/flow/classes/class-cartflows-step-post-type.php:253
319
+ #: modules/flow/view/meta-flow-steps.php:12
320
+ msgid "Checkout (Woo)"
321
+ msgstr ""
322
+
323
+ #: classes/class-cartflows-importer.php:1275
324
+ #: modules/flow/classes/class-cartflows-step-post-type.php:260
325
+ #: modules/flow/view/meta-flow-steps.php:13
326
+ msgid "Thank You (Woo)"
327
+ msgstr ""
328
+
329
+ #: classes/class-cartflows-importer.php:1283
330
+ #: modules/flow/classes/class-cartflows-step-post-type.php:239
331
+ #: modules/flow/view/meta-flow-steps.php:11
332
+ msgid "Landing"
333
+ msgstr ""
334
+
335
+ #: classes/class-cartflows-importer.php:1287
336
+ msgid "Thank You"
337
+ msgstr ""
338
+
339
+ #: classes/class-cartflows-importer.php:1397
340
+ #. translators: %s: template ID
341
+ msgid "Invalid template id %1$s or post id %2$s."
342
+ msgstr ""
343
+
344
+ #: classes/class-cartflows-importer.php:1472
345
+ #. translators: %s: flow ID
346
+ msgid "Invalid flow id %1$s OR step type %2$s."
347
+ msgstr ""
348
+
349
+ #: classes/class-cartflows-importer.php:1597
350
+ msgid ""
351
+ "Elementor is not activated. Please activate plugin Elementor Page Builder "
352
+ "to import the step."
353
+ msgstr ""
354
+
355
+ #: classes/class-cartflows-importer.php:1700
356
+ msgid "Action failed. Invalid Security Nonce."
357
+ msgstr ""
358
+
359
+ #: classes/class-cartflows-importer.php:1707
360
+ msgid "User have not plugin install permissions."
361
+ msgstr ""
362
+
363
+ #: classes/class-cartflows-importer.php:1729
364
+ msgid "Plugin Successfully Activated"
365
+ msgstr ""
366
+
367
+ #: classes/class-cartflows-learndash-compatibility.php:86
368
+ msgid "None"
369
+ msgstr ""
370
+
371
+ #: classes/class-cartflows-learndash-compatibility.php:113
372
+ #. translators: 1: anchor start, 2: anchor close
373
+ msgid ""
374
+ "Non-enrolled students will redirect to the selected CartFlows template. If "
375
+ "you have not created any Flow already, add new Flow from %1$shere%2$s."
376
+ msgstr ""
377
+
378
+ #: classes/class-cartflows-learndash-compatibility.php:119
379
+ msgid "Select CartFlows Template for this Course"
380
+ msgstr ""
381
+
382
+ #: classes/class-cartflows-loader.php:232
383
+ #. translators: %s: html tags
384
+ msgid ""
385
+ "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
386
+ "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
387
+ msgstr ""
388
+
389
+ #: classes/class-cartflows-loader.php:501
390
+ #. translators: %s: html tags
391
+ msgid ""
392
+ "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
393
+ "activated."
394
+ msgstr ""
395
+
396
+ #: classes/class-cartflows-loader.php:511
397
+ msgid "Activate WooCommerce"
398
+ msgstr ""
399
+
400
+ #: classes/class-cartflows-loader.php:519
401
+ msgid "Install WooCommerce"
402
+ msgstr ""
403
+
404
+ #: classes/class-cartflows-logger.php:161
405
+ msgid "Action failed. Please refresh the page and retry."
406
+ msgstr ""
407
+
408
+ #: classes/class-cartflows-meta-fields.php:61
409
+ msgid "Thin 100"
410
+ msgstr ""
411
+
412
+ #: classes/class-cartflows-meta-fields.php:62
413
+ msgid "Extra-Light 200"
414
+ msgstr ""
415
+
416
+ #: classes/class-cartflows-meta-fields.php:63
417
+ msgid "Light 300"
418
+ msgstr ""
419
+
420
+ #: classes/class-cartflows-meta-fields.php:64
421
+ msgid "Normal 400"
422
+ msgstr ""
423
+
424
+ #: classes/class-cartflows-meta-fields.php:65
425
+ msgid "Medium 500"
426
+ msgstr ""
427
+
428
+ #: classes/class-cartflows-meta-fields.php:66
429
+ msgid "Semi-Bold 600"
430
+ msgstr ""
431
+
432
+ #: classes/class-cartflows-meta-fields.php:67
433
+ msgid "Bold 700"
434
+ msgstr ""
435
+
436
+ #: classes/class-cartflows-meta-fields.php:68
437
+ msgid "Extra-Bold 800"
438
+ msgstr ""
439
+
440
+ #: classes/class-cartflows-meta-fields.php:69
441
+ msgid "Ultra-Bold 900"
442
+ msgstr ""
443
+
444
+ #: classes/class-cartflows-meta-fields.php:182
445
+ #. Translators: %d stock amount
446
+ msgid "Stock: %d"
447
+ msgstr ""
448
+
449
+ #: classes/class-cartflows-meta-fields.php:765
450
+ #: includes/meta-fields/generate-product-repeater.php:30
451
+ msgid "Search for a product&hellip;"
452
+ msgstr ""
453
+
454
+ #: classes/class-cartflows-meta-fields.php:816
455
+ msgid "Search for a coupon&hellip;"
456
+ msgstr ""
457
+
458
+ #: classes/class-cartflows-meta.php:34
459
+ msgid "Update"
460
+ msgstr ""
461
+
462
+ #: classes/class-cartflows-meta.php:42
463
+ #: modules/flow/classes/class-cartflows-flow-meta.php:95
464
+ #: modules/flow/classes/class-cartflows-flow-meta.php:763
465
+ msgid "Back to edit Flow"
466
+ msgstr ""
467
+
468
+ #: classes/class-cartflows-meta.php:63
469
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:198
470
+ #: modules/landing/classes/class-cartflows-landing-meta.php:136
471
+ #: modules/optin/classes/class-cartflows-optin-meta.php:156
472
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:154
473
+ msgid "Custom Script"
474
+ msgstr ""
475
+
476
+ #: classes/class-cartflows-meta.php:66
477
+ msgid ""
478
+ "Custom script lets you add your own custom script on front end of this flow "
479
+ "page."
480
+ msgstr ""
481
+
482
+ #: classes/class-cartflows-metabox.php:59
483
+ msgid "Flow Details"
484
+ msgstr ""
485
+
486
+ #: classes/class-cartflows-wizard.php:94
487
+ msgid "Thanks for installing and using CartFlows!"
488
+ msgstr ""
489
+
490
+ #: classes/class-cartflows-wizard.php:95
491
+ msgid ""
492
+ "It is easy to use the CartFlows. Please use the setup wizard to quick start "
493
+ "setup."
494
+ msgstr ""
495
+
496
+ #: classes/class-cartflows-wizard.php:97
497
+ msgid "Start Wizard"
498
+ msgstr ""
499
+
500
+ #: classes/class-cartflows-wizard.php:98
501
+ msgid "Skip Setup"
502
+ msgstr ""
503
+
504
+ #: classes/class-cartflows-wizard.php:128
505
+ msgid "Welcome"
506
+ msgstr ""
507
+
508
+ #: classes/class-cartflows-wizard.php:133
509
+ msgid "Page Builder"
510
+ msgstr ""
511
+
512
+ #: classes/class-cartflows-wizard.php:137
513
+ msgid "Checkout"
514
+ msgstr ""
515
+
516
+ #: classes/class-cartflows-wizard.php:141
517
+ msgid "Training"
518
+ msgstr ""
519
+
520
+ #: classes/class-cartflows-wizard.php:145
521
+ msgid "Ready!"
522
+ msgstr ""
523
+
524
+ #: classes/class-cartflows-wizard.php:220
525
+ msgid "CartFlows Setup"
526
+ msgstr ""
527
+
528
+ #: classes/class-cartflows-wizard.php:246
529
+ msgid "Exit Setup Wizard"
530
+ msgstr ""
531
+
532
+ #: classes/class-cartflows-wizard.php:299
533
+ msgid "Welcome to CartFlows!"
534
+ msgstr ""
535
+
536
+ #: classes/class-cartflows-wizard.php:300
537
+ msgid ""
538
+ "Thank you for choosing CartFlows to get more leads, increase conversions, & "
539
+ "maximize profits. This short setup wizard will guide you though configuring "
540
+ "CartFlows and creating your first funnel."
541
+ msgstr ""
542
+
543
+ #: classes/class-cartflows-wizard.php:304
544
+ msgid "Let&#x27;s Build it better!"
545
+ msgstr ""
546
+
547
+ #: classes/class-cartflows-wizard.php:305
548
+ msgid ""
549
+ "Get improved features and faster fixes by sharing non-sensitive data via "
550
+ "usage tracking that shows us how CartFlows is used. No personal data is "
551
+ "tracked or stored."
552
+ msgstr ""
553
+
554
+ #: classes/class-cartflows-wizard.php:306
555
+ msgid "Learn More"
556
+ msgstr ""
557
+
558
+ #: classes/class-cartflows-wizard.php:309
559
+ msgid "Yes, I am in."
560
+ msgstr ""
561
+
562
+ #: classes/class-cartflows-wizard.php:316
563
+ msgid "Lets Go »"
564
+ msgstr ""
565
+
566
+ #: classes/class-cartflows-wizard.php:344
567
+ msgid "Page Builder Setup"
568
+ msgstr ""
569
+
570
+ #: classes/class-cartflows-wizard.php:345
571
+ msgid "Please select a page builder you would like to use with CartFlows."
572
+ msgstr ""
573
+
574
+ #: classes/class-cartflows-wizard.php:350
575
+ msgid "Select Page Builder"
576
+ msgstr ""
577
+
578
+ #: classes/class-cartflows-wizard.php:357
579
+ #: classes/class-cartflows-wizard.php:423
580
+ #: includes/admin/cartflows-general.php:76
581
+ msgid "Elementor"
582
+ msgstr ""
583
+
584
+ #: classes/class-cartflows-wizard.php:367
585
+ msgid "Beaver Builder Plugin (Lite Version)"
586
+ msgstr ""
587
+
588
+ #: classes/class-cartflows-wizard.php:377
589
+ #: includes/admin/cartflows-general.php:78
590
+ msgid "Divi"
591
+ msgstr ""
592
+
593
+ #: classes/class-cartflows-wizard.php:387
594
+ #: includes/admin/cartflows-general.php:79
595
+ msgid "Gutenberg"
596
+ msgstr ""
597
+
598
+ #: classes/class-cartflows-wizard.php:397
599
+ #: includes/admin/cartflows-general.php:80
600
+ msgid "Other"
601
+ msgstr ""
602
+
603
+ #: classes/class-cartflows-wizard.php:419
604
+ msgid ""
605
+ "While CartFlows Should work with most page builders, we offer templates for "
606
+ "the above page builders."
607
+ msgstr ""
608
+
609
+ #: classes/class-cartflows-wizard.php:422
610
+ #: classes/class-cartflows-wizard.php:464
611
+ msgid "The following plugin will be installed and activated for you:"
612
+ msgstr ""
613
+
614
+ #: classes/class-cartflows-wizard.php:429
615
+ #: classes/class-cartflows-wizard.php:474
616
+ #: classes/class-cartflows-wizard.php:684
617
+ msgid "« Previous"
618
+ msgstr ""
619
+
620
+ #: classes/class-cartflows-wizard.php:432
621
+ msgid "Skip this step"
622
+ msgstr ""
623
+
624
+ #: classes/class-cartflows-wizard.php:433
625
+ msgid "Next »"
626
+ msgstr ""
627
+
628
+ #: classes/class-cartflows-wizard.php:452
629
+ msgid "Choose a checkout"
630
+ msgstr ""
631
+
632
+ #: classes/class-cartflows-wizard.php:455
633
+ msgid ""
634
+ "While CartFlows is designed to use WooCommerce sell digital and physical "
635
+ "products, not all funnels need a checkout system."
636
+ msgstr ""
637
+
638
+ #: classes/class-cartflows-wizard.php:457
639
+ msgid ""
640
+ "Would you like to install WooCommerce to sell digital and physical products "
641
+ "in your funnels?"
642
+ msgstr ""
643
+
644
+ #: classes/class-cartflows-wizard.php:465
645
+ msgid "WooCommerce"
646
+ msgstr ""
647
+
648
+ #: classes/class-cartflows-wizard.php:466
649
+ msgid "WooCommerce Cart Abandonment Recovery"
650
+ msgstr ""
651
+
652
+ #: classes/class-cartflows-wizard.php:477
653
+ #: classes/class-cartflows-wizard.php:687
654
+ msgid "No thanks"
655
+ msgstr ""
656
+
657
+ #: classes/class-cartflows-wizard.php:478
658
+ msgid "Yes"
659
+ msgstr ""
660
+
661
+ #: classes/class-cartflows-wizard.php:620
662
+ msgid "Congratulations, You Did It!"
663
+ msgstr ""
664
+
665
+ #: classes/class-cartflows-wizard.php:627
666
+ msgid ""
667
+ "CartFlows is ready to use on your website. You've successfully completed "
668
+ "the setup process and all that is left for you to do is create your first "
669
+ "flow."
670
+ msgstr ""
671
+
672
+ #: classes/class-cartflows-wizard.php:641
673
+ msgid "Create a flow"
674
+ msgstr ""
675
+
676
+ #: classes/class-cartflows-wizard.php:658
677
+ msgid "Exclusive CartFlows Training Course Offer"
678
+ msgstr ""
679
+
680
+ #: classes/class-cartflows-wizard.php:669
681
+ msgid ""
682
+ "We want you to get off to a great start using CartFlows, so we would like "
683
+ "to give access to our exclusive training course."
684
+ msgstr ""
685
+
686
+ #: classes/class-cartflows-wizard.php:670
687
+ msgid "Get access to this couse, for free, by entering your email below."
688
+ msgstr ""
689
+
690
+ #: classes/class-cartflows-wizard.php:672
691
+ msgid "Enter Email address"
692
+ msgstr ""
693
+
694
+ #: classes/class-cartflows-wizard.php:688
695
+ msgid "Allow"
696
+ msgstr ""
697
+
698
+ #: classes/lib/notices/class-astra-notices.php:125
699
+ msgid "WordPress Nonce not validated."
700
+ msgstr ""
701
+
702
+ #: classes/logger/class-cartflows-log-handler-file.php:351
703
+ #: classes/logger/class-cartflows-log-handler-file.php:371
704
+ msgid "This method should not be called before plugins_loaded."
705
+ msgstr ""
706
+
707
+ #: classes/logger/class-cartflows-wc-logger.php:58
708
+ #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
709
+ msgid "The provided handler %1$s does not implement %2$s."
710
+ msgstr ""
711
+
712
+ #: classes/logger/class-cartflows-wc-logger.php:136
713
+ #. translators: 1: Cartflows_WC_Logger::log 2: level
714
+ msgid "%1$s was called with an invalid level \"%2$s\"."
715
+ msgstr ""
716
+
717
+ #: includes/admin/cartflows-admin-header.php:17
718
+ #: includes/admin/cartflows-admin.php:19
719
+ msgid "Generate More Leads & More Sales"
720
+ msgstr ""
721
+
722
+ #: includes/admin/cartflows-admin.php:29
723
+ msgid "Settings saved successfully."
724
+ msgstr ""
725
+
726
+ #: includes/admin/cartflows-error-log.php:36
727
+ msgid "%1$s at %2$s"
728
+ msgstr ""
729
+
730
+ #: includes/admin/cartflows-error-log.php:41
731
+ #: modules/flow/classes/class-cartflows-flow-meta.php:804
732
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:225
733
+ msgid "View"
734
+ msgstr ""
735
+
736
+ #: includes/admin/cartflows-error-log.php:65
737
+ msgid "Delete log"
738
+ msgstr ""
739
+
740
+ #: includes/admin/cartflows-error-log.php:70
741
+ msgid "There are currently no logs to view."
742
+ msgstr ""
743
+
744
+ #: includes/admin/cartflows-general.php:31
745
+ #: includes/admin/cartflows-general.php:40
746
+ msgid "General Settings"
747
+ msgstr ""
748
+
749
+ #: includes/admin/cartflows-general.php:53
750
+ msgid "Disallow search engines from indexing flows"
751
+ msgstr ""
752
+
753
+ #: includes/admin/cartflows-general.php:63
754
+ #: modules/flow/view/view-flow-inner-step.php:52
755
+ msgid "Global Checkout"
756
+ msgstr ""
757
+
758
+ #: includes/admin/cartflows-general.php:72
759
+ msgid "Show Templates designed with"
760
+ msgstr ""
761
+
762
+ #: includes/admin/cartflows-general.php:73
763
+ msgid ""
764
+ "CartFlows offers flow templates that can be imported in one click. These "
765
+ "templates are available in few different page builders. Please choose your "
766
+ "preferred page builder from the list so you will only see templates that "
767
+ "are made using that page builder.."
768
+ msgstr ""
769
+
770
+ #: includes/admin/cartflows-general.php:77
771
+ msgid "Beaver Builder"
772
+ msgstr ""
773
+
774
+ #: includes/admin/cartflows-general.php:89
775
+ #: includes/admin/cartflows-general.php:175
776
+ #: includes/admin/cartflows-general.php:281
777
+ #: includes/admin/cartflows-general.php:398
778
+ msgid "Save Changes"
779
+ msgstr ""
780
+
781
+ #: includes/admin/cartflows-general.php:101
782
+ msgid "Permalink Settings"
783
+ msgstr ""
784
+
785
+ #: includes/admin/cartflows-general.php:116
786
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:647
787
+ #: modules/optin/classes/class-cartflows-optin-meta.php:383
788
+ msgid "Default"
789
+ msgstr ""
790
+
791
+ #: includes/admin/cartflows-general.php:122
792
+ msgid "Flow and Step Slug"
793
+ msgstr ""
794
+
795
+ #: includes/admin/cartflows-general.php:128
796
+ msgid "Flow Slug"
797
+ msgstr ""
798
+
799
+ #: includes/admin/cartflows-general.php:134
800
+ msgid "Step Slug"
801
+ msgstr ""
802
+
803
+ #: includes/admin/cartflows-general.php:146
804
+ msgid "Post Type Permalink Base"
805
+ msgstr ""
806
+
807
+ #: includes/admin/cartflows-general.php:154
808
+ msgid "Step Base"
809
+ msgstr ""
810
+
811
+ #: includes/admin/cartflows-general.php:164
812
+ msgid "Flow Base"
813
+ msgstr ""
814
+
815
+ #: includes/admin/cartflows-general.php:176
816
+ msgid "Set Default"
817
+ msgstr ""
818
+
819
+ #: includes/admin/cartflows-general.php:190
820
+ msgid "Facebook Pixel Settings"
821
+ msgstr ""
822
+
823
+ #: includes/admin/cartflows-general.php:205
824
+ msgid "Enable Facebook Pixel Tracking"
825
+ msgstr ""
826
+
827
+ #: includes/admin/cartflows-general.php:218
828
+ msgid "Enable for the whole site"
829
+ msgstr ""
830
+
831
+ #: includes/admin/cartflows-general.php:226
832
+ #: includes/admin/cartflows-general.php:325
833
+ msgid "If this option is unchecked, it will only apply to CartFlows steps."
834
+ msgstr ""
835
+
836
+ #: includes/admin/cartflows-general.php:236
837
+ msgid "Enter Facebook pixel ID"
838
+ msgstr ""
839
+
840
+ #: includes/admin/cartflows-general.php:244
841
+ #: includes/admin/cartflows-general.php:343
842
+ msgid "Enable Events:"
843
+ msgstr ""
844
+
845
+ #: includes/admin/cartflows-general.php:253
846
+ msgid "Initiate Checkout"
847
+ msgstr ""
848
+
849
+ #: includes/admin/cartflows-general.php:262
850
+ #: includes/admin/cartflows-general.php:369
851
+ msgid "Add Payment Info"
852
+ msgstr ""
853
+
854
+ #: includes/admin/cartflows-general.php:271
855
+ msgid "Purchase Complete"
856
+ msgstr ""
857
+
858
+ #: includes/admin/cartflows-general.php:293
859
+ msgid "Google Analytics Settings"
860
+ msgstr ""
861
+
862
+ #: includes/admin/cartflows-general.php:304
863
+ msgid "Enable Google Analytics Tracking"
864
+ msgstr ""
865
+
866
+ #: includes/admin/cartflows-general.php:317
867
+ msgid "Enable for the whole website"
868
+ msgstr ""
869
+
870
+ #: includes/admin/cartflows-general.php:335
871
+ msgid "Google Analytics ID"
872
+ msgstr ""
873
+
874
+ #: includes/admin/cartflows-general.php:337
875
+ msgid ""
876
+ "Log into your <a href=\"https://analytics.google.com/\" "
877
+ "target=\"_blank\">google analytics account</a> to find your ID. eg: "
878
+ "UA-XXXXXX-X&period;"
879
+ msgstr ""
880
+
881
+ #: includes/admin/cartflows-general.php:351
882
+ msgid "Begin Checkout"
883
+ msgstr ""
884
+
885
+ #: includes/admin/cartflows-general.php:360
886
+ msgid "Add To Cart"
887
+ msgstr ""
888
+
889
+ #: includes/admin/cartflows-general.php:378
890
+ msgid "Purchase"
891
+ msgstr ""
892
+
893
+ #: includes/admin/cartflows-general.php:386
894
+ msgid ""
895
+ "Google Analytics not working correctly? <a "
896
+ "href=\"https://cartflows.com/docs/troubleshooting-google-analytics-tracking-"
897
+ "issues/\" > Click here </a> to know more. "
898
+ msgstr ""
899
+
900
+ #: includes/admin/cartflows-general.php:419
901
+ #: includes/admin/cartflows-home.php:43
902
+ msgid "Knowledge Base"
903
+ msgstr ""
904
+
905
+ #: includes/admin/cartflows-general.php:423
906
+ #: includes/admin/cartflows-home.php:47
907
+ msgid "Not sure how something works? Take a peek at the knowledge base and learn."
908
+ msgstr ""
909
+
910
+ #: includes/admin/cartflows-general.php:426
911
+ #: includes/admin/cartflows-home.php:50
912
+ msgid "Visit Knowledge Base »"
913
+ msgstr ""
914
+
915
+ #: includes/admin/cartflows-general.php:434
916
+ #: includes/admin/cartflows-home.php:58
917
+ msgid "Community"
918
+ msgstr ""
919
+
920
+ #: includes/admin/cartflows-general.php:438
921
+ #: includes/admin/cartflows-home.php:62
922
+ msgid ""
923
+ "Join the community of super helpful CartFlows users. Say hello, ask "
924
+ "questions, give feedback and help each other!"
925
+ msgstr ""
926
+
927
+ #: includes/admin/cartflows-general.php:441
928
+ #: includes/admin/cartflows-home.php:65
929
+ msgid "Join Our Facebook Group »"
930
+ msgstr ""
931
+
932
+ #: includes/admin/cartflows-general.php:449
933
+ #: includes/admin/cartflows-home.php:73
934
+ msgid "Five Star Support"
935
+ msgstr ""
936
+
937
+ #: includes/admin/cartflows-general.php:453
938
+ #: includes/admin/cartflows-home.php:77
939
+ msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
940
+ msgstr ""
941
+
942
+ #: includes/admin/cartflows-general.php:456
943
+ #: includes/admin/cartflows-home.php:80
944
+ msgid "Submit a Ticket »"
945
+ msgstr ""
946
+
947
+ #: includes/admin/cartflows-general.php:466
948
+ msgid "Load Minified CSS"
949
+ msgstr ""
950
+
951
+ #: includes/admin/cartflows-general.php:471
952
+ msgid ""
953
+ "Load the Minified CSS from here. Just Enable it by checking the below given "
954
+ "checkbox."
955
+ msgstr ""
956
+
957
+ #: includes/admin/cartflows-general.php:478
958
+ msgid "Load minified CSS & JS Files"
959
+ msgstr ""
960
+
961
+ #: includes/admin/cartflows-general.php:483
962
+ msgid "Save"
963
+ msgstr ""
964
+
965
+ #: includes/admin/cartflows-home.php:20
966
+ msgid "Getting Started"
967
+ msgstr ""
968
+
969
+ #: includes/admin/cartflows-home.php:28
970
+ msgid "Modernizing WordPress eCommerce!"
971
+ msgstr ""
972
+
973
+ #: includes/exporter.php:12
974
+ msgid "Export Flows to a JSON file"
975
+ msgstr ""
976
+
977
+ #: includes/exporter.php:13
978
+ msgid ""
979
+ "This tool allows you to generate and download a JSON file containing a list "
980
+ "of all flows."
981
+ msgstr ""
982
+
983
+ #: includes/importer.php:12
984
+ msgid "Import Flows to a JSON file"
985
+ msgstr ""
986
+
987
+ #: includes/importer.php:13
988
+ msgid "This tool allows you to import the flows from the JSON file."
989
+ msgstr ""
990
+
991
+ #: includes/importer.php:21
992
+ msgid "Import"
993
+ msgstr ""
994
+
995
+ #: includes/meta-fields/generate-product-repeater.php:36
996
+ msgid "Remove"
997
+ msgstr ""
998
+
999
+ #: includes/meta-fields/generate-product-repeater.php:51
1000
+ msgid "Product Quantity"
1001
+ msgstr ""
1002
+
1003
+ #: includes/meta-fields/generate-product-repeater.php:65
1004
+ msgid "Discount Type"
1005
+ msgstr ""
1006
+
1007
+ #: includes/meta-fields/generate-product-repeater.php:69
1008
+ msgid "Select Discount Type"
1009
+ msgstr ""
1010
+
1011
+ #: includes/meta-fields/generate-product-repeater.php:70
1012
+ msgid "Original"
1013
+ msgstr ""
1014
+
1015
+ #: includes/meta-fields/generate-product-repeater.php:71
1016
+ msgid "Percentage"
1017
+ msgstr ""
1018
+
1019
+ #: includes/meta-fields/generate-product-repeater.php:72
1020
+ msgid "Price"
1021
+ msgstr ""
1022
+
1023
+ #: includes/meta-fields/generate-product-repeater.php:83
1024
+ msgid "Discount Value"
1025
+ msgstr ""
1026
+
1027
+ #: includes/meta-fields/generate-product-repeater.php:85
1028
+ msgid "Discount value will apply for each quantity of product."
1029
+ msgstr ""
1030
+
1031
+ #: includes/meta-fields/get-product-selection-repeater.php:112
1032
+ msgid "Add New Product"
1033
+ msgstr ""
1034
+
1035
+ #: includes/meta-fields/get-product-selection-repeater.php:113
1036
+ msgid "Create Product"
1037
+ msgstr ""
1038
+
1039
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:284
1040
+ #: modules/optin/classes/class-cartflows-optin-markup.php:159
1041
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:90
1042
+ msgid ""
1043
+ "WooCommerce functions do not exist. If you are in an IFrame, please reload "
1044
+ "it."
1045
+ msgstr ""
1046
+
1047
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:285
1048
+ #: modules/optin/classes/class-cartflows-optin-markup.php:160
1049
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:91
1050
+ msgid "Click Here to Reload"
1051
+ msgstr ""
1052
+
1053
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:303
1054
+ msgid "Checkout ID not found"
1055
+ msgstr ""
1056
+
1057
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:366
1058
+ #: modules/checkout/templates/embed/checkout-template-simple.php:25
1059
+ #: modules/checkout/templates/wcf-template.php:36
1060
+ #: modules/optin/templates/optin-template-simple.php:25
1061
+ msgid "Your cart is currently empty."
1062
+ msgstr ""
1063
+
1064
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:432
1065
+ msgid ""
1066
+ "No product is selected. Please select products from the checkout meta "
1067
+ "settings to continue."
1068
+ msgstr ""
1069
+
1070
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:522
1071
+ msgid "Variations Not set"
1072
+ msgstr ""
1073
+
1074
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:530
1075
+ msgid "This product can't be purchased"
1076
+ msgstr ""
1077
+
1078
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:975
1079
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1018
1080
+ msgid "Coupon Code"
1081
+ msgstr ""
1082
+
1083
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:976
1084
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1027
1085
+ msgid "Apply"
1086
+ msgstr ""
1087
+
1088
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1183
1089
+ msgid "Sorry there was a problem removing this coupon."
1090
+ msgstr ""
1091
+
1092
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1186
1093
+ msgid "Coupon has been removed."
1094
+ msgstr ""
1095
+
1096
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1205
1097
+ msgid "Sorry there was a problem removing "
1098
+ msgstr ""
1099
+
1100
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1208
1101
+ msgid " has been removed."
1102
+ msgstr ""
1103
+
1104
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:65
1105
+ msgid "Checkout Layout"
1106
+ msgstr ""
1107
+
1108
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
1109
+ #: modules/landing/classes/class-cartflows-landing-meta.php:130
1110
+ #: modules/optin/classes/class-cartflows-optin-meta.php:126
1111
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
1112
+ msgid "Shortcodes"
1113
+ msgstr ""
1114
+
1115
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
1116
+ #: modules/optin/classes/class-cartflows-optin-meta.php:132
1117
+ msgid "Select Product"
1118
+ msgstr ""
1119
+
1120
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:162
1121
+ msgid "Product Options"
1122
+ msgstr ""
1123
+
1124
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:168
1125
+ msgid "Order Bump"
1126
+ msgstr ""
1127
+
1128
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:174
1129
+ msgid "Checkout Offer"
1130
+ msgstr ""
1131
+
1132
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:180
1133
+ msgid "Checkout Design"
1134
+ msgstr ""
1135
+
1136
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
1137
+ msgid "Checkout Fields"
1138
+ msgstr ""
1139
+
1140
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
1141
+ msgid "Checkout Settings"
1142
+ msgstr ""
1143
+
1144
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:209
1145
+ msgid "Logo (Optional)"
1146
+ msgstr ""
1147
+
1148
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:270
1149
+ #. translators: %s: link
1150
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
1151
+ msgstr ""
1152
+
1153
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:281
1154
+ #. translators: %s: link.
1155
+ msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
1156
+ msgstr ""
1157
+
1158
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:309
1159
+ msgid "Add this shortcode to your checkout page"
1160
+ msgstr ""
1161
+
1162
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:345
1163
+ #. translators: %s: link
1164
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
1165
+ msgstr ""
1166
+
1167
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:372
1168
+ #. translators: %s: link
1169
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1170
+ msgstr ""
1171
+
1172
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:382
1173
+ #. translators: %s: link
1174
+ msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1175
+ msgstr ""
1176
+
1177
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:409
1178
+ #. translators: %s: link
1179
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
1180
+ msgstr ""
1181
+
1182
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:419
1183
+ #. translators: %s: link
1184
+ msgid ""
1185
+ "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
1186
+ "feature"
1187
+ msgstr ""
1188
+
1189
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
1190
+ #. translators: %s: link
1191
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1192
+ msgstr ""
1193
+
1194
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1195
+ #: modules/optin/classes/class-cartflows-optin-meta.php:270
1196
+ #. translators: %s: link
1197
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1198
+ msgstr ""
1199
+
1200
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:492
1201
+ msgid "Place Order Button Text"
1202
+ msgstr ""
1203
+
1204
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:496
1205
+ msgid "Place order"
1206
+ msgstr ""
1207
+
1208
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
1209
+ msgid "It will change the Place Order Button text on checkout page."
1210
+ msgstr ""
1211
+
1212
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:508
1213
+ msgid "Enable cart editing on checkout"
1214
+ msgstr ""
1215
+
1216
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:516
1217
+ #. translators: %s: link
1218
+ msgid "Users will able to remove products from the checkout page."
1219
+ msgstr ""
1220
+
1221
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:546
1222
+ msgid "One Column (Available in CartFlows Pro) "
1223
+ msgstr ""
1224
+
1225
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:547
1226
+ msgid "Two Step (Available in CartFlows Pro) "
1227
+ msgstr ""
1228
+
1229
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:553
1230
+ msgid "Checkout Skin"
1231
+ msgstr ""
1232
+
1233
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:557
1234
+ msgid "One Column"
1235
+ msgstr ""
1236
+
1237
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:558
1238
+ msgid "Two Column"
1239
+ msgstr ""
1240
+
1241
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
1242
+ msgid "Two Step"
1243
+ msgstr ""
1244
+
1245
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:568
1246
+ #: modules/optin/classes/class-cartflows-optin-meta.php:346
1247
+ msgid "Primary Color"
1248
+ msgstr ""
1249
+
1250
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:577
1251
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:612
1252
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:658
1253
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:750
1254
+ #: modules/optin/classes/class-cartflows-optin-meta.php:355
1255
+ #: modules/optin/classes/class-cartflows-optin-meta.php:394
1256
+ #: modules/optin/classes/class-cartflows-optin-meta.php:506
1257
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:209
1258
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:240
1259
+ msgid "Font Family"
1260
+ msgstr ""
1261
+
1262
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:585
1263
+ msgid "Advance Options"
1264
+ msgstr ""
1265
+
1266
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:597
1267
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:225
1268
+ msgid "Heading"
1269
+ msgstr ""
1270
+
1271
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
1272
+ msgid "Heading Color"
1273
+ msgstr ""
1274
+
1275
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:621
1276
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:667
1277
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:759
1278
+ #: modules/optin/classes/class-cartflows-optin-meta.php:403
1279
+ #: modules/optin/classes/class-cartflows-optin-meta.php:515
1280
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:249
1281
+ msgid "Font Weight"
1282
+ msgstr ""
1283
+
1284
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:629
1285
+ #: modules/optin/classes/class-cartflows-optin-meta.php:366
1286
+ msgid "Input Fields"
1287
+ msgstr ""
1288
+
1289
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1290
+ #: modules/optin/classes/class-cartflows-optin-meta.php:373
1291
+ msgid "Floating Labels (Available in CartFlows Pro)"
1292
+ msgstr ""
1293
+
1294
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:643
1295
+ #: modules/optin/classes/class-cartflows-optin-meta.php:379
1296
+ msgid "Style"
1297
+ msgstr ""
1298
+
1299
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:648
1300
+ #: modules/optin/classes/class-cartflows-optin-meta.php:384
1301
+ msgid "Floating Labels"
1302
+ msgstr ""
1303
+
1304
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:675
1305
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:767
1306
+ #: modules/optin/classes/class-cartflows-optin-meta.php:411
1307
+ #: modules/optin/classes/class-cartflows-optin-meta.php:523
1308
+ msgid "Size"
1309
+ msgstr ""
1310
+
1311
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:679
1312
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:771
1313
+ #: modules/optin/classes/class-cartflows-optin-meta.php:415
1314
+ #: modules/optin/classes/class-cartflows-optin-meta.php:527
1315
+ msgid "Extra Small"
1316
+ msgstr ""
1317
+
1318
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:680
1319
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:772
1320
+ #: modules/optin/classes/class-cartflows-optin-meta.php:416
1321
+ #: modules/optin/classes/class-cartflows-optin-meta.php:528
1322
+ msgid "Small"
1323
+ msgstr ""
1324
+
1325
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1326
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:773
1327
+ #: modules/optin/classes/class-cartflows-optin-meta.php:417
1328
+ #: modules/optin/classes/class-cartflows-optin-meta.php:529
1329
+ msgid "Medium"
1330
+ msgstr ""
1331
+
1332
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:682
1333
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:774
1334
+ #: modules/optin/classes/class-cartflows-optin-meta.php:418
1335
+ #: modules/optin/classes/class-cartflows-optin-meta.php:530
1336
+ msgid "Large"
1337
+ msgstr ""
1338
+
1339
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:683
1340
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:775
1341
+ #: modules/optin/classes/class-cartflows-optin-meta.php:419
1342
+ #: modules/optin/classes/class-cartflows-optin-meta.php:531
1343
+ msgid "Extra Large"
1344
+ msgstr ""
1345
+
1346
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:684
1347
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:776
1348
+ #: modules/optin/classes/class-cartflows-optin-meta.php:420
1349
+ #: modules/optin/classes/class-cartflows-optin-meta.php:532
1350
+ msgid "Custom"
1351
+ msgstr ""
1352
+
1353
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:691
1354
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:783
1355
+ #: modules/optin/classes/class-cartflows-optin-meta.php:427
1356
+ #: modules/optin/classes/class-cartflows-optin-meta.php:539
1357
+ msgid "Top Bottom Spacing"
1358
+ msgstr ""
1359
+
1360
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:699
1361
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:791
1362
+ #: modules/optin/classes/class-cartflows-optin-meta.php:435
1363
+ #: modules/optin/classes/class-cartflows-optin-meta.php:547
1364
+ msgid "Left Right Spacing"
1365
+ msgstr ""
1366
+
1367
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:707
1368
+ #: modules/optin/classes/class-cartflows-optin-meta.php:451
1369
+ msgid "Text / Placeholder Color"
1370
+ msgstr ""
1371
+
1372
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:715
1373
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:815
1374
+ #: modules/optin/classes/class-cartflows-optin-meta.php:459
1375
+ #: modules/optin/classes/class-cartflows-optin-meta.php:584
1376
+ msgid "Background Color"
1377
+ msgstr ""
1378
+
1379
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:723
1380
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:831
1381
+ #: modules/optin/classes/class-cartflows-optin-meta.php:467
1382
+ #: modules/optin/classes/class-cartflows-optin-meta.php:600
1383
+ msgid "Border Color"
1384
+ msgstr ""
1385
+
1386
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:730
1387
+ #: modules/optin/classes/class-cartflows-optin-meta.php:443
1388
+ msgid "Label Color"
1389
+ msgstr ""
1390
+
1391
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:743
1392
+ msgid "Buttons"
1393
+ msgstr ""
1394
+
1395
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:799
1396
+ #: modules/optin/classes/class-cartflows-optin-meta.php:568
1397
+ msgid "Text Color"
1398
+ msgstr ""
1399
+
1400
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:807
1401
+ #: modules/optin/classes/class-cartflows-optin-meta.php:576
1402
+ msgid "Text Hover Color"
1403
+ msgstr ""
1404
+
1405
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:823
1406
+ #: modules/optin/classes/class-cartflows-optin-meta.php:592
1407
+ msgid "Background Hover Color"
1408
+ msgstr ""
1409
+
1410
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:839
1411
+ #: modules/optin/classes/class-cartflows-optin-meta.php:608
1412
+ msgid "Border Hover Color"
1413
+ msgstr ""
1414
+
1415
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:852
1416
+ msgid "Sections"
1417
+ msgstr ""
1418
+
1419
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:858
1420
+ msgid "Highlight Area Background Color"
1421
+ msgstr ""
1422
+
1423
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:897
1424
+ msgid "Header Logo"
1425
+ msgstr ""
1426
+
1427
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:905
1428
+ msgid "Logo Width (In px)"
1429
+ msgstr ""
1430
+
1431
+ #: modules/checkout/templates/wcf-template.php:46
1432
+ msgid "Copyright &copy;"
1433
+ msgstr ""
1434
+
1435
+ #: modules/checkout/templates/wcf-template.php:50
1436
+ msgid "All Rights Reserved"
1437
+ msgstr ""
1438
+
1439
+ #: modules/flow/classes/class-cartflows-flow-meta.php:265
1440
+ #. translators: %s flow id
1441
+ msgid "Step not deleted for flow - %s"
1442
+ msgstr ""
1443
+
1444
+ #: modules/flow/classes/class-cartflows-flow-meta.php:303
1445
+ #. translators: %s flow id
1446
+ msgid "Step deleted for flow - %s"
1447
+ msgstr ""
1448
+
1449
+ #: modules/flow/classes/class-cartflows-flow-meta.php:312
1450
+ #. translators: %s flow id
1451
+ msgid "This step can not be deleted."
1452
+ msgstr ""
1453
+
1454
+ #: modules/flow/classes/class-cartflows-flow-meta.php:344
1455
+ #. translators: %s flow id
1456
+ msgid "Steps not sorted for flow - %s"
1457
+ msgstr ""
1458
+
1459
+ #: modules/flow/classes/class-cartflows-flow-meta.php:380
1460
+ #. translators: %s flow id
1461
+ msgid "Steps sorted for flow - %s"
1462
+ msgstr ""
1463
+
1464
+ #: modules/flow/classes/class-cartflows-flow-meta.php:485
1465
+ msgid "Analytics"
1466
+ msgstr ""
1467
+
1468
+ #: modules/flow/classes/class-cartflows-flow-meta.php:502
1469
+ #. translators: %s: link
1470
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1471
+ msgstr ""
1472
+
1473
+ #: modules/flow/classes/class-cartflows-flow-meta.php:520
1474
+ msgid "Flow Settings"
1475
+ msgstr ""
1476
+
1477
+ #: modules/flow/classes/class-cartflows-flow-meta.php:605
1478
+ msgid "Enable Test Mode"
1479
+ msgstr ""
1480
+
1481
+ #: modules/flow/classes/class-cartflows-flow-meta.php:612
1482
+ msgid ""
1483
+ "If you are using WooCommerce plugin then test mode will add random products "
1484
+ "in your flow, so you can preview it easily while testing."
1485
+ msgstr ""
1486
+
1487
+ #: modules/flow/classes/class-cartflows-flow-meta.php:732
1488
+ #: modules/flow/view/meta-flow-steps.php:145
1489
+ msgid "Add New Step"
1490
+ msgstr ""
1491
+
1492
+ #: modules/flow/classes/class-cartflows-flow-meta.php:802
1493
+ #: modules/flow/classes/class-cartflows-step-post-type.php:166
1494
+ msgid "View Step"
1495
+ msgstr ""
1496
+
1497
+ #: modules/flow/classes/class-cartflows-flow-meta.php:813
1498
+ #: modules/flow/classes/class-cartflows-step-post-type.php:165
1499
+ msgid "Edit Step"
1500
+ msgstr ""
1501
+
1502
+ #: modules/flow/classes/class-cartflows-flow-meta.php:815
1503
+ msgid "Edit"
1504
+ msgstr ""
1505
+
1506
+ #: modules/flow/classes/class-cartflows-flow-meta.php:822
1507
+ msgid "Clone Step"
1508
+ msgstr ""
1509
+
1510
+ #: modules/flow/classes/class-cartflows-flow-meta.php:833
1511
+ msgid "Delete Step"
1512
+ msgstr ""
1513
+
1514
+ #: modules/flow/classes/class-cartflows-flow-meta.php:835
1515
+ msgid "Delete"
1516
+ msgstr ""
1517
+
1518
+ #: modules/flow/classes/class-cartflows-flow-meta.php:844
1519
+ #: modules/flow/classes/class-cartflows-flow-meta.php:846
1520
+ msgid "A/B Test"
1521
+ msgstr ""
1522
+
1523
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1524
+ msgid "Flow: "
1525
+ msgstr ""
1526
+
1527
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1528
+ msgid "Name: "
1529
+ msgstr ""
1530
+
1531
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:101
1532
+ msgid "Search Flows"
1533
+ msgstr ""
1534
+
1535
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:102
1536
+ msgid "All Flows"
1537
+ msgstr ""
1538
+
1539
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:103
1540
+ msgid "Edit Flow"
1541
+ msgstr ""
1542
+
1543
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:104
1544
+ msgid "View Flow"
1545
+ msgstr ""
1546
+
1547
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:105
1548
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:107
1549
+ #: modules/flow/classes/class-cartflows-step-post-type.php:167
1550
+ #: modules/flow/classes/class-cartflows-step-post-type.php:169
1551
+ msgid "Add New"
1552
+ msgstr ""
1553
+
1554
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:106
1555
+ msgid "Update Flow"
1556
+ msgstr ""
1557
+
1558
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:108
1559
+ msgid "New Flow Name"
1560
+ msgstr ""
1561
+
1562
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:190
1563
+ msgid "Upgrade to CartFlows Pro"
1564
+ msgstr ""
1565
+
1566
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:209
1567
+ msgid "Slug"
1568
+ msgstr ""
1569
+
1570
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:321
1571
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:322
1572
+ msgid "Flows"
1573
+ msgstr ""
1574
+
1575
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:344
1576
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:350
1577
+ #: modules/flow/classes/class-cartflows-step-post-type.php:401
1578
+ #: modules/flow/classes/class-cartflows-step-post-type.php:407
1579
+ #. translators: %s: singular custom post type name
1580
+ msgid "%s updated."
1581
+ msgstr ""
1582
+
1583
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:346
1584
+ #: modules/flow/classes/class-cartflows-step-post-type.php:403
1585
+ #. translators: %s: singular custom post type name
1586
+ msgid "Custom %s updated."
1587
+ msgstr ""
1588
+
1589
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:348
1590
+ #: modules/flow/classes/class-cartflows-step-post-type.php:405
1591
+ #. translators: %s: singular custom post type name
1592
+ msgid "Custom %s deleted."
1593
+ msgstr ""
1594
+
1595
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:352
1596
+ #: modules/flow/classes/class-cartflows-step-post-type.php:409
1597
+ #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1598
+ #. the revision
1599
+ msgid "%1$s restored to revision from %2$s"
1600
+ msgstr ""
1601
+
1602
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1603
+ #: modules/flow/classes/class-cartflows-step-post-type.php:411
1604
+ #. translators: %s: singular custom post type name
1605
+ msgid "%s published."
1606
+ msgstr ""
1607
+
1608
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1609
+ #: modules/flow/classes/class-cartflows-step-post-type.php:413
1610
+ #. translators: %s: singular custom post type name
1611
+ msgid "%s saved."
1612
+ msgstr ""
1613
+
1614
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1615
+ #: modules/flow/classes/class-cartflows-step-post-type.php:415
1616
+ #. translators: %s: singular custom post type name
1617
+ msgid "%s submitted."
1618
+ msgstr ""
1619
+
1620
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1621
+ #: modules/flow/classes/class-cartflows-step-post-type.php:417
1622
+ #. translators: %s: singular custom post type name
1623
+ msgid "%s scheduled for."
1624
+ msgstr ""
1625
+
1626
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1627
+ #: modules/flow/classes/class-cartflows-step-post-type.php:419
1628
+ #. translators: %s: singular custom post type name
1629
+ msgid "%s draft updated."
1630
+ msgstr ""
1631
+
1632
+ #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1633
+ #: modules/widgets/class-cartflows-next-step.php:78
1634
+ msgid "Next Step"
1635
+ msgstr ""
1636
+
1637
+ #: modules/flow/classes/class-cartflows-step-post-type.php:163
1638
+ msgid "Search Steps"
1639
+ msgstr ""
1640
+
1641
+ #: modules/flow/classes/class-cartflows-step-post-type.php:164
1642
+ msgid "All Steps"
1643
+ msgstr ""
1644
+
1645
+ #: modules/flow/classes/class-cartflows-step-post-type.php:168
1646
+ msgid "Update Step"
1647
+ msgstr ""
1648
+
1649
+ #: modules/flow/classes/class-cartflows-step-post-type.php:170
1650
+ msgid "New Step Name"
1651
+ msgstr ""
1652
+
1653
+ #: modules/flow/classes/class-cartflows-step-post-type.php:211
1654
+ msgid "Step Type"
1655
+ msgstr ""
1656
+
1657
+ #: modules/flow/classes/class-cartflows-step-post-type.php:221
1658
+ msgid "Step Flow"
1659
+ msgstr ""
1660
+
1661
+ #: modules/flow/classes/class-cartflows-step-post-type.php:246
1662
+ #: modules/flow/view/meta-flow-steps.php:16
1663
+ msgid "Optin (Woo)"
1664
+ msgstr ""
1665
+
1666
+ #: modules/flow/classes/class-cartflows-step-post-type.php:267
1667
+ #: modules/flow/view/meta-flow-steps.php:14
1668
+ msgid "Upsell (Woo)"
1669
+ msgstr ""
1670
+
1671
+ #: modules/flow/classes/class-cartflows-step-post-type.php:274
1672
+ #: modules/flow/view/meta-flow-steps.php:15
1673
+ msgid "Downsell (Woo)"
1674
+ msgstr ""
1675
+
1676
+ #: modules/flow/view/view-flow-inner-step.php:30
1677
+ msgid "Control"
1678
+ msgstr ""
1679
+
1680
+ #: modules/flow/view/view-flow-inner-step.php:32
1681
+ #. translators: %s badge count
1682
+ msgid "Variation-%s"
1683
+ msgstr ""
1684
+
1685
+ #: modules/flow/view/view-flow-inner-step.php:44
1686
+ msgid "No Product Assigned"
1687
+ msgstr ""
1688
+
1689
+ #: modules/flow/view/view-flow-inner-step.php:48
1690
+ msgid "Global Checkout - Remove selected checkout product"
1691
+ msgstr ""
1692
+
1693
+ #: modules/flow/view/view-remote-importer.php:19
1694
+ msgid "Steps Library"
1695
+ msgstr ""
1696
+
1697
+ #: modules/flow/view/view-remote-importer.php:68
1698
+ msgid "Create Step"
1699
+ msgstr ""
1700
+
1701
+ #: modules/flow/view/view-remote-importer.php:70
1702
+ msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1703
+ msgstr ""
1704
+
1705
+ #: modules/landing/classes/class-cartflows-landing-meta.php:66
1706
+ msgid "Landing Page Settings"
1707
+ msgstr ""
1708
+
1709
+ #: modules/landing/classes/class-cartflows-landing-meta.php:169
1710
+ msgid "Next Step Link"
1711
+ msgstr ""
1712
+
1713
+ #: modules/optin/classes/class-cartflows-optin-markup.php:178
1714
+ msgid "Please place shortcode on Optin step-type only."
1715
+ msgstr ""
1716
+
1717
+ #: modules/optin/classes/class-cartflows-optin-markup.php:238
1718
+ msgid ""
1719
+ "No product is selected. Please select a Simple, Virtual and Free product "
1720
+ "from the meta settings."
1721
+ msgstr ""
1722
+
1723
+ #: modules/optin/classes/class-cartflows-optin-markup.php:255
1724
+ msgid "Please update the selected product's price to zero (0)."
1725
+ msgstr ""
1726
+
1727
+ #: modules/optin/classes/class-cartflows-optin-markup.php:264
1728
+ #: modules/optin/classes/class-cartflows-optin-markup.php:268
1729
+ msgid "Please select a Simple, Virtual and Free product."
1730
+ msgstr ""
1731
+
1732
+ #: modules/optin/classes/class-cartflows-optin-meta.php:65
1733
+ msgid "Optin Settings"
1734
+ msgstr ""
1735
+
1736
+ #: modules/optin/classes/class-cartflows-optin-meta.php:138
1737
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1738
+ msgid "Design"
1739
+ msgstr ""
1740
+
1741
+ #: modules/optin/classes/class-cartflows-optin-meta.php:144
1742
+ msgid "Form Fields"
1743
+ msgstr ""
1744
+
1745
+ #: modules/optin/classes/class-cartflows-optin-meta.php:213
1746
+ msgid "Add this shortcode to your optin page"
1747
+ msgstr ""
1748
+
1749
+ #: modules/optin/classes/class-cartflows-optin-meta.php:238
1750
+ msgid "Select Free Product"
1751
+ msgstr ""
1752
+
1753
+ #: modules/optin/classes/class-cartflows-optin-meta.php:239
1754
+ msgid "Select Free and Virtual product only."
1755
+ msgstr ""
1756
+
1757
+ #: modules/optin/classes/class-cartflows-optin-meta.php:293
1758
+ msgid "Pass Fields as URL Parameters"
1759
+ msgstr ""
1760
+
1761
+ #: modules/optin/classes/class-cartflows-optin-meta.php:296
1762
+ msgid "Enable"
1763
+ msgstr ""
1764
+
1765
+ #: modules/optin/classes/class-cartflows-optin-meta.php:297
1766
+ msgid ""
1767
+ "You can pass specific fields from the form to next step as URL query "
1768
+ "parameters."
1769
+ msgstr ""
1770
+
1771
+ #: modules/optin/classes/class-cartflows-optin-meta.php:308
1772
+ msgid "Enter form field"
1773
+ msgstr ""
1774
+
1775
+ #: modules/optin/classes/class-cartflows-optin-meta.php:311
1776
+ #: modules/optin/classes/class-cartflows-optin-meta.php:321
1777
+ msgid "Enter comma seprated field name. E.g. first_name, last_name"
1778
+ msgstr ""
1779
+
1780
+ #: modules/optin/classes/class-cartflows-optin-meta.php:313
1781
+ msgid "Fields to pass, separated by commas"
1782
+ msgstr ""
1783
+
1784
+ #: modules/optin/classes/class-cartflows-optin-meta.php:323
1785
+ #. translators: %s: link
1786
+ msgid ""
1787
+ "You can pass field value as a URL parameter to the next step. %1$sClick "
1788
+ "here%2$s for more information."
1789
+ msgstr ""
1790
+
1791
+ #: modules/optin/classes/class-cartflows-optin-meta.php:480
1792
+ msgid "Submit Button"
1793
+ msgstr ""
1794
+
1795
+ #: modules/optin/classes/class-cartflows-optin-meta.php:486
1796
+ msgid "Button Text"
1797
+ msgstr ""
1798
+
1799
+ #: modules/optin/classes/class-cartflows-optin-meta.php:497
1800
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1801
+ msgid "Font Size"
1802
+ msgstr ""
1803
+
1804
+ #: modules/optin/classes/class-cartflows-optin-meta.php:555
1805
+ msgid "Position"
1806
+ msgstr ""
1807
+
1808
+ #: modules/optin/classes/class-cartflows-optin-meta.php:559
1809
+ msgid "Left"
1810
+ msgstr ""
1811
+
1812
+ #: modules/optin/classes/class-cartflows-optin-meta.php:560
1813
+ msgid "Center"
1814
+ msgstr ""
1815
+
1816
+ #: modules/optin/classes/class-cartflows-optin-meta.php:561
1817
+ msgid "Right"
1818
+ msgstr ""
1819
+
1820
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1821
+ msgid "Thank You Page Settings"
1822
+ msgstr ""
1823
+
1824
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1825
+ msgid "Edit Fields"
1826
+ msgstr ""
1827
+
1828
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:182
1829
+ msgid "Order Details"
1830
+ msgstr ""
1831
+
1832
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:194
1833
+ msgid "Text"
1834
+ msgstr ""
1835
+
1836
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:200
1837
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:231
1838
+ msgid "Color"
1839
+ msgstr ""
1840
+
1841
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:257
1842
+ msgid "Advanced Options"
1843
+ msgstr ""
1844
+
1845
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:267
1846
+ msgid "Container Width (In px)"
1847
+ msgstr ""
1848
+
1849
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1850
+ msgid "Section Background Color"
1851
+ msgstr ""
1852
+
1853
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:289
1854
+ msgid "Enable Order Overview "
1855
+ msgstr ""
1856
+
1857
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:297
1858
+ msgid "Enable Order Details "
1859
+ msgstr ""
1860
+
1861
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:305
1862
+ msgid "Enable Billing Details "
1863
+ msgstr ""
1864
+
1865
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:313
1866
+ msgid "Enable Shipping Details "
1867
+ msgstr ""
1868
+
1869
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:329
1870
+ msgid "Thank You Page Text"
1871
+ msgstr ""
1872
+
1873
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
1874
+ #: woocommerce/template/checkout/thankyou.php:41
1875
+ #: woocommerce/template/checkout/thankyou.php:83
1876
+ msgid "Thank you. Your order has been received."
1877
+ msgstr ""
1878
+
1879
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:335
1880
+ msgid "It will change the default text on thank you page."
1881
+ msgstr ""
1882
+
1883
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:343
1884
+ msgid "Redirect After Purchase"
1885
+ msgstr ""
1886
+
1887
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:352
1888
+ msgid "Redirect Link"
1889
+ msgstr ""
1890
+
1891
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:356
1892
+ msgid "https://"
1893
+ msgstr ""
1894
+
1895
+ #: modules/widgets/class-cartflows-next-step.php:24
1896
+ msgid "CartFlows Next Step"
1897
+ msgstr ""
1898
+
1899
+ #: modules/widgets/class-cartflows-next-step.php:26
1900
+ msgid "Next Step Widgets"
1901
+ msgstr ""
1902
+
1903
+ #: modules/widgets/class-cartflows-next-step.php:106
1904
+ msgid "New title"
1905
+ msgstr ""
1906
+
1907
+ #: modules/widgets/class-cartflows-next-step.php:123
1908
+ msgid "Title:"
1909
+ msgstr ""
1910
+
1911
+ #: modules/widgets/class-cartflows-next-step.php:127
1912
+ msgid "Flow ID:"
1913
+ msgstr ""
1914
+
1915
+ #: modules/widgets/class-cartflows-next-step.php:131
1916
+ msgid "Step ID:"
1917
+ msgstr ""
1918
+
1919
+ #: woocommerce/template/cart/cart-shipping.php:51
1920
+ #. Translators: $s shipping destination.
1921
+ msgid "Estimate for %s."
1922
+ msgstr ""
1923
+
1924
+ #: woocommerce/template/cart/cart-shipping.php:52
1925
+ msgid "Change address"
1926
+ msgstr ""
1927
+
1928
+ #: woocommerce/template/cart/cart-shipping.php:54
1929
+ msgid "This is only an estimate. Prices will be updated during checkout."
1930
+ msgstr ""
1931
+
1932
+ #: woocommerce/template/cart/cart-shipping.php:61
1933
+ msgid "Enter your address to view shipping options."
1934
+ msgstr ""
1935
+
1936
+ #: woocommerce/template/cart/cart-shipping.php:63
1937
+ msgid ""
1938
+ "There are no shipping methods available. Please ensure that your address "
1939
+ "has been entered correctly, or contact us if you need any help."
1940
+ msgstr ""
1941
+
1942
+ #: woocommerce/template/cart/cart-shipping.php:66
1943
+ #. Translators: $s shipping destination.
1944
+ msgid "No shipping options were found for %s."
1945
+ msgstr ""
1946
+
1947
+ #: woocommerce/template/cart/cart-shipping.php:67
1948
+ msgid "Enter a different address"
1949
+ msgstr ""
1950
+
1951
+ #: woocommerce/template/checkout/form-billing.php:27
1952
+ msgid "Billing &amp; Shipping"
1953
+ msgstr ""
1954
+
1955
+ #: woocommerce/template/checkout/form-billing.php:31
1956
+ msgid "Billing details"
1957
+ msgstr ""
1958
+
1959
+ #: woocommerce/template/checkout/form-billing.php:59
1960
+ msgid "Create an account?"
1961
+ msgstr ""
1962
+
1963
+ #: woocommerce/template/checkout/form-checkout.php:26
1964
+ msgid "You must be logged in to checkout."
1965
+ msgstr ""
1966
+
1967
+ #: woocommerce/template/checkout/form-checkout.php:52
1968
+ msgid "Your order"
1969
+ msgstr ""
1970
+
1971
+ #: woocommerce/template/checkout/form-coupon.php:26
1972
+ msgid "Have a coupon?"
1973
+ msgstr ""
1974
+
1975
+ #: woocommerce/template/checkout/form-coupon.php:26
1976
+ msgid "Click here to enter your code"
1977
+ msgstr ""
1978
+
1979
+ #: woocommerce/template/checkout/form-coupon.php:31
1980
+ msgid "If you have a coupon code, please apply it below."
1981
+ msgstr ""
1982
+
1983
+ #: woocommerce/template/checkout/form-coupon.php:34
1984
+ msgid "Coupon code"
1985
+ msgstr ""
1986
+
1987
+ #: woocommerce/template/checkout/form-coupon.php:38
1988
+ msgid "Apply coupon"
1989
+ msgstr ""
1990
+
1991
+ #: woocommerce/template/checkout/form-login.php:26
1992
+ msgid "Returning customer?"
1993
+ msgstr ""
1994
+
1995
+ #: woocommerce/template/checkout/form-login.php:26
1996
+ msgid "Click here to login"
1997
+ msgstr ""
1998
+
1999
+ #: woocommerce/template/checkout/form-login.php:32
2000
+ msgid ""
2001
+ "If you have shopped with us before, please enter your details below. If you "
2002
+ "are a new customer, please proceed to the Billing &amp; Shipping section."
2003
+ msgstr ""
2004
+
2005
+ #: woocommerce/template/checkout/form-shipping.php:26
2006
+ msgid "Ship to a different address?"
2007
+ msgstr ""
2008
+
2009
+ #: woocommerce/template/checkout/form-shipping.php:57
2010
+ msgid "Additional information"
2011
+ msgstr ""
2012
+
2013
+ #: woocommerce/template/checkout/payment.php:33
2014
+ msgid ""
2015
+ "Sorry, it seems that there are no available payment methods for your state. "
2016
+ "Please contact us if you require assistance or wish to make alternate "
2017
+ "arrangements."
2018
+ msgstr ""
2019
+
2020
+ #: woocommerce/template/checkout/payment.php:33
2021
+ msgid "Please fill in your details above to see available payment methods."
2022
+ msgstr ""
2023
+
2024
+ #: woocommerce/template/checkout/payment.php:42
2025
+ #. translators: $1 and $2 opening and closing emphasis tags respectively
2026
+ msgid ""
2027
+ "Since your browser does not support JavaScript, or it is disabled, please "
2028
+ "ensure you click the %1$sUpdate Totals%2$s button before placing your "
2029
+ "order. You may be charged more than the amount stated above if you fail to "
2030
+ "do so."
2031
+ msgstr ""
2032
+
2033
+ #: woocommerce/template/checkout/payment.php:44
2034
+ msgid "Update totals"
2035
+ msgstr ""
2036
+
2037
+ #: woocommerce/template/checkout/review-order.php:26
2038
+ #: woocommerce/template/order/order-details.php:51
2039
+ msgid "Product"
2040
+ msgstr ""
2041
+
2042
+ #: woocommerce/template/checkout/review-order.php:27
2043
+ #: woocommerce/template/checkout/review-order.php:107
2044
+ #: woocommerce/template/order/order-details.php:52
2045
+ msgid "Total"
2046
+ msgstr ""
2047
+
2048
+ #: woocommerce/template/checkout/review-order.php:60
2049
+ msgid "Subtotal"
2050
+ msgstr ""
2051
+
2052
+ #: woocommerce/template/checkout/thankyou.php:30
2053
+ msgid ""
2054
+ "Unfortunately your order cannot be processed as the originating "
2055
+ "bank/merchant has declined your transaction. Please attempt your purchase "
2056
+ "again."
2057
+ msgstr ""
2058
+
2059
+ #: woocommerce/template/checkout/thankyou.php:33
2060
+ msgid "Pay"
2061
+ msgstr ""
2062
+
2063
+ #: woocommerce/template/checkout/thankyou.php:35
2064
+ msgid "My account"
2065
+ msgstr ""
2066
+
2067
+ #: woocommerce/template/checkout/thankyou.php:46
2068
+ msgid "Order number:"
2069
+ msgstr ""
2070
+
2071
+ #: woocommerce/template/checkout/thankyou.php:51
2072
+ msgid "Date:"
2073
+ msgstr ""
2074
+
2075
+ #: woocommerce/template/checkout/thankyou.php:57
2076
+ msgid "Email:"
2077
+ msgstr ""
2078
+
2079
+ #: woocommerce/template/checkout/thankyou.php:63
2080
+ msgid "Total:"
2081
+ msgstr ""
2082
+
2083
+ #: woocommerce/template/checkout/thankyou.php:69
2084
+ msgid "Payment method:"
2085
+ msgstr ""
2086
+
2087
+ #: woocommerce/template/global/form-login.php:34
2088
+ msgid "Username or email"
2089
+ msgstr ""
2090
+
2091
+ #: woocommerce/template/global/form-login.php:38
2092
+ msgid "Password"
2093
+ msgstr ""
2094
+
2095
+ #: woocommerce/template/global/form-login.php:48
2096
+ msgid "Login"
2097
+ msgstr ""
2098
+
2099
+ #: woocommerce/template/global/form-login.php:53
2100
+ msgid "Remember me"
2101
+ msgstr ""
2102
+
2103
+ #: woocommerce/template/global/form-login.php:57
2104
+ msgid "Lost your password?"
2105
+ msgstr ""
2106
+
2107
+ #: woocommerce/template/order/order-details.php:45
2108
+ msgid "Order details"
2109
+ msgstr ""
2110
+
2111
+ #: woocommerce/template/order/order-details.php:93
2112
+ msgid "Note:"
2113
+ msgstr ""
2114
+
2115
+ #. Plugin Name of the plugin/theme
2116
+ msgid "CartFlows"
2117
+ msgstr ""
2118
+
2119
+ #. Author URI of the plugin/theme
2120
+ msgid "https://cartflows.com/"
2121
+ msgstr ""
2122
+
2123
+ #. Description of the plugin/theme
2124
+ msgid "Create beautiful checkout pages & sales flows for WooCommerce."
2125
+ msgstr ""
2126
+
2127
+ #. Author of the plugin/theme
2128
+ msgid "CartFlows Inc"
2129
+ msgstr ""
2130
+
2131
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:99
2132
+ msgctxt "flow general name"
2133
+ msgid "Flows"
2134
+ msgstr ""
2135
+
2136
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:100
2137
+ msgctxt "flow singular name"
2138
+ msgid "Flow"
2139
+ msgstr ""
2140
+
2141
+ #: modules/flow/classes/class-cartflows-step-post-type.php:161
2142
+ msgctxt "flow step general name"
2143
+ msgid "Steps"
2144
+ msgstr ""
2145
+
2146
+ #: modules/flow/classes/class-cartflows-step-post-type.php:162
2147
+ msgctxt "flow step singular name"
2148
+ msgid "Step"
2149
+ msgstr ""
2150
+
2151
+ #: modules/flow/classes/class-cartflows-step-post-type.php:315
2152
+ msgctxt "cartflows"
2153
+ msgid "CartFlows — Boxed"
2154
+ msgstr ""
2155
+
2156
+ #: modules/flow/classes/class-cartflows-step-post-type.php:316
2157
+ msgctxt "cartflows"
2158
+ msgid "Template for Page Builders"
2159
  msgstr ""
modules/checkout/classes/class-cartflows-checkout-markup.php CHANGED
@@ -477,7 +477,8 @@ class Cartflows_Checkout_Markup {
477
 
478
  $cart_item_data = array();
479
 
480
- if ( ! empty( $custom_price ) ) {
 
481
 
482
  $cart_item_data = array(
483
  'custom_price' => $custom_price,
477
 
478
  $cart_item_data = array();
479
 
480
+ // Set the Product's custom price even if it is zero. Discount may have applied.
481
+ if ( $custom_price >= 0 && '' !== $custom_price ) {
482
 
483
  $cart_item_data = array(
484
  'custom_price' => $custom_price,
modules/flow/classes/class-cartflows-flow-meta.php CHANGED
@@ -1,760 +1,866 @@
1
- <?php
2
- /**
3
- * Flow meta
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Meta Boxes setup
10
- */
11
- class Cartflows_Flow_Meta {
12
-
13
-
14
- /**
15
- * Instance
16
- *
17
- * @var $instance
18
- */
19
- private static $instance;
20
-
21
- /**
22
- * Meta Option
23
- *
24
- * @var $meta_option
25
- */
26
- private static $meta_option;
27
-
28
- /**
29
- * For Gutenberg
30
- *
31
- * @var $is_gutenberg_editor_active
32
- */
33
- private $is_gutenberg_editor_active = false;
34
-
35
- /**
36
- * Initiator
37
- */
38
- public static function get_instance() {
39
- if ( ! isset( self::$instance ) ) {
40
- self::$instance = new self();
41
- }
42
-
43
- return self::$instance;
44
- }
45
-
46
- /**
47
- * Constructor
48
- */
49
- public function __construct() {
50
-
51
- add_action( 'admin_head', array( $this, 'menu_highlight' ) );
52
-
53
- add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
54
-
55
- /* Init Metabox */
56
- add_action( 'load-post.php', array( $this, 'init_metabox' ) );
57
- add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
58
-
59
- /* Add Scripts */
60
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 20 );
61
-
62
- add_action( 'wp_ajax_cartflows_delete_flow_step', array( $this, 'cartflows_delete_flow_step' ) );
63
- add_action( 'wp_ajax_cartflows_reorder_flow_steps', array( $this, 'cartflows_reorder_flow_steps' ) );
64
-
65
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
66
-
67
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
68
-
69
- /* To check the status of gutenberg */
70
- add_action( 'enqueue_block_editor_assets', array( $this, 'set_block_editor_status' ) );
71
-
72
- /* Add back to edit flow button for gutenberg */
73
- add_action( 'admin_footer', array( $this, 'gutenberg_module_templates' ) );
74
- }
75
-
76
- /**
77
- * Display admin notices.
78
- *
79
- * @since 1.0.0
80
- *
81
- * @return void
82
- */
83
- public function admin_notices() {
84
-
85
- if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
86
- return;
87
- }
88
-
89
- $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
90
- if ( $flow_id ) { ?>
91
- <div class="wcf-notice-back-edit-flow">
92
- <p>
93
- <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-hero wcf-header-back-button" style="text-decoration: none;">
94
- <i class="dashicons dashicons-arrow-left-alt"></i>
95
- <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
96
- </a>
97
- </p>
98
- </div>
99
- <?php
100
- }
101
- }
102
-
103
- /**
104
- * Initialize admin actions.
105
- *
106
- * @since 1.0.0
107
- *
108
- * @return void
109
- */
110
- public function admin_init_actions() {
111
- add_action( 'before_delete_post', array( $this, 'step_post_sync' ) );
112
- add_action( 'wp_trash_post', array( $this, 'step_post_trash_sync' ) );
113
- add_action( 'untrashed_post', array( $this, 'step_post_untrash_sync' ) );
114
- }
115
-
116
- /**
117
- * Delete term data and steps data after deleting flow.
118
- *
119
- * @since 1.0.0
120
- * @param int $pid post id.
121
- *
122
- * @return void
123
- */
124
- public function step_post_sync( $pid ) {
125
-
126
- global $post_type;
127
-
128
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
129
-
130
- $steps = get_post_meta( $pid, 'wcf-steps', true );
131
-
132
- if ( $steps && is_array( $steps ) ) {
133
- foreach ( $steps as $i => $step ) {
134
- wp_delete_post( $step['id'], true );
135
- }
136
- }
137
-
138
- $term_data = term_exists( 'flow-' . $pid, CARTFLOWS_TAXONOMY_STEP_FLOW );
139
-
140
- if ( is_array( $term_data ) ) {
141
- wp_delete_term( $term_data['term_id'], CARTFLOWS_TAXONOMY_STEP_FLOW );
142
- }
143
- }
144
- }
145
-
146
- /**
147
- * Trash steps data after trashing flow.
148
- *
149
- * @since 1.0.0
150
- * @param int $pid post id.
151
- *
152
- * @return void
153
- */
154
- public function step_post_trash_sync( $pid ) {
155
-
156
- global $post_type;
157
-
158
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
159
-
160
- $steps = get_post_meta( $pid, 'wcf-steps', true );
161
-
162
- if ( $steps && is_array( $steps ) ) {
163
- foreach ( $steps as $i => $step ) {
164
- wp_trash_post( $step['id'] );
165
- }
166
- }
167
- }
168
- }
169
-
170
- /**
171
- * Untrash steps data after restoring flow.
172
- *
173
- * @since 1.0.0
174
- * @param int $pid post id.
175
- *
176
- * @return void
177
- */
178
- public function step_post_untrash_sync( $pid ) {
179
-
180
- global $post_type;
181
-
182
- if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
183
-
184
- $steps = get_post_meta( $pid, 'wcf-steps', true );
185
-
186
- if ( $steps && is_array( $steps ) ) {
187
- foreach ( $steps as $i => $step ) {
188
- wp_untrash_post( $step['id'] );
189
- }
190
- }
191
- }
192
- }
193
-
194
- /**
195
- * Create step for given flow.
196
- *
197
- * @param int $flow_id flow ID.
198
- * @param int $step_type step type.
199
- * @param int $step_title step title.
200
- * @since 1.0.0
201
- *
202
- * @return int
203
- */
204
- public function create_step( $flow_id, $step_type, $step_title ) {
205
-
206
- $new_step_id = wp_insert_post(
207
- array(
208
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
209
- 'post_title' => $step_title,
210
- 'post_status' => 'publish',
211
- )
212
- );
213
-
214
- if ( $new_step_id ) {
215
-
216
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
217
-
218
- if ( ! is_array( $flow_steps ) ) {
219
- $flow_steps = array();
220
- }
221
-
222
- $flow_steps[] = array(
223
- 'id' => $new_step_id,
224
- 'title' => $step_title,
225
- 'type' => $step_type,
226
- );
227
-
228
- // insert post meta.
229
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
230
- update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
231
-
232
- wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
233
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
234
- }
235
-
236
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
237
-
238
- return $new_step_id;
239
- }
240
-
241
- /**
242
- * Delete step for flow
243
- *
244
- * @since 1.0.0
245
- *
246
- * @return void
247
- */
248
- public function cartflows_delete_flow_step() {
249
-
250
- if ( ! current_user_can( 'manage_options' ) ) {
251
- return;
252
- }
253
-
254
- check_ajax_referer( 'wcf-delete-flow-step', 'security' );
255
-
256
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
257
- $flow_id = intval( $_POST['post_id'] );
258
- $step_id = intval( $_POST['step_id'] );
259
- }
260
- $result = array(
261
- 'status' => false,
262
- /* translators: %s flow id */
263
- 'text' => sprintf( __( 'Step not deleted for flow - %s', 'cartflows' ), $flow_id ),
264
- );
265
-
266
- if ( ! $flow_id || ! $step_id ) {
267
- wp_send_json( $result );
268
- }
269
-
270
- wp_delete_post( $step_id, true );
271
-
272
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
273
-
274
- if ( ! is_array( $flow_steps ) ) {
275
- wp_send_json( $result );
276
- }
277
-
278
- foreach ( $flow_steps as $index => $data ) {
279
-
280
- if ( intval( $data['id'] ) === $step_id ) {
281
- unset( $flow_steps[ $index ] );
282
- break;
283
- }
284
- }
285
-
286
- /* Set index order properly */
287
- $flow_steps = array_merge( $flow_steps );
288
-
289
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
290
-
291
- $result = array(
292
- 'status' => true,
293
- /* translators: %s flow id */
294
- 'text' => sprintf( __( 'Step deleted for flow - %s', 'cartflows' ), $flow_id ),
295
- );
296
-
297
- wp_send_json( $result );
298
- }
299
-
300
- /**
301
- * Reorder step flow
302
- *
303
- * @since 1.0.0
304
- *
305
- * @return void
306
- */
307
- public function cartflows_reorder_flow_steps() {
308
-
309
- if ( ! current_user_can( 'manage_options' ) ) {
310
- return;
311
- }
312
-
313
- check_ajax_referer( 'wcf-reorder-flow-steps', 'security' );
314
-
315
- if ( isset( $_POST['post_id'] ) && isset( $_POST['step_ids'] ) ) {
316
- $flow_id = intval( $_POST['post_id'] );
317
- $step_ids = array_map( 'intval', $_POST['step_ids'] );
318
- }
319
- $result = array(
320
- 'status' => false,
321
- /* translators: %s flow id */
322
- 'text' => sprintf( __( 'Steps not sorted for flow - %s', 'cartflows' ), $flow_id ),
323
- );
324
-
325
- if ( ! $flow_id || ! is_array( $step_ids ) ) {
326
- wp_send_json( $result );
327
- }
328
-
329
- $new_flow_steps = array();
330
-
331
- foreach ( $step_ids as $index => $step_id ) {
332
-
333
- $new_flow_steps[] = array(
334
- 'id' => intval( $step_id ),
335
- 'title' => get_the_title( $step_id ),
336
- 'type' => get_post_meta( $step_id, 'wcf-step-type', true ),
337
- );
338
- }
339
-
340
- update_post_meta( $flow_id, 'wcf-steps', $new_flow_steps );
341
-
342
- $result = array(
343
- 'status' => true,
344
- /* translators: %s flow id */
345
- 'text' => sprintf( __( 'Steps sorted for flow - %s', 'cartflows' ), $flow_id ),
346
- );
347
-
348
- wp_send_json( $result );
349
- }
350
-
351
-
352
- /**
353
- * Load admin scripts
354
- *
355
- * @since 1.0.0
356
- *
357
- * @return void
358
- */
359
- public function admin_scripts() {
360
-
361
- global $pagenow;
362
- global $post;
363
-
364
- $screen = get_current_screen();
365
-
366
- if ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && CARTFLOWS_FLOW_POST_TYPE == $screen->post_type ) {
367
-
368
- wp_enqueue_script(
369
- 'wcf-flow-meta',
370
- CARTFLOWS_URL . 'admin/assets/js/flow-admin-edit.js',
371
- array( 'jquery', 'jquery-ui-sortable' ),
372
- CARTFLOWS_VER,
373
- true
374
- );
375
-
376
- wp_enqueue_style( 'wcf-flow-meta', CARTFLOWS_URL . 'admin/assets/css/flow-admin-edit.css', '', CARTFLOWS_VER );
377
- wp_style_add_data( 'wcf-flow-meta', 'rtl', 'replace' );
378
-
379
- $localize = array(
380
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
381
- );
382
-
383
- wp_localize_script( 'jquery', 'cartflows', apply_filters( 'wcf_js_localize', $localize ) );
384
- }
385
- }
386
-
387
- /**
388
- * Initialize meta box
389
- *
390
- * @since 1.0.0
391
- *
392
- * @return void
393
- */
394
- public function init_metabox() {
395
-
396
- /**
397
- * Fires after the title field.
398
- *
399
- * @param WP_Post $post Post object.
400
- */
401
- add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) );
402
- add_action( 'edit_form_after_title', array( $this, 'setup_meta_box' ) );
403
- add_action( 'save_post', array( $this, 'save_meta_box' ) );
404
- }
405
-
406
- /**
407
- * Is first time import?
408
- *
409
- * @param integer $post_id post ID.
410
- * @return bool
411
- */
412
- public function is_flow_imported( $post_id = 0 ) {
413
-
414
- if ( 0 === $post_id ) {
415
- $post_id = get_the_ID();
416
- }
417
-
418
- $steps = get_post_meta( $post_id, 'wcf-steps', true );
419
- $choice = get_post_meta( $post_id, 'wcf-flow-choise', true );
420
-
421
- if ( empty( $steps ) && 'import' === $choice ) {
422
- return true;
423
- }
424
-
425
- return false;
426
- }
427
-
428
- /**
429
- * Setup meta box.
430
- *
431
- * @return void
432
- */
433
- public function setup_meta_box() {
434
- if ( ! Cartflows_Admin::is_flow_edit_admin() ) {
435
- return;
436
- }
437
-
438
- /**
439
- * Adding Add new step button to the top*/
440
- echo $this->add_add_new_step_button();
441
-
442
- $this->markup_meta_box();
443
-
444
- $this->add_upgrade_to_pro_metabox();
445
- }
446
-
447
-
448
- /**
449
- * Add metabox when cartflows pro is not enabled.
450
- */
451
- public function add_upgrade_to_pro_metabox() {
452
-
453
- if ( ! _is_cartflows_pro() ) {
454
- add_meta_box(
455
- 'wcf-upgrade-pro',
456
- __( 'Analytics', 'cartflows' ),
457
- array( $this, 'upgrade_to_pro' ),
458
- CARTFLOWS_FLOW_POST_TYPE,
459
- 'side',
460
- 'high'
461
- );
462
- }
463
-
464
- }
465
-
466
- /**
467
- * Show Upgrade To Pro markup.
468
- */
469
- public function upgrade_to_pro() {
470
-
471
- echo '<div>';
472
- /* translators: %s: link */
473
- echo '<p><i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Analytics feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i></p>';
474
- echo '<p><a target="_blank" href="https://cartflows.com/" class="button button-primary">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';
475
- echo '</div>';
476
-
477
- }
478
-
479
- /**
480
- * Settings meta box.
481
- *
482
- * @return void
483
- */
484
- public function settings_meta_box() {
485
-
486
- if ( CARTFLOWS_FLOW_POST_TYPE === get_post_type() ) {
487
-
488
- /* No need of sandbox will delete it later */
489
- add_meta_box(
490
- 'wcf-sandbox-settings', // Id.
491
- __( 'Flow Settings', 'cartflows' ), // Title.
492
- array( $this, 'sandbox_meta_box' ), // Callback.
493
- CARTFLOWS_FLOW_POST_TYPE, // Post_type.
494
- 'side', // Context.
495
- 'high' // Priority.
496
- );
497
-
498
- do_action( 'cartflows_add_flow_metabox' );
499
- }
500
- }
501
-
502
- /**
503
- * Metabox Markup
504
- *
505
- * @return void
506
- */
507
- public function markup_meta_box() {
508
- global $post;
509
-
510
- wp_nonce_field( 'save-nonce-flow-meta', 'nonce-flow-meta' );
511
-
512
- // Get defaults.
513
- $meta = self::get_current_post_meta( $post->ID );
514
-
515
- /**
516
- * Get options
517
- */
518
- $updated_data = array(
519
- 'steps' => $meta['wcf-steps']['default'],
520
- );
521
-
522
- do_action( 'wcf_flow_settings_markup_before', $meta );
523
- $this->page_header_tab( $updated_data );
524
- do_action( 'wcf_flow_settings_markup_after', $meta );
525
- }
526
-
527
- /**
528
- * Metabox Markup
529
- *
530
- * @param object $post Post object.
531
- * @return void
532
- */
533
- public function sandbox_meta_box( $post ) {
534
-
535
- // Get defaults.
536
- $meta = self::get_current_post_meta( $post->ID );
537
-
538
- /**
539
- * Get options
540
- */
541
- foreach ( $meta as $key => $value ) {
542
- $updated_data[ $key ] = $meta[ $key ]['default'];
543
- }
544
-
545
- do_action( 'wcf_flow_sandbox_markup_before', $meta );
546
- $this->sandbox_markup( $updated_data );
547
- do_action( 'wcf_flow_sandbox_markup_after', $meta );
548
- }
549
-
550
- /**
551
- * Page Header Tabs
552
- *
553
- * @param array $options Post meta.
554
- * @return void
555
- */
556
- public function page_header_tab( $options ) {
557
-
558
- include_once CARTFLOWS_FLOW_DIR . 'view/meta-flow-steps.php';
559
- }
560
-
561
- /**
562
- * Sandbox Markup
563
- *
564
- * @param array $options Post meta.
565
- * @return void
566
- */
567
- public function sandbox_markup( $options ) {
568
- ?>
569
- <div class="wcf-flow-sandbox-table wcf-general-metabox-wrap widefat">
570
- <div class="wcf-flow-sandbox-table-container">
571
- <?php
572
- echo wcf()->meta->get_checkbox_field(
573
- array(
574
- 'name' => 'wcf-testing',
575
- 'value' => $options['wcf-testing'],
576
- 'after' => esc_html__( 'Enable Test Mode', 'cartflows' ),
577
- )
578
- );
579
-
580
- echo wcf()->meta->get_description_field(
581
- array(
582
- 'name' => 'wcf-testing-note',
583
- 'content' => esc_html__( 'If you are using WooCommerce plugin then test mode will add random products in your flow, so you can preview it easily while testing.', 'cartflows' ),
584
- )
585
- );
586
-
587
- ?>
588
- </div>
589
- </div>
590
- <?php
591
- }
592
-
593
- /**
594
- * Keep the menu open when editing the flows.
595
- * Highlights the wanted admin (sub-) menu items for the CPT.
596
- *
597
- * @since 1.0.0
598
- */
599
- public function menu_highlight() {
600
- global $parent_file, $submenu_file, $post_type;
601
- if ( CARTFLOWS_FLOW_POST_TYPE == $post_type ) :
602
- $parent_file = CARTFLOWS_SLUG;//phpcs:ignore
603
- $submenu_file = 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE;//phpcs:ignore
604
- endif;
605
- }
606
-
607
- /**
608
- * Get metabox options
609
- *
610
- * @param int $post_id post id.
611
- * @return array
612
- */
613
- public static function get_meta_option( $post_id ) {
614
-
615
- if ( null === self::$meta_option ) {
616
- /**
617
- * Set metabox options
618
- */
619
- self::$meta_option = wcf()->options->get_flow_fields( $post_id );
620
- }
621
-
622
- return self::$meta_option;
623
- }
624
-
625
- /**
626
- * Get metabox options
627
- *
628
- * @param int $post_id post ID.
629
- * @return array
630
- */
631
- public static function get_current_post_meta( $post_id ) {
632
-
633
- $stored = get_post_meta( $post_id );
634
-
635
- $default_meta = self::get_meta_option( $post_id );
636
-
637
- // Set stored and override defaults.
638
- foreach ( $stored as $key => $value ) {
639
- if ( array_key_exists( $key, $default_meta ) ) {
640
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
641
- } else {
642
- self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
643
- }
644
- }
645
-
646
- return self::get_meta_option( $post_id );
647
- }
648
-
649
- /**
650
- * Metabox Save
651
- *
652
- * @param number $post_id Post ID.
653
- * @return void
654
- */
655
- public function save_meta_box( $post_id ) {
656
-
657
- // Checks save status.
658
- $is_autosave = wp_is_post_autosave( $post_id );
659
- $is_revision = wp_is_post_revision( $post_id );
660
-
661
- $is_valid_nonce = ( isset( $_POST['nonce-flow-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-flow-meta'] ) ), 'save-nonce-flow-meta' ) ) ? true : false;
662
-
663
- // Exits script depending on save status.
664
- if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
665
- return;
666
- }
667
-
668
- wcf()->options->save_flow_fields( $post_id );
669
- }
670
-
671
- /**
672
- * Localize variables in admin
673
- *
674
- * @param array $vars variables.
675
- */
676
- public function localize_vars( $vars ) {
677
-
678
- $ajax_actions = array(
679
- 'wcf_setup_default_steps',
680
- 'wcf_add_flow_step',
681
- 'wcf_delete_flow_step',
682
- 'wcf_reorder_flow_steps',
683
- );
684
-
685
- foreach ( $ajax_actions as $action ) {
686
-
687
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
688
- }
689
-
690
- return $vars;
691
- }
692
-
693
- /**
694
- * Add New Step Button
695
- *
696
- * @return string
697
- */
698
- public function add_add_new_step_button() {
699
- $add_new_btn_markup = '<style>.wrap{ position:relative;}</style>';
700
- $add_new_btn_markup .= "<div class='wcf-button-wrap'>";
701
- $add_new_btn_markup .= "<button class='wcf-trigger-popup page-title-action'>";
702
- $add_new_btn_markup .= esc_html__( 'Add New Step', 'cartflows' );
703
- $add_new_btn_markup .= '</button>';
704
- $add_new_btn_markup .= '</div>';
705
-
706
- return $add_new_btn_markup;
707
- }
708
-
709
- /**
710
- * Back to flow button gutenberg template
711
- *
712
- * @return void
713
- */
714
- public function gutenberg_module_templates() {
715
-
716
- // Exit if block editor is not enabled.
717
- if ( ! $this->is_gutenberg_editor_active ) {
718
- return;
719
- }
720
-
721
- if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
722
- return;
723
- }
724
-
725
- $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
726
-
727
- if ( $flow_id ) {
728
- ?>
729
- <script id="wcf-gutenberg-back-flow-button" type="text/html">
730
- <div class="wcf-notice-back-edit-flow gutenberg-button" >
731
- <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-large wcf-header-back-button" style="text-decoration: none;">
732
- <i class="dashicons dashicons-arrow-left-alt"></i>
733
- <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
734
- </a>
735
- </div>
736
- </script>
737
- <?php
738
- }
739
- }
740
-
741
- /**
742
- * Set status true for gutenberg.
743
- *
744
- * @return void
745
- */
746
- public function set_block_editor_status() {
747
-
748
- if ( ! current_user_can( 'manage_options' ) ) {
749
- return;
750
- }
751
-
752
- // Set gutenberg status here.
753
- $this->is_gutenberg_editor_active = true;
754
- }
755
- }
756
-
757
- /**
758
- * Kicking this off by calling 'get_instance()' method
759
- */
760
- Cartflows_Flow_Meta::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Flow meta
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Meta Boxes setup
10
+ */
11
+ class Cartflows_Flow_Meta {
12
+
13
+
14
+ /**
15
+ * Instance
16
+ *
17
+ * @var $instance
18
+ */
19
+ private static $instance;
20
+
21
+ /**
22
+ * Meta Option
23
+ *
24
+ * @var $meta_option
25
+ */
26
+ private static $meta_option;
27
+
28
+ /**
29
+ * For Gutenberg
30
+ *
31
+ * @var $is_gutenberg_editor_active
32
+ */
33
+ private $is_gutenberg_editor_active = false;
34
+
35
+ /**
36
+ * Initiator
37
+ */
38
+ public static function get_instance() {
39
+ if ( ! isset( self::$instance ) ) {
40
+ self::$instance = new self();
41
+ }
42
+
43
+ return self::$instance;
44
+ }
45
+
46
+ /**
47
+ * Constructor
48
+ */
49
+ public function __construct() {
50
+
51
+ add_action( 'admin_head', array( $this, 'menu_highlight' ) );
52
+
53
+ add_action( 'admin_init', array( $this, 'admin_init_actions' ) );
54
+
55
+ /* Init Metabox */
56
+ add_action( 'load-post.php', array( $this, 'init_metabox' ) );
57
+ add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
58
+
59
+ /* Add Scripts */
60
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ), 20 );
61
+
62
+ add_action( 'wp_ajax_cartflows_delete_flow_step', array( $this, 'cartflows_delete_flow_step' ) );
63
+ add_action( 'wp_ajax_cartflows_reorder_flow_steps', array( $this, 'cartflows_reorder_flow_steps' ) );
64
+
65
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
66
+
67
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
68
+
69
+ /* To check the status of gutenberg */
70
+ add_action( 'enqueue_block_editor_assets', array( $this, 'set_block_editor_status' ) );
71
+
72
+ /* Add back to edit flow button for gutenberg */
73
+ add_action( 'admin_footer', array( $this, 'gutenberg_module_templates' ) );
74
+ }
75
+
76
+ /**
77
+ * Display admin notices.
78
+ *
79
+ * @since 1.0.0
80
+ *
81
+ * @return void
82
+ */
83
+ public function admin_notices() {
84
+
85
+ if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
86
+ return;
87
+ }
88
+
89
+ $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
90
+ if ( $flow_id ) { ?>
91
+ <div class="wcf-notice-back-edit-flow">
92
+ <p>
93
+ <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-hero wcf-header-back-button" style="text-decoration: none;">
94
+ <i class="dashicons dashicons-arrow-left-alt"></i>
95
+ <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
96
+ </a>
97
+ </p>
98
+ </div>
99
+ <?php
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Initialize admin actions.
105
+ *
106
+ * @since 1.0.0
107
+ *
108
+ * @return void
109
+ */
110
+ public function admin_init_actions() {
111
+ add_action( 'before_delete_post', array( $this, 'step_post_sync' ) );
112
+ add_action( 'wp_trash_post', array( $this, 'step_post_trash_sync' ) );
113
+ add_action( 'untrashed_post', array( $this, 'step_post_untrash_sync' ) );
114
+ }
115
+
116
+ /**
117
+ * Delete term data and steps data after deleting flow.
118
+ *
119
+ * @since 1.0.0
120
+ * @param int $pid post id.
121
+ *
122
+ * @return void
123
+ */
124
+ public function step_post_sync( $pid ) {
125
+
126
+ global $post_type;
127
+
128
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
129
+
130
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
131
+
132
+ if ( $steps && is_array( $steps ) ) {
133
+ foreach ( $steps as $i => $step ) {
134
+ wp_delete_post( $step['id'], true );
135
+ }
136
+ }
137
+
138
+ $term_data = term_exists( 'flow-' . $pid, CARTFLOWS_TAXONOMY_STEP_FLOW );
139
+
140
+ if ( is_array( $term_data ) ) {
141
+ wp_delete_term( $term_data['term_id'], CARTFLOWS_TAXONOMY_STEP_FLOW );
142
+ }
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Trash steps data after trashing flow.
148
+ *
149
+ * @since 1.0.0
150
+ * @param int $pid post id.
151
+ *
152
+ * @return void
153
+ */
154
+ public function step_post_trash_sync( $pid ) {
155
+
156
+ global $post_type;
157
+
158
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
159
+
160
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
161
+
162
+ if ( $steps && is_array( $steps ) ) {
163
+ foreach ( $steps as $i => $step ) {
164
+ wp_trash_post( $step['id'] );
165
+ }
166
+ }
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Untrash steps data after restoring flow.
172
+ *
173
+ * @since 1.0.0
174
+ * @param int $pid post id.
175
+ *
176
+ * @return void
177
+ */
178
+ public function step_post_untrash_sync( $pid ) {
179
+
180
+ global $post_type;
181
+
182
+ if ( CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
183
+
184
+ $steps = get_post_meta( $pid, 'wcf-steps', true );
185
+
186
+ if ( $steps && is_array( $steps ) ) {
187
+ foreach ( $steps as $i => $step ) {
188
+ wp_untrash_post( $step['id'] );
189
+ }
190
+ }
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Create step for given flow.
196
+ *
197
+ * @param int $flow_id flow ID.
198
+ * @param int $step_type step type.
199
+ * @param int $step_title step title.
200
+ * @since 1.0.0
201
+ *
202
+ * @return int
203
+ */
204
+ public function create_step( $flow_id, $step_type, $step_title ) {
205
+
206
+ $new_step_id = wp_insert_post(
207
+ array(
208
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
209
+ 'post_title' => $step_title,
210
+ 'post_status' => 'publish',
211
+ )
212
+ );
213
+
214
+ if ( $new_step_id ) {
215
+
216
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
217
+
218
+ if ( ! is_array( $flow_steps ) ) {
219
+ $flow_steps = array();
220
+ }
221
+
222
+ $flow_steps[] = array(
223
+ 'id' => $new_step_id,
224
+ 'title' => $step_title,
225
+ 'type' => $step_type,
226
+ );
227
+
228
+ // insert post meta.
229
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
230
+ update_post_meta( $new_step_id, 'wcf-step-type', $step_type );
231
+
232
+ wp_set_object_terms( $new_step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
233
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
234
+ }
235
+
236
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
237
+
238
+ return $new_step_id;
239
+ }
240
+
241
+ /**
242
+ * Delete step for flow
243
+ *
244
+ * @since 1.0.0
245
+ *
246
+ * @return void
247
+ */
248
+ public function cartflows_delete_flow_step() {
249
+
250
+ if ( ! current_user_can( 'manage_options' ) ) {
251
+ return;
252
+ }
253
+
254
+ check_ajax_referer( 'wcf-delete-flow-step', 'security' );
255
+
256
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_id'] ) ) {
257
+ $flow_id = intval( $_POST['post_id'] );
258
+ $step_id = intval( $_POST['step_id'] );
259
+ }
260
+
261
+ $result = array(
262
+ 'status' => false,
263
+ 'reload' => false,
264
+ /* translators: %s flow id */
265
+ 'text' => sprintf( __( 'Step not deleted for flow - %s', 'cartflows' ), $flow_id ),
266
+ );
267
+
268
+ if ( ! $flow_id || ! $step_id ) {
269
+ wp_send_json( $result );
270
+ }
271
+
272
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
273
+
274
+ if ( ! is_array( $flow_steps ) ) {
275
+ wp_send_json( $result );
276
+ }
277
+
278
+ $is_ab_test = get_post_meta( $step_id, 'wcf-ab-test', true );
279
+
280
+ if ( ! $is_ab_test ) {
281
+
282
+ foreach ( $flow_steps as $index => $data ) {
283
+
284
+ if ( intval( $data['id'] ) === $step_id ) {
285
+ unset( $flow_steps[ $index ] );
286
+ break;
287
+ }
288
+ }
289
+
290
+ /* Set index order properly */
291
+ $flow_steps = array_merge( $flow_steps );
292
+
293
+ /* Update latest data */
294
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
295
+
296
+ /* Delete step */
297
+ wp_delete_post( $step_id, true );
298
+
299
+ $result = array(
300
+ 'status' => true,
301
+ 'reload' => false,
302
+ /* translators: %s flow id */
303
+ 'text' => sprintf( __( 'Step deleted for flow - %s', 'cartflows' ), $flow_id ),
304
+ );
305
+
306
+ } else {
307
+
308
+ $result = array(
309
+ 'status' => false,
310
+ 'reload' => false,
311
+ /* translators: %s flow id */
312
+ 'text' => sprintf( __( 'This step can not be deleted.', 'cartflows' ), $flow_id ),
313
+ );
314
+ /**
315
+ Action do_action( 'cartflows_step_delete_ab_test', $step_id, $flow_id, $flow_steps );
316
+ */
317
+ }
318
+
319
+ wp_send_json( $result );
320
+ }
321
+
322
+ /**
323
+ * Reorder step flow
324
+ *
325
+ * @since 1.0.0
326
+ *
327
+ * @return void
328
+ */
329
+ public function cartflows_reorder_flow_steps() {
330
+
331
+ if ( ! current_user_can( 'manage_options' ) ) {
332
+ return;
333
+ }
334
+
335
+ check_ajax_referer( 'wcf-reorder-flow-steps', 'security' );
336
+
337
+ if ( isset( $_POST['post_id'] ) && isset( $_POST['step_ids'] ) ) {
338
+ $flow_id = intval( $_POST['post_id'] );
339
+ $step_ids = array_map( 'intval', $_POST['step_ids'] );
340
+ }
341
+ $result = array(
342
+ 'status' => false,
343
+ /* translators: %s flow id */
344
+ 'text' => sprintf( __( 'Steps not sorted for flow - %s', 'cartflows' ), $flow_id ),
345
+ );
346
+
347
+ if ( ! $flow_id || ! is_array( $step_ids ) ) {
348
+ wp_send_json( $result );
349
+ }
350
+
351
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
352
+ $flow_steps_map = array();
353
+
354
+ foreach ( $flow_steps as $key => $value ) {
355
+ $flow_steps_map[ $value['id'] ] = $value;
356
+ }
357
+
358
+ $new_flow_steps = array();
359
+
360
+ foreach ( $step_ids as $index => $step_id ) {
361
+
362
+ $new_flow_step_data = array();
363
+
364
+ if ( isset( $flow_steps_map[ $step_id ] ) ) {
365
+ $new_flow_step_data = $flow_steps_map[ $step_id ];
366
+ }
367
+
368
+ $new_flow_step_data['id'] = intval( $step_id );
369
+ $new_flow_step_data['title'] = get_the_title( $step_id );
370
+ $new_flow_step_data['type'] = get_post_meta( $step_id, 'wcf-step-type', true );
371
+
372
+ $new_flow_steps[] = $new_flow_step_data;
373
+ }
374
+
375
+ update_post_meta( $flow_id, 'wcf-steps', $new_flow_steps );
376
+
377
+ $result = array(
378
+ 'status' => true,
379
+ /* translators: %s flow id */
380
+ 'text' => sprintf( __( 'Steps sorted for flow - %s', 'cartflows' ), $flow_id ),
381
+ );
382
+
383
+ wp_send_json( $result );
384
+ }
385
+
386
+
387
+ /**
388
+ * Load admin scripts
389
+ *
390
+ * @since 1.0.0
391
+ *
392
+ * @return void
393
+ */
394
+ public function admin_scripts() {
395
+
396
+ global $pagenow;
397
+ global $post;
398
+
399
+ $screen = get_current_screen();
400
+
401
+ if ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && CARTFLOWS_FLOW_POST_TYPE == $screen->post_type ) {
402
+
403
+ wp_enqueue_script(
404
+ 'wcf-flow-meta',
405
+ CARTFLOWS_URL . 'admin/assets/js/flow-admin-edit.js',
406
+ array( 'jquery', 'jquery-ui-sortable' ),
407
+ CARTFLOWS_VER,
408
+ true
409
+ );
410
+
411
+ wp_enqueue_style( 'wcf-flow-meta', CARTFLOWS_URL . 'admin/assets/css/flow-admin-edit.css', '', CARTFLOWS_VER );
412
+ wp_style_add_data( 'wcf-flow-meta', 'rtl', 'replace' );
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Initialize meta box
418
+ *
419
+ * @since 1.0.0
420
+ *
421
+ * @return void
422
+ */
423
+ public function init_metabox() {
424
+
425
+ /**
426
+ * Fires after the title field.
427
+ *
428
+ * @param WP_Post $post Post object.
429
+ */
430
+ add_action( 'add_meta_boxes', array( $this, 'settings_meta_box' ) );
431
+ add_action( 'edit_form_after_title', array( $this, 'setup_meta_box' ) );
432
+ add_action( 'save_post', array( $this, 'save_meta_box' ) );
433
+ }
434
+
435
+ /**
436
+ * Is first time import?
437
+ *
438
+ * @param integer $post_id post ID.
439
+ * @return bool
440
+ */
441
+ public function is_flow_imported( $post_id = 0 ) {
442
+
443
+ if ( 0 === $post_id ) {
444
+ $post_id = get_the_ID();
445
+ }
446
+
447
+ $steps = get_post_meta( $post_id, 'wcf-steps', true );
448
+ $choice = get_post_meta( $post_id, 'wcf-flow-choise', true );
449
+
450
+ if ( empty( $steps ) && 'import' === $choice ) {
451
+ return true;
452
+ }
453
+
454
+ return false;
455
+ }
456
+
457
+ /**
458
+ * Setup meta box.
459
+ *
460
+ * @return void
461
+ */
462
+ public function setup_meta_box() {
463
+ if ( ! Cartflows_Admin::is_flow_edit_admin() ) {
464
+ return;
465
+ }
466
+
467
+ /**
468
+ * Adding Add new step button to the top*/
469
+ echo $this->add_add_new_step_button();
470
+
471
+ $this->markup_meta_box();
472
+
473
+ $this->add_upgrade_to_pro_metabox();
474
+ }
475
+
476
+
477
+ /**
478
+ * Add metabox when cartflows pro is not enabled.
479
+ */
480
+ public function add_upgrade_to_pro_metabox() {
481
+
482
+ if ( ! _is_cartflows_pro() ) {
483
+ add_meta_box(
484
+ 'wcf-upgrade-pro',
485
+ __( 'Analytics', 'cartflows' ),
486
+ array( $this, 'upgrade_to_pro' ),
487
+ CARTFLOWS_FLOW_POST_TYPE,
488
+ 'side',
489
+ 'high'
490
+ );
491
+ }
492
+
493
+ }
494
+
495
+ /**
496
+ * Show Upgrade To Pro markup.
497
+ */
498
+ public function upgrade_to_pro() {
499
+
500
+ echo '<div>';
501
+ /* translators: %s: link */
502
+ echo '<p><i>' . sprintf( esc_html__( 'Upgrade to %1$sCartFlows Pro%2$s for Analytics feature', 'cartflows' ), '<a href="https://cartflows.com/" target="_blank">', '</a>' ) . '</i></p>';
503
+ echo '<p><a target="_blank" href="https://cartflows.com/" class="button button-primary">' . esc_html__( 'Get Pro', 'cartflows' ) . '</a></p>';
504
+ echo '</div>';
505
+
506
+ }
507
+
508
+ /**
509
+ * Settings meta box.
510
+ *
511
+ * @return void
512
+ */
513
+ public function settings_meta_box() {
514
+
515
+ if ( CARTFLOWS_FLOW_POST_TYPE === get_post_type() ) {
516
+
517
+ /* No need of sandbox will delete it later */
518
+ add_meta_box(
519
+ 'wcf-sandbox-settings', // Id.
520
+ __( 'Flow Settings', 'cartflows' ), // Title.
521
+ array( $this, 'sandbox_meta_box' ), // Callback.
522
+ CARTFLOWS_FLOW_POST_TYPE, // Post_type.
523
+ 'side', // Context.
524
+ 'high' // Priority.
525
+ );
526
+
527
+ do_action( 'cartflows_add_flow_metabox' );
528
+ }
529
+ }
530
+
531
+ /**
532
+ * Metabox Markup
533
+ *
534
+ * @return void
535
+ */
536
+ public function markup_meta_box() {
537
+ global $post;
538
+
539
+ wp_nonce_field( 'save-nonce-flow-meta', 'nonce-flow-meta' );
540
+
541
+ // Get defaults.
542
+ $meta = self::get_current_post_meta( $post->ID );
543
+
544
+ /**
545
+ * Get options
546
+ */
547
+ $updated_data = array(
548
+ 'steps' => $meta['wcf-steps']['default'],
549
+ );
550
+
551
+ do_action( 'wcf_flow_settings_markup_before', $meta );
552
+ $this->page_header_tab( $updated_data );
553
+ do_action( 'wcf_flow_settings_markup_after', $meta );
554
+ }
555
+
556
+ /**
557
+ * Metabox Markup
558
+ *
559
+ * @param object $post Post object.
560
+ * @return void
561
+ */
562
+ public function sandbox_meta_box( $post ) {
563
+
564
+ // Get defaults.
565
+ $meta = self::get_current_post_meta( $post->ID );
566
+
567
+ /**
568
+ * Get options
569
+ */
570
+ foreach ( $meta as $key => $value ) {
571
+ $updated_data[ $key ] = $meta[ $key ]['default'];
572
+ }
573
+
574
+ do_action( 'wcf_flow_sandbox_markup_before', $meta );
575
+ $this->sandbox_markup( $updated_data );
576
+ do_action( 'wcf_flow_sandbox_markup_after', $meta );
577
+ }
578
+
579
+ /**
580
+ * Page Header Tabs
581
+ *
582
+ * @param array $options Post meta.
583
+ * @return void
584
+ */
585
+ public function page_header_tab( $options ) {
586
+
587
+ include_once CARTFLOWS_FLOW_DIR . 'view/meta-flow-steps.php';
588
+ }
589
+
590
+ /**
591
+ * Sandbox Markup
592
+ *
593
+ * @param array $options Post meta.
594
+ * @return void
595
+ */
596
+ public function sandbox_markup( $options ) {
597
+ ?>
598
+ <div class="wcf-flow-sandbox-table wcf-general-metabox-wrap widefat">
599
+ <div class="wcf-flow-sandbox-table-container">
600
+ <?php
601
+ echo wcf()->meta->get_checkbox_field(
602
+ array(
603
+ 'name' => 'wcf-testing',
604
+ 'value' => $options['wcf-testing'],
605
+ 'after' => esc_html__( 'Enable Test Mode', 'cartflows' ),
606
+ )
607
+ );
608
+
609
+ echo wcf()->meta->get_description_field(
610
+ array(
611
+ 'name' => 'wcf-testing-note',
612
+ 'content' => esc_html__( 'If you are using WooCommerce plugin then test mode will add random products in your flow, so you can preview it easily while testing.', 'cartflows' ),
613
+ )
614
+ );
615
+
616
+ ?>
617
+ </div>
618
+ </div>
619
+ <?php
620
+ }
621
+
622
+ /**
623
+ * Keep the menu open when editing the flows.
624
+ * Highlights the wanted admin (sub-) menu items for the CPT.
625
+ *
626
+ * @since 1.0.0
627
+ */
628
+ public function menu_highlight() {
629
+ global $parent_file, $submenu_file, $post_type;
630
+ if ( CARTFLOWS_FLOW_POST_TYPE == $post_type ) :
631
+ $parent_file = CARTFLOWS_SLUG;//phpcs:ignore
632
+ $submenu_file = 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE;//phpcs:ignore
633
+ endif;
634
+ }
635
+
636
+ /**
637
+ * Get metabox options
638
+ *
639
+ * @param int $post_id post id.
640
+ * @return array
641
+ */
642
+ public static function get_meta_option( $post_id ) {
643
+
644
+ if ( null === self::$meta_option ) {
645
+ /**
646
+ * Set metabox options
647
+ */
648
+ self::$meta_option = wcf()->options->get_flow_fields( $post_id );
649
+ }
650
+
651
+ return self::$meta_option;
652
+ }
653
+
654
+ /**
655
+ * Get metabox options
656
+ *
657
+ * @param int $post_id post ID.
658
+ * @return array
659
+ */
660
+ public static function get_current_post_meta( $post_id ) {
661
+
662
+ $stored = get_post_meta( $post_id );
663
+
664
+ $default_meta = self::get_meta_option( $post_id );
665
+
666
+ // Set stored and override defaults.
667
+ foreach ( $stored as $key => $value ) {
668
+ if ( array_key_exists( $key, $default_meta ) ) {
669
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? maybe_unserialize( $stored[ $key ][0] ) : '';
670
+ } else {
671
+ self::$meta_option[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
672
+ }
673
+ }
674
+
675
+ return self::get_meta_option( $post_id );
676
+ }
677
+
678
+ /**
679
+ * Metabox Save
680
+ *
681
+ * @param number $post_id Post ID.
682
+ * @return void
683
+ */
684
+ public function save_meta_box( $post_id ) {
685
+
686
+ // Checks save status.
687
+ $is_autosave = wp_is_post_autosave( $post_id );
688
+ $is_revision = wp_is_post_revision( $post_id );
689
+
690
+ $is_valid_nonce = ( isset( $_POST['nonce-flow-meta'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce-flow-meta'] ) ), 'save-nonce-flow-meta' ) ) ? true : false;
691
+
692
+ // Exits script depending on save status.
693
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
694
+ return;
695
+ }
696
+
697
+ wcf()->options->save_flow_fields( $post_id );
698
+ }
699
+
700
+ /**
701
+ * Localize variables in admin
702
+ *
703
+ * @param array $vars variables.
704
+ */
705
+ public function localize_vars( $vars ) {
706
+
707
+ $ajax_actions = array(
708
+ 'wcf_setup_default_steps',
709
+ 'wcf_add_flow_step',
710
+ 'wcf_delete_flow_step',
711
+ 'wcf_reorder_flow_steps',
712
+ 'wcf_clone_flow_step',
713
+ );
714
+
715
+ foreach ( $ajax_actions as $action ) {
716
+
717
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
718
+ }
719
+
720
+ return $vars;
721
+ }
722
+
723
+ /**
724
+ * Add New Step Button
725
+ *
726
+ * @return string
727
+ */
728
+ public function add_add_new_step_button() {
729
+ $add_new_btn_markup = '<style>.wrap{ position:relative;}</style>';
730
+ $add_new_btn_markup .= "<div class='wcf-button-wrap'>";
731
+ $add_new_btn_markup .= "<button class='wcf-trigger-popup page-title-action'>";
732
+ $add_new_btn_markup .= esc_html__( 'Add New Step', 'cartflows' );
733
+ $add_new_btn_markup .= '</button>';
734
+ $add_new_btn_markup .= '</div>';
735
+
736
+ return $add_new_btn_markup;
737
+ }
738
+
739
+ /**
740
+ * Back to flow button gutenberg template
741
+ *
742
+ * @return void
743
+ */
744
+ public function gutenberg_module_templates() {
745
+
746
+ // Exit if block editor is not enabled.
747
+ if ( ! $this->is_gutenberg_editor_active ) {
748
+ return;
749
+ }
750
+
751
+ if ( CARTFLOWS_STEP_POST_TYPE !== get_post_type() ) {
752
+ return;
753
+ }
754
+
755
+ $flow_id = get_post_meta( get_the_id(), 'wcf-flow-id', true );
756
+
757
+ if ( $flow_id ) {
758
+ ?>
759
+ <script id="wcf-gutenberg-back-flow-button" type="text/html">
760
+ <div class="wcf-notice-back-edit-flow gutenberg-button" >
761
+ <a href="<?php echo esc_url( get_edit_post_link( $flow_id ) ); ?>" class="button button-primary button-large wcf-header-back-button" style="text-decoration: none;">
762
+ <i class="dashicons dashicons-arrow-left-alt"></i>
763
+ <?php esc_html_e( 'Back to edit Flow', 'cartflows' ); ?>
764
+ </a>
765
+ </div>
766
+ </script>
767
+ <?php
768
+ }
769
+ }
770
+
771
+ /**
772
+ * Set status true for gutenberg.
773
+ *
774
+ * @return void
775
+ */
776
+ public function set_block_editor_status() {
777
+
778
+ if ( ! current_user_can( 'manage_options' ) ) {
779
+ return;
780
+ }
781
+
782
+ // Set gutenberg status here.
783
+ $this->is_gutenberg_editor_active = true;
784
+ }
785
+
786
+ /**
787
+ * Get step action buttons
788
+ *
789
+ * @param int $inner_step_id step id.
790
+ * @param bool $ab_test_ui ab test.
791
+ * @param array $args ab test array.
792
+ * @return array.
793
+ */
794
+ public function get_step_action_buttons( $inner_step_id, $ab_test_ui, $args ) {
795
+
796
+ $action_buttons = apply_filters(
797
+ 'cartflows_step_actions',
798
+ array(
799
+ 'view' => array(
800
+ 'link' => get_permalink( $inner_step_id ),
801
+ 'class' => 'wcf-step-view wcf-action-button wp-ui-text-highlight',
802
+ 'tooltip' => esc_html__( 'View Step', 'cartflows' ),
803
+ 'icon' => 'dashicons-visibility',
804
+ 'label' => esc_html__( 'View', 'cartflows' ),
805
+ 'attr' => array(
806
+ 'target' => '_blank',
807
+ ),
808
+ 'show' => true,
809
+ ),
810
+ 'edit' => array(
811
+ 'link' => get_edit_post_link( $inner_step_id ),
812
+ 'class' => 'wcf-step-edit wcf-action-button wp-ui-text-highlight',
813
+ 'tooltip' => esc_html__( 'Edit Step', 'cartflows' ),
814
+ 'icon' => 'dashicons-edit',
815
+ 'label' => esc_html__( 'Edit', 'cartflows' ),
816
+ 'show' => true,
817
+ ),
818
+ 'clone' => array(
819
+ 'link' => '#',
820
+ 'target' => '_blank',
821
+ 'class' => 'wcf-step-clone wcf-action-button wp-ui-text-highlight',
822
+ 'tooltip' => esc_html__( 'Clone Step', 'cartflows' ),
823
+ 'icon' => 'dashicons-admin-page',
824
+ 'label' => esc_html__( 'Clone', 'cartflows' ),
825
+ 'attr' => array(
826
+ 'data-id' => $inner_step_id,
827
+ ),
828
+ 'show' => _is_cartflows_pro() ? true : false,
829
+ ),
830
+ 'delete' => array(
831
+ 'link' => '#',
832
+ 'class' => 'wcf-step-delete wcf-action-button wp-ui-text-highlight',
833
+ 'tooltip' => esc_html__( 'Delete Step', 'cartflows' ),
834
+ 'icon' => 'dashicons-trash',
835
+ 'label' => esc_html__( 'Delete', 'cartflows' ),
836
+ 'attr' => array(
837
+ 'data-id' => $inner_step_id,
838
+ ),
839
+ 'show' => true,
840
+ ),
841
+ 'ab-test' => array(
842
+ 'link' => '#',
843
+ 'class' => 'wcf-step-abtest wcf-action-button wp-ui-text-highlight',
844
+ 'tooltip' => esc_html__( 'A/B Test', 'cartflows' ),
845
+ 'icon' => 'dashicons-forms',
846
+ 'label' => esc_html__( 'A/B Test', 'cartflows' ),
847
+ 'show' => true,
848
+ 'attr' => array(
849
+ 'data-id' => $inner_step_id,
850
+ ),
851
+ 'show' => _is_cartflows_pro() ? true : false,
852
+ ),
853
+ ),
854
+ $inner_step_id,
855
+ $ab_test_ui,
856
+ $args
857
+ );
858
+
859
+ return $action_buttons;
860
+ }
861
+ }
862
+
863
+ /**
864
+ * Kicking this off by calling 'get_instance()' method
865
+ */
866
+ Cartflows_Flow_Meta::get_instance();
modules/flow/classes/class-cartflows-flow-post-type.php CHANGED
@@ -1,383 +1,373 @@
1
- <?php
2
- /**
3
- * Flow post type
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Flow_Post_Type {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Initiator
25
- */
26
- public static function get_instance() {
27
- if ( ! isset( self::$instance ) ) {
28
- self::$instance = new self();
29
- }
30
- return self::$instance;
31
- }
32
-
33
- /**
34
- * Constructor
35
- */
36
- public function __construct() {
37
-
38
- add_action( 'init', array( $this, 'flow_post_type' ) );
39
- add_action( 'admin_menu', array( $this, 'register_as_submenu' ), 100 );
40
- add_action( 'do_meta_boxes', array( $this, 'wcf_change_metabox_position' ) );
41
-
42
- add_filter( 'post_updated_messages', array( $this, 'custom_post_type_post_update_messages' ) );
43
-
44
- add_filter( 'display_post_states', array( $this, 'add_cartflows_post_state' ), 15, 1 );
45
-
46
- add_filter( 'hidden_meta_boxes', array( $this, 'display_flow_slug_meta_box' ), 10, 2 );
47
-
48
- /* View Post URL */
49
- add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
50
- add_filter( 'preview_post_link', array( $this, 'preview_post_link' ), 10, 2 );
51
- add_action( 'template_redirect', array( $this, 'redirect_to_step' ), 10 );
52
- }
53
-
54
- /**
55
- * Add CartFlows post status.
56
- *
57
- * @param array $post_states post data.
58
- * @return array
59
- */
60
- public function add_cartflows_post_state( $post_states ) {
61
-
62
- global $post;
63
-
64
- if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
65
-
66
- $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
67
- $flow_title = get_the_title( $flow_id );
68
-
69
- $post_states['cartflows_step'] = '( ' . __( 'Flow: ', 'cartflows' ) . $flow_id . ' | ' . __( 'Name: ', 'cartflows' ) . $flow_title . ')';
70
-
71
- }
72
-
73
- return $post_states;
74
- }
75
-
76
- /**
77
- * Display slugdiv.
78
- *
79
- * @param array $hidden metaboxes.
80
- * @param obj $screen screen.
81
- * @return array
82
- */
83
- public function display_flow_slug_meta_box( $hidden, $screen ) {
84
- $post_type = $screen->id;
85
- if ( ! empty( $post_type ) && CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
86
- $pos = array_search( 'slugdiv', $hidden, true );
87
- unset( $hidden[ $pos ] );
88
- }
89
-
90
- return $hidden;
91
- }
92
-
93
- /**
94
- * Create custom post type
95
- */
96
- public function flow_post_type() {
97
-
98
- $labels = array(
99
- 'name' => esc_html_x( 'Flows', 'flow general name', 'cartflows' ),
100
- 'singular_name' => esc_html_x( 'Flow', 'flow singular name', 'cartflows' ),
101
- 'search_items' => esc_html__( 'Search Flows', 'cartflows' ),
102
- 'all_items' => esc_html__( 'All Flows', 'cartflows' ),
103
- 'edit_item' => esc_html__( 'Edit Flow', 'cartflows' ),
104
- 'view_item' => esc_html__( 'View Flow', 'cartflows' ),
105
- 'add_new' => esc_html__( 'Add New', 'cartflows' ),
106
- 'update_item' => esc_html__( 'Update Flow', 'cartflows' ),
107
- 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
108
- 'new_item_name' => esc_html__( 'New Flow Name', 'cartflows' ),
109
- );
110
-
111
- $args = array(
112
- 'labels' => $labels,
113
- 'show_in_menu' => false,
114
- 'public' => false, // it's not public, not own permalink.
115
- 'publicly_queryable' => true, // you should be able to query it.
116
- 'show_ui' => true,
117
- 'query_var' => true,
118
- 'can_export' => true,
119
- 'show_in_admin_bar' => true,
120
- 'exclude_from_search' => true,
121
- 'has_archive' => false, // it shouldn't have archive page.
122
- 'rewrite' => false, // it shouldn't have rewrite rules.
123
- 'supports' => array( 'title', 'thumbnail', 'slug' ),
124
- 'capability_type' => 'post',
125
- );
126
-
127
- if ( ! _is_cartflows_pro() ) {
128
-
129
- $flow_posts = get_posts(
130
- array(
131
- 'posts_per_page' => 4,
132
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
133
- 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ),
134
- )
135
- );
136
-
137
- if ( is_array( $flow_posts ) ) {
138
-
139
- $flow_count = count( $flow_posts );
140
-
141
- if ( $flow_count > 3 || 3 === $flow_count ) {
142
-
143
- $args['capabilities'] = array(
144
- 'create_posts' => 'do_not_allow',
145
- );
146
- $args['map_meta_cap'] = true;
147
-
148
- // Add new notice button.
149
- add_action( 'admin_print_footer_scripts', array( $this, 'add_new_notice_button' ) );
150
-
151
- // Add the notice popup HTML to admin footer.
152
- add_action( 'admin_footer', array( $this, 'upgrade_to_pro_notice_popup' ) );
153
- }
154
- }
155
- }
156
-
157
- register_post_type( CARTFLOWS_FLOW_POST_TYPE, $args );
158
- }
159
-
160
- /**
161
- * Show custom add new button.
162
- */
163
- public function add_new_notice_button() {
164
-
165
- $screen = get_current_screen();
166
-
167
- if ( is_object( $screen ) && CARTFLOWS_FLOW_POST_TYPE === $screen->post_type && 'edit-cartflows_flow' === $screen->id ) {
168
- ?>
169
- <script>
170
- jQuery('.wrap h1.wp-heading-inline').after('<a type="button" class="wcf-custom-add-new-button button">Add New</a>');
171
- </script>
172
- <?php
173
- }
174
- }
175
-
176
- /**
177
- * Upgrade to pro notice popup.
178
- *
179
- * @since 1.3.4
180
- *
181
- * @return void
182
- */
183
- public function upgrade_to_pro_notice_popup() {
184
-
185
- ?>
186
- <div id="cartflows-upgrade-notice-overlay" style="display:none;"></div>
187
- <div id="cartflows-upgrade-notice-popup" style="display:none;">
188
- <div class="inner">
189
- <div class="heading">
190
- <span><?php esc_html_e( 'Upgrade to CartFlows Pro', 'cartflows' ); ?></span>
191
- <span class="cartflows-close-popup-button tb-close-icon"></span>
192
- </div>
193
- <div class="contents">
194
- <div class="wcf-notice">
195
- <p>Upgrade to CartFlows Pro for adding more flows and other features. <a href ="https://cartflows.com/" target="_blank"> Click here</a> to upgrade.</p>
196
- </div>
197
- </div>
198
- </div>
199
- </div>
200
- <?php
201
- }
202
-
203
- /**
204
- * Change metabox position.
205
- */
206
- public function wcf_change_metabox_position() {
207
-
208
- remove_meta_box( 'slugdiv', CARTFLOWS_FLOW_POST_TYPE, 'normal' );
209
- add_meta_box( 'slugdiv', __( 'Slug', 'cartflows' ), 'post_slug_meta_box', CARTFLOWS_FLOW_POST_TYPE, 'side', 'high' );
210
- }
211
-
212
- /**
213
- * Add post raw actions
214
- *
215
- * @param array $actions actions.
216
- * @param array $post post data.
217
- * @return array
218
- */
219
- public function post_row_actions( $actions, $post ) {
220
-
221
- $first_step = $this->get_first_step_url( $post );
222
-
223
- if ( $first_step && isset( $actions['view'] ) ) {
224
-
225
- $actions['view'] = '<a href="' . $first_step . '">' . __( 'View', 'cartflows' ) . '</a>';
226
- }
227
-
228
- return $actions;
229
- }
230
-
231
- /**
232
- * Returns previous post link
233
- *
234
- * @param string $prev_link previous link.
235
- * @param array $post post data.
236
- * @return string
237
- */
238
- public function preview_post_link( $prev_link, $post ) {
239
-
240
- if ( $this->is_flow_post_type( $post ) ) {
241
-
242
- $first_step = $this->get_first_step_url( $post );
243
-
244
- if ( $first_step ) {
245
-
246
- return $first_step;
247
- }
248
-
249
- return '';
250
- }
251
-
252
- return $prev_link;
253
- }
254
-
255
- /**
256
- * Check if post type is flow
257
- *
258
- * @param array $post post data.
259
- * @return bool
260
- */
261
- public function is_flow_post_type( $post ) {
262
-
263
- if ( isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
264
-
265
- return true;
266
- }
267
-
268
- return false;
269
- }
270
-
271
- /**
272
- * Redirect to first step
273
- *
274
- * @return void
275
- */
276
- public function redirect_to_step() {
277
-
278
- global $post;
279
-
280
- $first_step = $this->get_first_step_url( $post );
281
-
282
- if ( $first_step ) {
283
-
284
- wp_safe_redirect( $first_step );
285
- die;
286
- }
287
- }
288
-
289
- /**
290
- * Return first step URL
291
- *
292
- * @param array $post post data.
293
- * @return bool
294
- */
295
- public function get_first_step_url( $post ) {
296
-
297
- if ( $this->is_flow_post_type( $post ) ) {
298
-
299
- $flow_id = $post->ID;
300
- $title = $post->post_title;
301
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
302
-
303
- if ( is_array( $steps ) && ! empty( $steps ) && isset( $steps[0]['id'] ) ) {
304
-
305
- return get_permalink( $steps[0]['id'] );
306
- }
307
- }
308
-
309
- return false;
310
- }
311
-
312
- /**
313
- * Register the admin menu for Custom Layouts
314
- *
315
- * @since 1.0.0
316
- * Moved the menu under Appearance -> Custom Layouts
317
- public function register_admin_menu() {
318
- add_submenu_page(
319
- CARTFLOWS_SLUG,
320
- __( 'Flows', 'wcf' ),
321
- __( 'Flows', 'wcf' ),
322
- 'edit_pages',
323
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
324
- );
325
- }
326
- */
327
- public function register_as_submenu() {
328
-
329
- global $submenu;
330
-
331
- $submenu[ CARTFLOWS_SLUG ][0] = array( //phpcs:ignore
332
- __( 'Flows', 'cartflows' ),
333
- 'edit_pages',
334
- 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE,
335
- );
336
- }
337
-
338
- /**
339
- * Add Update messages for any custom post type
340
- *
341
- * @param array $messages Array of default messages.
342
- */
343
- public function custom_post_type_post_update_messages( $messages ) {
344
-
345
- $custom_post_type = get_post_type( get_the_ID() );
346
-
347
- if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
348
-
349
- $obj = get_post_type_object( $custom_post_type );
350
- $singular_name = $obj->labels->singular_name;
351
- $messages[ $custom_post_type ] = array(
352
- 0 => '', // Unused. Messages start at index 1.
353
- /* translators: %s: singular custom post type name */
354
- 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
355
- /* translators: %s: singular custom post type name */
356
- 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
357
- /* translators: %s: singular custom post type name */
358
- 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
359
- /* translators: %s: singular custom post type name */
360
- 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
361
- /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
362
- 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'cartflows' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, //phpcs:ignore
363
- /* translators: %s: singular custom post type name */
364
- 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
365
- /* translators: %s: singular custom post type name */
366
- 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
367
- /* translators: %s: singular custom post type name */
368
- 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
369
- /* translators: %s: singular custom post type name */
370
- 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
371
- /* translators: %s: singular custom post type name */
372
- 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
373
- );
374
- }
375
-
376
- return $messages;
377
- }
378
- }
379
-
380
- /**
381
- * Kicking this off by calling 'get_instance()' method
382
- */
383
- Cartflows_Flow_Post_Type::get_instance();
1
+ <?php
2
+ /**
3
+ * Flow post type
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Flow_Post_Type {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Initiator
25
+ */
26
+ public static function get_instance() {
27
+ if ( ! isset( self::$instance ) ) {
28
+ self::$instance = new self();
29
+ }
30
+ return self::$instance;
31
+ }
32
+
33
+ /**
34
+ * Constructor
35
+ */
36
+ public function __construct() {
37
+
38
+ add_action( 'init', array( $this, 'flow_post_type' ) );
39
+ add_action( 'admin_menu', array( $this, 'register_as_submenu' ), 100 );
40
+ add_action( 'do_meta_boxes', array( $this, 'wcf_change_metabox_position' ) );
41
+
42
+ add_filter( 'post_updated_messages', array( $this, 'custom_post_type_post_update_messages' ) );
43
+
44
+ add_filter( 'display_post_states', array( $this, 'add_cartflows_post_state' ), 15, 1 );
45
+
46
+ add_filter( 'hidden_meta_boxes', array( $this, 'display_flow_slug_meta_box' ), 10, 2 );
47
+
48
+ /* View Post URL */
49
+ add_filter( 'post_row_actions', array( $this, 'post_row_actions' ), 10, 2 );
50
+ add_filter( 'preview_post_link', array( $this, 'preview_post_link' ), 10, 2 );
51
+ add_action( 'template_redirect', array( $this, 'redirect_to_step' ), 10 );
52
+ }
53
+
54
+ /**
55
+ * Add CartFlows post status.
56
+ *
57
+ * @param array $post_states post data.
58
+ * @return array
59
+ */
60
+ public function add_cartflows_post_state( $post_states ) {
61
+
62
+ global $post;
63
+
64
+ if ( isset( $post->post_type ) && CARTFLOWS_STEP_POST_TYPE === $post->post_type ) {
65
+
66
+ $flow_id = get_post_meta( $post->ID, 'wcf-flow-id', true );
67
+ $flow_title = get_the_title( $flow_id );
68
+
69
+ $post_states['cartflows_step'] = '( ' . __( 'Flow: ', 'cartflows' ) . $flow_id . ' | ' . __( 'Name: ', 'cartflows' ) . $flow_title . ')';
70
+
71
+ }
72
+
73
+ return $post_states;
74
+ }
75
+
76
+ /**
77
+ * Display slugdiv.
78
+ *
79
+ * @param array $hidden metaboxes.
80
+ * @param obj $screen screen.
81
+ * @return array
82
+ */
83
+ public function display_flow_slug_meta_box( $hidden, $screen ) {
84
+ $post_type = $screen->id;
85
+ if ( ! empty( $post_type ) && CARTFLOWS_FLOW_POST_TYPE === $post_type ) {
86
+ $pos = array_search( 'slugdiv', $hidden, true );
87
+ unset( $hidden[ $pos ] );
88
+ }
89
+
90
+ return $hidden;
91
+ }
92
+
93
+ /**
94
+ * Create custom post type
95
+ */
96
+ public function flow_post_type() {
97
+
98
+ $labels = array(
99
+ 'name' => esc_html_x( 'Flows', 'flow general name', 'cartflows' ),
100
+ 'singular_name' => esc_html_x( 'Flow', 'flow singular name', 'cartflows' ),
101
+ 'search_items' => esc_html__( 'Search Flows', 'cartflows' ),
102
+ 'all_items' => esc_html__( 'All Flows', 'cartflows' ),
103
+ 'edit_item' => esc_html__( 'Edit Flow', 'cartflows' ),
104
+ 'view_item' => esc_html__( 'View Flow', 'cartflows' ),
105
+ 'add_new' => esc_html__( 'Add New', 'cartflows' ),
106
+ 'update_item' => esc_html__( 'Update Flow', 'cartflows' ),
107
+ 'add_new_item' => esc_html__( 'Add New', 'cartflows' ),
108
+ 'new_item_name' => esc_html__( 'New Flow Name', 'cartflows' ),
109
+ );
110
+
111
+ $args = array(
112
+ 'labels' => $labels,
113
+ 'show_in_menu' => false,
114
+ 'public' => false, // it's not public, not own permalink.
115
+ 'publicly_queryable' => true, // you should be able to query it.
116
+ 'show_ui' => true,
117
+ 'query_var' => true,
118
+ 'can_export' => true,
119
+ 'show_in_admin_bar' => true,
120
+ 'exclude_from_search' => true,
121
+ 'has_archive' => false, // it shouldn't have archive page.
122
+ 'rewrite' => false, // it shouldn't have rewrite rules.
123
+ 'supports' => array( 'title', 'thumbnail', 'slug' ),
124
+ 'capability_type' => 'post',
125
+ );
126
+
127
+ if ( ! _is_cartflows_pro() ) {
128
+
129
+ $flow_posts = get_posts(
130
+ array(
131
+ 'posts_per_page' => 4,
132
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
133
+ 'post_status' => array( 'publish', 'pending', 'draft', 'future', 'private' ),
134
+ )
135
+ );
136
+
137
+ if ( is_array( $flow_posts ) ) {
138
+
139
+ $flow_count = count( $flow_posts );
140
+
141
+ if ( $flow_count > 3 || 3 === $flow_count ) {
142
+
143
+ $args['capabilities'] = array(
144
+ 'create_posts' => 'do_not_allow',
145
+ );
146
+ $args['map_meta_cap'] = true;
147
+
148
+ // Add new notice button.
149
+ add_action( 'admin_print_footer_scripts', array( $this, 'add_new_notice_button' ) );
150
+
151
+ // Add the notice popup HTML to admin footer.
152
+ add_action( 'admin_footer', array( $this, 'upgrade_to_pro_notice_popup' ) );
153
+ }
154
+ }
155
+ }
156
+
157
+ register_post_type( CARTFLOWS_FLOW_POST_TYPE, $args );
158
+ }
159
+
160
+ /**
161
+ * Show custom add new button.
162
+ */
163
+ public function add_new_notice_button() {
164
+
165
+ $screen = get_current_screen();
166
+
167
+ if ( is_object( $screen ) && CARTFLOWS_FLOW_POST_TYPE === $screen->post_type && 'edit-cartflows_flow' === $screen->id ) {
168
+ ?>
169
+ <script>
170
+ jQuery('.wrap h1.wp-heading-inline').after('<a type="button" class="wcf-custom-add-new-button button">Add New</a>');
171
+ </script>
172
+ <?php
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Upgrade to pro notice popup.
178
+ *
179
+ * @since 1.3.4
180
+ *
181
+ * @return void
182
+ */
183
+ public function upgrade_to_pro_notice_popup() {
184
+
185
+ ?>
186
+ <div id="cartflows-upgrade-notice-overlay" style="display:none;"></div>
187
+ <div id="cartflows-upgrade-notice-popup" style="display:none;">
188
+ <div class="inner">
189
+ <div class="heading">
190
+ <span><?php esc_html_e( 'Upgrade to CartFlows Pro', 'cartflows' ); ?></span>
191
+ <span class="cartflows-close-popup-button tb-close-icon"></span>
192
+ </div>
193
+ <div class="contents">
194
+ <div class="wcf-notice">
195
+ <p>Upgrade to CartFlows Pro for adding more flows and other features. <a href ="https://cartflows.com/" target="_blank"> Click here</a> to upgrade.</p>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ <?php
201
+ }
202
+
203
+ /**
204
+ * Change metabox position.
205
+ */
206
+ public function wcf_change_metabox_position() {
207
+
208
+ remove_meta_box( 'slugdiv', CARTFLOWS_FLOW_POST_TYPE, 'normal' );
209
+ add_meta_box( 'slugdiv', __( 'Slug', 'cartflows' ), 'post_slug_meta_box', CARTFLOWS_FLOW_POST_TYPE, 'side', 'high' );
210
+ }
211
+
212
+ /**
213
+ * Add post raw actions
214
+ *
215
+ * @param array $actions actions.
216
+ * @param array $post post data.
217
+ * @return array
218
+ */
219
+ public function post_row_actions( $actions, $post ) {
220
+
221
+ $first_step = $this->get_first_step_url( $post );
222
+
223
+ if ( $first_step && isset( $actions['view'] ) ) {
224
+
225
+ $actions['view'] = '<a href="' . $first_step . '">' . __( 'View', 'cartflows' ) . '</a>';
226
+ }
227
+
228
+ return $actions;
229
+ }
230
+
231
+ /**
232
+ * Returns previous post link
233
+ *
234
+ * @param string $prev_link previous link.
235
+ * @param array $post post data.
236
+ * @return string
237
+ */
238
+ public function preview_post_link( $prev_link, $post ) {
239
+
240
+ if ( $this->is_flow_post_type( $post ) ) {
241
+
242
+ $first_step = $this->get_first_step_url( $post );
243
+
244
+ if ( $first_step ) {
245
+
246
+ return $first_step;
247
+ }
248
+
249
+ return '';
250
+ }
251
+
252
+ return $prev_link;
253
+ }
254
+
255
+ /**
256
+ * Check if post type is flow
257
+ *
258
+ * @param array $post post data.
259
+ * @return bool
260
+ */
261
+ public function is_flow_post_type( $post ) {
262
+
263
+ if ( isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
264
+
265
+ return true;
266
+ }
267
+
268
+ return false;
269
+ }
270
+
271
+ /**
272
+ * Redirect to first step
273
+ *
274
+ * @return void
275
+ */
276
+ public function redirect_to_step() {
277
+
278
+ global $post;
279
+
280
+ $first_step = $this->get_first_step_url( $post );
281
+
282
+ if ( $first_step ) {
283
+
284
+ wp_safe_redirect( $first_step );
285
+ die;
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Return first step URL
291
+ *
292
+ * @param array $post post data.
293
+ * @return bool
294
+ */
295
+ public function get_first_step_url( $post ) {
296
+
297
+ if ( $this->is_flow_post_type( $post ) ) {
298
+
299
+ $flow_id = $post->ID;
300
+ $title = $post->post_title;
301
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
302
+
303
+ if ( is_array( $steps ) && ! empty( $steps ) && isset( $steps[0]['id'] ) ) {
304
+
305
+ return get_permalink( $steps[0]['id'] );
306
+ }
307
+ }
308
+
309
+ return false;
310
+ }
311
+
312
+ /**
313
+ * Register the admin menu for Custom Layouts
314
+ * Add flows submenu
315
+ *
316
+ * @since 1.0.0
317
+ */
318
+ public function register_as_submenu() {
319
+ add_submenu_page(
320
+ CARTFLOWS_SLUG,
321
+ __( 'Flows', 'cartflows' ),
322
+ __( 'Flows', 'cartflows' ),
323
+ 'edit_pages',
324
+ 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE
325
+ );
326
+ }
327
+
328
+ /**
329
+ * Add Update messages for any custom post type
330
+ *
331
+ * @param array $messages Array of default messages.
332
+ */
333
+ public function custom_post_type_post_update_messages( $messages ) {
334
+
335
+ $custom_post_type = get_post_type( get_the_ID() );
336
+
337
+ if ( CARTFLOWS_FLOW_POST_TYPE == $custom_post_type ) {
338
+
339
+ $obj = get_post_type_object( $custom_post_type );
340
+ $singular_name = $obj->labels->singular_name;
341
+ $messages[ $custom_post_type ] = array(
342
+ 0 => '', // Unused. Messages start at index 1.
343
+ /* translators: %s: singular custom post type name */
344
+ 1 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
345
+ /* translators: %s: singular custom post type name */
346
+ 2 => sprintf( __( 'Custom %s updated.', 'cartflows' ), $singular_name ),
347
+ /* translators: %s: singular custom post type name */
348
+ 3 => sprintf( __( 'Custom %s deleted.', 'cartflows' ), $singular_name ),
349
+ /* translators: %s: singular custom post type name */
350
+ 4 => sprintf( __( '%s updated.', 'cartflows' ), $singular_name ),
351
+ /* translators: %1$s: singular custom post type name ,%2$s: date and time of the revision */
352
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'cartflows' ), $singular_name, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, //phpcs:ignore
353
+ /* translators: %s: singular custom post type name */
354
+ 6 => sprintf( __( '%s published.', 'cartflows' ), $singular_name ),
355
+ /* translators: %s: singular custom post type name */
356
+ 7 => sprintf( __( '%s saved.', 'cartflows' ), $singular_name ),
357
+ /* translators: %s: singular custom post type name */
358
+ 8 => sprintf( __( '%s submitted.', 'cartflows' ), $singular_name ),
359
+ /* translators: %s: singular custom post type name */
360
+ 9 => sprintf( __( '%s scheduled for.', 'cartflows' ), $singular_name ),
361
+ /* translators: %s: singular custom post type name */
362
+ 10 => sprintf( __( '%s draft updated.', 'cartflows' ), $singular_name ),
363
+ );
364
+ }
365
+
366
+ return $messages;
367
+ }
368
+ }
369
+
370
+ /**
371
+ * Kicking this off by calling 'get_instance()' method
372
+ */
373
+ Cartflows_Flow_Post_Type::get_instance();
 
 
 
 
 
 
 
 
 
 
modules/flow/view/meta-flow-steps.php CHANGED
@@ -1,210 +1,158 @@
1
- <?php
2
- /**
3
- * View Flow steps
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
9
-
10
- $steps = array(
11
- 'landing' => __( 'Landing', 'cartflows' ),
12
- 'checkout' => __( 'Checkout (Woo)', 'cartflows' ),
13
- 'thankyou' => __( 'Thank You (Woo)', 'cartflows' ),
14
- 'upsell' => __( 'Upsell (Woo)', 'cartflows' ),
15
- 'downsell' => __( 'Downsell (Woo)', 'cartflows' ),
16
- 'optin' => __( 'Optin (Woo)', 'cartflows' ),
17
- );
18
-
19
- ?>
20
- <div class="wcf-flow-steps-meta-box">
21
- <div class="wcf-flow-settings">
22
- <?php do_action( 'cartflows_above_flow_steps' ); ?>
23
- <div class="wcf-flow-steps-wrap">
24
- <div class="wcf-flow-steps-container">
25
- <?php if ( is_array( $options['steps'] ) ) { ?>
26
- <?php foreach ( $options['steps'] as $index => $data ) { ?>
27
- <?php
28
- $term_slug = '';
29
- $term_name = '';
30
- $step_wrap_class = '';
31
- $has_product_assigned = true;
32
- $is_global_checkout = '';
33
- $common = '';
34
- $data_step_id = intval( $data['id'] );
35
-
36
- if ( isset( $data['type'] ) ) {
37
- $term_slug = $data['type'];
38
- $term_name = $steps[ $data['type'] ];
39
- }
40
-
41
- if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) {
42
- $step_wrap_class .= ' invalid-step';
43
- }
44
-
45
- if ( isset( $_GET['highlight-step-id'] ) ) { //phpcs:ignore
46
-
47
- $highlight_step_id = intval( $_GET['highlight-step-id'] ); //phpcs:ignore
48
-
49
- if ( $highlight_step_id === $data_step_id ) {
50
- $step_wrap_class .= ' wcf-new-step-highlight';
51
- }
52
- }
53
-
54
- if ( 'checkout' === $term_slug ) {
55
-
56
- $common = Cartflows_Helper::get_common_settings();
57
-
58
- $is_global_checkout = (int) $common['global_checkout'];
59
-
60
- if ( $data['id'] === $is_global_checkout ) {
61
- $step_wrap_class .= ' wcf-global-checkout';
62
- }
63
- }
64
-
65
- if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) {
66
-
67
- $has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] );
68
-
69
- if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
70
- $step_wrap_class .= ' wcf-no-product-step';
71
- }
72
- }
73
-
74
- ?>
75
- <div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>">
76
- <div class="wcf-step">
77
- <div class="wcf-step-left-content">
78
- <span class="dashicons dashicons-menu"></span>
79
- <span><?php echo wp_trim_words( get_the_title( $data['id'] ), 3 ); ?></span>
80
- <span class="wcf-flow-badge"><?php echo esc_attr( $term_name ); ?></span>
81
-
82
- <?php
83
- if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
84
- ?>
85
- <span class="wcf-no-product-badge"><?php esc_html_e( 'No Product Assigned', 'cartflows' ); ?></span>
86
- <?php
87
- } elseif ( ( $has_product_assigned ) && ( $data['id'] === $is_global_checkout ) ) {
88
- ?>
89
- <span class="wcf-global-checkout-badge wcf-error-badge"><?php esc_html_e( 'Global Checkout - Remove selected checkout product', 'cartflows' ); ?></span>
90
- <?php
91
- } elseif ( ( ! $has_product_assigned ) && $data['id'] === $is_global_checkout ) {
92
- ?>
93
- <span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout', 'cartflows' ); ?></span>
94
- <?php
95
- }
96
- ?>
97
-
98
- <input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $data['id']; ?>">
99
- <?php do_action( 'cartflows_step_left_content', $data['id'], $term_slug ); ?>
100
- </div>
101
- <div class="wcf-steps-action-buttons">
102
- <a href="<?php echo get_permalink( $data['id'] ); ?>" target="_blank" class="wcf-step-view wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'View Step', 'cartflows' ); ?>" >
103
- <span class="dashicons dashicons-visibility"></span>
104
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'View', 'cartflows' ); ?></span>
105
- </a>
106
- <a href="<?php echo get_edit_post_link( $data['id'] ); ?>" class="wcf-step-edit wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Edit Step', 'cartflows' ); ?>" >
107
- <span class="dashicons dashicons-edit"></span>
108
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Edit', 'cartflows' ); ?></span>
109
- </a>
110
- <?php
111
- if ( _is_cartflows_pro() ) {
112
- ?>
113
- <a href="<?php echo wp_nonce_url( 'admin.php?action=cartflows_clone_step&post=' . $data['id'], 'step_clone', 'step_clone_nonce' ); ?>" class="wcf-step-clone wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Clone Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>">
114
- <span class="dashicons dashicons-admin-page"></span>
115
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Clone', 'cartflows' ); ?></span>
116
- </a>
117
- <?php } ?>
118
- <a href="#" class="wcf-step-delete wcf-action-button wp-ui-text-highlight" title="<?php echo esc_html__( 'Delete Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>">
119
- <span class="dashicons dashicons-trash"></span>
120
- <span class="wcf-step-act-btn-text"><?php echo esc_html__( 'Delete', 'cartflows' ); ?></span>
121
- </a>
122
- </div>
123
- </div>
124
- </div><!-- .wcf-step-wrap -->
125
- <?php } ?>
126
- <?php } ?>
127
- </div><!-- .wcf-flow-steps-container -->
128
- </div> <!-- .wcf-flow-steps-wrap -->
129
- <div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap -->
130
- <?php do_action( 'cartflows_bellow_flow_steps' ); ?>
131
- <div class='wcf-add-new-step-btn-wrap'>
132
- <button class='wcf-trigger-popup button button-primary'>
133
- <?php echo esc_html__( 'Add New Step', 'cartflows' ); ?>
134
- </button>
135
- </div>
136
- </div><!-- .wcf-flow-buttons-wrap -->
137
- </div><!-- .wcf-flow-settings -->
138
-
139
- <div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay">
140
- <div class="wcf-templates-popup-content">
141
- <div class="spinner"></div>
142
- <div class="wcf-templates-wrap wcf-templates-wrap-flows">
143
-
144
- <div id="wcf-remote-step-actions" class="wcf-template-header">
145
- <div class="wcf-template-logo-wrap">
146
- <span class="wcf-cartflows-logo-img">
147
- <span class="cartflows-logo-icon"></span>
148
- </span>
149
- <span class="wcf-cartflows-title"><?php esc_html_e( 'Steps Library', 'cartflows' ); ?></span>
150
- </div>
151
- <div class="wcf-tab-wrapper">
152
- <?php if ( 'other' !== $default_page_builder ) { ?>
153
- <div id="wcf-get-started-steps">
154
- <ul class="filter-links ">
155
- <li>
156
- <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
157
- </li>
158
- <li>
159
- <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
160
- </li>
161
- </ul>
162
- </div>
163
- <?php } ?>
164
- </div>
165
- <div class="wcf-popup-close-wrap">
166
- <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
167
- </div>
168
- </div>
169
-
170
- <!--<div class="wcf-search-form">
171
- <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
172
- <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
173
- </div>-->
174
-
175
- <div id="wcf-remote-content">
176
- <?php if ( 'other' !== $default_page_builder ) { ?>
177
- <div id="wcf-ready-templates">
178
- <div id="wcf-remote-filters">
179
- <div id="wcf-page-builders"></div>
180
- <div id="wcf-categories"></div>
181
- </div>
182
- <div class="wcf-page-builder-notice"></div>
183
- <div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
184
- <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
185
- </div>
186
- <?php } ?>
187
- <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
188
- <div class="inner">
189
- <div id="wcf-scratch-steps-categories">
190
- <select class="step-type-filter-links filter-links">
191
- <option value="" class="current"> Select Step Type </option>
192
-
193
- <?php foreach ( $steps as $key => $value ) { ?>
194
- <option class="<?php echo $key; ?>" data-slug="<?php echo $key; ?>" data-title="<?php echo $key; ?>"><?php echo $value; ?></option>
195
- <?php } ?>
196
- </select>
197
- </div>
198
- <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create Step', 'cartflows' ); ?></a>
199
- <?php if ( ! _is_cartflows_pro() ) { ?>
200
- <div class="wcf-template-notice"><p><?php echo esc_html__( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div>
201
- <?php } ?>
202
- <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
203
- </div>
204
- </div>
205
- </div>
206
- </div>
207
- </div>
208
- </div><!-- .wcf-templates-popup-overlay -->
209
- </div>
210
- <?php
1
+ <?php
2
+ /**
3
+ * View Flow steps
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
9
+
10
+ $steps = array(
11
+ 'landing' => __( 'Landing', 'cartflows' ),
12
+ 'checkout' => __( 'Checkout (Woo)', 'cartflows' ),
13
+ 'thankyou' => __( 'Thank You (Woo)', 'cartflows' ),
14
+ 'upsell' => __( 'Upsell (Woo)', 'cartflows' ),
15
+ 'downsell' => __( 'Downsell (Woo)', 'cartflows' ),
16
+ 'optin' => __( 'Optin (Woo)', 'cartflows' ),
17
+ );
18
+ ?>
19
+ <div class="wcf-flow-steps-meta-box">
20
+ <div class="wcf-flow-settings">
21
+ <?php do_action( 'cartflows_above_flow_steps' ); ?>
22
+ <div class="wcf-flow-steps-wrap">
23
+ <div class="wcf-flow-steps-container">
24
+ <?php if ( is_array( $options['steps'] ) ) { ?>
25
+ <?php foreach ( $options['steps'] as $index => $data ) { ?>
26
+ <?php
27
+ $term_slug = '';
28
+ $term_name = '';
29
+ $step_wrap_class = '';
30
+ $has_product_assigned = true;
31
+ $is_global_checkout = '';
32
+ $common = '';
33
+ $data_step_id = intval( $data['id'] );
34
+
35
+ $control_id = $data_step_id;
36
+ $note = '';
37
+ $ab_test = false;
38
+ $ab_test_ui = false;
39
+ $ab_test_variations = array();
40
+ $ab_test_archived_variations = array();
41
+ $ab_test_variations_count = 0;
42
+ $ab_test_args = array();
43
+
44
+ if ( _is_cartflows_pro() ) {
45
+
46
+ $ab_test_ui = isset( $data['ab-test-ui'] ) && $data['ab-test-ui'] ? true : false;
47
+ $ab_test = isset( $data['ab-test'] ) && $data['ab-test'] ? true : false;
48
+ $ab_test_variations = isset( $data['ab-test-variations'] ) ? $data['ab-test-variations'] : array();
49
+ $ab_test_archived_variations = isset( $data['ab-test-archived-variations'] ) ? $data['ab-test-archived-variations'] : array();
50
+ $ab_test_variations_count = count( $ab_test_variations );
51
+
52
+ if ( $ab_test_variations_count < 2 ) {
53
+ $ab_test_ui = false;
54
+ }
55
+ }
56
+
57
+ $ab_test_args = array(
58
+ 'control_id' => $data_step_id,
59
+ 'ab_test_variations' => $ab_test_variations,
60
+ 'ab_test_archived_variations' => $ab_test_archived_variations,
61
+ 'ab_test_variations_count' => $ab_test_variations_count,
62
+ );
63
+
64
+ if ( isset( $data['type'] ) ) {
65
+ $term_slug = $data['type'];
66
+ $term_name = $steps[ $data['type'] ];
67
+ }
68
+
69
+ if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) {
70
+ $step_wrap_class .= ' invalid-step';
71
+ }
72
+
73
+ if ( isset( $_GET['highlight-step-id'] ) ) { //phpcs:ignore
74
+
75
+ $highlight_step_id = intval( $_GET['highlight-step-id'] ); //phpcs:ignore
76
+
77
+ if ( $highlight_step_id === $data_step_id ) {
78
+ $step_wrap_class .= ' wcf-new-step-highlight';
79
+ }
80
+ }
81
+
82
+ if ( 'checkout' === $term_slug ) {
83
+
84
+ $common = Cartflows_Helper::get_common_settings();
85
+
86
+ $is_global_checkout = (int) $common['global_checkout'];
87
+
88
+ if ( $data['id'] === $is_global_checkout ) {
89
+ $step_wrap_class .= ' wcf-global-checkout';
90
+ }
91
+ }
92
+
93
+ if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) {
94
+
95
+ $has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] );
96
+
97
+ if ( ( ! $has_product_assigned ) && ( $data['id'] != $is_global_checkout ) ) {
98
+ $step_wrap_class .= ' wcf-no-product-step';
99
+ }
100
+ }
101
+
102
+ if ( $ab_test_ui ) {
103
+ $step_wrap_class .= apply_filters( 'cartflows_ab_test_step_wrap_class', ' wcf-ab-test' );
104
+ }
105
+
106
+ ?>
107
+ <div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>">
108
+ <?php
109
+ do_action( 'cartflows_wcf_step_wrap_top', $data, $ab_test_ui, $ab_test, $ab_test_args );
110
+ ?>
111
+ <?php
112
+
113
+ if ( $ab_test_ui && is_array( $ab_test_variations ) && ! empty( $ab_test_variations ) ) {
114
+
115
+ $var_badge_count = 0;
116
+
117
+ foreach ( $ab_test_variations as $ab_test_variation ) {
118
+
119
+ $inner_step_id = $ab_test_variation['id'];
120
+ $action_buttons = $this->get_step_action_buttons( $inner_step_id, $ab_test_ui, $ab_test_args );
121
+
122
+ include CARTFLOWS_FLOW_DIR . 'view/view-flow-inner-step.php';
123
+ }
124
+ } else {
125
+
126
+ $inner_step_id = $data['id'];
127
+ $action_buttons = $this->get_step_action_buttons( $inner_step_id, $ab_test_ui, $ab_test_args );
128
+
129
+ include CARTFLOWS_FLOW_DIR . 'view/view-flow-inner-step.php';
130
+ }
131
+
132
+ do_action( 'cartflows_wcf_step_wrap_bottom', $data, $ab_test_ui, $ab_test, $ab_test_args );
133
+
134
+
135
+ ?>
136
+ </div><!-- .wcf-step-wrap -->
137
+ <?php } ?>
138
+ <?php } ?>
139
+ </div><!-- .wcf-flow-steps-container -->
140
+ </div> <!-- .wcf-flow-steps-wrap -->
141
+ <div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap -->
142
+ <?php do_action( 'cartflows_below_flow_steps' ); ?>
143
+ <div class='wcf-add-new-step-btn-wrap'>
144
+ <button class='wcf-trigger-popup button button-primary'>
145
+ <?php echo esc_html__( 'Add New Step', 'cartflows' ); ?>
146
+ </button>
147
+ </div>
148
+ </div><!-- .wcf-flow-buttons-wrap -->
149
+ </div><!-- .wcf-flow-settings -->
150
+
151
+ <?php
152
+
153
+ require CARTFLOWS_FLOW_DIR . 'view/view-remote-importer.php';
154
+
155
+ do_action( 'cartflows_after_flow_settings_meta', $data );
156
+ ?>
157
+ </div>
158
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/flow/view/view-flow-inner-step.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * View flow inner step
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $inner_step_title = get_the_title( $inner_step_id );
9
+ $note = get_post_meta( $inner_step_id, 'wcf-step-note', true );
10
+ ?>
11
+ <div class="wcf-step">
12
+ <div class="wcf-step-left-content">
13
+ <span class="dashicons dashicons-menu"></span>
14
+ <span title="<?php echo esc_attr( $inner_step_title ); ?>"><?php echo wp_trim_words( $inner_step_title, 3 ); ?></span>
15
+ <?php
16
+ if ( $ab_test && ! empty( $note ) ) {
17
+ ?>
18
+ <span class="dashicons dashicons-editor-help" id="wcf-tooltip">
19
+ <span class="wcf-ab-test-note-badge"><?php echo $note; ?></span>
20
+ </span>
21
+ <?php
22
+ }
23
+
24
+
25
+ ?>
26
+ <?php
27
+ if ( $ab_test_ui ) {
28
+ if ( $control_id === $inner_step_id ) {
29
+ ?>
30
+ <span class="wcf-step-badge wcf-abtest-control-badge"><?php esc_html_e( 'Control', 'cartflows' ); ?></span>
31
+ <?php } else { ?>
32
+ <span class="wcf-step-badge wcf-abtest-variation-badge"><?php /* translators: %s badge count */ echo esc_html( sprintf( __( 'Variation-%s', 'cartflows' ), ++$var_badge_count ) ); ?></span>
33
+ <?php
34
+ }
35
+ }
36
+ ?>
37
+
38
+ <span class="wcf-flow-badge"><?php echo esc_html( $term_name ); ?></span>
39
+
40
+ <?php
41
+
42
+ if ( ( ! $has_product_assigned ) && ( $inner_step_id != $is_global_checkout ) ) {
43
+ ?>
44
+ <span class="wcf-no-product-badge"><?php esc_html_e( 'No Product Assigned', 'cartflows' ); ?></span>
45
+ <?php
46
+ } elseif ( ( $has_product_assigned ) && ( $inner_step_id === $is_global_checkout ) ) {
47
+ ?>
48
+ <span class="wcf-global-checkout-badge wcf-error-badge"><?php esc_html_e( 'Global Checkout - Remove selected checkout product', 'cartflows' ); ?></span>
49
+ <?php
50
+ } elseif ( ( ! $has_product_assigned ) && $inner_step_id === $is_global_checkout ) {
51
+ ?>
52
+ <span class="wcf-global-checkout-badge"><?php esc_html_e( 'Global Checkout', 'cartflows' ); ?></span>
53
+ <?php
54
+ }
55
+
56
+ ?>
57
+
58
+ <?php if ( $control_id === $inner_step_id ) { ?>
59
+ <input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $inner_step_id; ?>">
60
+ <?php } ?>
61
+ <?php do_action( 'cartflows_step_left_content', $inner_step_id, $term_slug ); ?>
62
+ </div>
63
+
64
+ <!-- popup for setting -->
65
+ <div id="wcf-edit-dropdown" class="wcf-edit-content" >
66
+
67
+
68
+ <?php foreach ( $action_buttons as $action_slug => $action_data ) { ?>
69
+ <?php
70
+
71
+ if ( 'view' === $action_slug || 'edit' === $action_slug ) {
72
+ continue;
73
+ }
74
+
75
+ if ( $ab_test_ui ) {
76
+
77
+ if ( 'ab-test' === $action_slug ) {
78
+ continue;
79
+ }
80
+ } else {
81
+
82
+ if ( isset( $action_data['ab-test'] ) ) {
83
+ continue;
84
+ }
85
+ }
86
+
87
+
88
+ $action_attr = ' ';
89
+ if ( isset( $action_data['attr'] ) && is_array( $action_data['attr'] ) ) {
90
+ foreach ( $action_data['attr'] as $attr_key => $attr_value ) {
91
+ $action_attr .= $attr_key . '="' . $attr_value . '"';
92
+ }
93
+ }
94
+ $style = '';
95
+ if ( ! $action_data['show'] ) {
96
+ $style = 'opacity: 0.65; cursor: not-allowed;';
97
+ $action_data['label'] .= ' ( Pro )';
98
+ $action_data['tooltip'] = 'Upgrade to Pro for this feature.';
99
+ $action_data['class'] .= ' wcf-pro';
100
+ }
101
+ ?>
102
+ <a href="<?php echo $action_data['link']; ?>" style ="<?php echo $style; ?>" class="<?php echo $action_data['class']; ?>" title="<?php echo $action_data['tooltip']; ?>" <?php echo $action_attr; ?>>
103
+ <span class="dashicons <?php echo $action_data['icon']; ?>"></span>
104
+ <span class="wcf-step-act-btn-text"><?php echo $action_data['label']; ?></span>
105
+ </a>
106
+ <?php } ?>
107
+
108
+ </div>
109
+
110
+ <!-- popup for setting -->
111
+
112
+ <div class="wcf-steps-action-buttons">
113
+ <div class="wcf-basic-action-buttons">
114
+ <?php
115
+ foreach ( $action_buttons as $action_slug => $action_data ) {
116
+ if ( 'view' === $action_slug || 'edit' === $action_slug ) {
117
+ ?>
118
+ <a href="<?php echo $action_data['link']; ?>" class="<?php echo $action_data['class']; ?>" title="<?php echo $action_data['tooltip']; ?>" <?php echo $action_attr; ?>>
119
+ <span class="dashicons <?php echo $action_data['icon']; ?>"></span>
120
+ <span class="wcf-step-act-btn-text"><?php echo $action_data['label']; ?></span>
121
+ </a>
122
+ <?php
123
+ }
124
+ }
125
+ ?>
126
+ </div>
127
+ <div class="wcf-edit-settings"></div>
128
+ </div>
129
+ </div>
modules/flow/view/view-remote-importer.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * View Remote importer popup
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ ?>
9
+ <div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay">
10
+ <div class="wcf-templates-popup-content">
11
+ <div class="spinner"></div>
12
+ <div class="wcf-templates-wrap wcf-templates-wrap-flows">
13
+
14
+ <div id="wcf-remote-step-actions" class="wcf-template-header">
15
+ <div class="wcf-template-logo-wrap">
16
+ <span class="wcf-cartflows-logo-img">
17
+ <span class="cartflows-logo-icon"></span>
18
+ </span>
19
+ <span class="wcf-cartflows-title"><?php esc_html_e( 'Steps Library', 'cartflows' ); ?></span>
20
+ </div>
21
+ <div class="wcf-tab-wrapper">
22
+ <?php if ( 'other' !== $default_page_builder ) { ?>
23
+ <div id="wcf-get-started-steps">
24
+ <ul class="filter-links ">
25
+ <li>
26
+ <a href="#" class="current" data-slug="ready-templates" data-title="<?php esc_html_e( 'Ready Templates', 'cartflows' ); ?>"><?php esc_html_e( 'Ready Templates', 'cartflows' ); ?></a>
27
+ </li>
28
+ <li>
29
+ <a href="#" data-slug="canvas" data-title="<?php esc_html_e( 'Create Your Own', 'cartflows' ); ?>"><?php esc_html_e( 'Create Your Own', 'cartflows' ); ?></a>
30
+ </li>
31
+ </ul>
32
+ </div>
33
+ <?php } ?>
34
+ </div>
35
+ <div class="wcf-popup-close-wrap">
36
+ <span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span>
37
+ </div>
38
+ </div>
39
+
40
+ <!--<div class="wcf-search-form">
41
+ <label class="screen-reader-text" for="wp-filter-search-input"><?php esc_html_e( 'Search Sites', 'cartflows' ); ?> </label>
42
+ <input placeholder="<?php esc_html_e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input">
43
+ </div>-->
44
+
45
+ <div id="wcf-remote-content">
46
+ <?php if ( 'other' !== $default_page_builder ) { ?>
47
+ <div id="wcf-ready-templates">
48
+ <div id="wcf-remote-filters">
49
+ <div id="wcf-page-builders"></div>
50
+ <div id="wcf-categories"></div>
51
+ </div>
52
+ <div class="wcf-page-builder-notice"></div>
53
+ <div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"><span class="spinner is-active"></span></div>
54
+ <div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div>
55
+ </div>
56
+ <?php } ?>
57
+ <div id="wcf-start-from-scratch" style="<?php echo ( 'other' !== $default_page_builder ) ? 'display: none;' : ''; ?>">
58
+ <div class="inner">
59
+ <div id="wcf-scratch-steps-categories">
60
+ <select class="step-type-filter-links filter-links">
61
+ <option value="" class="current"> Select Step Type </option>
62
+
63
+ <?php foreach ( $steps as $key => $value ) { ?>
64
+ <option class="<?php echo $key; ?>" data-slug="<?php echo $key; ?>" data-title="<?php echo $key; ?>"><?php echo $value; ?></option>
65
+ <?php } ?>
66
+ </select>
67
+ </div>
68
+ <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create Step', 'cartflows' ); ?></a>
69
+ <?php if ( ! _is_cartflows_pro() ) { ?>
70
+ <div class="wcf-template-notice"><p><?php echo esc_html__( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div>
71
+ <?php } ?>
72
+ <p class="wcf-learn-how"><a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank"><?php esc_html_e( 'Learn How', 'cartflows' ); ?> <i class="dashicons dashicons-external"></i></a></p>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div><!-- .wcf-templates-popup-overlay -->
modules/optin/classes/class-cartflows-optin-markup.php CHANGED
@@ -62,6 +62,8 @@ class Cartflows_Optin_Markup {
62
 
63
  add_filter( 'woocommerce_checkout_required_field_notice', array( $this, 'change_field_label_in_required_notice' ), 100, 2 );
64
 
 
 
65
  $this->elementor_editor_compatibility();
66
  }
67
 
@@ -83,6 +85,17 @@ class Cartflows_Optin_Markup {
83
  }
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
86
  /**
87
  * Change order button text .
88
  *
@@ -310,6 +323,10 @@ class Cartflows_Optin_Markup {
310
 
311
  add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
312
 
 
 
 
 
313
  global $post;
314
 
315
  $optin_id = $post->ID;
62
 
63
  add_filter( 'woocommerce_checkout_required_field_notice', array( $this, 'change_field_label_in_required_notice' ), 100, 2 );
64
 
65
+ add_action( 'init', array( $this, 'remove_login_actions' ) );
66
+
67
  $this->elementor_editor_compatibility();
68
  }
69
 
85
  }
86
  }
87
 
88
+ /**
89
+ * Remove login and registration actions.
90
+ */
91
+ public function remove_login_actions() {
92
+
93
+ if ( _is_wcf_doing_optin_ajax() ) {
94
+ add_filter( 'woocommerce_checkout_registration_enabled', '__return_false' );
95
+ add_filter( 'woocommerce_checkout_registration_required', '__return_false' );
96
+ }
97
+ }
98
+
99
  /**
100
  * Change order button text .
101
  *
323
 
324
  add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
325
 
326
+ /* Remove login actions */
327
+ add_filter( 'woocommerce_checkout_registration_enabled', '__return_false' );
328
+ add_filter( 'woocommerce_checkout_registration_required', '__return_false' );
329
+
330
  global $post;
331
 
332
  $optin_id = $post->ID;
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brainstormforce, wpcrafter
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
5
  Requires at least: 4.4
6
- Tested up to: 5.4.2
7
- Stable tag: 1.5.14
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -18,7 +18,7 @@ Create beautiful checkout pages & sales flows for WooCommerce.
18
 
19
  **Funnels are the most effective way to sell products & services.** We created CartFlows, a <a href="https://cartflows.com" target="_blank">**WordPress Funnel Builder**</a>, to help every website owner get more leads, increase conversions, & maximize profits.
20
 
21
- [youtube https://www.youtube.com/watch?v=N2ZEGu9A2e4]
22
 
23
  Turn your WooCommerce website into a selling machine using one-click sales funnels with frictionless checkout, custom thank you pages, global checkout replacement, and more…
24
 
@@ -127,6 +127,12 @@ Glad you asked! Most normal users have less than 3 funnels on a single website,
127
 
128
  == Changelog ==
129
 
 
 
 
 
 
 
130
  = Version 1.5.14 - Thursday, 30th July 2020 =
131
  * Fix: Not able to search & select the course type of product.
132
 
3
  Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
5
  Requires at least: 4.4
6
+ Tested up to: 5.5
7
+ Stable tag: 1.5.15
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
18
 
19
  **Funnels are the most effective way to sell products & services.** We created CartFlows, a <a href="https://cartflows.com" target="_blank">**WordPress Funnel Builder**</a>, to help every website owner get more leads, increase conversions, & maximize profits.
20
 
21
+ [youtube https://www.youtube.com/watch?v=5iFv9Pxwgx0]
22
 
23
  Turn your WooCommerce website into a selling machine using one-click sales funnels with frictionless checkout, custom thank you pages, global checkout replacement, and more…
24
 
127
 
128
  == Changelog ==
129
 
130
+ = Version 1.5.15 - Wednesday, 12th August 2020 =
131
+ * Improvement: Added Split Testing compatibility for a future release of CartFlows Pro.
132
+ * Improvement: Added WordPress 5.5 Compatibility.
133
+ * Fix: Product discount price & percentage options were not working if the full discount is applied.
134
+ * Fix: Account already exists error message on the Optin step.
135
+
136
  = Version 1.5.14 - Thursday, 30th July 2020 =
137
  * Fix: Not able to search & select the course type of product.
138