PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 3.1.4
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v3.1.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 3.1.4, at modules/page-cart/widgets/page-cart.php

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