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

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.3
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.3

assets/css/optin-template-divi-rtl.css ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Optin Page CSS for DIVI
3
+ */
4
+
5
+ .cartflows-container .et_pb_module .wcf-optin-form,
6
+ .cartflows-container .et_pb_module .wcf-optin-form * {
7
+ -webkit-box-sizing: border-box;
8
+ -moz-box-sizing: border-box;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ .et_pb_module #wcf-optin-form {
13
+ background: inherit;
14
+ width: 100%;
15
+ margin: 0 auto;
16
+ }
17
+
18
+ .et_pb_module #wcf-optin-form .woocommerce-checkout {
19
+ display: inline-block;
20
+ text-align: inherit;
21
+ width: 100%;
22
+ }
23
+
24
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set {
25
+ display: block;
26
+ width: 100%;
27
+ float: none;
28
+ margin: 10px 0 0 0;
29
+ padding: 0px;
30
+ }
31
+
32
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,
33
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,
34
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .shop_table,
35
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-qty-options,
36
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,
37
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading,
38
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment,
39
+ .et_pb_module #wcf-optin-form .woocommerce form.checkout_coupon,
40
+ .et_pb_module #wcf-optin-form .woocommerce .wcf-order-wrap {
41
+ width: 100%;
42
+ }
43
+
44
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,
45
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,
46
+ .et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,
47
+ .et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2 {
48
+ float: none;
49
+ width: 100%;
50
+ max-width: 100%;
51
+ padding: 0px;
52
+ -webkit-border-radius: 0px;
53
+ border-radius: 0px;
54
+ border: none;
55
+ border-color: none;
56
+ margin-bottom: 0px;
57
+ }
58
+
59
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
60
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,
61
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper {
62
+ margin: 0 -7px;
63
+ -ms-flex-wrap: wrap;
64
+ flex-wrap: wrap;
65
+ -js-display: flex;
66
+ display: -webkit-box;
67
+ display: -moz-box;
68
+ display: -ms-flexbox;
69
+ display: flex;
70
+ display: -webkit-flex;
71
+ flex-wrap: wrap;
72
+ -webkit-flex-wrap: wrap;
73
+ }
74
+
75
+ /* Headings */
76
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,
77
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading {
78
+ display: none;
79
+ }
80
+
81
+ .et_pb_module #wcf-optin-form .woocommerce-additional-fields > h3,
82
+ .et_pb_module #wcf-optin-form .woocommerce-billing-fields > h3,
83
+ .et_pb_module #wcf-optin-form #order_review_heading,
84
+ .et_pb_module #wcf-optin-form .woocommerce #ship-to-different-address {
85
+ display: none !important;
86
+ }
87
+ /* Headings */
88
+
89
+
90
+ /* Row */
91
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row {
92
+ display: block;
93
+ margin-bottom: 1.1em;
94
+ padding: 3px 7px;
95
+ position: relative;
96
+ }
97
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment .form-row {
98
+ margin: 0;
99
+ padding: 0;
100
+ }
101
+
102
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-first,
103
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first {
104
+ float: right;
105
+ clear: right;
106
+ }
107
+
108
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-last,
109
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last {
110
+ float: left;
111
+ clear: left;
112
+ }
113
+
114
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-first,
115
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-last {
116
+ width: 50%;
117
+ display: block;
118
+ }
119
+
120
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,
121
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide {
122
+ width: 100%;
123
+ }
124
+ /* Row */
125
+
126
+ /* Label */
127
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-billing-fields label,
128
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-shipping-fields label {
129
+ display: inherit;
130
+ }
131
+
132
+ .et_pb_module #wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,
133
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .form-row label {
134
+ font-size: 13px;
135
+ line-height: 1em;
136
+ letter-spacing: 0.3px;
137
+ font-family: inherit;
138
+ font-weight: inherit;
139
+ margin-bottom: 8px;
140
+ }
141
+
142
+ /* Label */
143
+
144
+ /* Fields */
145
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row input.input-text,
146
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row textarea,
147
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row select,
148
+ .et_pb_module #wcf-optin-form .woocommerce #order_review .input-text {
149
+ display: block;
150
+ width: 100%;
151
+ min-height: 34px;
152
+ padding: 11px 12px;
153
+ font-family: inherit;
154
+ font-weight: inherit;
155
+ font-size: 14px;
156
+ line-height: 1.42857143 !important;
157
+ color: #555;
158
+ background-color: #fff;
159
+ background-image: none;
160
+ border: 1px solid;
161
+ border-color: #d4d4d4;
162
+ -webkit-border-radius: 3px;
163
+ border-radius: 3px;
164
+ -webkit-box-shadow: none;
165
+ box-shadow: none;
166
+ height: auto;
167
+ }
168
+
169
+ /*.et_pb_module #wcf-optin-form input[type="text"],
170
+ .et_pb_module #wcf-optin-form input[type="email"],
171
+ .et_pb_module #wcf-optin-form input[type="password"],
172
+ .et_pb_module #wcf-optin-form input[type="tel"],
173
+ .et_pb_module #wcf-optin-form textarea,
174
+ .et_pb_module #wcf-optin-form select {
175
+ display: block;
176
+ width: 100%;
177
+ min-height: 40px;
178
+ padding: 11px 12px;
179
+ font-family: inherit;
180
+ font-weight: inherit;
181
+ font-size: 14px;
182
+ line-height: 1.42857143;
183
+ color: #555;
184
+ background-color: #fff;
185
+ background-image: none;
186
+ border: 1px solid #d4d4d4;
187
+ -webkit-border-radius: 3px;
188
+ border-radius: 3px;
189
+ -webkit-box-shadow: none;
190
+ box-shadow: none;
191
+ }*/
192
+
193
+ /* Fields */
194
+
195
+ /* Checkboxes*/
196
+
197
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper {
198
+ display: none;
199
+ }
200
+
201
+ /* Checkboxes*/
202
+
203
+ /* Buttons */
204
+ .et_pb_module #wcf-optin-form #order_review {
205
+ padding: 0;
206
+ width: 100%;
207
+ }
208
+
209
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment {
210
+ background: unset;
211
+ -webkit-border-radius: 0;
212
+ border-radius: 0;
213
+ }
214
+
215
+ .et_pb_module #wcf-optin-form .woocommerce #order_review #payment button {
216
+ float: none;
217
+ margin: 0 auto;
218
+ display: block;
219
+ }
220
+
221
+ .et_pb_module #wcf-optin-form .woocommerce #order_review button {
222
+ border: 1px solid;
223
+ border-color: #F16334;
224
+ background-color: #F16334;
225
+ font-family: inherit;
226
+ font-weight: inherit;
227
+ font-size: 18px;
228
+ letter-spacing: 0.5px;
229
+ width: 100%;
230
+ padding: 16px 24px;
231
+ font-size: 16px;
232
+ line-height: 1.5;
233
+ -webkit-border-radius: 3px;
234
+ border-radius: 3px;
235
+ color: #fff;
236
+ }
237
+ /* Buttons
238
+
239
+
240
+ /*
241
+ * Media CSS.
242
+ */
243
+
244
+ @media only screen and (max-width: 768px) {
245
+
246
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-first,
247
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-last,
248
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,
249
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first,
250
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last,
251
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide{
252
+ width: 100%;
253
+ }
254
+ }
255
+
256
+ /*
257
+ * Media CSS.
258
+ */
assets/css/optin-template-divi.css ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Optin Page CSS for DIVI
3
+ */
4
+
5
+ .cartflows-container .et_pb_module .wcf-optin-form,
6
+ .cartflows-container .et_pb_module .wcf-optin-form * {
7
+ -webkit-box-sizing: border-box;
8
+ -moz-box-sizing: border-box;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ .et_pb_module #wcf-optin-form {
13
+ background: inherit;
14
+ width: 100%;
15
+ margin: 0 auto;
16
+ }
17
+
18
+ .et_pb_module #wcf-optin-form .woocommerce-checkout {
19
+ display: inline-block;
20
+ text-align: inherit;
21
+ width: 100%;
22
+ }
23
+
24
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set {
25
+ display: block;
26
+ width: 100%;
27
+ float: none;
28
+ margin: 10px 0 0 0;
29
+ padding: 0px;
30
+ }
31
+
32
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,
33
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,
34
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .shop_table,
35
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-qty-options,
36
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,
37
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading,
38
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment,
39
+ .et_pb_module #wcf-optin-form .woocommerce form.checkout_coupon,
40
+ .et_pb_module #wcf-optin-form .woocommerce .wcf-order-wrap {
41
+ width: 100%;
42
+ }
43
+
44
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,
45
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,
46
+ .et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,
47
+ .et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2 {
48
+ float: none;
49
+ width: 100%;
50
+ max-width: 100%;
51
+ padding: 0px;
52
+ -webkit-border-radius: 0px;
53
+ border-radius: 0px;
54
+ border: none;
55
+ border-color: none;
56
+ margin-bottom: 0px;
57
+ }
58
+
59
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,
60
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper,
61
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper {
62
+ margin: 0 -7px;
63
+ -ms-flex-wrap: wrap;
64
+ flex-wrap: wrap;
65
+ -js-display: flex;
66
+ display: -webkit-box;
67
+ display: -moz-box;
68
+ display: -ms-flexbox;
69
+ display: flex;
70
+ display: -webkit-flex;
71
+ flex-wrap: wrap;
72
+ -webkit-flex-wrap: wrap;
73
+ }
74
+
75
+ /* Headings */
76
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,
77
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading {
78
+ display: none;
79
+ }
80
+
81
+ .et_pb_module #wcf-optin-form .woocommerce-additional-fields > h3,
82
+ .et_pb_module #wcf-optin-form .woocommerce-billing-fields > h3,
83
+ .et_pb_module #wcf-optin-form #order_review_heading,
84
+ .et_pb_module #wcf-optin-form .woocommerce #ship-to-different-address {
85
+ display: none !important;
86
+ }
87
+ /* Headings */
88
+
89
+
90
+ /* Row */
91
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row {
92
+ display: block;
93
+ margin-bottom: 1.1em;
94
+ padding: 3px 7px;
95
+ position: relative;
96
+ }
97
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment .form-row {
98
+ margin: 0;
99
+ padding: 0;
100
+ }
101
+
102
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-first,
103
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first {
104
+ float: left;
105
+ clear: left;
106
+ }
107
+
108
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-last,
109
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last {
110
+ float: right;
111
+ clear: right;
112
+ }
113
+
114
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-first,
115
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-last {
116
+ width: 50%;
117
+ display: block;
118
+ }
119
+
120
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,
121
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide {
122
+ width: 100%;
123
+ }
124
+ /* Row */
125
+
126
+ /* Label */
127
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-billing-fields label,
128
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-shipping-fields label {
129
+ display: inherit;
130
+ }
131
+
132
+ .et_pb_module #wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,
133
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .form-row label {
134
+ font-size: 13px;
135
+ line-height: 1em;
136
+ letter-spacing: 0.3px;
137
+ font-family: inherit;
138
+ font-weight: inherit;
139
+ margin-bottom: 8px;
140
+ }
141
+
142
+ /* Label */
143
+
144
+ /* Fields */
145
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row input.input-text,
146
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row textarea,
147
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row select,
148
+ .et_pb_module #wcf-optin-form .woocommerce #order_review .input-text {
149
+ display: block;
150
+ width: 100%;
151
+ min-height: 34px;
152
+ padding: 11px 12px;
153
+ font-family: inherit;
154
+ font-weight: inherit;
155
+ font-size: 14px;
156
+ line-height: 1.42857143 !important;
157
+ color: #555;
158
+ background-color: #fff;
159
+ background-image: none;
160
+ border: 1px solid;
161
+ border-color: #d4d4d4;
162
+ -webkit-border-radius: 3px;
163
+ border-radius: 3px;
164
+ -webkit-box-shadow: none;
165
+ box-shadow: none;
166
+ height: auto;
167
+ }
168
+
169
+ /*.et_pb_module #wcf-optin-form input[type="text"],
170
+ .et_pb_module #wcf-optin-form input[type="email"],
171
+ .et_pb_module #wcf-optin-form input[type="password"],
172
+ .et_pb_module #wcf-optin-form input[type="tel"],
173
+ .et_pb_module #wcf-optin-form textarea,
174
+ .et_pb_module #wcf-optin-form select {
175
+ display: block;
176
+ width: 100%;
177
+ min-height: 40px;
178
+ padding: 11px 12px;
179
+ font-family: inherit;
180
+ font-weight: inherit;
181
+ font-size: 14px;
182
+ line-height: 1.42857143;
183
+ color: #555;
184
+ background-color: #fff;
185
+ background-image: none;
186
+ border: 1px solid #d4d4d4;
187
+ -webkit-border-radius: 3px;
188
+ border-radius: 3px;
189
+ -webkit-box-shadow: none;
190
+ box-shadow: none;
191
+ }*/
192
+
193
+ /* Fields */
194
+
195
+ /* Checkboxes*/
196
+
197
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper {
198
+ display: none;
199
+ }
200
+
201
+ /* Checkboxes*/
202
+
203
+ /* Buttons */
204
+ .et_pb_module #wcf-optin-form #order_review {
205
+ padding: 0;
206
+ width: 100%;
207
+ }
208
+
209
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment {
210
+ background: unset;
211
+ -webkit-border-radius: 0;
212
+ border-radius: 0;
213
+ }
214
+
215
+ .et_pb_module #wcf-optin-form .woocommerce #order_review #payment button {
216
+ float: none;
217
+ margin: 0 auto;
218
+ display: block;
219
+ }
220
+
221
+ .et_pb_module #wcf-optin-form .woocommerce #order_review button {
222
+ border: 1px solid;
223
+ border-color: #F16334;
224
+ background-color: #F16334;
225
+ font-family: inherit;
226
+ font-weight: inherit;
227
+ font-size: 18px;
228
+ letter-spacing: 0.5px;
229
+ width: 100%;
230
+ padding: 16px 24px;
231
+ font-size: 16px;
232
+ line-height: 1.5;
233
+ -webkit-border-radius: 3px;
234
+ border-radius: 3px;
235
+ color: #fff;
236
+ }
237
+ /* Buttons
238
+
239
+
240
+ /*
241
+ * Media CSS.
242
+ */
243
+
244
+ @media only screen and (max-width: 768px) {
245
+
246
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-first,
247
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-last,
248
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,
249
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first,
250
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last,
251
+ .et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide{
252
+ width: 100%;
253
+ }
254
+ }
255
+
256
+ /*
257
+ * Media CSS.
258
+ */
assets/min-css/optin-template-divi-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .cartflows-container .et_pb_module .wcf-optin-form,.cartflows-container .et_pb_module .wcf-optin-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.et_pb_module #wcf-optin-form{background:inherit;width:100%;margin:0 auto}.et_pb_module #wcf-optin-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;float:none;margin:10px 0 0 0;padding:0}.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,.et_pb_module #wcf-optin-form .woocommerce .wcf-order-wrap,.et_pb_module #wcf-optin-form .woocommerce form.checkout_coupon,.et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,.et_pb_module #wcf-optin-form .woocommerce-checkout #payment,.et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading,.et_pb_module #wcf-optin-form .woocommerce-checkout .shop_table,.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-qty-options{width:100%}.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,.et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,.et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,.et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading{display:none}.et_pb_module #wcf-optin-form #order_review_heading,.et_pb_module #wcf-optin-form .woocommerce #ship-to-different-address,.et_pb_module #wcf-optin-form .woocommerce-additional-fields>h3,.et_pb_module #wcf-optin-form .woocommerce-billing-fields>h3{display:none!important}.et_pb_module #wcf-optin-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.et_pb_module #wcf-optin-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.et_pb_module #wcf-optin-form .woocommerce form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first{float:right;clear:right}.et_pb_module #wcf-optin-form .woocommerce form .form-row-last,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last{float:left;clear:left}.et_pb_module #wcf-optin-form .woocommerce form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce form .form-row-last{width:50%;display:block}.et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide{width:100%}.et_pb_module #wcf-optin-form .woocommerce .woocommerce-billing-fields label,.et_pb_module #wcf-optin-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.et_pb_module #wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,.et_pb_module #wcf-optin-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.et_pb_module #wcf-optin-form .woocommerce #order_review .input-text,.et_pb_module #wcf-optin-form .woocommerce form .form-row input.input-text,.et_pb_module #wcf-optin-form .woocommerce form .form-row select,.et_pb_module #wcf-optin-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.et_pb_module #wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper{display:none}.et_pb_module #wcf-optin-form #order_review{padding:0;width:100%}.et_pb_module #wcf-optin-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.et_pb_module #wcf-optin-form .woocommerce #order_review #payment button{float:none;margin:0 auto;display:block}.et_pb_module #wcf-optin-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff}@media only screen and (max-width:768px){.et_pb_module #wcf-optin-form .woocommerce form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce form .form-row-last,.et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide{width:100%}}
assets/min-css/optin-template-divi.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .cartflows-container .et_pb_module .wcf-optin-form,.cartflows-container .et_pb_module .wcf-optin-form *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.et_pb_module #wcf-optin-form{background:inherit;width:100%;margin:0 auto}.et_pb_module #wcf-optin-form .woocommerce-checkout{display:inline-block;text-align:inherit;width:100%}.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set{display:block;width:100%;float:none;margin:10px 0 0 0;padding:0}.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,.et_pb_module #wcf-optin-form .woocommerce .wcf-order-wrap,.et_pb_module #wcf-optin-form .woocommerce form.checkout_coupon,.et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,.et_pb_module #wcf-optin-form .woocommerce-checkout #payment,.et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading,.et_pb_module #wcf-optin-form .woocommerce-checkout .shop_table,.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-qty-options{width:100%}.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,.et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,.et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-1,.et_pb_module #wcf-optin-form .woocommerce .wcf-col2-set .wcf-col-2{float:none;width:100%;max-width:100%;padding:0;-webkit-border-radius:0;border-radius:0;border:none;border-color:none;margin-bottom:0}.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-additional-fields .woocommerce-additional-fields__field-wrapper,.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper,.et_pb_module #wcf-optin-form .woocommerce-checkout .wcf-col2-set .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper{margin:0 -7px;-ms-flex-wrap:wrap;flex-wrap:wrap;-js-display:flex;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flex;display:-webkit-flex;flex-wrap:wrap;-webkit-flex-wrap:wrap}.et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,.et_pb_module #wcf-optin-form .woocommerce-checkout #your_products_heading{display:none}.et_pb_module #wcf-optin-form #order_review_heading,.et_pb_module #wcf-optin-form .woocommerce #ship-to-different-address,.et_pb_module #wcf-optin-form .woocommerce-additional-fields>h3,.et_pb_module #wcf-optin-form .woocommerce-billing-fields>h3{display:none!important}.et_pb_module #wcf-optin-form .woocommerce form .form-row{display:block;margin-bottom:1.1em;padding:3px 7px;position:relative}.et_pb_module #wcf-optin-form .woocommerce-checkout #payment .form-row{margin:0;padding:0}.et_pb_module #wcf-optin-form .woocommerce form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first{float:left;clear:left}.et_pb_module #wcf-optin-form .woocommerce form .form-row-last,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last{float:right;clear:right}.et_pb_module #wcf-optin-form .woocommerce form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce form .form-row-last{width:50%;display:block}.et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide{width:100%}.et_pb_module #wcf-optin-form .woocommerce .woocommerce-billing-fields label,.et_pb_module #wcf-optin-form .woocommerce .woocommerce-shipping-fields label{display:inherit}.et_pb_module #wcf-optin-form .woocommerce form.woocommerce-form-login .form-row label,.et_pb_module #wcf-optin-form .woocommerce-checkout .form-row label{font-size:13px;line-height:1em;letter-spacing:.3px;font-family:inherit;font-weight:inherit;margin-bottom:8px}.et_pb_module #wcf-optin-form .woocommerce #order_review .input-text,.et_pb_module #wcf-optin-form .woocommerce form .form-row input.input-text,.et_pb_module #wcf-optin-form .woocommerce form .form-row select,.et_pb_module #wcf-optin-form .woocommerce form .form-row textarea{display:block;width:100%;min-height:34px;padding:11px 12px;font-family:inherit;font-weight:inherit;font-size:14px;line-height:1.42857143!important;color:#555;background-color:#fff;background-image:none;border:1px solid;border-color:#d4d4d4;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;height:auto}.et_pb_module #wcf-optin-form .woocommerce .woocommerce-terms-and-conditions-wrapper{display:none}.et_pb_module #wcf-optin-form #order_review{padding:0;width:100%}.et_pb_module #wcf-optin-form .woocommerce-checkout #payment{background:unset;-webkit-border-radius:0;border-radius:0}.et_pb_module #wcf-optin-form .woocommerce #order_review #payment button{float:none;margin:0 auto;display:block}.et_pb_module #wcf-optin-form .woocommerce #order_review button{border:1px solid;border-color:#f16334;background-color:#f16334;font-family:inherit;font-weight:inherit;font-size:18px;letter-spacing:.5px;width:100%;padding:16px 24px;font-size:16px;line-height:1.5;-webkit-border-radius:3px;border-radius:3px;color:#fff}@media only screen and (max-width:768px){.et_pb_module #wcf-optin-form .woocommerce form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce form .form-row-last,.et_pb_module #wcf-optin-form .woocommerce form .form-row-wide,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-first,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-last,.et_pb_module #wcf-optin-form .woocommerce-page form .form-row-wide{width:100%}}
cartflows.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.5.2
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
3
  * Plugin Name: CartFlows
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.5.3
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: cartflows
changelog.txt CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  Version 1.5.2 - Wednesday, 18th March 2020
2
  - New: Added an option to enable Facebook pixel's Pageview event on the whole site.
