PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 1.5.2
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v1.5.2
3.1.4 3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 All 93 releases
ultimate-store-kit / modules / page-checkout / widgets / page-checkout.php

page-checkout.php in Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder 1.5.2, at modules/page-checkout/widgets/page-checkout.php

1,051 lines 47.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace UltimateStoreKit\Modules\PageCheckout\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Typography;
7 use Elementor\Group_Control_Border;
8 use Elementor\Plugin;
9
10 use UltimateStoreKit\Base\Module_Base;
11
12 if (!defined('ABSPATH')) exit; // Exit if accessed directly
13
14 class Page_Checkout extends Module_Base {
15
16 public function get_name() {
17 return 'usk-page-checkout';
18 }
19
20 public function get_title() {
21 return BDTUSK . esc_html__('Checkout (Page)', 'ultimate-store-kit');
22 }
23
24 public function get_icon() {
25 return 'usk-widget-icon usk-icon-page-checkout usk-new';
26 }
27
28 public function get_categories() {
29 return ['ultimate-store-kit'];
30 }
31
32 public function get_keywords() {
33 return ['cart', 'order', 'wc', 'checkout'];
34 }
35
36 public function get_style_depends() {
37 if ($this->usk_is_edit_mode()) {
38 return ['usk-all-styles'];
39 } else {
40 return ['wc-checkout', 'ultimate-store-kit-font', 'usk-page-checkout'];
41 }
42 }
43
44 public function get_script_depends() {
45 return ['usk-page-checkout'];
46 }
47
48 protected function register_controls() {
49
50 $this->start_controls_section(
51 'section_style_heading',
52 [
53 'label' => __('Heading', 'ultimate-store-kit'),
54 'tab' => Controls_Manager::TAB_STYLE,
55 ]
56 );
57 $this->add_control(
58 'heading_color',
59 [
60 'label' => __('Color', 'ultimate-store-kit'),
61 'type' => Controls_Manager::COLOR,
62 'selectors' => [
63 '{{WRAPPER}} .usk-checkout-order-review .order_review_heading, {{WRAPPER}} .usk-checkout-billing-address .usk-checkout-billing-address-header' => 'color: {{VALUE}}',
64 ],
65 ]
66 );
67 $this->add_responsive_control(
68 'heading_bottom_spacing',
69 [
70 'label' => __('Bottom Spacing', 'ultimate-store-kit'),
71 'type' => Controls_Manager::SLIDER,
72 'size_units' => ['px', '%', 'vh'],
73 'selectors' => [
74 '{{WRAPPER}} .usk-checkout-order-review .order_review_heading, {{WRAPPER}} .usk-checkout-billing-address .usk-checkout-billing-address-header' => 'margin-bottom: {{SIZE}}{{UNIT}};',
75 ],
76 'separator' => 'after'
77 ]
78 );
79 $this->add_control(
80 'heading_alignment',
81 [
82 'label' => __('Alignment', 'ultimate-store-kit'),
83 'type' => Controls_Manager::CHOOSE,
84 'options' => [
85 'left' => [
86 'title' => __('Left', 'ultimate-store-kit'),
87 'icon' => 'eicon-h-align-left',
88 ],
89 'center' => [
90 'title' => __('Center', 'ultimate-store-kit'),
91 'icon' => 'eicon-h-align-center',
92 ],
93 'right' => [
94 'title' => __('Right', 'ultimate-store-kit'),
95 'icon' => 'eicon-h-align-right',
96 ],
97 ],
98 'default' => 'left',
99 'selectors' => [
100 '{{WRAPPER}} .usk-checkout-order-review .order_review_heading, {{WRAPPER}} .usk-checkout-billing-address .usk-checkout-billing-address-header' => 'text-align: {{VALUE}}',
101 ],
102 ]
103 );
104
105 $this->add_group_control(
106 Group_Control_Typography::get_type(),
107 [
108 'name' => 'heading_typography',
109 'label' => __('Typography', 'ultimate-store-kit'),
110 'selector' => '{{WRAPPER}} .usk-checkout-order-review .order_review_heading, {{WRAPPER}} .usk-checkout-billing-address .usk-checkout-billing-address-header',
111 ]
112 );
113
114 $this->end_controls_section();
115
116 $this->start_controls_section(
117 'section_checkout_shipping_form_container',
118 [
119 'label' => esc_html__('Container', 'ultimate-store-kit'),
120 'tab' => Controls_Manager::TAB_STYLE,
121 ]
122 );
123
124 $this->add_control(
125 'checkout_shipping_form_container_bg',
126 [
127 'label' => esc_html__('Background', 'ultimate-store-kit'),
128 'type' => Controls_Manager::COLOR,
129 'selectors' => [
130 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper' => 'background-color: {{VALUE}};',
131 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper' => 'background-color: {{VALUE}};',
132 ],
133 ]
134 );
135
136 $this->add_control(
137 'checkout_shipping_form_container_alignment',
138 [
139 'label' => esc_html__(
140 'Alignment',
141 'ultimate-store-kit'
142 ),
143 'type' => Controls_Manager::CHOOSE,
144 'options' => [
145 'left' => [
146 'title' => esc_html__(
147 'Left',
148 'ultimate-store-kit'
149 ),
150 'icon' => 'eicon-text-align-left',
151 ],
152 'right' => [
153 'title' => esc_html__('Right', 'ultimate-store-kit'),
154 'icon' => 'eicon-text-align-right',
155 ],
156 ],
157 'selectors' => [
158 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper' => 'text-align: {{VALUE}};',
159 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper .woocommerce-input-wrapper input' => 'text-align: {{VALUE}};',
160 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper .woocommerce-input-wrapper select' => 'text-align: {{VALUE}};',
161 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper' => 'text-align: {{VALUE}};',
162 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper .woocommerce-input-wrapper input' => 'text-align: {{VALUE}};',
163 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper .woocommerce-input-wrapper select' => 'text-align: {{VALUE}};',
164 ],
165 ]
166 );
167
168
169 $this->add_responsive_control(
170 'checkout_shipping_form_container_padding',
171 [
172 'label' => esc_html__('Padding', 'ultimate-store-kit'),
173 'type' => Controls_Manager::DIMENSIONS,
174 'selectors' => [
175 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
176 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
177 ],
178
179 ]
180 );
181 $this->add_responsive_control(
182 'checkout_shipping_form_container_margin',
183 [
184 'label' => esc_html__('Margin', 'ultimate-store-kit'),
185 'type' => Controls_Manager::DIMENSIONS,
186 'selectors' => [
187 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
188 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
189 ],
190 ]
191 );
192 $this->add_group_control(
193 Group_Control_Border::get_type(),
194 [
195 'name' => 'checkout_shipping_form_container_border',
196 'label' => __('Border', 'ultimate-store-kit'),
197 'selector' => '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper, {{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper',
198 ]
199 );
200 $this->add_responsive_control(
201 'checkout_shipping_form_container_radius',
202 [
203 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
204 'type' => Controls_Manager::DIMENSIONS,
205 'selectors' => [
206 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields .woocommerce-shipping-fields__field-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
207 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
208 ],
209
210 ]
211 );
212 $this->end_controls_section();
213
214 $this->start_controls_section(
215 'section_checkout_billing_address_form',
216 [
217 'label' => __('Form', 'ultimate-store-kit'),
218 'tab' => Controls_Manager::TAB_STYLE,
219 ]
220 );
221 $this->start_controls_tabs(
222 'tabs_checkout_billing_address_forms'
223 );
224 $this->start_controls_tab(
225 'tab_checkout_billing_address_label',
226 [
227 'label' => __('Label', 'ultimate-store-kit'),
228 ]
229 );
230
231 $this->add_control(
232 'checkout_billing_address_input_label_color',
233 [
234 'label' => esc_html__('Color', 'ultimate-store-kit'),
235 'type' => Controls_Manager::COLOR,
236 'selectors' => [
237 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper .form-row label,
238 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper .form-row label' => 'color: {{VALUE}}',
239 ],
240 ]
241 );
242
243 $this->add_control(
244 'checkout_billing_address_input_label_indicator_color',
245 [
246 'label' => esc_html__('Required Indicator Color:', 'ultimate-store-kit'),
247 'type' => Controls_Manager::COLOR,
248 'selectors' => [
249 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper .form-row label abbr,
250 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper .form-row label abbr' => 'color: {{VALUE}}',
251 ],
252 ]
253 );
254 $this->add_responsive_control(
255 'title',
256 [
257 'label' => __('Bottom Spacing', 'ultimate-store-kit'),
258 'type' => Controls_Manager::SLIDER,
259 'selectors' => [
260 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper .form-row label,
261 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper .form-row label' => 'margin-bottom: {{SIZE}}{{UNIT}};',
262 ],
263 'separator' => 'before'
264 ]
265 );
266
267 $this->add_group_control(
268 Group_Control_Typography::get_type(),
269 [
270 'name' => 'checkout_billing_address_input_label_typography',
271 'label' => __('Typography', 'ultimate-store-kit'),
272 'selector' => '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper .form-row label, {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper .form-row label',
273 'separator' => 'before'
274 ]
275 );
276
277 $this->end_controls_tab();
278 $this->start_controls_tab(
279 'tab_checkout_billing_address_input',
280 [
281 'label' => __('Input', 'ultimate-store-kit'),
282 ]
283 );
284 $this->add_control(
285 'checkout_billing_address_input_color',
286 [
287 'label' => esc_html__('Color', 'ultimate-store-kit'),
288 'type' => Controls_Manager::COLOR,
289 'selectors' => [
290 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)' => 'color: {{VALUE}};',
291 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, input::placeholder, textarea::placeholder, .woocommerce-input-wrapper .select2-selection, select):focus' => 'color: {{VALUE}};',
292 ],
293
294 ]
295 );
296
297 $this->add_control(
298 'checkout_billing_address_input_placeholder_color',
299 [
300 'label' => esc_html__('Placeholder Color', 'ultimate-store-kit'),
301 'type' => Controls_Manager::COLOR,
302 'selectors' => [
303 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)::placeholder' => 'color: {{VALUE}};',
304 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)::placeholder' => 'color: {{VALUE}};',
305 ],
306 ]
307 );
308 $this->add_control(
309 'checkout_billing_address_input_background',
310 [
311 'label' => esc_html__('Background', 'ultimate-store-kit'),
312 'type' => Controls_Manager::COLOR,
313 'selectors' => [
314 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .select2-selection, select)' => 'background-color: {{VALUE}};',
315 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)' => 'background-color: {{VALUE}};',
316 ],
317 ]
318 );
319 $this->add_responsive_control(
320 'checkout_billing_address_input_padding',
321 [
322 'label' => esc_html__('Padding', 'ultimate-store-kit'),
323 'type' => Controls_Manager::DIMENSIONS,
324 'selectors' => [
325 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .select2-selection, select),
326 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
327 ],
328 'separator' => 'before',
329 ]
330 );
331
332 $this->add_control(
333 'checkout_billing_address_input_margin',
334 [
335 'label' => esc_html__('Margin', 'ultimate-store-kit'),
336 'type' => Controls_Manager::DIMENSIONS,
337 'selectors' => [
338 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select),
339 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;'
340 ],
341 ]
342 );
343
344 $this->add_group_control(
345 Group_Control_Border::get_type(),
346 [
347 'name' => 'checkout_billing_address_input_border',
348 'label' => esc_html__('Border', 'ultimate-store-kit'),
349 'selector' =>
350 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select),
351 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)',
352 ]
353 );
354 $this->add_control(
355 'checkout_billing_address_input_border_radius',
356 [
357 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
358 'type' => Controls_Manager::DIMENSIONS,
359 'selectors' => [
360 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select),
361 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;'
362 ],
363 ]
364 );
365
366 $this->add_control(
367 'heading_checkout_billing_address_input_focus',
368 [
369 'label' => __('F O C U S', 'ultimate-store-kit'),
370 'type' => Controls_Manager::HEADING,
371 'separator' => 'before',
372 ]
373 );
374 $this->add_control(
375 'checkout_billing_address_input_color_focus',
376 [
377 'label' => esc_html__('Color', 'ultimate-store-kit'),
378 'type' => Controls_Manager::COLOR,
379 'selectors' => [
380 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .select2-selection, select):focus' => 'color: {{VALUE}};',
381 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, input::placeholder, textarea::placeholder, .woocommerce-input-wrapper .select2-selection, select):focus' => 'color: {{VALUE}};',
382 ],
383 ]
384 );
385
386 $this->add_control(
387 'checkout_billing_address_input_background_focus',
388 [
389 'label' => esc_html__('Background', 'ultimate-store-kit'),
390 'type' => Controls_Manager::COLOR,
391 'selectors' => [
392 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .select2-selection, select):focus' => 'background-color: {{VALUE}};',
393 '{{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, input::placeholder, textarea::placeholder, .woocommerce-input-wrapper .select2-selection, select):focus' => 'background-color: {{VALUE}};',
394 ],
395 ]
396 );
397
398 $this->add_group_control(
399 Group_Control_Border::get_type(),
400 [
401 'name' => 'checkout_billing_address_input_border_focus',
402 'label' => esc_html__('Border', 'ultimate-store-kit'),
403 'separator' => 'after',
404 'selector' =>
405 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .select2-selection, select):focus,
406 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, input::placeholder, textarea::placeholder, .woocommerce-input-wrapper .select2-selection, select):focus',
407 ]
408 );
409 $this->add_group_control(
410 Group_Control_Typography::get_type(),
411 [
412 'name' => 'checkout_billing_address_input_typography',
413 'label' => __('Typography', 'ultimate-store-kit'),
414 'separator' => 'before',
415 'selector' =>
416 '{{WRAPPER}} .usk-checkout-billing-address .woocommerce-billing-fields__field-wrapper :is(input, textarea, .woocommerce-input-wrapper .select2-selection, select),
417 {{WRAPPER}} .usk-checkout-shipping-form .woocommerce-shipping-fields__field-wrapper :is(input, input::placeholder, textarea::placeholder, .woocommerce-input-wrapper .select2-selection, select):focus',
418 ]
419 );
420
421 $this->end_controls_tab();
422 $this->end_controls_tabs();
423 $this->end_controls_section();
424 $this->start_controls_section(
425 'section_style_layout',
426 [
427 'label' => __('Order Details', 'ultimate-store-kit'),
428 'tab' => Controls_Manager::TAB_STYLE,
429 ]
430 );
431 $this->add_group_control(
432 Group_Control_Border::get_type(),
433 [
434 'name' => 'table_border',
435 'label' => __('Border', 'ultimate-store-kit'),
436 'selector' => '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table th,
437 {{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table td',
438 ]
439 );
440 $this->start_controls_tabs(
441 'tabs_table_header'
442 );
443 $this->start_controls_tab(
444 'tab_table_header',
445 [
446 'label' => __('HEADER', 'ultimate-store-kit'),
447 ]
448 );
449 $this->add_control(
450 'orders_header_color',
451 [
452 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
453 'type' => Controls_Manager::COLOR,
454 'selectors' => [
455 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table thead th' => 'color: {{VALUE}}',
456 ],
457 ]
458 );
459
460 $this->add_control(
461 'orders_header_background',
462 [
463 'label' => esc_html__('Background', 'ultimate-store-kit'),
464 'type' => Controls_Manager::COLOR,
465 'selectors' => [
466 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table thead th' => 'background-color: {{VALUE}}',
467 ],
468 ]
469 );
470
471
472 $this->add_responsive_control(
473 'table_header_padding',
474 [
475 'label' => esc_html__('Padding', 'ultimate-store-kit'),
476 'type' => Controls_Manager::DIMENSIONS,
477 'selectors' => [
478 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
479 '.rtl {{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table thead th' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
480 ],
481 'separator' => 'after'
482 ]
483 );
484
485 $this->add_group_control(
486 Group_Control_Typography::get_type(),
487 [
488 'name' => 'orders_header_text_typography',
489 'label' => esc_html__('Typography', 'ultimate-store-kit'),
490 'selector' => '{{WRAPPER}} .usk-checkout-order-review #order_review .woocommerce-checkout-review-order-table thead th',
491 ]
492 );
493 $this->end_controls_tab();
494 $this->start_controls_tab(
495 'tab_table_body',
496 [
497 'label' => __('BODY', 'ultimate-store-kit'),
498 ]
499 );
500 $this->add_control(
501 'table_body_text_color',
502 [
503 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
504 'type' => Controls_Manager::COLOR,
505 'selectors' => [
506 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tbody td' => 'color: {{VALUE}}',
507 ],
508 ]
509 );
510
511 $this->add_control(
512 'orders_body_background',
513 [
514 'label' => esc_html__('Background', 'ultimate-store-kit'),
515 'type' => Controls_Manager::COLOR,
516 'selectors' => [
517 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table > tbody > tr' => 'background-color: {{VALUE}} !important',
518 ],
519 ]
520 );
521 $this->add_control(
522 'table_body_price_color',
523 [
524 'label' => esc_html__('Price Color', 'ultimate-store-kit'),
525 'type' => Controls_Manager::COLOR,
526 'selectors' => [
527 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tbody td .amount' => 'color: {{VALUE}} !important',
528 ],
529 ]
530 );
531 $this->add_responsive_control(
532 'table_body_data_padding',
533 [
534 'label' => esc_html__('Row Padding ', 'ultimate-store-kit'),
535 'type' => Controls_Manager::DIMENSIONS,
536 'selectors' => [
537 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table:not(.shipping__table--multiple) > tbody > tr > td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
538 ],
539 ]
540 );
541
542 $this->add_group_control(
543 Group_Control_Typography::get_type(),
544 [
545 'name' => 'orders_body_typography',
546 'label' => esc_html__(' Typography', 'ultimate-store-kit'),
547 'selector' => '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tbody :is(td, label, .amount, strong, bdi)',
548 ]
549 );
550 $this->end_controls_tab();
551 $this->start_controls_tab(
552 'tab_table_footer',
553 [
554 'label' => __('FOOTER', 'ultimate-store-kit'),
555 ]
556 );
557 $this->add_control(
558 'footer_text_color',
559 [
560 'label' => esc_html__('Text Color', 'ultimate-store-kit'),
561 'type' => Controls_Manager::COLOR,
562 'selectors' => [
563 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot :is(th, td, label)' => 'color: {{VALUE}} !important'
564 ],
565 ]
566 );
567
568 $this->add_control(
569 'footer_price_color',
570 [
571 'label' => esc_html__('Price Color', 'ultimate-store-kit'),
572 'type' => Controls_Manager::COLOR,
573
574 'selectors' => [
575 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot :is(th, td) .amount' => 'color: {{VALUE}} !important'
576 ],
577 ]
578 );
579 $this->add_control(
580 'footer_subtotal_bg_color',
581 [
582 'label' => esc_html__('Subtotal Background Color', 'ultimate-store-kit'),
583 'type' => Controls_Manager::COLOR,
584 'selectors' => [
585 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot .cart-subtotal' => 'background-color: {{VALUE}} !important'
586 ],
587 ]
588 );
589
590 $this->add_control(
591 'footer_total_bg_color',
592 [
593 'label' => esc_html__('Total Background Color', 'ultimate-store-kit'),
594 'type' => Controls_Manager::COLOR,
595
596 'selectors' => [
597 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot .order-total' => 'background-color: {{VALUE}} !important'
598 ],
599 ]
600 );
601
602 $this->add_responsive_control(
603 'table_footer_data_padding',
604 [
605 'label' => esc_html__('Padding ', 'ultimate-store-kit'),
606 'type' => Controls_Manager::DIMENSIONS,
607 'selectors' => [
608 '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot :is(th, td, label)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
609 '.rtl {{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot :is(th, td, label)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
610 ],
611 'separator' => 'after'
612 ]
613 );
614
615 $this->add_group_control(
616 Group_Control_Typography::get_type(),
617 [
618 'name' => 'footer_color_typography',
619 'label' => esc_html__('Text Typography', 'ultimate-store-kit'),
620 'selector' => '{{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot th,
621 {{WRAPPER}} .usk-checkout-order-review .woocommerce-checkout-review-order-table tfoot td :is(label, .amount)',
622 ]
623 );
624 $this->end_controls_tab();
625 $this->end_controls_tabs();
626 $this->end_controls_section();
627
628
629 // $this->start_controls_section(
630 // 'checkout_payment_content_section',
631 // [
632 // 'label' => esc_html__('Content', 'ultimate-store-kit-pro'),
633 // 'tab' => Controls_Manager::TAB_STYLE,
634 // ]
635 // );
636
637
638 // $this->end_controls_section();
639
640 $this->start_controls_section(
641 'checkout_payment_methods',
642 [
643 'label' => esc_html__('Payment Methods', 'ultimate-store-kit-pro'),
644 'tab' => Controls_Manager::TAB_STYLE,
645 ]
646 );
647 $this->start_controls_tabs(
648 'tabs_checkout_payment_methods'
649 );
650 $this->start_controls_tab(
651 'tab_content_checkout_payment_method',
652 [
653 'label' => __('Content', 'ultimate-store-kit'),
654 ]
655 );
656 $this->add_control(
657 'checkout_payment_text_color',
658 [
659 'label' => esc_html__('Text Color', 'ultimate-store-kit-pro'),
660 'type' => Controls_Manager::COLOR,
661 'selectors' => [
662 '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods .payment_box' => 'color: {{VALUE}};',
663 '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods .payment_box p' => 'color: {{VALUE}};',
664 '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods .payment_box a' => 'color: {{VALUE}};',
665 '{{WRAPPER}} .usk-checkout-payment #payment .woocommerce-privacy-policy-text p' => 'color: {{VALUE}};',
666 ],
667 ]
668 );
669
670 $this->add_control(
671 'checkout_payment_link_color',
672 [
673 'label' => esc_html__('Link Color', 'ultimate-store-kit-pro'),
674 'type' => Controls_Manager::COLOR,
675 'selectors' => [
676 '{{WRAPPER}} .usk-checkout-payment a' => 'color: {{VALUE}};',
677 ],
678 ]
679 );
680
681 $this->add_control(
682 'checkout_payment_link_hover_color',
683 [
684 'label' => esc_html__('Link hover Color', 'ultimate-store-kit-pro'),
685 'type' => Controls_Manager::COLOR,
686 'selectors' => [
687 '{{WRAPPER}} .usk-checkout-payment a:hover' => 'color: {{VALUE}};',
688 ],
689 ]
690 );
691
692 $this->add_group_control(
693 Group_Control_Typography::get_type(),
694 [
695 'name' => 'checkout_payment_content_typography',
696 'label' => esc_html__('Typography', 'ultimate-store-kit-pro'),
697 'selector' => '{{WRAPPER}} .usk-checkout-payment #payment :is(.payment_box, .woocommerce-terms-and-conditions-wrapper, .payment_method_paypal) :is(p, a)',
698 ]
699 );
700 $this->add_control(
701 'checkout_payment_method_radio_input_color',
702 [
703 'label' => esc_html__('Checked Color', 'ultimate-store-kit-pro'),
704 'type' => Controls_Manager::COLOR,
705 'selectors' => [
706 '{{WRAPPER}} .usk-checkout-payment #payment .wc_payment_method input[type="radio"]' => 'accent-color: {{VALUE}};',
707 ],
708 ]
709 );
710 $this->add_control(
711 'checkout_payment_label_color',
712 [
713 'label' => esc_html__('Label Color', 'ultimate-store-kit-pro'),
714 'type' => Controls_Manager::COLOR,
715 'selectors' => [
716 '{{WRAPPER}} .usk-checkout-payment .wc_payment_method label' => 'color: {{VALUE}} !important;',
717 ],
718 ]
719 );
720 $this->add_responsive_control(
721 'checkout_payment_methods_checkbox_padding',
722 [
723 'label' => esc_html__('Padding', 'ultimate-store-kit-pro'),
724 'type' => Controls_Manager::DIMENSIONS,
725 'separator' => 'before',
726 'selectors' => [
727 '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
728 ],
729 ]
730 );
731
732 $this->add_responsive_control(
733 'checkout_payment_methods_checkbox_margin',
734 [
735 'label' => esc_html__('Margin', 'ultimate-store-kit-pro'),
736 'type' => Controls_Manager::DIMENSIONS,
737 'selectors' => [
738 '{{WRAPPER}} .usk-checkout-payment #payment .wc_payment_method input[type="radio"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
739 ],
740 ]
741 );
742 $this->add_group_control(
743 Group_Control_Border::get_type(),
744 [
745 'name' => 'checkout_payment_methods_border',
746 'label' => esc_html__('Border', 'ultimate-store-kit-pro'),
747 'selector' => '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods li',
748 'separator' => 'before',
749 ]
750 );
751
752 $this->add_responsive_control(
753 'checkout_payment_methods_radius',
754 [
755 'label' => esc_html__('Border Radius', 'ultimate-store-kit-pro'),
756 'type' => Controls_Manager::DIMENSIONS,
757 'selectors' => [
758 '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
759 ],
760 ]
761 );
762
763 $this->add_responsive_control(
764 'checkout_payment_methods_checkbox_spacing',
765 [
766 'label' => __('Bottom Spacing', 'ultimate-store-kit-pro'),
767 'type' => Controls_Manager::SLIDER,
768 'separator' => 'before',
769 'selectors' => [
770 '{{WRAPPER}} .usk-checkout-payment #payment .payment_methods li' => 'margin-bottom: {{SIZE}}{{UNIT}};',
771 ],
772 ]
773 );
774
775 $this->add_group_control(
776 Group_Control_Typography::get_type(),
777 [
778 'name' => 'checkout_payment_label_typography',
779 'label' => esc_html__('Typography', 'ultimate-store-kit-pro'),
780 'selector' => '{{WRAPPER}} .usk-checkout-payment .wc_payment_method label',
781 ]
782 );
783 $this->end_controls_tab();
784 $this->start_controls_tab(
785 'tab_button_checkout_payment_method',
786 [
787 'label' => __('Button', 'ultimate-store-kit'),
788 ]
789 );
790 $this->add_control(
791 'checkout_payment_order_button_color',
792 [
793 'label' => esc_html__('Color', 'ultimate-store-kit-pro'),
794 'type' => Controls_Manager::COLOR,
795 'selectors' => [
796 '{{WRAPPER}} .usk-checkout-payment #payment #place_order' => 'color: {{VALUE}}',
797 ],
798 ]
799 );
800
801 $this->add_control(
802 'checkout_payment_order_button_background',
803 [
804 'label' => esc_html__('Background', 'ultimate-store-kit-pro'),
805 'type' => Controls_Manager::COLOR,
806 'selectors' => [
807 '{{WRAPPER}} .usk-checkout-payment #payment #place_order' => 'background: {{VALUE}}',
808 ],
809 ]
810 );
811
812 $this->add_responsive_control(
813 'checkout_payment_order_button_padding',
814 [
815 'label' => esc_html__('Padding', 'ultimate-store-kit-pro'),
816 'type' => Controls_Manager::DIMENSIONS,
817 'selectors' => [
818 '{{WRAPPER}} .usk-checkout-payment #payment #place_order' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
819 ],
820 'separator' => 'before',
821 ]
822 );
823
824 $this->add_group_control(
825 Group_Control_Border::get_type(),
826 [
827 'name' => 'checkout_payment_input_border',
828 'label' => esc_html__('Border', 'ultimate-store-kit-pro'),
829 'selector' => '{{WRAPPER}} .usk-checkout-payment #payment #place_order',
830 ]
831 );
832
833
834 $this->add_control(
835 'checkout_payment_order_button_radius',
836 [
837 'label' => esc_html__('Border Radius', 'ultimate-store-kit-pro'),
838 'type' => Controls_Manager::DIMENSIONS,
839 'selectors' => [
840 '{{WRAPPER}} .usk-checkout-payment #payment #place_order' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
841 ],
842 ]
843 );
844
845 $this->add_control(
846 'checkout_payment_order_button_width',
847 [
848 'label' => __('Full Width', 'ultimate-store-kit-pro'),
849 'type' => Controls_Manager::SWITCHER,
850 'label_on' => __('Yes', 'ultimate-store-kit-pro'),
851 'label_off' => __('No', 'ultimate-store-kit-pro'),
852 'return_value' => 'yes',
853 'default' => 'yes',
854 'separator' => 'before',
855 'selectors' => [
856 '{{WRAPPER}} .usk-checkout-payment #payment #place_order' => 'width: 100%;',
857 ],
858 ]
859 );
860
861 $this->add_group_control(
862 Group_Control_Typography::get_type(),
863 [
864 'name' => 'checkout_payment_order_button_typography',
865 'label' => esc_html__('Typography', 'ultimate-store-kit-pro'),
866 'selector' => '{{WRAPPER}} .usk-checkout-payment #payment #place_order',
867 ]
868 );
869 $this->add_control(
870 'heading_button_hover',
871 [
872 'label' => __('H O V E R', 'ultimate-store-kit'),
873 'type' => Controls_Manager::HEADING,
874 'separator' => 'before',
875 ]
876 );
877 $this->add_control(
878 'checkout_payment_order_button_tabs_hover_clr',
879 [
880 'label' => esc_html__('Color', 'ultimate-store-kit-pro'),
881 'type' => Controls_Manager::COLOR,
882 'selectors' => [
883 '{{WRAPPER}} .usk-checkout-payment #payment #place_order:hover' => 'color: {{VALUE}}',
884 ],
885 ]
886 );
887
888 $this->add_control(
889 'checkout_payment_order_button_tabs_hover_bg',
890 [
891 'label' => esc_html__('Background', 'ultimate-store-kit-pro'),
892 'type' => Controls_Manager::COLOR,
893 'selectors' => [
894 '{{WRAPPER}} .usk-checkout-payment #payment #place_order:hover' => 'background: {{VALUE}}',
895 ],
896 ]
897 );
898 $this->end_controls_tab();
899 $this->end_controls_tabs();
900 $this->end_controls_section();
901 }
902
903 protected function checkout_payment_methods() {
904
905 ?>
906 <div class="usk-checkout-payment">
907 <?php if (Plugin::instance()->editor->is_edit_mode()) {
908 woocommerce_checkout_payment();
909 } else {
910 if (!empty(WC()->cart) && !WC()->cart->is_empty()) {
911 woocommerce_checkout_payment();
912 }
913 }
914 ?>
915 </div>
916 <?php
917
918 }
919 public function checkout_shipping_form() {
920 $checkout = WC()->checkout();
921 if (Plugin::instance()->editor->is_edit_mode()) {
922 $screen_check = true;
923 } else {
924 $screen_check = WC()->cart->needs_shipping_address();
925 }
926 ?>
927 <div class="usk-checkout-shipping-form">
928 <div class="woocommerce-shipping-fields">
929 <?php if (true === $screen_check) : ?>
930 <h3 id="ship-to-different-address">
931 <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
932 <input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked(apply_filters('woocommerce_ship_to_different_address_checked', 'shipping' === get_option('woocommerce_ship_to_destination') ? 1 : 0), 1); ?> type="checkbox" name="ship_to_different_address" value="1" />
933 <span><?php esc_html_e('Ship to a different address?', 'ultimate-store-kit'); ?></span>
934 </label>
935 </h3>
936 <div class="shipping_address">
937 <?php do_action('woocommerce_before_checkout_shipping_form', $checkout); ?>
938 <div class="woocommerce-shipping-fields__field-wrapper">
939 <?php $fields = $checkout->get_checkout_fields('shipping');
940 foreach ($fields as $key => $field) {
941 woocommerce_form_field($key, $field, $checkout->get_value($key));
942 } ?>
943 </div>
944 <?php do_action('woocommerce_after_checkout_shipping_form', $checkout); ?>
945 </div>
946 <?php endif;
947 ?>
948 </div>
949 </div>
950 <?php
951 }
952 protected function checkout_billing_address() {
953 $settings = $this->get_settings_for_display();
954 $checkout = WC()->checkout(); ?>
955
956 <div class="usk-checkout-billing-address">
957 <div class="woocommerce-billing-fields">
958
959 <?php if (wc_ship_to_billing_address_only() && WC()->cart->needs_shipping()) : ?>
960 <h3 class="usk-checkout-billing-address-header"><?php esc_html_e('Billing &amp; Shipping', 'ultimate-store-kit'); ?></h3>
961 <?php else : ?>
962 <h3 class="usk-checkout-billing-address-header"><?php esc_html_e('Billing details', 'ultimate-store-kit'); ?></h3>
963 <?php endif; ?>
964 <?php do_action('woocommerce_before_checkout_billing_form', $checkout); ?>
965
966 <div class="woocommerce-billing-fields__field-wrapper">
967 <?php $fields = $checkout->get_checkout_fields('billing');
968 foreach ($fields as $key => $field) {
969 woocommerce_form_field($key, $field, $checkout->get_value($key));
970 } ?>
971
972 </div>
973
974 <?php do_action('woocommerce_after_checkout_billing_form', $checkout); ?>
975
976 </div>
977
978 <?php if (!is_user_logged_in() && $checkout->is_registration_enabled()) : ?>
979 <div class="woocommerce-account-fields">
980 <?php if (!$checkout->is_registration_required()) : ?>
981
982 <p class="form-row form-row-wide create-account">
983 <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
984 <input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked((true === $checkout->get_value('createaccount') || (true === apply_filters('woocommerce_create_account_default_checked', false))), true); ?> type="checkbox" name="createaccount" value="1" />
985 <span><?php esc_html_e('Create an account?', 'ultimate-store-kit'); ?></span>
986 </label>
987 </p>
988
989 <?php endif; ?>
990
991 <?php do_action('woocommerce_before_checkout_registration_form', $checkout); ?>
992
993 <?php if ($checkout->get_checkout_fields('account')) : ?>
994
995 <div class="create-account">
996 <?php foreach ($checkout->get_checkout_fields('account') as $key => $field) : ?>
997 <?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?>
998 <?php endforeach; ?>
999 <div class="clear"></div>
1000 </div>
1001
1002 <?php endif; ?>
1003
1004 <?php do_action('woocommerce_after_checkout_registration_form', $checkout); ?>
1005 </div>
1006 <?php endif; ?>
1007 </div>
1008 <?php
1009 }
1010
1011 public function checkout_order_review() {
1012 ?>
1013 <div class="usk-checkout-order-review">
1014 <h3 id="order_review_heading" class="order_review_heading"><?php esc_html_e('Your order', 'ultimate-store-kit'); ?></h3>
1015 <div id="order_review" class="woocommerce-checkout-review-order">
1016 <?php do_action('woocommerce_checkout_before_order_review'); ?>
1017 <?php
1018 global $wp;
1019 if (isset($wp->query_vars['order-pay'])) {
1020 \WC_Shortcode_Checkout::output([]);
1021 } else {
1022 woocommerce_order_review();
1023 }
1024
1025 ?>
1026 </div>
1027 <?php do_action('woocommerce_checkout_after_order_review'); ?>
1028 </div>
1029 <?php
1030 }
1031 public function render() {
1032 ?>
1033
1034 <form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url(wc_get_checkout_url()); ?>" enctype="multipart/form-data">
1035 <div class="usk-page-checkout">
1036
1037 <div class="usk-checkout-address-wrapper">
1038 <?php $this->checkout_billing_address(); ?>
1039 <?php $this->checkout_shipping_form(); ?>
1040 </div>
1041 <div class="usk-checkout-details-wrapper">
1042 <?php $this->checkout_order_review(); ?>
1043 <?php $this->checkout_payment_methods(); ?>
1044 </div>
1045 </div>
1046 </form>
1047
1048 <?php
1049 }
1050 }
1051