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

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