3
  - Improvement: Added compatibility for the Pro theme.
1
+ Version 1.5.3 - Wednesday, 1st April 2020
2
+ - Improvement: Divi CSS support added for Optin step type.
3
+ - Fix: FB Pixel php notice issue & conflict with Beaver Builder.
4
+
5
  Version 1.5.2 - Wednesday, 18th March 2020
6
  - New: Added an option to enable Facebook pixel's Pageview event on the whole site.
7
  - Improvement: Added compatibility for the Pro theme.
classes/class-cartflows-frontend.php CHANGED
@@ -350,7 +350,7 @@ class Cartflows_Frontend {
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=<?php echo $facebook_id; ?>&ev=PageView&noscript=1'/></noscript>";
354
 
355
  $fb_page_view = "<script type='text/javascript'>
356
  fbq('init', $facebook_id);
@@ -417,8 +417,8 @@ class Cartflows_Frontend {
417
 
418
  $page_template = get_post_meta( _get_wcf_step_id(), '_wp_page_template', true );
419
 
420
- $fb_active = get_option( '_cartflows_facebook' );
421
- $wcf_ga_active = get_option( '_cartflows_google_analytics' );
422
  $params = array();
423
  $ga_param = array();
424
 
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);
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
 
classes/class-cartflows-loader.php CHANGED
@@ -125,7 +125,7 @@ if ( ! class_exists( 'Cartflows_Loader' ) ) {
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.2' );
129
  define( 'CARTFLOWS_SLUG', 'cartflows' );
130
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
131
 
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.3' );
129
  define( 'CARTFLOWS_SLUG', 'cartflows' );
130
  define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
131
 
languages/cartflows.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the CartFlows package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: CartFlows 1.5.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2020-03-18 05:58:59+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the CartFlows package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: CartFlows 1.5.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2020-04-01 05:28:26+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
modules/optin/classes/class-cartflows-optin-markup.php CHANGED
@@ -1,802 +1,712 @@
1
- <?php
2
- /**
3
- * Checkout markup.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Checkout Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Optin_Markup {
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
- /* Set is checkout flag */
38
- add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
39
-
40
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'save_optin_fields' ), 10, 2 );
41
-
42
- /* Optin Shortcode */
43
- add_shortcode( 'cartflows_optin', array( $this, 'optin_shortcode_markup' ) );
44
-
45
- /* Preconfigured cart data */
46
- add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
47
-
48
- /* Optin shortcode data */
49
- add_action( 'wp', array( $this, 'shortcode_load_data' ), 1000 );
50
-
51
- /* Ajax Endpoint */
52
- add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ), 10, 2 );
53
- add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
54
-
55
- /* Optin Fields */
56
- add_filter( 'woocommerce_default_address_fields', array( $this, 'set_optin_default_fields' ), 1000 );
57
- /**
58
- * It may required later
59
- * add_filter( 'woocommerce_checkout_fields', array( $this, 'set_optin_fields' ) );
60
- */
61
- add_filter( 'woocommerce_billing_fields', array( $this, 'billing_optin_fields' ), 1000, 2 );
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
-
68
- /**
69
- * Elementor editor compatibility.
70
- */
71
- public function elementor_editor_compatibility() {
72
-
73
- if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] && is_admin() ) { //phpcs:ignore
74
-
75
- if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
76
-
77
- if ( _wcf_check_is_optin_by_id( intval( $_GET['post'] ) ) ) { //phpcs:ignore
78
-
79
- /* Submit Button */
80
- add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
81
- }
82
- }
83
- }
84
- }
85
-
86
- /**
87
- * Change order button text .
88
- *
89
- * @param string $woo_button_text place order.
90
- * @return string
91
- */
92
- public function place_order_button_text( $woo_button_text ) {
93
-
94
- $optin_id = get_the_ID();
95
-
96
- $wcf_order_button_text = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-text' );
97
-
98
- if ( ! empty( $wcf_order_button_text ) ) {
99
- $woo_button_text = $wcf_order_button_text;
100
- }
101
-
102
- return $woo_button_text;
103
- }
104
-
105
- /**
106
- * Display all WooCommerce notices.
107
- *
108
- * @since 1.1.5
109
- */
110
- public function display_woo_notices() {
111
-
112
- if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
113
- woocommerce_output_all_notices();
114
- }
115
- }
116
-
117
- /**
118
- * Check for checkout flag
119
- *
120
- * @param bool $is_checkout is checkout.
121
- *
122
- * @return bool
123
- */
124
- public function woo_checkout_flag( $is_checkout ) {
125
-
126
- if ( ! is_admin() ) {
127
-
128
- if ( _is_wcf_optin_type() ) {
129
-
130
- $is_checkout = true;
131
- }
132
- }
133
-
134
- return $is_checkout;
135
- }
136
-
137
- /**
138
- * Render checkout shortcode markup.
139
- *
140
- * @param array $atts attributes.
141
- * @return string
142
- */
143
- public function optin_shortcode_markup( $atts ) {
144
-
145
- if ( ! function_exists( 'wc_print_notices' ) ) {
146
- $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
147
- $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
148
-
149
- return $notice_out;
150
- }
151
-
152
- $atts = shortcode_atts(
153
- array(
154
- 'id' => 0,
155
- ),
156
- $atts
157
- );
158
-
159
- $optin_id = intval( $atts['id'] );
160
-
161
- if ( empty( $optin_id ) ) {
162
-
163
- if ( ! _is_wcf_optin_type() ) {
164
-
165
- return '<h4>' . __( 'Please place shortcode on Optin step-type only.', 'cartflows' ) . '</h4>';
166
- }
167
-
168
- global $post;
169
-
170
- $optin_id = intval( $post->ID );
171
- }
172
-
173
- $output = '';
174
-
175
- ob_start();
176
-
177
- do_action( 'cartflows_optin_form_before', $optin_id );
178
-
179
- $optin_layout = 'default';
180
-
181
- $template_default = CARTFLOWS_OPTIN_DIR . 'templates/optin-template-simple.php';
182
-
183
- include $template_default;
184
-
185
- $output .= ob_get_clean();
186
-
187
- return $output;
188
- }
189
-
190
- /**
191
- * Configure Cart Data.
192
- *
193
- * @since 1.0.0
194
- *
195
- * @return void
196
- */
197
- public function preconfigured_cart_data() {
198
-
199
- if ( is_admin() ) {
200
- return;
201
- }
202
-
203
- global $post;
204
-
205
- if ( _is_wcf_optin_type() ) {
206
-
207
- if ( wp_doing_ajax() ) {
208
- return;
209
- } else {
210
-
211
- $optin_id = $post->ID;
212
-
213
- do_action( 'cartflows_optin_before_configure_cart', $optin_id );
214
-
215
- $products = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-product' );
216
-
217
- if ( ! is_array( $products ) ) {
218
- return;
219
- }
220
-
221
- /* Empty the current cart */
222
- WC()->cart->empty_cart();
223
-
224
- if ( is_array( $products ) && count( $products ) < 1 ) {
225
- wc_add_notice( __( 'No product is selected. Please select a Simple, Virtual and Free product from the meta settings.', 'cartflows' ), 'error' );
226
- return;
227
- }
228
-
229
- /* Set customer session if not set */
230
- if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
231
- WC()->session->set_customer_session_cookie( true );
232
- }
233
-
234
- $product_id = reset( $products );
235
- $_product = wc_get_product( $product_id );
236
-
237
- if ( ! empty( $_product ) ) {
238
-
239
- if ( $_product->is_type( 'simple' ) && $_product->is_virtual() ) {
240
-
241
- if ( $_product->get_price() > 0 ) {
242
- wc_add_notice( __( 'Please update the selected product\'s price to zero (0).', 'cartflows' ), 'error' );
243
- } else {
244
-
245
- $quantity = 1;
246
-
247
- WC()->cart->add_to_cart( $product_id, $quantity );
248
- }
249
- } else {
250
-
251
- wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
252
- }
253
- } else {
254
-
255
- wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
256
- }
257
-
258
- do_action( 'cartflows_optin_after_configure_cart', $optin_id );
259
- }
260
- }
261
- }
262
-
263
- /**
264
- * Load shortcode data.
265
- *
266
- * @return void
267
- */
268
- public function shortcode_load_data() {
269
-
270
- if ( _is_wcf_optin_type() ) {
271
-
272
- add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
273
-
274
- /* Show notices if cart has errors */
275
- add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
276
-
277
- // Outputting the hidden field in checkout page.
278
- add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
279
- add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
280
-
281
- /* Remove unnecessary option */
282
- add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
283
- add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false' );
284
-
285
- remove_all_actions( 'woocommerce_before_checkout_form' );
286
- remove_all_actions( 'woocommerce_checkout_billing' );
287
- remove_all_actions( 'woocommerce_checkout_shipping' );
288
- remove_all_actions( 'woocommerce_checkout_before_order_review' );
289
- remove_all_actions( 'woocommerce_checkout_order_review' );
290
- remove_all_actions( 'woocommerce_checkout_after_order_review' );
291
- add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
292
- add_filter( 'woocommerce_available_payment_gateways', array( $this, 'disable_payment_gateways' ) );
293
-
294
- /* Paypal Expresss remove */
295
-
296
- if ( function_exists( 'wc_gateway_ppec' ) ) {
297
- remove_action( 'wp_enqueue_scripts', array( wc_gateway_ppec()->cart, 'enqueue_scripts' ) );
298
- }
299
-
300
- // Hook in actions once.
301
- add_action( 'woocommerce_before_checkout_form', 'woocommerce_output_all_notices', 10 );
302
- add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
303
- add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
304
- add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
305
-
306
- /* Submit Button */
307
- add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
308
-
309
- add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
310
-
311
- global $post;
312
-
313
- $optin_id = $post->ID;
314
-
315
- do_action( 'cartflows_optin_before_shortcode', $optin_id );
316
- }
317
- }
318
-
319
- /**
320
- * Disable payment gateways.
321
- *
322
- * @param array $available_gateways gateways.
323
- * @return array
324
- */
325
- public function disable_payment_gateways( $available_gateways ) {
326
-
327
- if ( ! is_admin() ) {
328
-
329
- $available_gateways = array();
330
- }
331
-
332
- return $available_gateways;
333
- }
334
-
335
- /**
336
- * Render checkout ID hidden field.
337
- *
338
- * @param array $checkout checkout session data.
339
- * @return void
340
- */
341
- public function checkout_shortcode_post_id( $checkout ) {
342
-
343
- if ( ! _is_wcf_optin_type() ) {
344
- return;
345
- }
346
-
347
- global $post;
348
-
349
- $optin_id = $post->ID;
350
-
351
- $flow_id = get_post_meta( $optin_id, 'wcf-flow-id', true );
352
-
353
- echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
354
- echo '<input type="hidden" class="input-hidden _wcf_optin_id" name="_wcf_optin_id" value="' . intval( $optin_id ) . '">';
355
- }
356
-
357
- /**
358
- * Load shortcode scripts.
359
- *
360
- * @return void
361
- */
362
- public function shortcode_scripts() {
363
-
364
- wp_enqueue_style( 'wcf-optin-template', wcf()->utils->get_css_url( 'optin-template' ), '', CARTFLOWS_VER );
365
-
366
- wp_enqueue_script(
367
- 'wcf-optin-template',
368
- wcf()->utils->get_js_url( 'optin-template' ),
369
- array( 'jquery' ),
370
- CARTFLOWS_VER,
371
- true
372
- );
373
-
374
- do_action( 'cartflows_optin_scripts' );
375
-
376
- $style = $this->generate_style();
377
-
378
- wp_add_inline_style( 'wcf-optin-template', $style );
379
- }
380
-
381
- /**
382
- * Generate styles.
383
- *
384
- * @return string
385
- */
386
- public function generate_style() {
387
-
388
- global $post;
389
-
390
- $optin_id = $post->ID;
391
-
392
- /* Load all fonts */
393
- CartFlows_Font_Families::render_fonts( $optin_id );
394
-
395
- $r = '';
396
- $g = '';
397
- $b = '';
398
- $output = '';
399
-
400
- /* Global */
401
- $primary_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-primary-color' );
402
- $base_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-base-font-family' );
403
-
404
- /* Input Fields */
405
- $input_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-family' );
406
- $input_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-weight' );
407
- $field_input_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-field-size' );
408
- $field_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-tb-padding' );
409
- $field_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-lr-padding' );
410
- $field_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-color' );
411
- $field_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-bg-color' );
412
- $field_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-border-color' );
413
- $field_label_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-label-color' );
414
-
415
- if ( 'custom' == $field_input_size ) {
416
- $field_input_size = '38px';
417
- }
418
-
419
- /* Submit Button */
420
- $submit_button_width = '100%';
421
- $optin_button_position = '';
422
- $button_font_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-font-size' );
423
- $button_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-family' );
424
- $button_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-weight' );
425
- $submit_button_height = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-size' );
426
- $submit_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-tb-padding' );
427
- $submit_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-lr-padding' );
428
- $submit_button_position = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-position' );
429
- $submit_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-color' );
430
- $submit_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-hover-color' );
431
- $submit_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-color', $primary_color );
432
- $submit_bg_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-hover-color', $primary_color );
433
- $submit_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-color', $primary_color );
434
- $submit_border_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-hover-color', $primary_color );
435
-
436
- if ( 'custom' == $submit_button_height ) {
437
- $submit_button_height = '38px';
438
- $submit_button_width = 'auto';
439
-
440
- switch ( $submit_button_position ) {
441
- case 'left':
442
- $optin_button_position = '0 auto 0 0';
443
- break;
444
- case 'center':
445
- $optin_button_position = '0 auto';
446
- break;
447
- case 'right':
448
- $optin_button_position = '0 0 0 auto';
449
- break;
450
-
451
- default:
452
- $optin_button_position = '0 auto';
453
- break;
454
- }
455
-
456
- $output .= ".wcf-optin-form .woocommerce #order_review #payment button{
457
- margin: {$optin_button_position};
458
- }";
459
- }
460
-
461
- $output .= "
462
- .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
463
- .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:checked:before{
464
- color: {$primary_color};
465
- }
466
- .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{
467
- background-color: {$primary_color};
468
- }
469
- .wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,
470
- .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:focus,
471
- .wcf-optin-form .woocommerce #payment input[type=radio]:checked:focus,
472
- .wcf-optin-form .woocommerce #payment input[type=radio]:not(:checked):focus{
473
- border-color: {$primary_color};
474
- box-shadow: 0 0 2px rgba( " . $r . ',' . $g . ',' . $b . ", .8);
475
- }
476
- .wcf-optin-form .woocommerce-checkout label{
477
- color: {$field_label_color};
478
- }
479
-
480
- .wcf-optin-form #order_review .wcf-custom-coupon-field input[type='text'],
481
- .wcf-optin-form .woocommerce form .form-row input.input-text,
482
- .wcf-optin-form .woocommerce form .form-row textarea,
483
- .wcf-optin-form .select2-container--default .select2-selection--single {
484
- color: {$field_color};
485
- background: {$field_bg_color};
486
- border-color: {$field_border_color};
487
- padding-top: {$field_tb_padding}px;
488
- padding-bottom: {$field_tb_padding}px;
489
- padding-left: {$field_lr_padding}px;
490
- padding-right: {$field_lr_padding}px;
491
- min-height: {$field_input_size};
492
- font-family: {$input_font_family};
493
- font-weight: {$input_font_weight};
494
- }
495
-
496
- .wcf-optin-form .woocommerce .col2-set .col-1,
497
- .wcf-optin-form .woocommerce .col2-set .col-2,
498
- .wcf-optin-form .woocommerce-checkout .shop_table,
499
- .wcf-optin-form .woocommerce-checkout #order_review_heading,
500
- .wcf-optin-form .woocommerce-checkout #payment,
501
- .wcf-optin-form .woocommerce form.checkout_coupon {
502
- font-family: {$input_font_family};
503
- font-weight: {$input_font_weight};
504
- }
505
-
506
- .woocommerce table.shop_table th{
507
- color: {$field_label_color};
508
- }
509
-
510
- .wcf-optin-form .woocommerce a{
511
- color: {$primary_color};
512
- }
513
- .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered {
514
- color: {$field_color};
515
- }
516
- .wcf-optin-form ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
517
- color: {$field_color};
518
- }
519
- .wcf-optin-form ::-moz-placeholder { /* Firefox 19+ */
520
- color: {$field_color};
521
- }
522
- .wcf-optin-form :-ms-input-placeholder { /* IE 10+ */
523
- color: {$field_color};
524
- }
525
- .wcf-optin-form :-moz-placeholder { /* Firefox 18- */
526
- color: {$field_color};
527
- }
528
- .wcf-optin-form .woocommerce form p.form-row label {
529
- color: {$field_label_color};
530
- font-family: {$input_font_family};
531
- font-weight: {$input_font_weight};
532
- }
533
- .wcf-optin-form .woocommerce #order_review button,
534
- .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,
535
- .wcf-optin-form .woocommerce #order_review button.wcf-btn-small {
536
- color: {$submit_color};
537
- background: {$submit_bg_color};
538
- padding-top: {$submit_tb_padding}px;
539
- padding-bottom: {$submit_tb_padding}px;
540
- padding-left: {$submit_lr_padding}px;
541
- padding-right: {$submit_lr_padding}px;
542
- border-color: {$submit_border_color};
543
- min-height: {$submit_button_height};
544
- font-size: {$button_font_size}px;
545
- font-family: {$button_font_family};
546
- font-weight: {$button_font_weight};
547
- width: {$submit_button_width};
548
-
549
- }
550
-
551
- .wcf-optin-form .woocommerce-checkout form.woocommerce-form-login .button,
552
- .wcf-optin-form .woocommerce-checkout form.checkout_coupon .button{
553
- background: {$submit_bg_color};
554
- border: 1px {$submit_border_color} solid;
555
- color: {$submit_color};
556
- min-height: {$submit_button_height};
557
- font-family: {$button_font_family};
558
- font-weight: {$button_font_weight};
559
- }
560
- .wcf-optin-form .woocommerce-checkout form.login .button:hover,
561
- .wcf-optin-form .woocommerce-checkout form.checkout_coupon .button:hover,
562
- .wcf-optin-form .woocommerce #payment #place_order:hover,
563
- .wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{
564
- color: {$submit_hover_color};
565
- background-color: {$submit_bg_hover_color};
566
- border-color: {$submit_border_hover_color};
567
- }
568
- .wcf-optin-form .woocommerce-info::before,
569
- .wcf-optin-form .woocommerce-message::before{
570
- color: {$primary_color};
571
- }
572
- .wcf-optin-form{
573
- font-family: {$base_font_family};
574
- }
575
- img.emoji, img.wp-smiley {}";
576
-
577
- return $output;
578
- }
579
-
580
- /**
581
- * Get ajax end points.
582
- *
583
- * @param string $endpoint_url end point URL.
584
- * @param string $request end point request.
585
- * @return string
586
- */
587
- public function get_ajax_endpoint( $endpoint_url, $request ) {
588
-
589
- global $post;
590
-
591
- if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
592
-
593
- if ( _is_wcf_optin_type() ) {
594
-
595
- if ( mb_strpos( $endpoint_url, 'checkout', 0, 'utf-8' ) === false ) {
596
-
597
- if ( '' === $request ) {
598
- $query_args = array(
599
- 'wc-ajax' => '%%endpoint%%',
600
- );
601
- } else {
602
- $query_args = array(
603
- 'wc-ajax' => $request,
604
- );
605
- }
606
-
607
- $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 ); //phpcs:ignore
608
- $uri = $uri[0];
609
-
610
- $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
611
- }
612
- }
613
- }
614
-
615
- return $endpoint_url;
616
- }
617
-
618
-
619
- /**
620
- * Save checkout fields.
621
- *
622
- * @param int $order_id order id.
623
- * @param array $posted posted data.
624
- * @return void
625
- */
626
- public function save_optin_fields( $order_id, $posted ) {
627
-
628
- if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
629
-
630
- $optin_id = wc_clean( wp_unslash( $_POST['_wcf_optin_id'] ) ); //phpcs:ignore
631
-
632
- update_post_meta( $order_id, '_wcf_optin_id', $optin_id );
633
-
634
- if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
635
-
636
- $flow_id = wc_clean( wp_unslash( $_POST['_wcf_flow_id'] ) ); //phpcs:ignore
637
-
638
- update_post_meta( $order_id, '_wcf_flow_id', $flow_id );
639
- }
640
- }
641
-
642
- }
643
-
644
- /**
645
- * Redirect users to our checkout if hidden param
646
- *
647
- * @param string $redirect redirect url.
648
- * @param object $user user.
649
- * @return string
650
- */
651
- public function after_login_redirect( $redirect, $user ) {
652
-
653
- if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
654
-
655
- $optin_id = intval( $_POST['_wcf_optin_id'] ); //phpcs:ignore
656
-
657
- $redirect = get_permalink( $optin_id );
658
- }
659
-
660
- return $redirect;
661
- }
662
-
663
-
664
- /**
665
- * Add custom class to the fields to change the UI to three column.
666
- *
667
- * @param array $fields fields.
668
- */
669
- public function set_optin_default_fields( $fields ) {
670
-
671
- if ( _is_wcf_optin_type() ) {
672
-
673
- global $post;
674
-
675
- $optin_id = $post->ID;
676
- } else {
677
-
678
- if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
679
-
680
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
681
- } else {
682
- return $fields;
683
- }
684
- }
685
-
686
- $first_name = $fields['first_name'];
687
- $last_name = $fields['last_name'];
688
-
689
- /* Make fields required */
690
- $first_name['required'] = true;
691
- $last_name['required'] = true;
692
-
693
- $fields = array(
694
- 'first_name' => $first_name,
695
- 'last_name' => $last_name,
696
- );
697
-
698
- return apply_filters( 'cartflows_optin_default_fields', $fields, $optin_id );
699
- }
700
-
701
- /**
702
- * Add custom class to the fields to change the UI to three column.
703
- *
704
- * @param array $fields fields.
705
- */
706
- public function set_optin_fields( $fields ) {
707
-
708
- if ( _is_wcf_optin_type() ) {
709
-
710
- global $post;
711
-
712
- $optin_id = $post->ID;
713
- } else {
714
-
715
- if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
716
-
717
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
718
- } else {
719
- return $fields;
720
- }
721
- }
722
-
723
- $billing_first_name = $fields['billing']['billing_first_name'];
724
- $billing_last_name = $fields['billing']['billing_last_name'];
725
- $billing_email = $fields['billing']['billing_email'];
726
-
727
- $fields['billing'] = array(
728
- 'billing_first_name' => $billing_first_name,
729
- 'billing_last_name' => $billing_last_name,
730
- 'billing_email' => $billing_email,
731
- );
732
-
733
- return apply_filters( 'cartflows_optin_fields', $fields, $optin_id );
734
- }
735
-
736
- /**
737
- * Billing field customization.
738
- *
739
- * @param array $fields fields data.
740
- * @param string $country country name.
741
- * @return array
742
- */
743
- public function billing_optin_fields( $fields, $country ) {
744
-
745
- if ( _is_wcf_optin_type() ) {
746
-
747
- global $post;
748
-
749
- $optin_id = $post->ID;
750
- } else {
751
-
752
- if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
753
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
754
- } else {
755
- return $fields;
756
- }
757
- }
758
-
759
- if ( is_wc_endpoint_url( 'edit-address' ) ) {
760
- return $fields;
761
- }
762
-
763
- $billing_first_name = $fields['billing_first_name'];
764
- $billing_last_name = $fields['billing_last_name'];
765
- $billing_email = $fields['billing_email'];
766
-
767
- /* Make fields required */
768
- $billing_first_name['required'] = true;
769
- $billing_last_name['required'] = true;
770
-
771
- $fields = array(
772
- 'billing_first_name' => $billing_first_name,
773
- 'billing_last_name' => $billing_last_name,
774
- 'billing_email' => $billing_email,
775
- );
776
-
777
- return apply_filters( 'cartflows_billing_optin_fields', $fields, $country, $optin_id );
778
- }
779
-
780
-
781
- /**
782
- * Replace billing label.
783
- *
784
- * @param string $notice Notice.
785
- * @param string $field_label Field name.
786
- * @return string
787
- */
788
- public function change_field_label_in_required_notice( $notice, $field_label ) {
789
-
790
- if ( _is_wcf_doing_optin_ajax() ) {
791
-
792
- $notice = str_replace( 'Billing ', '', $notice );
793
- }
794
-
795
- return $notice;
796
- }
797
- }
798
-
799
- /**
800
- * Kicking this off by calling 'get_instance()' method
801
- */
802
- Cartflows_Optin_Markup::get_instance();
1
+ <?php
2
+ /**
3
+ * Checkout markup.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Optin_Markup {
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
+ /* Set is checkout flag */
38
+ add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
39
+
40
+ add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'save_optin_fields' ), 10, 2 );
41
+
42
+ /* Optin Shortcode */
43
+ add_shortcode( 'cartflows_optin', array( $this, 'optin_shortcode_markup' ) );
44
+
45
+ /* Preconfigured cart data */
46
+ add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
47
+
48
+ /* Optin shortcode data */
49
+ add_action( 'wp', array( $this, 'shortcode_load_data' ), 1000 );
50
+
51
+ /* Ajax Endpoint */
52
+ add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ), 10, 2 );
53
+ add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
54
+
55
+ /* Optin Fields */
56
+ add_filter( 'woocommerce_default_address_fields', array( $this, 'set_optin_default_fields' ), 1000 );
57
+ /**
58
+ * It may required later
59
+ * add_filter( 'woocommerce_checkout_fields', array( $this, 'set_optin_fields' ) );
60
+ */
61
+ add_filter( 'woocommerce_billing_fields', array( $this, 'billing_optin_fields' ), 1000, 2 );
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
+
68
+ /**
69
+ * Elementor editor compatibility.
70
+ */
71
+ public function elementor_editor_compatibility() {
72
+
73
+ if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] && is_admin() ) { //phpcs:ignore
74
+
75
+ if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
76
+
77
+ if ( _wcf_check_is_optin_by_id( intval( $_GET['post'] ) ) ) { //phpcs:ignore
78
+
79
+ /* Submit Button */
80
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Change order button text .
88
+ *
89
+ * @param string $woo_button_text place order.
90
+ * @return string
91
+ */
92
+ public function place_order_button_text( $woo_button_text ) {
93
+
94
+ $optin_id = get_the_ID();
95
+
96
+ $wcf_order_button_text = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-text' );
97
+
98
+ if ( ! empty( $wcf_order_button_text ) ) {
99
+ $woo_button_text = $wcf_order_button_text;
100
+ }
101
+
102
+ return $woo_button_text;
103
+ }
104
+
105
+ /**
106
+ * Display all WooCommerce notices.
107
+ *
108
+ * @since 1.1.5
109
+ */
110
+ public function display_woo_notices() {
111
+
112
+ if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
113
+ woocommerce_output_all_notices();
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Check for checkout flag
119
+ *
120
+ * @param bool $is_checkout is checkout.
121
+ *
122
+ * @return bool
123
+ */
124
+ public function woo_checkout_flag( $is_checkout ) {
125
+
126
+ if ( ! is_admin() ) {
127
+
128
+ if ( _is_wcf_optin_type() ) {
129
+
130
+ $is_checkout = true;
131
+ }
132
+ }
133
+
134
+ return $is_checkout;
135
+ }
136
+
137
+ /**
138
+ * Render checkout shortcode markup.
139
+ *
140
+ * @param array $atts attributes.
141
+ * @return string
142
+ */
143
+ public function optin_shortcode_markup( $atts ) {
144
+
145
+ if ( ! function_exists( 'wc_print_notices' ) ) {
146
+ $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
147
+ $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
148
+
149
+ return $notice_out;
150
+ }
151
+
152
+ $atts = shortcode_atts(
153
+ array(
154
+ 'id' => 0,
155
+ ),
156
+ $atts
157
+ );
158
+
159
+ $optin_id = intval( $atts['id'] );
160
+
161
+ if ( empty( $optin_id ) ) {
162
+
163
+ if ( ! _is_wcf_optin_type() ) {
164
+
165
+ return '<h4>' . __( 'Please place shortcode on Optin step-type only.', 'cartflows' ) . '</h4>';
166
+ }
167
+
168
+ global $post;
169
+
170
+ $optin_id = intval( $post->ID );
171
+ }
172
+
173
+ $output = '';
174
+
175
+ ob_start();
176
+
177
+ do_action( 'cartflows_optin_form_before', $optin_id );
178
+
179
+ $optin_layout = 'default';
180
+
181
+ $template_default = CARTFLOWS_OPTIN_DIR . 'templates/optin-template-simple.php';
182
+
183
+ include $template_default;
184
+
185
+ $output .= ob_get_clean();
186
+
187
+ return $output;
188
+ }
189
+
190
+ /**
191
+ * Configure Cart Data.
192
+ *
193
+ * @since 1.0.0
194
+ *
195
+ * @return void
196
+ */
197
+ public function preconfigured_cart_data() {
198
+
199
+ if ( is_admin() ) {
200
+ return;
201
+ }
202
+
203
+ global $post;
204
+
205
+ if ( _is_wcf_optin_type() ) {
206
+
207
+ if ( wp_doing_ajax() ) {
208
+ return;
209
+ } else {
210
+
211
+ $optin_id = $post->ID;
212
+
213
+ do_action( 'cartflows_optin_before_configure_cart', $optin_id );
214
+
215
+ $products = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-product' );
216
+
217
+ if ( ! is_array( $products ) ) {
218
+ return;
219
+ }
220
+
221
+ /* Empty the current cart */
222
+ WC()->cart->empty_cart();
223
+
224
+ if ( is_array( $products ) && count( $products ) < 1 ) {
225
+ wc_add_notice( __( 'No product is selected. Please select a Simple, Virtual and Free product from the meta settings.', 'cartflows' ), 'error' );
226
+ return;
227
+ }
228
+
229
+ /* Set customer session if not set */
230
+ if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
231
+ WC()->session->set_customer_session_cookie( true );
232
+ }
233
+
234
+ $product_id = reset( $products );
235
+ $_product = wc_get_product( $product_id );
236
+
237
+ if ( ! empty( $_product ) ) {
238
+
239
+ if ( $_product->is_type( 'simple' ) && $_product->is_virtual() ) {
240
+
241
+ if ( $_product->get_price() > 0 ) {
242
+ wc_add_notice( __( 'Please update the selected product\'s price to zero (0).', 'cartflows' ), 'error' );
243
+ } else {
244
+
245
+ $quantity = 1;
246
+
247
+ WC()->cart->add_to_cart( $product_id, $quantity );
248
+ }
249
+ } else {
250
+
251
+ wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
252
+ }
253
+ } else {
254
+
255
+ wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
256
+ }
257
+
258
+ do_action( 'cartflows_optin_after_configure_cart', $optin_id );
259
+ }
260
+ }
261
+ }
262
+
263
+ /**
264
+ * Load shortcode data.
265
+ *
266
+ * @return void
267
+ */
268
+ public function shortcode_load_data() {
269
+
270
+ if ( _is_wcf_optin_type() ) {
271
+
272
+ add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
273
+
274
+ add_action( 'wp_enqueue_scripts', array( $this, 'compatibility_scripts' ), 101 );
275
+
276
+ /* Show notices if cart has errors */
277
+ add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
278
+
279
+ // Outputting the hidden field in checkout page.
280
+ add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
281
+ add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
282
+
283
+ /* Remove unnecessary option */
284
+ add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
285
+ add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false' );
286
+
287
+ remove_all_actions( 'woocommerce_before_checkout_form' );
288
+ remove_all_actions( 'woocommerce_checkout_billing' );
289
+ remove_all_actions( 'woocommerce_checkout_shipping' );
290
+ remove_all_actions( 'woocommerce_checkout_before_order_review' );
291
+ remove_all_actions( 'woocommerce_checkout_order_review' );
292
+ remove_all_actions( 'woocommerce_checkout_after_order_review' );
293
+ add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
294
+ add_filter( 'woocommerce_available_payment_gateways', array( $this, 'disable_payment_gateways' ) );
295
+
296
+ /* Paypal Expresss remove */
297
+
298
+ if ( function_exists( 'wc_gateway_ppec' ) ) {
299
+ remove_action( 'wp_enqueue_scripts', array( wc_gateway_ppec()->cart, 'enqueue_scripts' ) );
300
+ }
301
+
302
+ // Hook in actions once.
303
+ add_action( 'woocommerce_before_checkout_form', 'woocommerce_output_all_notices', 10 );
304
+ add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
305
+ add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
306
+ add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
307
+
308
+ /* Submit Button */
309
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
310
+
311
+ add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
312
+
313
+ global $post;
314
+
315
+ $optin_id = $post->ID;
316
+
317
+ do_action( 'cartflows_optin_before_shortcode', $optin_id );
318
+ }
319
+ }
320
+
321
+ /**
322
+ * Disable payment gateways.
323
+ *
324
+ * @param array $available_gateways gateways.
325
+ * @return array
326
+ */
327
+ public function disable_payment_gateways( $available_gateways ) {
328
+
329
+ if ( ! is_admin() ) {
330
+
331
+ $available_gateways = array();
332
+ }
333
+
334
+ return $available_gateways;
335
+ }
336
+
337
+ /**
338
+ * Render checkout ID hidden field.
339
+ *
340
+ * @param array $checkout checkout session data.
341
+ * @return void
342
+ */
343
+ public function checkout_shortcode_post_id( $checkout ) {
344
+
345
+ if ( ! _is_wcf_optin_type() ) {
346
+ return;
347
+ }
348
+
349
+ global $post;
350
+
351
+ $optin_id = $post->ID;
352
+
353
+ $flow_id = get_post_meta( $optin_id, 'wcf-flow-id', true );
354
+
355
+ echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
356
+ echo '<input type="hidden" class="input-hidden _wcf_optin_id" name="_wcf_optin_id" value="' . intval( $optin_id ) . '">';
357
+ }
358
+
359
+ /**
360
+ * Load shortcode scripts.
361
+ *
362
+ * @return void
363
+ */
364
+ public function shortcode_scripts() {
365
+
366
+ wp_enqueue_style( 'wcf-optin-template', wcf()->utils->get_css_url( 'optin-template' ), '', CARTFLOWS_VER );
367
+
368
+ wp_enqueue_script(
369
+ 'wcf-optin-template',
370
+ wcf()->utils->get_js_url( 'optin-template' ),
371
+ array( 'jquery' ),
372
+ CARTFLOWS_VER,
373
+ true
374
+ );
375
+
376
+ do_action( 'cartflows_optin_scripts' );
377
+
378
+ $style = $this->generate_style();
379
+
380
+ wp_add_inline_style( 'wcf-optin-template', $style );
381
+ }
382
+
383
+ /**
384
+ * Load compatibility scripts.
385
+ *
386
+ * @return void
387
+ */
388
+ public function compatibility_scripts() {
389
+
390
+ global $post;
391
+
392
+ $optin_id = $post->ID;
393
+
394
+ // Add DIVI Compatibility css if DIVI theme is enabled.
395
+ if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
396
+ Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $optin_id )
397
+ ) {
398
+ wp_enqueue_style( 'wcf-optin-template-divi', wcf()->utils->get_css_url( 'optin-template-divi' ), '', CARTFLOWS_VER );
399
+ }
400
+ }
401
+
402
+ /**
403
+ * Generate styles.
404
+ *
405
+ * @return string
406
+ */
407
+ public function generate_style() {
408
+
409
+ global $post;
410
+
411
+ $optin_id = $post->ID;
412
+
413
+ /* Load all fonts */
414
+ CartFlows_Font_Families::render_fonts( $optin_id );
415
+
416
+ $r = '';
417
+ $g = '';
418
+ $b = '';
419
+ $output = '';
420
+
421
+ /* Global */
422
+ $primary_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-primary-color' );
423
+ $base_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-base-font-family' );
424
+
425
+ /* Input Fields */
426
+ $input_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-family' );
427
+ $input_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-weight' );
428
+ $field_input_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-field-size' );
429
+ $field_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-tb-padding' );
430
+ $field_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-lr-padding' );
431
+ $field_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-color' );
432
+ $field_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-bg-color' );
433
+ $field_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-border-color' );
434
+ $field_label_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-label-color' );
435
+
436
+ if ( 'custom' == $field_input_size ) {
437
+ $field_input_size = '38px';
438
+ }
439
+
440
+ /* Submit Button */
441
+ $submit_button_width = '100%';
442
+ $optin_button_position = '';
443
+ $button_font_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-font-size' );
444
+ $button_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-family' );
445
+ $button_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-weight' );
446
+ $submit_button_height = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-size' );
447
+ $submit_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-tb-padding' );
448
+ $submit_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-lr-padding' );
449
+ $submit_button_position = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-position' );
450
+ $submit_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-color' );
451
+ $submit_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-hover-color' );
452
+ $submit_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-color', $primary_color );
453
+ $submit_bg_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-hover-color', $primary_color );
454
+ $submit_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-color', $primary_color );
455
+ $submit_border_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-hover-color', $primary_color );
456
+
457
+ if ( 'custom' == $submit_button_height ) {
458
+ $submit_button_height = '38px';
459
+ $submit_button_width = 'auto';
460
+
461
+ switch ( $submit_button_position ) {
462
+ case 'left':
463
+ $optin_button_position = '0 auto 0 0';
464
+ break;
465
+ case 'center':
466
+ $optin_button_position = '0 auto';
467
+ break;
468
+ case 'right':
469
+ $optin_button_position = '0 0 0 auto';
470
+ break;
471
+
472
+ default:
473
+ $optin_button_position = '0 auto';
474
+ break;
475
+ }
476
+ }
477
+
478
+ if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
479
+ Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $optin_id ) ) {
480
+
481
+ include CARTFLOWS_OPTIN_DIR . 'includes/optin-dynamic-divi-css.php';
482
+
483
+ } else {
484
+ include CARTFLOWS_OPTIN_DIR . 'includes/optin-dynamic-css.php';
485
+ }
486
+
487
+ return $output;
488
+ }
489
+
490
+ /**
491
+ * Get ajax end points.
492
+ *
493
+ * @param string $endpoint_url end point URL.
494
+ * @param string $request end point request.
495
+ * @return string
496
+ */
497
+ public function get_ajax_endpoint( $endpoint_url, $request ) {
498
+
499
+ global $post;
500
+
501
+ if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
502
+
503
+ if ( _is_wcf_optin_type() ) {
504
+
505
+ if ( mb_strpos( $endpoint_url, 'checkout', 0, 'utf-8' ) === false ) {
506
+
507
+ if ( '' === $request ) {
508
+ $query_args = array(
509
+ 'wc-ajax' => '%%endpoint%%',
510
+ );
511
+ } else {
512
+ $query_args = array(
513
+ 'wc-ajax' => $request,
514
+ );
515
+ }
516
+
517
+ $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 ); //phpcs:ignore
518
+ $uri = $uri[0];
519
+
520
+ $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
521
+ }
522
+ }
523
+ }
524
+
525
+ return $endpoint_url;
526
+ }
527
+
528
+
529
+ /**
530
+ * Save checkout fields.
531
+ *
532
+ * @param int $order_id order id.
533
+ * @param array $posted posted data.
534
+ * @return void
535
+ */
536
+ public function save_optin_fields( $order_id, $posted ) {
537
+
538
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
539
+
540
+ $optin_id = wc_clean( wp_unslash( $_POST['_wcf_optin_id'] ) ); //phpcs:ignore
541
+
542
+ update_post_meta( $order_id, '_wcf_optin_id', $optin_id );
543
+
544
+ if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
545
+
546
+ $flow_id = wc_clean( wp_unslash( $_POST['_wcf_flow_id'] ) ); //phpcs:ignore
547
+
548
+ update_post_meta( $order_id, '_wcf_flow_id', $flow_id );
549
+ }
550
+ }
551
+
552
+ }
553
+
554
+ /**
555
+ * Redirect users to our checkout if hidden param
556
+ *
557
+ * @param string $redirect redirect url.
558
+ * @param object $user user.
559
+ * @return string
560
+ */
561
+ public function after_login_redirect( $redirect, $user ) {
562
+
563
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
564
+
565
+ $optin_id = intval( $_POST['_wcf_optin_id'] ); //phpcs:ignore
566
+
567
+ $redirect = get_permalink( $optin_id );
568
+ }
569
+
570
+ return $redirect;
571
+ }
572
+
573
+
574
+ /**
575
+ * Add custom class to the fields to change the UI to three column.
576
+ *
577
+ * @param array $fields fields.
578
+ */
579
+ public function set_optin_default_fields( $fields ) {
580
+
581
+ if ( _is_wcf_optin_type() ) {
582
+
583
+ global $post;
584
+
585
+ $optin_id = $post->ID;
586
+ } else {
587
+
588
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
589
+
590
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
591
+ } else {
592
+ return $fields;
593
+ }
594
+ }
595
+
596
+ $first_name = $fields['first_name'];
597
+ $last_name = $fields['last_name'];
598
+
599
+ /* Make fields required */
600
+ $first_name['required'] = true;
601
+ $last_name['required'] = true;
602
+
603
+ $fields = array(
604
+ 'first_name' => $first_name,
605
+ 'last_name' => $last_name,
606
+ );
607
+
608
+ return apply_filters( 'cartflows_optin_default_fields', $fields, $optin_id );
609
+ }
610
+
611
+ /**
612
+ * Add custom class to the fields to change the UI to three column.
613
+ *
614
+ * @param array $fields fields.
615
+ */
616
+ public function set_optin_fields( $fields ) {
617
+
618
+ if ( _is_wcf_optin_type() ) {
619
+
620
+ global $post;
621
+
622
+ $optin_id = $post->ID;
623
+ } else {
624
+
625
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
626
+
627
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
628
+ } else {
629
+ return $fields;
630
+ }
631
+ }
632
+
633
+ $billing_first_name = $fields['billing']['billing_first_name'];
634
+ $billing_last_name = $fields['billing']['billing_last_name'];
635
+ $billing_email = $fields['billing']['billing_email'];
636
+
637
+ $fields['billing'] = array(
638
+ 'billing_first_name' => $billing_first_name,
639
+ 'billing_last_name' => $billing_last_name,
640
+ 'billing_email' => $billing_email,
641
+ );
642
+
643
+ return apply_filters( 'cartflows_optin_fields', $fields, $optin_id );
644
+ }
645
+
646
+ /**
647
+ * Billing field customization.
648
+ *
649
+ * @param array $fields fields data.
650
+ * @param string $country country name.
651
+ * @return array
652
+ */
653
+ public function billing_optin_fields( $fields, $country ) {
654
+
655
+ if ( _is_wcf_optin_type() ) {
656
+
657
+ global $post;
658
+
659
+ $optin_id = $post->ID;
660
+ } else {
661
+
662
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
663
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
664
+ } else {
665
+ return $fields;
666
+ }
667
+ }
668
+
669
+ if ( is_wc_endpoint_url( 'edit-address' ) ) {
670
+ return $fields;
671
+ }
672
+
673
+ $billing_first_name = $fields['billing_first_name'];
674
+ $billing_last_name = $fields['billing_last_name'];
675
+ $billing_email = $fields['billing_email'];
676
+
677
+ /* Make fields required */
678
+ $billing_first_name['required'] = true;
679
+ $billing_last_name['required'] = true;
680
+
681
+ $fields = array(
682
+ 'billing_first_name' => $billing_first_name,
683
+ 'billing_last_name' => $billing_last_name,
684
+ 'billing_email' => $billing_email,
685
+ );
686
+
687
+ return apply_filters( 'cartflows_billing_optin_fields', $fields, $country, $optin_id );
688
+ }
689
+
690
+
691
+ /**
692
+ * Replace billing label.
693
+ *
694
+ * @param string $notice Notice.
695
+ * @param string $field_label Field name.
696
+ * @return string
697
+ */
698
+ public function change_field_label_in_required_notice( $notice, $field_label ) {
699
+
700
+ if ( _is_wcf_doing_optin_ajax() ) {
701
+
702
+ $notice = str_replace( 'Billing ', '', $notice );
703
+ }
704
+
705
+ return $notice;
706
+ }
707
+ }
708
+
709
+ /**
710
+ * Kicking this off by calling 'get_instance()' method
711
+ */
712
+ Cartflows_Optin_Markup::get_instance();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/optin/includes/optin-dynamic-css.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dynamic checkout css
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $output .= "
9
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
10
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:checked:before{
11
+ color: {$primary_color};
12
+ }
13
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{
14
+ background-color: {$primary_color};
15
+ }
16
+ .wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,
17
+ .wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:focus,
18
+ .wcf-optin-form .woocommerce #payment input[type=radio]:checked:focus,
19
+ .wcf-optin-form .woocommerce #payment input[type=radio]:not(:checked):focus{
20
+ border-color: {$primary_color};
21
+ box-shadow: 0 0 2px rgba( " . $r . ',' . $g . ',' . $b . ", .8);
22
+ }
23
+ .wcf-optin-form .woocommerce-checkout label{
24
+ color: {$field_label_color};
25
+ }
26
+
27
+ .wcf-optin-form #order_review .wcf-custom-coupon-field input[type='text'],
28
+ .wcf-optin-form .woocommerce form .form-row input.input-text,
29
+ .wcf-optin-form .woocommerce form .form-row textarea,
30
+ .wcf-optin-form .select2-container--default .select2-selection--single {
31
+ color: {$field_color};
32
+ background: {$field_bg_color};
33
+ border-color: {$field_border_color};
34
+ padding-top: {$field_tb_padding}px;
35
+ padding-bottom: {$field_tb_padding}px;
36
+ padding-left: {$field_lr_padding}px;
37
+ padding-right: {$field_lr_padding}px;
38
+ min-height: {$field_input_size};
39
+ font-family: {$input_font_family};
40
+ font-weight: {$input_font_weight};
41
+ }
42
+
43
+ .wcf-optin-form .woocommerce .col2-set .col-1,
44
+ .wcf-optin-form .woocommerce .col2-set .col-2,
45
+ .wcf-optin-form .woocommerce-checkout .shop_table,
46
+ .wcf-optin-form .woocommerce-checkout #order_review_heading,
47
+ .wcf-optin-form .woocommerce-checkout #payment,
48
+ .wcf-optin-form .woocommerce form.checkout_coupon {
49
+ font-family: {$input_font_family};
50
+ font-weight: {$input_font_weight};
51
+ }
52
+
53
+ .woocommerce table.shop_table th{
54
+ color: {$field_label_color};
55
+ }
56
+
57
+ .wcf-optin-form .woocommerce a{
58
+ color: {$primary_color};
59
+ }
60
+ .wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered {
61
+ color: {$field_color};
62
+ }
63
+ .wcf-optin-form ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
64
+ color: {$field_color};
65
+ }
66
+ .wcf-optin-form ::-moz-placeholder { /* Firefox 19+ */
67
+ color: {$field_color};
68
+ }
69
+ .wcf-optin-form :-ms-input-placeholder { /* IE 10+ */
70
+ color: {$field_color};
71
+ }
72
+ .wcf-optin-form :-moz-placeholder { /* Firefox 18- */
73
+ color: {$field_color};
74
+ }
75
+ .wcf-optin-form .woocommerce form p.form-row label {
76
+ color: {$field_label_color};
77
+ font-family: {$input_font_family};
78
+ font-weight: {$input_font_weight};
79
+ }
80
+ .wcf-optin-form .woocommerce #order_review button,
81
+ .wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,
82
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small {
83
+ color: {$submit_color};
84
+ background: {$submit_bg_color};
85
+ padding-top: {$submit_tb_padding}px;
86
+ padding-bottom: {$submit_tb_padding}px;
87
+ padding-left: {$submit_lr_padding}px;
88
+ padding-right: {$submit_lr_padding}px;
89
+ border-color: {$submit_border_color};
90
+ min-height: {$submit_button_height};
91
+ font-size: {$button_font_size}px;
92
+ font-family: {$button_font_family};
93
+ font-weight: {$button_font_weight};
94
+ width: {$submit_button_width};
95
+
96
+ }
97
+
98
+ .wcf-optin-form .woocommerce-checkout form.woocommerce-form-login .button,
99
+ .wcf-optin-form .woocommerce-checkout form.checkout_coupon .button{
100
+ background: {$submit_bg_color};
101
+ border: 1px {$submit_border_color} solid;
102
+ color: {$submit_color};
103
+ min-height: {$submit_button_height};
104
+ font-family: {$button_font_family};
105
+ font-weight: {$button_font_weight};
106
+ }
107
+ .wcf-optin-form .woocommerce-checkout form.login .button:hover,
108
+ .wcf-optin-form .woocommerce-checkout form.checkout_coupon .button:hover,
109
+ .wcf-optin-form .woocommerce #payment #place_order:hover,
110
+ .wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{
111
+ color: {$submit_hover_color};
112
+ background-color: {$submit_bg_hover_color};
113
+ border-color: {$submit_border_hover_color};
114
+ }
115
+ .wcf-optin-form .woocommerce-info::before,
116
+ .wcf-optin-form .woocommerce-message::before{
117
+ color: {$primary_color};
118
+ }
119
+ .wcf-optin-form{
120
+ font-family: {$base_font_family};
121
+ }
122
+ img.emoji, img.wp-smiley {}";
123
+
124
+ if ( 'custom' == $submit_button_height ) {
125
+ $output .= "
126
+ .wcf-optin-form .woocommerce #order_review #payment button{
127
+ margin: {$optin_button_position};
128
+ }
129
+ ";
130
+ }
modules/optin/includes/optin-dynamic-divi-css.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Dynamic checkout css
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ $output .= "
9
+ .et_pb_module #wcf-optin-form .woocommerce #payment input[type=checkbox]:checked:before,
10
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:checked:before{
11
+ color: {$primary_color};
12
+ }
13
+ .et_pb_module #wcf-optin-form .woocommerce #payment input[type=radio]:checked:before{
14
+ background-color: {$primary_color};
15
+ }
16
+ .et_pb_module #wcf-optin-form .woocommerce #payment input[type=checkbox]:focus,
17
+ .et_pb_module #wcf-optin-form .woocommerce .woocommerce-shipping-fields [type='checkbox']:focus,
18
+ .et_pb_module #wcf-optin-form .woocommerce #payment input[type=radio]:checked:focus,
19
+ .et_pb_module #wcf-optin-form .woocommerce #payment input[type=radio]:not(:checked):focus{
20
+ border-color: {$primary_color};
21
+ box-shadow: 0 0 2px rgba( " . $r . ',' . $g . ',' . $b . ", .8);
22
+ }
23
+ .et_pb_module #wcf-optin-form .woocommerce-checkout label{
24
+ color: {$field_label_color};
25
+ }
26
+
27
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row input.input-text,
28
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row textarea,
29
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row select,
30
+ .et_pb_module #wcf-optin-form .woocommerce #order_review .input-text,
31
+ .et_pb_module #wcf-optin-form #order_review .wcf-custom-coupon-field input[type='text'],
32
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row input.input-text,
33
+ .et_pb_module #wcf-optin-form .woocommerce form .form-row textarea,
34
+ .et_pb_module #wcf-optin-form .select2-container--default .select2-selection--single {
35
+ color: {$field_color} !important;
36
+ background-color: {$field_bg_color}!important;
37
+ border-color: {$field_border_color}!important;
38
+ padding-top: {$field_tb_padding}px;
39
+ padding-bottom: {$field_tb_padding}px;
40
+ padding-left: {$field_lr_padding}px;
41
+ padding-right: {$field_lr_padding}px;
42
+ min-height: {$field_input_size}!important;
43
+ font-family: {$input_font_family};
44
+ font-weight: {$input_font_weight};
45
+ }
46
+
47
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-1,
48
+ .et_pb_module #wcf-optin-form .woocommerce .col2-set .col-2,
49
+ .et_pb_module #wcf-optin-form .woocommerce-checkout .shop_table,
50
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #order_review_heading,
51
+ .et_pb_module #wcf-optin-form .woocommerce-checkout #payment,
52
+ .et_pb_module #wcf-optin-form .woocommerce form.checkout_coupon {
53
+ font-family: {$input_font_family};
54
+ font-weight: {$input_font_weight};
55
+ }
56
+
57
+ .et_pb_module #wcf-optin-form .woocommerce table.shop_table th{
58
+ color: {$field_label_color};
59
+ }
60
+
61
+ .et_pb_module #wcf-optin-form .woocommerce a{
62
+ color: {$primary_color};
63
+ }
64
+ .et_pb_module #wcf-optin-form .select2-container--default .select2-selection--single .select2-selection__rendered {
65
+ color: {$field_color};
66
+ }
67
+ .et_pb_module #wcf-optin-form ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
68
+ color: {$field_color};
69
+ }
70
+ .et_pb_module #wcf-optin-form ::-moz-placeholder { /* Firefox 19+ */
71
+ color: {$field_color};
72
+ }
73
+ .et_pb_module #wcf-optin-form :-ms-input-placeholder { /* IE 10+ */
74
+ color: {$field_color};
75
+ }
76
+ .et_pb_module #wcf-optin-form :-moz-placeholder { /* Firefox 18- */
77
+ color: {$field_color};
78
+ }
79
+ .et_pb_module #wcf-optin-form .woocommerce form p.form-row label {
80
+ color: {$field_label_color};
81
+ font-family: {$input_font_family};
82
+ font-weight: {$input_font_weight};
83
+ }
84
+ .et_pb_module #wcf-optin-form .woocommerce #order_review button,
85
+ .et_pb_module #wcf-optin-form .woocommerce form.woocommerce-form-login .form-row button,
86
+ .et_pb_module #wcf-optin-form .woocommerce #order_review button.wcf-btn-small {
87
+ color: {$submit_color} !important;
88
+ background-color: {$submit_bg_color}!important;
89
+ padding-top: {$submit_tb_padding}px;
90
+ padding-bottom: {$submit_tb_padding}px;
91
+ padding-left: {$submit_lr_padding}px;
92
+ padding-right: {$submit_lr_padding}px;
93
+ border-color: {$submit_border_color}!important;
94
+ min-height: {$submit_button_height};
95
+ font-size: {$button_font_size}px;
96
+ font-family: {$button_font_family};
97
+ font-weight: {$button_font_weight};
98
+ width: {$submit_button_width};
99
+
100
+ }
101
+
102
+ .et_pb_module #wcf-optin-form .woocommerce-checkout form.woocommerce-form-login .button,
103
+ .et_pb_module #wcf-optin-form .woocommerce-checkout form.checkout_coupon .button{
104
+ background: {$submit_bg_color};
105
+ border: 1px {$submit_border_color} solid;
106
+ color: {$submit_color};
107
+ min-height: {$submit_button_height};
108
+ font-family: {$button_font_family};
109
+ font-weight: {$button_font_weight};
110
+ }
111
+ .et_pb_module #wcf-optin-form .woocommerce-checkout form.login .button:hover,
112
+ .et_pb_module #wcf-optin-form .woocommerce-checkout form.checkout_coupon .button:hover,
113
+ .et_pb_module #wcf-optin-form .woocommerce #payment #place_order:hover,
114
+ .et_pb_module #wcf-optin-form .woocommerce #order_review button.wcf-btn-small:hover{
115
+ color: {$submit_hover_color} !important;
116
+ background-color: {$submit_bg_hover_color} !important;
117
+ border-color: {$submit_border_hover_color} !important;
118
+ }
119
+ .et_pb_module #wcf-optin-form .woocommerce-info::before,
120
+ .et_pb_module #wcf-optin-form .woocommerce-message::before{
121
+ color: {$primary_color};
122
+ }
123
+ .et_pb_module #wcf-optin-form {
124
+ font-family: {$base_font_family};
125
+ }
126
+ img.emoji, img.wp-smiley {}
127
+ ";
128
+
129
+ if ( 'custom' == $submit_button_height ) {
130
+ $output .= "
131
+ .et_pb_module #wcf-optin-form .woocommerce #order_review #payment button{
132
+ margin: {$optin_button_position};
133
+ }
134
+ ";
135
+ }
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.3.2
7
- Stable tag: 1.5.2
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -125,6 +125,10 @@ Glad you asked! CartFlows Pro is an optional add-on to CartFlows that adds addit
125
 
126
  == Changelog ==
127
 
 
 
 
 
128
  = Version 1.5.2 - Wednesday, 18th March 2020 =
129
  * New: Added an option to enable Facebook pixel's Pageview event on the whole site.
130
  * Improvement: Added compatibility for the Pro theme.
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
7
+ Stable tag: 1.5.3
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
125
 
126
  == Changelog ==
127
 
128
+ = Version 1.5.3 - Wednesday, 1st April 2020 =
129
+ * Improvement: Divi CSS support added for the Optin step type.
130
+ * Fix: FB Pixel conflict with Beaver Builder & PHP notice issue.
131
+
132
  = Version 1.5.2 - Wednesday, 18th March 2020 =
133
  * New: Added an option to enable Facebook pixel's Pageview event on the whole site.
134
  * Improvement: Added compatibility for the Pro theme.