PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 2.0.4
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v2.0.4
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-cart / widgets / page-cart.php

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

1,706 lines 46.9 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\PageCart\Widgets;
4
5 use UltimateStoreKit\Base\Module_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Border;
8 use Elementor\Group_Control_Typography;
9 use Elementor\Group_Control_Background;
10
11 if ( ! defined( 'ABSPATH' ) )
12 exit; // Exit if accessed directly
13
14 class Page_Cart extends Module_Base {
15
16 public function get_name() {
17 return 'usk-page-cart';
18 }
19
20 public function get_title() {
21 return BDTUSK . esc_html__( 'Cart Page', 'ultimate-store-kit' );
22 }
23
24 public function get_icon() {
25 return 'usk-widget-icon usk-icon-page-cart usk-new';
26 }
27
28 public function get_categories() {
29 return [ 'ultimate-store-kit' ];
30 }
31
32 public function get_style_depends() {
33 if ( $this->usk_is_edit_mode() ) {
34 return [ 'usk-all-styles' ];
35 } else {
36 return [ 'usk-font', 'usk-page-cart' ];
37 }
38 }
39 public function get_keywords() {
40 return [ 'page', 'cart' ];
41 }
42
43 protected function register_controls() {
44
45 $this->start_controls_section(
46 'section_cart_layout',
47 [
48 'label' => __( 'Cart Layout', 'ultimate-store-kit' ),
49 'tab' => Controls_Manager::TAB_CONTENT,
50 ]
51 );
52
53 $this->add_control(
54 'show_image',
55 [
56 'label' => __( 'Show Image', 'ultimate-store-kit' ),
57 'type' => Controls_Manager::SWITCHER,
58 'default' => 'yes',
59 ]
60 );
61
62 $this->add_control(
63 'show_title',
64 [
65 'label' => __( 'Show Title', 'ultimate-store-kit' ),
66 'type' => Controls_Manager::SWITCHER,
67 'default' => 'yes',
68 ]
69 );
70
71 $this->add_control(
72 'show_price',
73 [
74 'label' => __( 'Show Price', 'ultimate-store-kit' ),
75 'type' => Controls_Manager::SWITCHER,
76 'default' => 'yes',
77 ]
78 );
79
80 $this->add_control(
81 'show_quantity',
82 [
83 'label' => __( 'Show Quantity', 'ultimate-store-kit' ),
84 'type' => Controls_Manager::SWITCHER,
85 'default' => 'yes',
86 ]
87 );
88
89 $this->add_control(
90 'show_subtotal',
91 [
92 'label' => __( 'Show Subtotal', 'ultimate-store-kit' ),
93 'type' => Controls_Manager::SWITCHER,
94 'default' => 'yes',
95 ]
96 );
97
98 $this->end_controls_section();
99
100 $this->start_controls_section(
101 'cart_heading_style_section',
102 [
103 'label' => __( 'Cart Heading', 'ultimate-store-kit' ),
104 'tab' => Controls_Manager::TAB_STYLE,
105 ]
106 );
107
108 $this->add_responsive_control(
109 'cart_heading_align',
110 [
111 'label' => __( 'Alignment', 'ultimate-store-kit' ),
112 'type' => Controls_Manager::CHOOSE,
113 'options' => [
114 'left' => [
115 'title' => __( 'Left', 'ultimate-store-kit' ),
116 'icon' => 'eicon-text-align-left',
117 ],
118 'center' => [
119 'title' => __( 'Center', 'ultimate-store-kit' ),
120 'icon' => 'eicon-text-align-center',
121 ],
122 'right' => [
123 'title' => __( 'Right', 'ultimate-store-kit' ),
124 'icon' => 'eicon-text-align-right',
125 ],
126 ],
127 'toggle' => true,
128 'selectors' => [
129 '{{WRAPPER}} .usk-page-cart .woocommerce thead th' => 'text-align: {{VALUE}};',
130 ],
131 ]
132 );
133
134 $this->add_control(
135 'cart_heading_color',
136 [
137 'label' => __( 'Color', 'ultimate-store-kit' ),
138 'type' => Controls_Manager::COLOR,
139 'selectors' => [
140 '{{WRAPPER}} .usk-page-cart .woocommerce thead th' => 'color: {{VALUE}};',
141 ],
142 ]
143 );
144
145 $this->add_group_control(
146 Group_Control_Background::get_type(),
147 [
148 'name' => 'cart_heading_background',
149 'label' => esc_html__( 'Background', 'ultimate-store-kit' ),
150 'types' => [ 'classic', 'gradient' ],
151 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table th',
152 'exclude' => [
153 'image'
154 ]
155 ]
156 );
157
158 $this->add_group_control(
159 Group_Control_Border::get_type(),
160 [
161 'name' => 'cart_heading_border',
162 'label' => esc_html__( 'Border', 'ultimate-store-kit' ),
163 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table th',
164 'separator' => 'before',
165 ]
166 );
167
168 $this->add_responsive_control(
169 'cart_heading_padding',
170 [
171 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
172 'type' => Controls_Manager::DIMENSIONS,
173 'size_units' => [ 'px', '%', 'em' ],
174 'selectors' => [
175 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
176 ],
177 ]
178 );
179
180 $this->add_group_control(
181 Group_Control_Typography::get_type(),
182 [
183 'name' => 'cart_heading_typo',
184 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce thead th',
185 ]
186 );
187
188 $this->end_controls_section();
189
190 $this->start_controls_section(
191 'product_item_style_section',
192 [
193 'label' => __( 'Cart Item', 'ultimate-store-kit' ),
194 'tab' => Controls_Manager::TAB_STYLE,
195 ]
196 );
197
198 $this->add_group_control(
199 Group_Control_Border::get_type(),
200 [
201 'name' => 'product_item_border',
202 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table td',
203 ]
204 );
205 $this->add_responsive_control(
206 'product_item_padding',
207 [
208 'label' => esc_html__( 'Cell Padding', 'ultimate-store-kit' ),
209 'type' => Controls_Manager::DIMENSIONS,
210 'size_units' => [ 'px', '%', 'em' ],
211 'selectors' => [
212 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
213 ],
214 ]
215 );
216 $this->add_control(
217 'product_item_even_bg_color',
218 [
219 'label' => esc_html__( 'Even Row Background Color', 'ultimate-store-kit' ),
220 'type' => Controls_Manager::COLOR,
221 'selectors' => [
222 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table tr:nth-child(even)' => 'background-color: {{VALUE}};',
223 ],
224 ]
225 );
226 $this->add_control(
227 'product_item_odd_bg_color',
228 [
229 'label' => esc_html__( 'Odd Row Background Color', 'ultimate-store-kit' ),
230 'type' => Controls_Manager::COLOR,
231 'selectors' => [
232 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table tr:nth-child(odd)' => 'background-color: {{VALUE}};',
233 ],
234 ]
235 );
236
237 $this->add_responsive_control(
238 'product_item_align',
239 [
240 'label' => __( 'Alignment', 'ultimate-store-kit' ),
241 'type' => Controls_Manager::CHOOSE,
242 'options' => [
243 'left' => [
244 'title' => __( 'Left', 'ultimate-store-kit' ),
245 'icon' => 'eicon-text-align-left',
246 ],
247 'center' => [
248 'title' => __( 'Center', 'ultimate-store-kit' ),
249 'icon' => 'eicon-text-align-center',
250 ],
251 'right' => [
252 'title' => __( 'Right', 'ultimate-store-kit' ),
253 'icon' => 'eicon-text-align-right',
254 ],
255 ],
256 'toggle' => true,
257 'selectors' => [
258 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table td' => 'text-align: {{VALUE}};',
259 ],
260 ]
261 );
262
263 $this->add_control(
264 'product_image_heading',
265 [
266 'label' => esc_html__( 'Product Image', 'ultimate-store-kit' ) . BDTUSK_NC,
267 'type' => Controls_Manager::HEADING,
268 'condition' => [
269 'show_image' => 'yes',
270 ],
271 'separator' => 'before'
272 ]
273 );
274
275 $this->add_responsive_control(
276 'product_image_size',
277 [
278 'label' => __( 'Image Size', 'ultimate-store-kit' ),
279 'type' => Controls_Manager::SLIDER,
280 'size_units' => [ 'px', '%' ],
281 'range' => [
282 'px' => [
283 'min' => 50,
284 'max' => 200,
285 ],
286 '%' => [
287 'min' => 10,
288 'max' => 100,
289 ],
290 ],
291 'selectors' => [
292 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-image a img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
293 ],
294 'condition' => [
295 'show_image' => 'yes',
296 ]
297 ]
298 );
299
300 $this->add_group_control(
301 Group_Control_Border::get_type(),
302 [
303 'name' => 'product_image_border',
304 'label' => esc_html__( 'Border', 'ultimate-store-kit' ),
305 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-image a img',
306 'condition' => [
307 'show_image' => 'yes',
308 ]
309 ]
310 );
311
312 $this->add_responsive_control(
313 'product_image_border_radius',
314 [
315 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
316 'type' => Controls_Manager::DIMENSIONS,
317 'size_units' => [ 'px', '%' ],
318 'selectors' => [
319 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-image a img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
320 ],
321 'condition' => [
322 'show_image' => 'yes',
323 ]
324 ]
325 );
326
327 $this->add_control(
328 'product_title_heading',
329 [
330 'label' => esc_html__( 'Product Title', 'ultimate-store-kit' ),
331 'type' => Controls_Manager::HEADING,
332 'condition' => [
333 'show_title' => 'yes',
334 ],
335 'separator' => 'before'
336 ]
337 );
338
339 $this->add_control(
340 'product_title_color',
341 [
342 'label' => __( 'Color', 'ultimate-store-kit' ),
343 'type' => Controls_Manager::COLOR,
344 'selectors' => [
345 '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-title a' => 'color: {{VALUE}};',
346 ],
347 'condition' => [
348 'show_title' => 'yes',
349 ]
350 ]
351 );
352
353 $this->add_control(
354 'product_title_hover_color',
355 [
356 'label' => __( 'Hover Color', 'ultimate-store-kit' ),
357 'type' => Controls_Manager::COLOR,
358 'selectors' => [
359 '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-title a:hover' => 'color: {{VALUE}};',
360 ],
361 'condition' => [
362 'show_title' => 'yes',
363 ]
364 ]
365 );
366
367 $this->add_group_control(
368 Group_Control_Typography::get_type(),
369 [
370 'name' => 'product_title_typo',
371 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-title a',
372 'condition' => [
373 'show_title' => 'yes',
374 ]
375 ]
376 );
377
378 $this->add_control(
379 'product_price_heading',
380 [
381 'label' => esc_html__( 'Product Price', 'ultimate-store-kit' ),
382 'type' => Controls_Manager::HEADING,
383 'condition' => [
384 'show_price' => 'yes',
385 ],
386 'separator' => 'before'
387 ]
388 );
389
390 $this->add_control(
391 'product_price_color',
392 [
393 'label' => __( 'Color', 'ultimate-store-kit' ),
394 'type' => Controls_Manager::COLOR,
395 'selectors' => [
396 '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-price' => 'color: {{VALUE}};',
397 ],
398 'condition' => [
399 'show_price' => 'yes',
400 ]
401 ]
402 );
403
404 $this->add_group_control(
405 Group_Control_Typography::get_type(),
406 [
407 'name' => 'product_price_typo',
408 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-price',
409 'condition' => [
410 'show_price' => 'yes',
411 ]
412 ]
413 );
414
415 $this->add_control(
416 'product_quantity_heading',
417 [
418 'label' => esc_html__( 'Product Quantity', 'ultimate-store-kit' ),
419 'type' => Controls_Manager::HEADING,
420 'condition' => [
421 'show_quantity' => 'yes',
422 ],
423 'separator' => 'before'
424 ]
425 );
426
427 $this->add_responsive_control(
428 'product_quantity_width',
429 [
430 'label' => __( 'Width', 'ultimate-store-kit' ),
431 'type' => Controls_Manager::SLIDER,
432 'range' => [
433 'px' => [
434 'min' => 50,
435 'max' => 200,
436 ],
437 ],
438 'selectors' => [
439 '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'width: {{SIZE}}{{UNIT}};',
440 ],
441 'condition' => [
442 'show_quantity' => 'yes',
443 ]
444 ]
445 );
446
447 $this->add_control(
448 'product_quantity_color',
449 [
450 'label' => __( 'Color', 'ultimate-store-kit' ),
451 'type' => Controls_Manager::COLOR,
452 'selectors' => [
453 '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'color: {{VALUE}};',
454 ],
455 'condition' => [
456 'show_quantity' => 'yes',
457 ]
458 ]
459 );
460
461 $this->add_responsive_control(
462 'product_quantity_align',
463 [
464 'label' => __( 'Alignment', 'ultimate-store-kit' ),
465 'type' => Controls_Manager::CHOOSE,
466 'options' => [
467 'left' => [
468 'title' => __( 'Left', 'ultimate-store-kit' ),
469 'icon' => 'eicon-text-align-left',
470 ],
471 'center' => [
472 'title' => __( 'Center', 'ultimate-store-kit' ),
473 'icon' => 'eicon-text-align-center',
474 ],
475 'right' => [
476 'title' => __( 'Right', 'ultimate-store-kit' ),
477 'icon' => 'eicon-text-align-right',
478 ],
479 ],
480 'toggle' => true,
481 'selectors' => [
482 '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'text-align: {{VALUE}};',
483 ],
484 'condition' => [
485 'show_quantity' => 'yes',
486 ]
487 ]
488 );
489
490 $this->add_group_control(
491 Group_Control_Typography::get_type(),
492 [
493 'name' => 'product_quantity_typo',
494 'selector' => '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty',
495 'condition' => [
496 'show_quantity' => 'yes',
497 ]
498 ]
499 );
500
501 $this->add_responsive_control(
502 'product_quantity_padding',
503 [
504 'label' => __( 'Padding', 'ultimate-store-kit' ),
505 'type' => Controls_Manager::DIMENSIONS,
506 'size_units' => [ 'px', 'em', '%' ],
507 'selectors' => [
508 '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
509 ],
510 'condition' => [
511 'show_quantity' => 'yes',
512 ]
513 ]
514 );
515
516 $this->add_group_control(
517 Group_Control_Border::get_type(),
518 [
519 'name' => 'product_quantity_border',
520 'selector' => '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty',
521 'condition' => [
522 'show_quantity' => 'yes',
523 ]
524 ]
525 );
526
527 $this->add_responsive_control(
528 'product_quantity_border_radius',
529 [
530 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
531 'type' => Controls_Manager::DIMENSIONS,
532 'size_units' => [ 'px', '%' ],
533 'selectors' => [
534 '{{WRAPPER}} .usk-page-cart .usk-product-quantity .input-text.qty' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
535 ],
536 'condition' => [
537 'show_quantity' => 'yes',
538 ]
539 ]
540 );
541
542 $this->add_control(
543 'product_subtotal_heading',
544 [
545 'label' => esc_html__( 'Product Sub Total', 'ultimate-store-kit' ),
546 'type' => Controls_Manager::HEADING,
547 'condition' => [
548 'show_subtotal' => 'yes',
549 ],
550 'separator' => 'before'
551 ]
552 );
553
554 $this->add_control(
555 'product_subtotal_color',
556 [
557 'label' => __( 'Color', 'ultimate-store-kit' ),
558 'type' => Controls_Manager::COLOR,
559 'selectors' => [
560 '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-subtotal' => 'color: {{VALUE}};',
561 ],
562 'condition' => [
563 'show_subtotal' => 'yes',
564 ]
565 ]
566 );
567
568 $this->add_group_control(
569 Group_Control_Typography::get_type(),
570 [
571 'name' => 'product_subtotal_typo',
572 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce tbody .usk-product-subtotal',
573 'condition' => [
574 'show_subtotal' => 'yes',
575 ]
576 ]
577 );
578
579 $this->end_controls_section();
580
581 $this->start_controls_section(
582 'cart_actions_style_section',
583 [
584 'label' => __( 'Close Button', 'ultimate-store-kit' ) . BDTUSK_NC,
585 'tab' => Controls_Manager::TAB_STYLE,
586 ]
587 );
588
589 $this->start_controls_tabs( 'remove_button_tabs' );
590 $this->start_controls_tab(
591 'remove_button_normal',
592 [
593 'label' => __( 'Normal', 'ultimate-store-kit' ),
594 ]
595 );
596
597 $this->add_control(
598 'remove_button_color',
599 [
600 'label' => __( 'Color', 'ultimate-store-kit' ),
601 'type' => Controls_Manager::COLOR,
602 'selectors' => [
603 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'color: {{VALUE}} !important;',
604 ],
605 ]
606 );
607
608 $this->add_group_control(
609 Group_Control_Background::get_type(),
610 [
611 'name' => 'remove_button_bg',
612 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove'
613 ]
614 );
615
616 $this->add_group_control(
617 Group_Control_Border::get_type(),
618 [
619 'name' => 'remove_button_border',
620 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove',
621 'separator' => 'before',
622 ]
623 );
624
625 $this->add_responsive_control(
626 'remove_button_border_radius',
627 [
628 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
629 'type' => Controls_Manager::DIMENSIONS,
630 'size_units' => [ 'px', '%' ],
631 'selectors' => [
632 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
633 ],
634 ]
635 );
636
637 $this->add_responsive_control(
638 'remove_button_size',
639 [
640 'label' => __( 'Padding', 'ultimate-store-kit' ),
641 'type' => Controls_Manager::SLIDER,
642 'size_units' => [ 'px', 'em' ],
643 'range' => [
644 'px' => [
645 'min' => 10,
646 'max' => 50,
647 ],
648 'em' => [
649 'min' => 0.1,
650 'max' => 2,
651 'step' => 0.1,
652 ],
653 ],
654 'selectors' => [
655 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};',
656 ],
657 ]
658 );
659
660 $this->add_responsive_control(
661 'remove_button_icon_size',
662 [
663 'label' => __( 'Icon Size', 'ultimate-store-kit' ),
664 'type' => Controls_Manager::SLIDER,
665 'size_units' => [ 'px', 'em' ],
666 'range' => [
667 'px' => [
668 'min' => 10,
669 'max' => 50,
670 ],
671 'em' => [
672 'min' => 0.1,
673 'max' => 2,
674 'step' => 0.1,
675 ],
676 ],
677 'selectors' => [
678 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove' => 'font-size: {{SIZE}}{{UNIT}};',
679 ],
680 ]
681 );
682
683 $this->end_controls_tab();
684 $this->start_controls_tab(
685 'remove_button_hover',
686 [
687 'label' => __( 'Hover', 'ultimate-store-kit' ),
688 ]
689 );
690
691 $this->add_control(
692 'remove_button_color_hover',
693 [
694 'label' => __( 'Color', 'ultimate-store-kit' ),
695 'type' => Controls_Manager::COLOR,
696 'selectors' => [
697 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove:hover' => 'color: {{VALUE}} !important;',
698 ],
699 ]
700 );
701
702 $this->add_group_control(
703 Group_Control_Background::get_type(),
704 [
705 'name' => 'remove_button_bg_hover',
706 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove:hover'
707 ]
708 );
709
710 $this->add_control(
711 'remove_button_border_color_hover',
712 [
713 'label' => __( 'Border Color', 'ultimate-store-kit' ),
714 'type' => Controls_Manager::COLOR,
715 'selectors' => [
716 '{{WRAPPER}} .usk-page-cart .woocommerce-cart-form .shop_table .usk-product-remove .remove:hover' => 'border-color: {{VALUE}};',
717 ],
718 'condition' => [
719 'remove_button_border_border!' => '',
720 ]
721 ]
722 );
723
724 $this->end_controls_tab();
725 $this->end_controls_tabs();
726 $this->end_controls_section();
727
728 $this->start_controls_section(
729 'product_coupon_style_section',
730 [
731 'label' => __( 'Coupon Style', 'ultimate-store-kit' ),
732 'tab' => Controls_Manager::TAB_STYLE,
733 ]
734 );
735
736 $this->add_control(
737 'coupon_label_heading',
738 [
739 'label' => esc_html__( 'Coupon Label', 'ultimate-store-kit' ),
740 'type' => Controls_Manager::HEADING,
741 ]
742 );
743
744 $this->add_control(
745 'coupon_label_color',
746 [
747 'label' => __( 'Color', 'ultimate-store-kit' ),
748 'type' => Controls_Manager::COLOR,
749 'selectors' => [
750 '{{WRAPPER}} .usk-page-cart .coupon label' => 'color: {{VALUE}};',
751 ],
752 ]
753 );
754
755 $this->add_group_control(
756 Group_Control_Typography::get_type(),
757 [
758 'name' => 'coupon_label_typo',
759 'selector' => '{{WRAPPER}} .usk-page-cart .coupon label',
760 ]
761 );
762
763 $this->add_control(
764 'coupon_field_heading',
765 [
766 'label' => esc_html__( 'Coupon Field', 'ultimate-store-kit' ),
767 'type' => Controls_Manager::HEADING,
768 'separator' => 'before'
769 ]
770 );
771
772 $this->add_control(
773 'coupon_field_color',
774 [
775 'label' => __( 'Color', 'ultimate-store-kit' ),
776 'type' => Controls_Manager::COLOR,
777 'selectors' => [
778 '{{WRAPPER}} .usk-page-cart .coupon #coupon_code::placeholder' => 'color: {{VALUE}};',
779 ],
780 ]
781 );
782
783 $this->add_group_control(
784 Group_Control_Typography::get_type(),
785 [
786 'name' => 'coupon_field_typo',
787 'selector' => '{{WRAPPER}} .usk-page-cart .coupon #coupon_code',
788 ]
789 );
790
791 $this->add_responsive_control(
792 'coupon_field_padding',
793 [
794 'label' => __( 'Padding', 'ultimate-store-kit' ),
795 'type' => Controls_Manager::DIMENSIONS,
796 'size_units' => [ 'px', 'em', '%' ],
797 'selectors' => [
798 '{{WRAPPER}} .usk-page-cart .coupon #coupon_code' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
799 ],
800 ]
801 );
802
803 $this->add_group_control(
804 Group_Control_Border::get_type(),
805 [
806 'name' => 'coupon_field_border',
807 'selector' => '{{WRAPPER}} .usk-page-cart .coupon #coupon_code',
808 ]
809 );
810
811 $this->add_responsive_control(
812 'coupon_field_border_radius',
813 [
814 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
815 'type' => Controls_Manager::DIMENSIONS,
816 'size_units' => [ 'px', '%' ],
817 'selectors' => [
818 '{{WRAPPER}} .usk-page-cart .coupon #coupon_code' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
819 ],
820 ]
821 );
822
823 $this->add_responsive_control(
824 'coupon_field_width',
825 [
826 'label' => __( 'Width', 'ultimate-store-kit' ),
827 'type' => Controls_Manager::SLIDER,
828 'size_units' => [ 'px', '%' ],
829 'range' => [
830 'px' => [
831 'min' => 50,
832 'max' => 500,
833 ],
834 '%' => [
835 'min' => 10,
836 'max' => 100,
837 ],
838 ],
839 'selectors' => [
840 '{{WRAPPER}} .usk-page-cart .coupon #coupon_code' => 'width: {{SIZE}}{{UNIT}};',
841 ],
842 ]
843 );
844
845 $this->add_control(
846 'coupon_button_heading',
847 [
848 'label' => esc_html__( 'Coupon Button', 'ultimate-store-kit' ),
849 'type' => Controls_Manager::HEADING,
850 'separator' => 'before',
851 ]
852 );
853
854 $this->start_controls_tabs( 'coupon_button_tabs' );
855 $this->start_controls_tab(
856 'coupon_button_normal',
857 [
858 'label' => __( 'Normal', 'ultimate-store-kit' ),
859 ]
860 );
861
862 $this->add_control(
863 'coupon_button_color',
864 [
865 'label' => __( 'Color', 'ultimate-store-kit' ),
866 'type' => Controls_Manager::COLOR,
867 'selectors' => [
868 '{{WRAPPER}} .usk-page-cart .coupon .button' => 'color: {{VALUE}};',
869 ],
870 ]
871 );
872
873 $this->add_group_control(
874 Group_Control_Background::get_type(),
875 [
876 'name' => 'coupon_button_bg',
877 'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button'
878 ]
879 );
880 $this->add_group_control(
881 Group_Control_Border::get_type(),
882 [
883 'name' => 'coupon_button_border',
884 'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button',
885 ]
886 );
887
888 $this->add_responsive_control(
889 'coupon_button_border_radius',
890 [
891 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
892 'type' => Controls_Manager::DIMENSIONS,
893 'size_units' => [ 'px', '%' ],
894 'selectors' => [
895 '{{WRAPPER}} .usk-page-cart .coupon .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
896 ],
897 ]
898 );
899
900 $this->add_responsive_control(
901 'coupon_button_padding',
902 [
903 'label' => __( 'Padding', 'ultimate-store-kit' ),
904 'type' => Controls_Manager::DIMENSIONS,
905 'size_units' => [ 'px', 'em', '%' ],
906 'selectors' => [
907 '{{WRAPPER}} .usk-page-cart .coupon .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
908 ],
909 ]
910 );
911
912 $this->add_responsive_control(
913 'coupon_button_width',
914 [
915 'label' => __( 'Width', 'ultimate-store-kit' ),
916 'type' => Controls_Manager::SLIDER,
917 'size_units' => [ 'px', '%' ],
918 'range' => [
919 'px' => [
920 'min' => 50,
921 'max' => 500,
922 ],
923 '%' => [
924 'min' => 10,
925 'max' => 100,
926 ],
927 ],
928 'selectors' => [
929 '{{WRAPPER}} .usk-page-cart .coupon .button' => 'width: {{SIZE}}{{UNIT}} !important;',
930 ],
931 ]
932 );
933 $this->add_group_control(
934 Group_Control_Typography::get_type(),
935 [
936 'name' => 'coupon_button_typo',
937 'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button',
938 ]
939 );
940
941 $this->end_controls_tab();
942 $this->start_controls_tab(
943 'coupon_button_hover',
944 [
945 'label' => __( 'Hover', 'ultimate-store-kit' ),
946 ]
947 );
948
949 $this->add_control(
950 'coupon_button_color_hover',
951 [
952 'label' => __( 'Color', 'ultimate-store-kit' ),
953 'type' => Controls_Manager::COLOR,
954 'selectors' => [
955 '{{WRAPPER}} .usk-page-cart .coupon .button:hover' => 'color: {{VALUE}};',
956 ],
957 ]
958 );
959
960 $this->add_group_control(
961 Group_Control_Background::get_type(),
962 [
963 'name' => 'coupon_button_bg_hover',
964 'selector' => '{{WRAPPER}} .usk-page-cart .coupon .button:hover'
965 ]
966 );
967
968 $this->add_control(
969 'coupon_button_border_color_hover',
970 [
971 'label' => __( 'Border Color', 'ultimate-store-kit' ),
972 'type' => Controls_Manager::COLOR,
973 'selectors' => [
974 '{{WRAPPER}} .usk-page-cart .coupon .button:hover' => 'border-color: {{VALUE}};',
975 ],
976 'condition' => [
977 'coupon_button_border_border!' => '',
978 ]
979 ]
980 );
981
982 $this->end_controls_tab();
983 $this->end_controls_tabs();
984 $this->end_controls_section();
985
986 $this->start_controls_section(
987 'update_cart_style_section',
988 [
989 'label' => __( 'Cart Update Button', 'ultimate-store-kit' ),
990 'tab' => Controls_Manager::TAB_STYLE,
991 ]
992 );
993
994 $this->start_controls_tabs( 'update_cart_tabs' );
995 $this->start_controls_tab(
996 'update_cart_normal',
997 [
998 'label' => __( 'Normal', 'ultimate-store-kit' ),
999 ]
1000 );
1001
1002 $this->add_control(
1003 'update_cart_color',
1004 [
1005 'label' => __( 'Color', 'ultimate-store-kit' ),
1006 'type' => Controls_Manager::COLOR,
1007 'selectors' => [
1008 '{{WRAPPER}} .usk-page-cart .actions>.button' => 'color: {{VALUE}};',
1009 ],
1010 ]
1011 );
1012
1013 $this->add_group_control(
1014 Group_Control_Background::get_type(),
1015 [
1016 'name' => 'update_cart_bg',
1017 'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button'
1018 ]
1019 );
1020
1021 $this->add_group_control(
1022 Group_Control_Border::get_type(),
1023 [
1024 'name' => 'update_cart_border',
1025 'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button',
1026 'separator' => 'before',
1027 ]
1028 );
1029
1030 $this->add_responsive_control(
1031 'update_cart_border_radius',
1032 [
1033 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
1034 'type' => Controls_Manager::DIMENSIONS,
1035 'size_units' => [ 'px', '%' ],
1036 'selectors' => [
1037 '{{WRAPPER}} .usk-page-cart .actions>.button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
1038 ],
1039 ]
1040 );
1041
1042 $this->add_responsive_control(
1043 'update_cart_padding',
1044 [
1045 'label' => __( 'Padding', 'ultimate-store-kit' ),
1046 'type' => Controls_Manager::DIMENSIONS,
1047 'size_units' => [ 'px', 'em', '%' ],
1048 'selectors' => [
1049 '{{WRAPPER}} .usk-page-cart .actions>.button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1050 ],
1051 ]
1052 );
1053
1054 $this->add_responsive_control(
1055 'update_cart_margin',
1056 [
1057 'label' => __( 'Margin', 'ultimate-store-kit' ),
1058 'type' => Controls_Manager::DIMENSIONS,
1059 'size_units' => [ 'px', 'em', '%' ],
1060 'selectors' => [
1061 '{{WRAPPER}} .usk-page-cart .actions>.button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1062 ],
1063 ]
1064 );
1065
1066 $this->add_responsive_control(
1067 'update_cart_width',
1068 [
1069 'label' => __( 'Width', 'ultimate-store-kit' ),
1070 'type' => Controls_Manager::SLIDER,
1071 'size_units' => [ 'px', '%' ],
1072 'range' => [
1073 'px' => [
1074 'min' => 50,
1075 'max' => 500,
1076 ],
1077 '%' => [
1078 'min' => 10,
1079 'max' => 100,
1080 ],
1081 ],
1082 'selectors' => [
1083 '{{WRAPPER}} .usk-page-cart .actions>.button' => 'width: {{SIZE}}{{UNIT}} !important;',
1084 ],
1085 ]
1086 );
1087
1088 $this->add_group_control(
1089 Group_Control_Typography::get_type(),
1090 [
1091 'name' => 'update_cart_typo',
1092 'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button',
1093 ]
1094 );
1095
1096 $this->end_controls_tab();
1097 $this->start_controls_tab(
1098 'update_cart_hover',
1099 [
1100 'label' => __( 'Hover', 'ultimate-store-kit' ),
1101 ]
1102 );
1103
1104 $this->add_control(
1105 'update_cart_color_hover',
1106 [
1107 'label' => __( 'Color', 'ultimate-store-kit' ),
1108 'type' => Controls_Manager::COLOR,
1109 'selectors' => [
1110 '{{WRAPPER}} .usk-page-cart .actions>.button:hover' => 'color: {{VALUE}};',
1111 ],
1112 ]
1113 );
1114
1115 $this->add_group_control(
1116 Group_Control_Background::get_type(),
1117 [
1118 'name' => 'update_cart_bg_hover',
1119 'selector' => '{{WRAPPER}} .usk-page-cart .actions>.button:hover'
1120 ]
1121 );
1122
1123 $this->add_control(
1124 'update_cart_border_color_hover',
1125 [
1126 'label' => __( 'Border Color', 'ultimate-store-kit' ),
1127 'type' => Controls_Manager::COLOR,
1128 'selectors' => [
1129 '{{WRAPPER}} .usk-page-cart .actions>.button:hover' => 'border-color: {{VALUE}};',
1130 ],
1131 'condition' => [
1132 'update_cart_border_border!' => '',
1133 ]
1134 ]
1135 );
1136
1137 $this->end_controls_tab();
1138 $this->end_controls_tabs();
1139 $this->end_controls_section();
1140
1141 $this->start_controls_section(
1142 'cart_collaterals_style_section',
1143 [
1144 'label' => __( 'Cart Collaterals', 'ultimate-store-kit' ),
1145 'tab' => Controls_Manager::TAB_STYLE,
1146 ]
1147 );
1148
1149 $this->add_control(
1150 'cart_total_heading',
1151 [
1152 'label' => esc_html__( 'Heading', 'ultimate-store-kit' ),
1153 'type' => Controls_Manager::HEADING,
1154 ]
1155 );
1156
1157 $this->add_control(
1158 'cart_total_color',
1159 [
1160 'label' => __( 'Color', 'ultimate-store-kit' ),
1161 'type' => Controls_Manager::COLOR,
1162 'selectors' => [
1163 '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals h2' => 'color: {{VALUE}};',
1164 ],
1165 ]
1166 );
1167
1168 $this->add_group_control(
1169 Group_Control_Typography::get_type(),
1170 [
1171 'name' => 'cart_total_typo',
1172 'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals h2',
1173 ]
1174 );
1175
1176 $this->add_control(
1177 'cart_total_bottom_spacing',
1178 [
1179 'label' => esc_html__( 'Bottom Spacing', 'ultimate-store-kit' ),
1180 'type' => Controls_Manager::SLIDER,
1181 'size_units' => [ 'px', '' ],
1182 'range' => [
1183 'px' => [
1184 'min' => 0,
1185 'max' => 100,
1186 ],
1187 ],
1188 'selectors' => [
1189 '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals h2' => 'margin-bottom: {{SIZE}}{{UNIT}};',
1190 ],
1191 ]
1192 );
1193
1194 $this->add_control(
1195 'cart_total_table_heading',
1196 [
1197 'label' => esc_html__( 'Table Body', 'ultimate-store-kit' ),
1198 'type' => Controls_Manager::HEADING,
1199 'separator' => 'before',
1200 ]
1201 );
1202 $this->add_group_control(
1203 Group_Control_Background::get_type(),
1204 [
1205 'name' => 'cart_total_table_bg',
1206 'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table th, {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table td',
1207 ]
1208 );
1209 $this->add_group_control(
1210 Group_Control_Border::get_type(),
1211 [
1212 'name' => 'cart_total_table_border',
1213 'selector' => '.woocommerce {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table th, .woocommerce {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table td, .woocommerce {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table',
1214 ]
1215 );
1216 $this->add_responsive_control(
1217 'cart_total_table_padding',
1218 [
1219 'label' => __( 'Padding', 'ultimate-store-kit' ),
1220 'type' => Controls_Manager::DIMENSIONS,
1221 'size_units' => [ 'px', 'em', '%' ],
1222 'selectors' => [
1223 '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table th, {{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals .shop_table td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1224 ],
1225 ]
1226 );
1227 $this->add_responsive_control(
1228 'cart_total_table_margin',
1229 [
1230 'label' => __( 'Margin', 'ultimate-store-kit' ),
1231 'type' => Controls_Manager::DIMENSIONS,
1232 'size_units' => [ 'px', 'em', '%' ],
1233 'selectors' => [
1234 '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart_totals table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1235 ],
1236 ]
1237 );
1238
1239 $this->start_controls_tabs( 'cart_total_tabs' );
1240 $this->start_controls_tab(
1241 'cart_subtotal_tab',
1242 [
1243 'label' => __( 'Subtotal', 'ultimate-store-kit' ),
1244 ]
1245 );
1246
1247 $this->add_control(
1248 'cart_sub_total_heading',
1249 [
1250 'label' => esc_html__( 'Title', 'ultimate-store-kit' ),
1251 'type' => Controls_Manager::HEADING,
1252 ]
1253 );
1254
1255 $this->add_control(
1256 'cart_sub_total_color',
1257 [
1258 'label' => __( 'Color', 'ultimate-store-kit' ),
1259 'type' => Controls_Manager::COLOR,
1260 'selectors' => [
1261 '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal th' => 'color: {{VALUE}};',
1262 ],
1263 ]
1264 );
1265
1266 $this->add_group_control(
1267 Group_Control_Typography::get_type(),
1268 [
1269 'name' => 'cart_sub_total_typo',
1270 'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal th',
1271 ]
1272 );
1273
1274 $this->add_control(
1275 'cart_sub_total_amount_heading',
1276 [
1277 'label' => esc_html__( 'Amount', 'ultimate-store-kit' ),
1278 'type' => Controls_Manager::HEADING,
1279 'separator' => 'before',
1280 ]
1281 );
1282
1283 $this->add_control(
1284 'cart_sub_total_amount_color',
1285 [
1286 'label' => __( 'Color', 'ultimate-store-kit' ),
1287 'type' => Controls_Manager::COLOR,
1288 'selectors' => [
1289 '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
1290 ],
1291 ]
1292 );
1293
1294 $this->add_group_control(
1295 Group_Control_Typography::get_type(),
1296 [
1297 'name' => 'cart_sub_total_amount_typo',
1298 'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .cart-subtotal .woocommerce-Price-amount.amount',
1299 ]
1300 );
1301
1302 $this->end_controls_tab();
1303 $this->start_controls_tab(
1304 'cart_total_tab',
1305 [
1306 'label' => __( 'Total', 'ultimate-store-kit' ),
1307 ]
1308 );
1309
1310 $this->add_control(
1311 'cart_final_total_heading',
1312 [
1313 'label' => esc_html__( 'Title', 'ultimate-store-kit' ),
1314 'type' => Controls_Manager::HEADING,
1315 ]
1316 );
1317
1318 $this->add_control(
1319 'cart_final_total_color',
1320 [
1321 'label' => __( 'Color', 'ultimate-store-kit' ),
1322 'type' => Controls_Manager::COLOR,
1323 'selectors' => [
1324 '{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total th' => 'color: {{VALUE}};',
1325 ],
1326 ]
1327 );
1328
1329 $this->add_group_control(
1330 Group_Control_Typography::get_type(),
1331 [
1332 'name' => 'cart_final_total_typo',
1333 'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total th',
1334 ]
1335 );
1336
1337 $this->add_control(
1338 'cart_final_total_amount_heading',
1339 [
1340 'label' => esc_html__( 'Amount', 'ultimate-store-kit' ),
1341 'type' => Controls_Manager::HEADING,
1342 'separator' => 'before',
1343 ]
1344 );
1345
1346 $this->add_control(
1347 'cart_final_total_amount_color',
1348 [
1349 'label' => __( 'Color', 'ultimate-store-kit' ),
1350 'type' => Controls_Manager::COLOR,
1351 'selectors' => [
1352 '{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
1353 ],
1354 ]
1355 );
1356
1357 $this->add_group_control(
1358 Group_Control_Typography::get_type(),
1359 [
1360 'name' => 'cart_final_total_amount_typo',
1361 'selector' => '{{WRAPPER}} .usk-page-cart .cart-collaterals .order-total .woocommerce-Price-amount.amount',
1362 ]
1363 );
1364
1365 $this->end_controls_tab();
1366 $this->end_controls_tabs();
1367 $this->end_controls_section();
1368
1369 $this->start_controls_section(
1370 'checkout_button_style_section',
1371 [
1372 'label' => __( 'Checkout Button', 'ultimate-store-kit' ),
1373 'tab' => Controls_Manager::TAB_STYLE,
1374 ]
1375 );
1376
1377 $this->start_controls_tabs( 'checkout_button_tabs' );
1378 $this->start_controls_tab(
1379 'checkout_button_normal',
1380 [
1381 'label' => __( 'Normal', 'ultimate-store-kit' ),
1382 ]
1383 );
1384
1385 $this->add_control(
1386 'checkout_button_color',
1387 [
1388 'label' => __( 'Color', 'ultimate-store-kit' ),
1389 'type' => Controls_Manager::COLOR,
1390 'selectors' => [
1391 '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'color: {{VALUE}};',
1392 ],
1393 ]
1394 );
1395
1396 $this->add_group_control(
1397 Group_Control_Background::get_type(),
1398 [
1399 'name' => 'checkout_button_bg',
1400 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a'
1401 ]
1402 );
1403
1404 $this->add_group_control(
1405 Group_Control_Border::get_type(),
1406 [
1407 'name' => 'checkout_button_border',
1408 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a',
1409 'separator' => 'before',
1410 ]
1411 );
1412
1413 $this->add_responsive_control(
1414 'checkout_button_border_radius',
1415 [
1416 'label' => __( 'Border Radius', 'ultimate-store-kit' ),
1417 'type' => Controls_Manager::DIMENSIONS,
1418 'size_units' => [ 'px', '%' ],
1419 'selectors' => [
1420 '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
1421 ],
1422 ]
1423 );
1424
1425 $this->add_responsive_control(
1426 'checkout_button_padding',
1427 [
1428 'label' => __( 'Padding', 'ultimate-store-kit' ),
1429 'type' => Controls_Manager::DIMENSIONS,
1430 'size_units' => [ 'px', 'em', '%' ],
1431 'selectors' => [
1432 '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1433 ],
1434 ]
1435 );
1436
1437 $this->add_responsive_control(
1438 'checkout_button_margin',
1439 [
1440 'label' => __( 'Margin', 'ultimate-store-kit' ),
1441 'type' => Controls_Manager::DIMENSIONS,
1442 'size_units' => [ 'px', 'em', '%' ],
1443 'selectors' => [
1444 '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1445 ],
1446 ]
1447 );
1448
1449 $this->add_group_control(
1450 Group_Control_Typography::get_type(),
1451 [
1452 'name' => 'checkout_button_typo',
1453 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a',
1454 ]
1455 );
1456
1457 $this->end_controls_tab();
1458
1459 $this->start_controls_tab(
1460 'checkout_button_hover',
1461 [
1462 'label' => __( 'Hover', 'ultimate-store-kit' ),
1463 ]
1464 );
1465
1466 $this->add_control(
1467 'checkout_button_color_hover',
1468 [
1469 'label' => __( 'Color', 'ultimate-store-kit' ),
1470 'type' => Controls_Manager::COLOR,
1471 'selectors' => [
1472 '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a:hover' => 'color: {{VALUE}};',
1473 ],
1474 ]
1475 );
1476
1477 $this->add_group_control(
1478 Group_Control_Background::get_type(),
1479 [
1480 'name' => 'checkout_button_bg_hover',
1481 'selector' => '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a:hover'
1482 ]
1483 );
1484
1485 $this->add_control(
1486 'checkout_button_border_color_hover',
1487 [
1488 'label' => __( 'Border Color', 'ultimate-store-kit' ),
1489 'type' => Controls_Manager::COLOR,
1490 'selectors' => [
1491 '{{WRAPPER}} .usk-page-cart .woocommerce .wc-proceed-to-checkout a:hover' => 'border-color: {{VALUE}};',
1492 ],
1493 'condition' => [
1494 'checkout_button_border_border!' => '',
1495 ]
1496 ]
1497 );
1498
1499 $this->end_controls_tab();
1500 $this->end_controls_tabs();
1501 $this->end_controls_section();
1502 }
1503
1504
1505 protected function render() {
1506 $settings = $this->get_settings_for_display();
1507 global $woocommerce;
1508
1509 if ( is_null( WC()->cart ) ) {
1510 wc_load_cart();
1511 }
1512
1513 $items = $woocommerce->cart->get_cart();
1514
1515 ?>
1516
1517 <div class="usk-page-cart">
1518 <div class="woocommerce">
1519 <div class="woocommerce-notices-wrapper"></div>
1520 <form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
1521 <table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents">
1522 <thead>
1523 <tr>
1524 <th><?php esc_html_e( 'Close', 'ultimate-store-kit' ); ?></th>
1525
1526 <?php if ( $settings['show_image'] == 'yes' ) : ?>
1527 <th><?php esc_html_e( 'Image', 'ultimate-store-kit' ); ?></th>
1528 <?php endif; ?>
1529
1530 <?php if ( $settings['show_title'] == 'yes' ) : ?>
1531 <th><?php esc_html_e( 'Product Title', 'ultimate-store-kit' ); ?></th>
1532 <?php endif; ?>
1533
1534 <?php if ( $settings['show_price'] == 'yes' ) : ?>
1535 <th><?php esc_html_e( 'Price', 'ultimate-store-kit' ); ?></th>
1536 <?php endif; ?>
1537
1538 <?php if ( $settings['show_quantity'] == 'yes' ) : ?>
1539 <th><?php esc_html_e( 'Quantity', 'ultimate-store-kit' ); ?></th>
1540 <?php endif; ?>
1541
1542 <?php if ( $settings['show_subtotal'] == 'yes' ) : ?>
1543 <th><?php esc_html_e( 'Subtotal', 'ultimate-store-kit' ); ?></th>
1544 <?php endif; ?>
1545 </tr>
1546 </thead>
1547 <tbody>
1548 <?php
1549 $product_names = array();
1550 foreach ( $items as $item => $values ) {
1551
1552 $_product = wc_get_product( $values['data']->get_id() );
1553 // $_product2 = apply_filters( 'woocommerce_cart_item_product', $values['data'], $values, $item );
1554 // Retrieve WC_Product object from the product-id:
1555 $_woo_product = wc_get_product( $values['product_id'] );
1556
1557 // Get SKU from the WC_Product object:
1558 $product_names['sku'] = $_woo_product->get_sku();
1559 $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $values ) : '', $values, $item );
1560 ?>
1561
1562 <tr>
1563 <td class="usk-product-remove"
1564 data-title="<?php esc_html_e( 'Remove', 'ultimate-store-kit' ); ?>">
1565 <a href="<?php echo esc_url( wc_get_cart_remove_url( $item ) ); ?>" class="remove"
1566 aria-label="Remove this item"
1567 data-product_id="<?php echo esc_html( $values['product_id'] ); ?>"
1568 data-product_sku="<?php echo esc_html( $product_names['sku'] ); ?>">
1569 <i class="usk-icon-close"></i>
1570 </a>
1571 </td>
1572 <?php if ( $settings['show_image'] == 'yes' ) : ?>
1573 <td class="usk-product-image"
1574 data-title="<?php esc_html_e( 'Image', 'ultimate-store-kit' ); ?>">
1575 <?php
1576 $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $values, $item );
1577
1578 if ( ! $product_permalink ) {
1579 echo wp_kses_post( $thumbnail ); // PHPCS: XSS ok.
1580 } else {
1581 printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), wp_kses_post( $thumbnail ) ); // PHPCS: XSS ok.
1582 }
1583 ?>
1584 </td>
1585 <?php endif; ?>
1586
1587 <?php if ( $settings['show_title'] == 'yes' ) : ?>
1588 <td class="usk-product-title"
1589 data-title="<?php esc_html_e( 'Product Title', 'ultimate-store-kit' ); ?>">
1590 <?php
1591 // echo $_product->get_title();
1592 if ( ! $product_permalink ) {
1593 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $values, $item ) . '&nbsp;' );
1594 } else {
1595 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $values, $item ) );
1596 }
1597
1598 do_action( 'woocommerce_after_cart_item_name', $values, $item );
1599
1600 // Meta data.
1601 echo wp_kses_post( wc_get_formatted_cart_item_data( $values ) ); // PHPCS: XSS ok.
1602
1603 // Backorder notification.
1604 if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $values['quantity'] ) ) {
1605 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__( 'Available on backorder', 'woocommerce' ) . '</p>', $_product ) );
1606 }
1607 ?>
1608 </td>
1609 <?php endif; ?>
1610
1611 <?php if ( $settings['show_price'] == 'yes' ) : ?>
1612 <td class="usk-product-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>">
1613 <?php
1614 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $values, $item ) ); // PHPCS: XSS ok.
1615 ?>
1616 </td>
1617 <?php endif; ?>
1618
1619 <?php if ( $settings['show_quantity'] == 'yes' ) : ?>
1620 <td class="usk-product-quantity"
1621 data-title="<?php esc_html_e( 'Quantity', 'ultimate-store-kit' ); ?>">
1622 <?php
1623
1624 if ( $_product->is_sold_individually() ) {
1625 $product_quantity = sprintf( '1 <input type="hidden" name="cart[%s][qty]" value="1" />', $item );
1626 } else {
1627 $product_quantity = woocommerce_quantity_input(
1628 array(
1629 'input_name' => "cart[{$item}][qty]",
1630 'input_value' => $values['quantity'],
1631 'max_value' => $_product->get_max_purchase_quantity(),
1632 'min_value' => '0',
1633 'product_name' => $_product->get_name(),
1634 ),
1635 $_product,
1636 false
1637 );
1638 }
1639
1640 echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $item, $values ); // PHPCS: XSS ok.
1641
1642 ?>
1643 </td>
1644 <?php endif; ?>
1645
1646 <?php if ( $settings['show_subtotal'] == 'yes' ) : ?>
1647 <td class="usk-product-subtotal"
1648 data-title="<?php esc_html_e( 'Subtotal', 'ultimate-store-kit' ); ?>">
1649 <?php
1650 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $values['quantity'] ), $values, $item ) ); // PHPCS: XSS ok.
1651 ?>
1652 </td>
1653 <?php endif; ?>
1654
1655 </tr>
1656
1657 <?php
1658 }
1659
1660 ?>
1661 <tr>
1662 <td colspan="6" class="actions">
1663 <?php if ( wc_coupons_enabled() ) { ?>
1664 <div class="coupon">
1665 <label for="coupon_code"><?php esc_html_e( 'Coupon:', 'woocommerce' ); ?></label>
1666 <input type="text" name="coupon_code" class="input-text" id="coupon_code" value=""
1667 placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" />
1668 <button type="submit" class="button" name="apply_coupon"
1669 value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?></button>
1670 <?php do_action( 'woocommerce_cart_coupon' ); ?>
1671 </div>
1672 <?php } ?>
1673
1674 <button type="submit" class="button" name="update_cart"
1675 value="<?php esc_attr_e( 'Update cart', 'woocommerce' ); ?>"><?php esc_html_e( 'Update cart', 'woocommerce' ); ?>
1676
1677 </button>
1678
1679 <?php do_action( 'woocommerce_cart_actions' ); ?>
1680
1681 <?php wp_nonce_field( 'woocommerce-cart', 'woocommerce-cart-nonce' ); ?>
1682 </td>
1683 </tr>
1684 </tbody>
1685 </table>
1686
1687 </form>
1688
1689 <div class="cart-collaterals">
1690 <?php
1691 /**
1692 * Cart collaterals hook.
1693 *
1694 * @hooked woocommerce_cross_sell_display
1695 * @hooked woocommerce_cart_totals - 10
1696 */
1697 do_action( 'woocommerce_cart_collaterals' );
1698 ?>
1699 </div>
1700
1701 </div>
1702 </div>
1703
1704 <?php }
1705 }
1706