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

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

1,309 lines 41.3 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\MiniCart\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_Box_Shadow;
10 use Elementor\Group_Control_Background;
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit;
14 }
15
16 class Mini_Cart extends Module_Base {
17
18 public function get_name() {
19 return 'usk-mini-cart';
20 }
21
22 public function get_title() {
23 return esc_html__( 'Mini Cart', 'ultimate-store-kit' );
24 }
25
26 public function get_icon() {
27 return 'usk-widget-icon usk-icon-mini-cart';
28 }
29
30 public function get_categories() {
31 return [ 'ultimate-store-kit' ];
32 }
33
34 public function get_keywords() {
35 return [ 'mini cart', 'cart', 'wc', 'woocommerce', 'add to cart' ];
36 }
37
38 public function get_style_depends() {
39 if ( $this->usk_is_edit_mode() ) {
40 return [ 'usk-all-styles' ];
41 } else {
42 return [ 'usk-font', 'usk-mini-cart', 'toolslide-css' ];
43 }
44 }
45
46 public function get_script_depends() {
47 if ( $this->usk_is_edit_mode() ) {
48 return [ 'toolslide-js', 'usk-all-styles' ];
49 } else {
50 return [ 'toolslide-js', 'usk-mini-cart' ];
51 }
52 }
53
54 protected function render_layout_controls_offcanvas() {
55 $this->start_controls_section(
56 'section_content_layout',
57 [
58 'label' => esc_html__( 'Offcanvas', 'ultimate-store-kit' ),
59 ]
60 );
61
62 $this->add_control(
63 'custom_widget_cart_title',
64 [
65 'label' => esc_html__( 'Cart Title', 'ultimate-store-kit' ),
66 'type' => Controls_Manager::TEXT,
67 'dynamic' => [ 'active' => true ],
68 'default' => esc_html__( 'Shopping Cart', 'ultimate-store-kit' ),
69 ]
70 );
71 $this->end_controls_section();
72 }
73 protected function render_controls_settings() {
74 $this->start_controls_section(
75 'section_content_mini_cart_settings',
76 [
77 'label' => esc_html__( 'Settings', 'ultimate-store-kit' ),
78 'tab' => Controls_Manager::TAB_CONTENT,
79 ]
80 );
81 $this->add_control(
82 'usk_mini_cart_position',
83 [
84 'label' => esc_html__( 'Position', 'ultimate-store-kit' ),
85 'type' => Controls_Manager::SELECT,
86 'options' => [
87 'left' => esc_html__( 'Left', 'ultimate-store-kit' ),
88 'right' => esc_html__( 'Right (Default)', 'ultimate-store-kit' ),
89 'bottom' => esc_html__( 'Bottom', 'ultimate-store-kit' ),
90 'top' => esc_html__( 'Top', 'ultimate-store-kit' ),
91 ],
92 'default' => 'right',
93 'dynamic' => [ 'active' => true ],
94 'render_type' => 'template',
95 'frontend_available' => true,
96 ]
97 );
98
99 $this->add_control(
100 'usk_mini_cart_height',
101 [
102 'label' => esc_html__( 'Height', 'ultimate-store-kit' ),
103 'type' => Controls_Manager::SLIDER,
104 'size_units' => [ 'px', '%', 'vh' ],
105 'range' => [
106 'px' => [
107 'min' => 0,
108 'max' => 1200,
109 'step' => 1,
110 ],
111 ],
112 'default' => [
113 'unit' => '%',
114 'size' => 100,
115 ],
116 'render_type' => 'none',
117 'frontend_available' => true,
118 ]
119 );
120
121 $this->add_control(
122 'usk_mini_cart_width',
123 [
124 'label' => esc_html__( 'Width', 'ultimate-store-kit' ),
125 'type' => Controls_Manager::SLIDER,
126 'size_units' => [ 'px', '%', 'vh' ],
127 'range' => [
128 'px' => [
129 'min' => 0,
130 'max' => 1200,
131 'step' => 1,
132 ],
133 ],
134 'default' => [
135 'unit' => 'px',
136 'size' => 340,
137 ],
138 'render_type' => 'none',
139 'frontend_available' => true,
140 ]
141 );
142 // $this->add_control(
143 // 'usk_mini_cart_closeable',
144 // [
145 // 'label' => esc_html__('Closeable', 'ultimate-store-kit'),
146 // 'type' => Controls_Manager::SWITCHER,
147 // 'label_on' => esc_html__('Yes', 'ultimate-store-kit'),
148 // 'label_off' => esc_html__('No', 'ultimate-store-kit'),
149 // 'render_type' => 'none',
150 // 'frontend_available' => true,
151 // ]
152 // );
153
154 $this->add_control(
155 'usk_mini_cart_startOpen',
156 [
157 'label' => esc_html__( 'Start Open', 'ultimate-store-kit' ),
158 'type' => Controls_Manager::SWITCHER,
159 'label_on' => esc_html__( 'Yes', 'ultimate-store-kit' ),
160 'label_off' => esc_html__( 'No', 'ultimate-store-kit' ),
161 'render_type' => 'none',
162 'frontend_available' => true,
163 ]
164 );
165
166 $this->add_control(
167 'usk_mini_cart_autoclose',
168 [
169 'label' => esc_html__( 'Auto close', 'ultimate-store-kit' ),
170 'type' => Controls_Manager::SWITCHER,
171 'label_on' => esc_html__( 'Yes', 'ultimate-store-kit' ),
172 'label_off' => esc_html__( 'No', 'ultimate-store-kit' ),
173 'render_type' => 'none',
174 'frontend_available' => true,
175 ]
176 );
177
178 $this->add_control(
179 'usk_mini_cart_clickOutsideToClose',
180 [
181 'label' => esc_html__( 'Click Outside To Close', 'ultimate-store-kit' ),
182 'type' => Controls_Manager::SWITCHER,
183 'label_on' => esc_html__( 'Yes', 'ultimate-store-kit' ),
184 'label_off' => esc_html__( 'No', 'ultimate-store-kit' ),
185 'render_type' => 'none',
186 'default' => 'yes',
187 'frontend_available' => true,
188 ]
189 );
190
191 $this->add_control(
192 'usk_mini_cart_autocloseDelay',
193 [
194 'label' => esc_html__( 'Auto Close Delay', 'ultimate-store-kit' ),
195 'description' => esc_html__( 'Description', 'ultimate-store-kit' ),
196 'type' => Controls_Manager::NUMBER,
197 'min' => 0,
198 'max' => 10000,
199 'step' => 1,
200 'default' => 5000,
201 'dynamic' => [ 'active' => true ],
202 'render_type' => 'none',
203 'frontend_available' => true,
204 ]
205 );
206 $this->end_controls_section();
207 }
208 protected function render_controls_mini_cart() {
209 $this->start_controls_section(
210 'section_content_mini_cart',
211 [
212 'label' => esc_html__( 'Mini Cart', 'ultimate-store-kit' ),
213 ]
214 );
215
216 $this->add_control(
217 'show_price_amount',
218 [
219 'label' => esc_html__( 'Show Price Amount', 'ultimate-store-kit' ),
220 'type' => Controls_Manager::SWITCHER,
221 ]
222 );
223
224 $this->add_control(
225 'show_cart_icon',
226 [
227 'label' => esc_html__( 'Show Cart Icon', 'ultimate-store-kit' ),
228 'type' => Controls_Manager::SWITCHER,
229 'default' => 'yes',
230
231 ]
232 );
233 $this->add_responsive_control(
234 'mini_cart_align',
235 [
236 'label' => esc_html__( 'Alignment', 'ultimate-store-kit' ),
237 'type' => Controls_Manager::CHOOSE,
238 'options' => [
239 'left' => [
240 'title' => esc_html__( 'Left', 'ultimate-store-kit' ),
241 'icon' => 'eicon-h-align-left',
242 ],
243 'center' => [
244 'title' => esc_html__( 'Center', 'ultimate-store-kit' ),
245 'icon' => 'eicon-h-align-center',
246 ],
247 'right' => [
248 'title' => esc_html__( 'Right', 'ultimate-store-kit' ),
249 'icon' => 'eicon-h-align-right',
250 ],
251 ],
252 'prefix_class' => 'elementor%s-align-',
253 'default' => 'left',
254 ]
255 );
256
257 $this->add_control(
258 'mini_cart_icon_indent',
259 [
260 'label' => esc_html__( 'Icon Spacing', 'ultimate-store-kit' ),
261 'type' => Controls_Manager::SLIDER,
262 'default' => [
263 'size' => 8,
264 ],
265 'range' => [
266 'px' => [
267 'max' => 50,
268 ],
269 ],
270 'selectors' => [
271 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner' => 'grid-gap: {{SIZE}}{{UNIT}};',
272 ],
273 'condition' => [
274 'show_cart_icon' => 'yes',
275 'show_price_amount' => 'yes'
276 ]
277 ]
278 );
279
280 $this->end_controls_section();
281 }
282
283 public function render_style_controls_mini_cart() {
284 $this->start_controls_section(
285 'section_style_mini_cart_content',
286 [
287 'label' => esc_html__( 'Mini Cart', 'ultimate-store-kit' ),
288 'tab' => Controls_Manager::TAB_STYLE,
289 ]
290 );
291
292 $this->add_control(
293 'mini_cart_price_amount_color',
294 [
295 'label' => esc_html__( 'Amount Color', 'ultimate-store-kit' ),
296 'type' => Controls_Manager::COLOR,
297 'selectors' => [
298 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .bdt-mini-cart-price-amount *' => 'color: {{VALUE}};',
299 ],
300 'condition' => [
301 'show_price_amount' => 'yes'
302 ]
303 ]
304 );
305
306 $this->add_control(
307 'mini_cart_icon_color',
308 [
309 'label' => esc_html__( 'Icon Color', 'ultimate-store-kit' ),
310 'type' => Controls_Manager::COLOR,
311 'selectors' => [
312 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .usk-cart-icon i' => 'color: {{VALUE}};',
313 ],
314 ]
315 );
316
317 $this->add_control(
318 'mini_cart_background_color',
319 [
320 'label' => esc_html__( 'Background Color', 'ultimate-store-kit' ),
321 'type' => Controls_Manager::COLOR,
322 'selectors' => [
323 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner' => 'background: {{VALUE}};',
324 ],
325 ]
326 );
327
328 $this->add_group_control(
329 Group_Control_Border::get_type(),
330 [
331 'name' => 'mini_cart_border',
332 'label' => esc_html__( 'Border', 'ultimate-store-kit' ),
333 'selector' => '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner',
334 ]
335 );
336
337 $this->add_control(
338 'mini_cart_border_radius',
339 [
340 'label' => esc_html__( 'Border Radius', 'ultimate-store-kit' ),
341 'type' => Controls_Manager::DIMENSIONS,
342 'size_units' => [ 'px', '%' ],
343 'selectors' => [
344 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
345 ],
346 ]
347 );
348
349 $this->add_responsive_control(
350 'mini_cart_padding',
351 [
352 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
353 'type' => Controls_Manager::DIMENSIONS,
354 'size_units' => [ 'px', 'em', '%' ],
355 'selectors' => [
356 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
357 ],
358 ]
359 );
360
361 $this->add_group_control(
362 Group_Control_Typography::get_type(),
363 [
364 'name' => 'price_amount_typography',
365 'selector' => '{{WRAPPER}} .bdt-mini-cart-inner .woocommerce-Price-amount.amount, {{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .usk-cart-icon i',
366 ]
367 );
368
369 $this->add_control(
370 'mini_cart_badge_style',
371 [
372 'label' => esc_html__( 'Cart Badge', 'ultimate-store-kit' ),
373 'type' => Controls_Manager::HEADING,
374 'separator' => 'before',
375 ]
376 );
377
378 $this->add_control(
379 'mini_cart_badge_color',
380 [
381 'label' => esc_html__( 'Color', 'ultimate-store-kit' ),
382 'type' => Controls_Manager::COLOR,
383 'selectors' => [
384 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .usk-cart-badge' => 'color: {{VALUE}};',
385 ],
386 ]
387 );
388
389 $this->add_control(
390 'mini_cart_badge_background_color',
391 [
392 'label' => esc_html__( 'Background', 'ultimate-store-kit' ),
393 'type' => Controls_Manager::COLOR,
394 'selectors' => [
395 '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .usk-cart-badge' => 'background: {{VALUE}};',
396 ],
397 ]
398 );
399 // $this->add_responsive_control(
400 // 'mini_cart_badge_padding',
401 // [
402 // 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
403 // 'type' => Controls_Manager::DIMENSIONS,
404 // 'size_units' => [ 'px', '%', 'em' ],
405 // 'selectors' => [
406 // '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .usk-cart-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
407 // ],
408 // ]
409 // );
410 $this->add_responsive_control(
411 'mini_cart_badge_size',
412 [
413 'label' => esc_html__( 'Size', 'ultimate-store-kit' ),
414 'type' => Controls_Manager::SLIDER,
415 'size_units' => [ 'px', 'em', 'rem' ],
416 'selectors' => [
417 '{{WRAPPER}} .bdt-mini-cart-inner .usk-cart-badge' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
418 ],
419 ]
420 );
421
422 $this->add_group_control(
423 Group_Control_Typography::get_type(),
424 [
425 'name' => 'cart_badge_typography',
426 'selector' => '{{WRAPPER}} .usk-mini-cart-toggle-btn .bdt-mini-cart-inner .usk-cart-badge',
427 ]
428 );
429
430 $this->end_controls_section();
431 }
432 protected function render_style_controls_offcanvas() {
433 $this->start_controls_section(
434 'section_style_offcanvas_content',
435 [
436 'label' => esc_html__( 'Offcanvas', 'ultimate-store-kit' ),
437 'tab' => Controls_Manager::TAB_STYLE,
438 ]
439 );
440
441 $this->start_controls_tabs( 'tabs_style_offcanvas_content' );
442
443 $this->start_controls_tab(
444 'tab_style_product_cart',
445 [
446 'label' => esc_html__( 'Product List', 'ultimate-store-kit' ),
447 ]
448 );
449
450 $this->add_control(
451 'product_cart_main_title_color',
452 [
453 'label' => esc_html__( 'Cart Title Color', 'ultimate-store-kit' ),
454 'type' => Controls_Manager::COLOR,
455 'selectors' => [
456 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .usk-widget-title' => 'color: {{VALUE}}',
457 ],
458 ]
459 );
460
461 $this->add_control(
462 'product_cart_main_title_border_color',
463 [
464 'label' => esc_html__( 'Cart Border Color', 'ultimate-store-kit' ),
465 'type' => Controls_Manager::COLOR,
466 'selectors' => [
467 '#usk-mini-cart-{{ID}}.usk-mini-cart .usk-widget-title' => 'border-color: {{VALUE}}',
468 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-product-item' => 'border-bottom-color: {{VALUE}}'
469 ],
470 ]
471 );
472
473 $this->add_group_control(
474 Group_Control_Typography::get_type(),
475 [
476 'name' => 'product_cart_main_title_typography',
477 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .usk-widget-title',
478 ]
479 );
480
481 $this->add_control(
482 'product_cart_style',
483 [
484 'label' => esc_html__( 'Product Cart', 'ultimate-store-kit' ),
485 'type' => Controls_Manager::HEADING,
486 'separator' => 'before',
487 ]
488 );
489
490 $this->add_control(
491 'product_cart_title_color',
492 [
493 'label' => esc_html__( 'Title Color', 'ultimate-store-kit' ),
494 'type' => Controls_Manager::COLOR,
495 'selectors' => [
496 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-name a' => 'color: {{VALUE}};',
497 ],
498 ]
499 );
500
501 $this->add_control(
502 'product_cart_title_hover_color',
503 [
504 'label' => esc_html__( 'Title Hover Color', 'ultimate-store-kit' ),
505 'type' => Controls_Manager::COLOR,
506 'selectors' => [
507 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-name a:hover' => 'color: {{VALUE}};',
508 ],
509 ]
510 );
511
512 $this->add_group_control(
513 Group_Control_Typography::get_type(),
514 [
515 'name' => 'product_cart_title_typography',
516 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-name a',
517 ]
518 );
519
520 // $this->add_control(
521 // 'product_cart_item_border_color',
522 // [
523 // 'label' => esc_html__('Item Border Color', 'ultimate-store-kit'),
524 // 'type' => Controls_Manager::COLOR,
525 // 'selectors' => [
526 // '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item' => 'border-color: {{VALUE}};',
527 // ],
528 // 'separator' => 'before',
529 // ]
530 // );
531
532 $this->add_control(
533 'product_cart_quantity_price_style',
534 [
535 'label' => esc_html__( 'Price', 'ultimate-store-kit' ),
536 'type' => Controls_Manager::HEADING,
537 'separator' => 'before',
538 ]
539 );
540
541 $this->add_control(
542 'product_cart_quantity_color',
543 [
544 'label' => esc_html__( 'Quantity Color', 'ultimate-store-kit' ),
545 'type' => Controls_Manager::COLOR,
546 'selectors' => [
547 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-price' => 'color: {{VALUE}};',
548 ],
549 ]
550 );
551
552 $this->add_control(
553 'product_cart_price_color',
554 [
555 'label' => esc_html__( 'Amount Color', 'ultimate-store-kit' ),
556 'type' => Controls_Manager::COLOR,
557 'selectors' => [
558 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .woocommerce-Price-amount .amount *' => 'color: {{VALUE}} !important;',
559 ],
560 ]
561 );
562
563 $this->add_group_control(
564 Group_Control_Typography::get_type(),
565 [
566 'name' => 'product_cart_price_typography',
567 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-price',
568 ]
569 );
570
571 $this->add_control(
572 'product_cart_image_style',
573 [
574 'label' => esc_html__( 'Image', 'ultimate-store-kit' ),
575 'type' => Controls_Manager::HEADING,
576 'separator' => 'before',
577 ]
578 );
579
580 $this->add_group_control(
581 Group_Control_Border::get_type(),
582 [
583 'name' => 'product_cart_image_border',
584 'label' => esc_html__( 'Image Border', 'ultimate-store-kit' ),
585 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-thumbnail img',
586 ]
587 );
588
589 $this->add_responsive_control(
590 'product_cart_image_radius',
591 [
592 'label' => esc_html__( 'Image Border Radius', 'ultimate-store-kit' ),
593 'type' => Controls_Manager::DIMENSIONS,
594 'size_units' => [ 'px', '%' ],
595 'selectors' => [
596 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-thumbnail img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
597 ],
598 ]
599 );
600
601 $this->add_control(
602 'product_cart_subtotal_style',
603 [
604 'label' => esc_html__( 'Subtotal', 'ultimate-store-kit' ),
605 'type' => Controls_Manager::HEADING,
606 'separator' => 'before',
607 ]
608 );
609
610 $this->add_control(
611 'product_cart_subtotal_color',
612 [
613 'label' => esc_html__( 'Subtotal Color', 'ultimate-store-kit' ),
614 'type' => Controls_Manager::COLOR,
615 'selectors' => [
616 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-subtotal strong' => 'color: {{VALUE}};',
617 ],
618 ]
619 );
620
621 $this->add_control(
622 'product_cart_subtotal_tax_color',
623 [
624 'label' => esc_html__( 'Tax Color', 'ultimate-store-kit' ),
625 'type' => Controls_Manager::COLOR,
626 'selectors' => [
627 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-subtotal .woocommerce-Price-amount.amount' => 'color: {{VALUE}};',
628 ],
629 ]
630 );
631
632 $this->add_group_control(
633 Group_Control_Typography::get_type(),
634 [
635 'name' => 'product_cart_subtotal_typography',
636 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-subtotal',
637 ]
638 );
639
640 $this->add_control(
641 'product_cart_viewcart_button_style',
642 [
643 'label' => esc_html__( 'View Cart Button', 'ultimate-store-kit' ),
644 'type' => Controls_Manager::HEADING,
645 'separator' => 'before',
646 ]
647 );
648
649 $this->add_control(
650 'pc_viewcart_text_color',
651 [
652 'label' => esc_html__( 'Color', 'ultimate-store-kit' ),
653 'type' => Controls_Manager::COLOR,
654 'default' => '',
655 'selectors' => [
656 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons a.bdt-button-view-cart ' => 'color: {{VALUE}};',
657 ],
658 ]
659 );
660
661 $this->add_control(
662 'pc_viewcart_button_hover_color',
663 [
664 'label' => esc_html__( 'Hover Color', 'ultimate-store-kit' ),
665 'type' => Controls_Manager::COLOR,
666 'selectors' => [
667 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons a.bdt-button-view-cart :hover' => 'color: {{VALUE}};',
668 ],
669 ]
670 );
671 $this->add_control(
672 'heading_viewcart_background_color',
673 [
674 'label' => __( 'Background', 'ultimate-store-kit' ),
675 'type' => Controls_Manager::HEADING,
676 'separator' => 'before',
677 ]
678 );
679 $this->add_group_control(
680 Group_Control_Background::get_type(),
681 [
682 'name' => 'pc_viewcart_background_color',
683 'label' => __( 'Background', 'ultimate-store-kit' ),
684 'types' => [ 'classic', 'gradient' ],
685 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons .bdt-button-view-cart'
686 ]
687 );
688
689 $this->add_group_control(
690 Group_Control_Background::get_type(),
691 [
692 'name' => 'pc_viewcart_background_hover_color',
693 'label' => __( 'Background', 'ultimate-store-kit' ),
694 'types' => [ 'classic', 'gradient' ],
695 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons .bdt-button-view-cart:hover'
696 ]
697 );
698
699 // $this->add_control(
700 // 'pc_viewcart_background_hover_color',
701 // [
702 // 'label' => esc_html__('Hover Background Color', 'ultimate-store-kit'),
703 // 'type' => Controls_Manager::COLOR,
704 // 'selectors' => [
705 // '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart:hover' => 'background-color: {{VALUE}};',
706 // ],
707 // ]
708 // );
709
710 $this->add_group_control(
711 Group_Control_Border::get_type(),
712 [
713 'name' => 'pc_viewcart_border',
714 'label' => esc_html__( 'Border', 'ultimate-store-kit' ),
715 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart',
716 ]
717 );
718
719 $this->add_control(
720 'pc_viewcart_hover_border_color',
721 [
722 'label' => esc_html__( 'Hover Border Color', 'ultimate-store-kit' ),
723 'type' => Controls_Manager::COLOR,
724 'condition' => [
725 'pc_viewcart_border_border!' => '',
726 ],
727 'selectors' => [
728 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart:hover' => 'border-color: {{VALUE}};',
729 ],
730 ]
731 );
732
733 $this->add_control(
734 'pc_viewcart_border_radius',
735 [
736 'label' => esc_html__( 'Border Radius', 'ultimate-store-kit' ),
737 'type' => Controls_Manager::DIMENSIONS,
738 'size_units' => [ 'px', '%' ],
739 'selectors' => [
740 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
741 ],
742 ]
743 );
744
745 $this->add_control(
746 'pc_viewcart_padding',
747 [
748 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
749 'type' => Controls_Manager::DIMENSIONS,
750 'size_units' => [ 'px', 'em', '%' ],
751 'selectors' => [
752 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
753 ],
754 ]
755 );
756
757 $this->add_group_control(
758 Group_Control_Box_Shadow::get_type(),
759 [
760 'name' => 'pc_viewcart_shadow',
761 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart',
762 ]
763 );
764
765 $this->add_group_control(
766 Group_Control_Typography::get_type(),
767 [
768 'name' => 'pc_viewcart_typography',
769 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ),
770 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-view-cart .bdt-button-text',
771 ]
772 );
773
774 $this->add_control(
775 'product_cart_checkout_button_style',
776 [
777 'label' => esc_html__( 'Checkout Button', 'ultimate-store-kit' ),
778 'type' => Controls_Manager::HEADING,
779 'separator' => 'before',
780 ]
781 );
782
783 $this->add_control(
784 'pc_checkout_text_color',
785 [
786 'label' => esc_html__( 'Color', 'ultimate-store-kit' ),
787 'type' => Controls_Manager::COLOR,
788 'default' => '',
789 'selectors' => [
790 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons .bdt-button-checkout' => 'color: {{VALUE}};',
791 ],
792 ]
793 );
794
795 $this->add_control(
796 'pc_checkout_button_hover_color',
797 [
798 'label' => esc_html__( 'Hover Color', 'ultimate-store-kit' ),
799 'type' => Controls_Manager::COLOR,
800 'selectors' => [
801 '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons .bdt-button-checkout:hover' => 'color: {{VALUE}};',
802 ],
803 ]
804 );
805
806 $this->add_group_control(
807 Group_Control_Background::get_type(),
808 [
809 'name' => 'pc_checkout_background_color',
810 'label' => __( 'Background', 'ultimate-store-kit' ),
811 'types' => [ 'classic', 'gradient' ],
812 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .bdt-mini-cart-footer-buttons .bdt-button-checkout',
813 ]
814 );
815
816 $this->add_control(
817 'pc_checkout_background_hover_color',
818 [
819 'label' => esc_html__( 'Hover Background Color', 'ultimate-store-kit' ),
820 'type' => Controls_Manager::COLOR,
821 'selectors' => [
822 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout:hover::before' => 'background-color: {{VALUE}};',
823 // '.usk-mini-cart .bdt-mini-cart-footer-buttons .bdt-button-checkout::before'
824 ],
825 ]
826 );
827
828 $this->add_group_control(
829 Group_Control_Border::get_type(),
830 [
831 'name' => 'pc_checkout_border',
832 'label' => esc_html__( 'Border', 'ultimate-store-kit' ),
833 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout',
834 ]
835 );
836
837 $this->add_control(
838 'pc_checkout_hover_border_color',
839 [
840 'label' => esc_html__( 'Hover Border Color', 'ultimate-store-kit' ),
841 'type' => Controls_Manager::COLOR,
842 'condition' => [
843 'pc_checkout_border_border!' => '',
844 ],
845 'selectors' => [
846 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout:hover' => 'border-color: {{VALUE}};',
847 ],
848 ]
849 );
850
851 $this->add_control(
852 'pc_checkout_border_radius',
853 [
854 'label' => esc_html__( 'Border Radius', 'ultimate-store-kit' ),
855 'type' => Controls_Manager::DIMENSIONS,
856 'size_units' => [ 'px', '%' ],
857 'selectors' => [
858 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
859 ],
860 ]
861 );
862
863 $this->add_control(
864 'pc_checkout_padding',
865 [
866 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
867 'type' => Controls_Manager::DIMENSIONS,
868 'size_units' => [ 'px', 'em', '%' ],
869 'selectors' => [
870 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
871 ],
872 ]
873 );
874
875 $this->add_group_control(
876 Group_Control_Box_Shadow::get_type(),
877 [
878 'name' => 'pc_checkout_shadow',
879 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout',
880 ]
881 );
882
883 $this->add_group_control(
884 Group_Control_Typography::get_type(),
885 [
886 'name' => 'pc_checkout_typography',
887 'label' => esc_html__( 'Typography', 'ultimate-store-kit' ),
888 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-footer-buttons .bdt-button-checkout .bdt-button-text',
889 ]
890 );
891
892 $this->add_control(
893 'product_cart_remove_button_style',
894 [
895 'label' => esc_html__( 'Product Remove Button', 'ultimate-store-kit' ),
896 'type' => Controls_Manager::HEADING,
897 'separator' => 'before',
898 ]
899 );
900
901 $this->add_control(
902 'pc_remove_text_color',
903 [
904 'label' => esc_html__( 'Color', 'ultimate-store-kit' ),
905 'type' => Controls_Manager::COLOR,
906 'default' => '',
907 'selectors' => [
908 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a svg *' => 'stroke: {{VALUE}};',
909 ],
910 ]
911 );
912
913 $this->add_control(
914 'pc_remove_button_hover_color',
915 [
916 'label' => esc_html__( 'Hover Color', 'ultimate-store-kit' ),
917 'type' => Controls_Manager::COLOR,
918 'selectors' => [
919 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a:hover svg *' => 'stroke: {{VALUE}};',
920 ],
921 ]
922 );
923
924 $this->add_control(
925 'pc_remove_background_color',
926 [
927 'label' => esc_html__( 'Background Color', 'ultimate-store-kit' ),
928 'type' => Controls_Manager::COLOR,
929 'selectors' => [
930 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a' => 'background-color: {{VALUE}};',
931 ],
932 ]
933 );
934
935 $this->add_control(
936 'pc_remove_background_hover_color',
937 [
938 'label' => esc_html__( 'Hover Background Color', 'ultimate-store-kit' ),
939 'type' => Controls_Manager::COLOR,
940 'selectors' => [
941 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a:hover' => 'background-color: {{VALUE}};',
942 ],
943 ]
944 );
945
946 $this->add_group_control(
947 Group_Control_Border::get_type(),
948 [
949 'name' => 'pc_remove_border',
950 'label' => esc_html__( 'Border', 'ultimate-store-kit' ),
951 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a',
952 ]
953 );
954
955 $this->add_control(
956 'pc_remove_hover_border_color',
957 [
958 'label' => esc_html__( 'Hover Border Color', 'ultimate-store-kit' ),
959 'type' => Controls_Manager::COLOR,
960 'condition' => [
961 'pc_remove_border_border!' => '',
962 ],
963 'selectors' => [
964 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a:hover' => 'border-color: {{VALUE}};',
965 ],
966 ]
967 );
968
969 $this->add_control(
970 'pc_remove_border_radius',
971 [
972 'label' => esc_html__( 'Border Radius', 'ultimate-store-kit' ),
973 'type' => Controls_Manager::DIMENSIONS,
974 'size_units' => [ 'px', '%' ],
975 'selectors' => [
976 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
977 ],
978 ]
979 );
980
981 $this->add_control(
982 'pc_remove_padding',
983 [
984 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
985 'type' => Controls_Manager::DIMENSIONS,
986 'size_units' => [ 'px', 'em', '%' ],
987 'selectors' => [
988 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
989 ],
990 ]
991 );
992
993 $this->add_group_control(
994 Group_Control_Box_Shadow::get_type(),
995 [
996 'name' => 'pc_remove_shadow',
997 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item .bdt-mini-cart-product-remove a',
998 ]
999 );
1000
1001 $this->end_controls_tab();
1002
1003 $this->start_controls_tab(
1004 'tab_style_offcanvas_content',
1005 [
1006 'label' => esc_html__( 'Offcanvas', 'ultimate-store-kit' ),
1007 ]
1008 );
1009 $this->add_control(
1010 'heading_offcanvas_content_background',
1011 [
1012 'label' => __( 'Content Background', 'ultimate-store-kit' ),
1013 'type' => Controls_Manager::HEADING,
1014 'separator' => 'before',
1015 ]
1016 );
1017 $this->add_group_control(
1018 Group_Control_Background::get_type(),
1019 [
1020 'name' => 'offcanvas_content_background_color',
1021 'label' => __( 'Background', 'ultimate-store-kit' ),
1022 'types' => [ 'classic', 'gradient' ],
1023 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container',
1024 ]
1025 );
1026 $this->add_control(
1027 'heading_offcanvas_item_background',
1028 [
1029 'label' => __( 'Item Background', 'ultimate-store-kit' ),
1030 'type' => Controls_Manager::HEADING,
1031 'separator' => 'before',
1032 ]
1033 );
1034
1035 $this->add_group_control(
1036 Group_Control_Background::get_type(),
1037 [
1038 'name' => 'offcanvas_item_background_color',
1039 'label' => __( 'Background', 'ultimate-store-kit' ),
1040 'types' => [ 'classic', 'gradient' ],
1041 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item',
1042 ]
1043 );
1044
1045 $this->add_control(
1046 'heading_offcanvas_item_hover_background',
1047 [
1048 'label' => __( 'Item Hover Background', 'ultimate-store-kit' ),
1049 'type' => Controls_Manager::HEADING,
1050 'separator' => 'before',
1051 ]
1052 );
1053 $this->add_group_control(
1054 Group_Control_Background::get_type(),
1055 [
1056 'name' => 'offcanvas_item_hover_background_color',
1057 'label' => __( 'Background', 'ultimate-store-kit' ),
1058 'types' => [ 'classic', 'gradient' ],
1059 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container .bdt-mini-cart-product-item:hover',
1060 ]
1061 );
1062 $this->add_group_control(
1063 Group_Control_Box_Shadow::get_type(),
1064 [
1065 'name' => 'offcanvas_content_shadow',
1066 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container',
1067 'separator' => 'before',
1068 ]
1069 );
1070
1071 $this->add_responsive_control(
1072 'offcanvas_content_padding',
1073 [
1074 'label' => esc_html__( 'Padding', 'ultimate-store-kit' ),
1075 'type' => Controls_Manager::DIMENSIONS,
1076 'size_units' => [ 'px', 'em', '%' ],
1077 'selectors' => [
1078 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1079 ],
1080 'separator' => 'before',
1081 ]
1082 );
1083
1084 $this->add_responsive_control(
1085 'offcanvas_margin',
1086 [
1087 'label' => esc_html__( 'Margin', 'ultimate-store-kit' ),
1088 'type' => Controls_Manager::DIMENSIONS,
1089 'size_units' => [ 'px', 'em', '%' ],
1090 'selectors' => [
1091 '#usk-mini-cart-{{ID}}.usk-mini-cart .ts-content-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1092 ],
1093 'separator' => 'after'
1094 ]
1095 );
1096 $this->add_control(
1097 'offcanvas_heading_footer',
1098 [
1099 'label' => __( 'Footer', 'ultimate-store-kit' ),
1100 'type' => Controls_Manager::HEADING,
1101 'separator' => 'before',
1102 ]
1103 );
1104 $this->add_group_control(
1105 Group_Control_Background::get_type(),
1106 [
1107 'name' => 'footer_backgrouind',
1108 'label' => __( 'Background', 'ultimate-store-kit' ),
1109 'types' => [ 'classic', 'gradient' ],
1110 'selector' => '#usk-mini-cart-{{ID}}.usk-mini-cart .usk-mini-cart-content-footer',
1111 ]
1112 );
1113 $this->end_controls_tab();
1114 $this->end_controls_tabs();
1115
1116 $this->end_controls_section();
1117 }
1118 protected function register_controls() {
1119 $this->render_layout_controls_offcanvas();
1120 $this->render_controls_mini_cart();
1121 $this->render_controls_settings();
1122
1123 //Style
1124 $this->render_style_controls_mini_cart();
1125 $this->render_style_controls_offcanvas();
1126 }
1127
1128 public function render() {
1129
1130 $settings = $this->get_settings_for_display();
1131 $id = 'usk-mini-cart-' . $this->get_id();
1132 $toggleID = 'usk-mini-cart-toggle-' . $this->get_id();
1133 if ( null === WC()->cart ) {
1134 return;
1135 }
1136 $product_count = WC()->cart->get_cart_contents_count();
1137 // $this->add_render_attribute('mini-cart', 'type', 'button');
1138 $this->add_render_attribute( 'mini-cart', 'id', $toggleID );
1139 $this->add_render_attribute( 'mini-cart', [
1140 'class' => [ 'usk-mini-cart-toggle-btn' ],
1141 'data-settings' => [
1142 wp_json_encode( array_filter( [
1143 'toggleButton' => '#' . $toggleID . '',
1144 // 'position' => $settings['cart_position'],
1145 // 'height' => "100%",
1146 // 'width' => "340px",
1147 // 'startOpen' => true,
1148 // 'closeable' => true,
1149 // 'autoclose' => false,
1150 // 'autocloseDelay' => 5000,
1151 // 'clickOutsideToClose' => true,
1152 ] ) )
1153 ]
1154 ], null, true );
1155 $this->add_render_attribute( 'offcanvas', [
1156 'id' => $id,
1157 'class' => [ 'usk-mini-cart' ],
1158 ], null, true );
1159 ?>
1160 <div class="ultimate-store-kit">
1161 <div <?php $this->print_render_attribute_string( 'mini-cart' ); ?>>
1162 <span class="bdt-mini-cart-inner">
1163 <?php if ( $settings['show_price_amount'] === 'yes' ) : ?>
1164 <span class="bdt-cart-button-text">
1165 <span class="bdt-mini-cart-price-amount">
1166 <?php echo WC()->cart->get_cart_subtotal(); ?>
1167 </span>
1168 </span>
1169 <?php endif; ?>
1170
1171 <?php if ( $settings['show_cart_icon'] === 'yes' ) : ?>
1172 <span class="bdt-mini-cart-button-icon">
1173 <?php //if (($product_count != 0)) :
1174 ?>
1175 <span class="usk-cart-badge"><?php echo esc_html( $product_count ); ?></span>
1176 <?php //endif;
1177 ?>
1178 <span class="usk-cart-icon">
1179 <i class="usk-icon-cart" aria-hidden="true"></i>
1180 </span>
1181 </span>
1182 <?php
1183 endif; ?>
1184 </span>
1185 </div>
1186
1187 <!-- OFFCANVAS -->
1188 <div <?php $this->print_render_attribute_string( 'offcanvas' ); ?>>
1189 <div class="ts-container">
1190 <div class="ts-nav-container"></div>
1191 <div class="ts-content-container">
1192 <div id="first" class="ts-content-item">
1193 <div class="usk-widget-title">
1194 <?php echo wp_kses_post( $settings['custom_widget_cart_title'] ); ?>
1195 </div>
1196 <div class="__widget_shopping_cart_content">
1197 <?php
1198 $cart_items = WC()->cart->get_cart();
1199 if ( empty( $cart_items ) ) { ?>
1200 <div class="woocommerce-mini-cart__empty-message">
1201 <?php esc_attr_e( 'No products in the cart.', 'ultimate-store-kit' ); ?>
1202 </div>
1203 <?php } else { ?>
1204 <div class="bdt-mini-cart-products woocommerce-mini-cart cart woocommerce-cart-form__contents">
1205 <?php
1206 do_action( 'woocommerce_before_mini_cart_contents' );
1207 foreach ( $cart_items as $cart_item_key => $cart_item ) {
1208 $this->ultimate_store_kit_render_mini_cart_item( $cart_item_key, $cart_item );
1209 }
1210 do_action( 'woocommerce_mini_cart_contents' );
1211 ?>
1212 </div>
1213 <div class="usk-mini-cart-content-footer">
1214 <div class="bdt-mini-cart-subtotal bdt-flex bdt-flex-between">
1215 <div>
1216 <strong><?php echo esc_html__( 'Subtotal', 'bdthemes-element-pack' ); ?>:</strong>
1217 </div>
1218 <div>
1219 <?php echo WC()->cart->get_cart_subtotal(); ?>
1220 </div>
1221 </div>
1222 <div class="bdt-mini-cart-footer-buttons">
1223 <a href="<?php echo esc_url( wc_get_cart_url() ); ?>"
1224 class="bdt-button bdt-button-view-cart bdt-size-md">
1225 <span
1226 class="bdt-button-text"><?php echo esc_html__( 'View cart', 'bdthemes-element-pack' ); ?></span>
1227 </a>
1228 <a href="<?php echo esc_url( wc_get_checkout_url() ); ?>"
1229 class="bdt-button bdt-button-checkout bdt-size-md">
1230 <span
1231 class="bdt-button-text"><?php echo esc_html__( 'Checkout', 'bdthemes-element-pack' ); ?></span>
1232 </a>
1233 </div>
1234 </div>
1235 <?php } ?>
1236 </div>
1237 </div>
1238 </div>
1239 </div>
1240 </div>
1241 </div>
1242 <?php
1243 }
1244
1245
1246
1247 function ultimate_store_kit_render_mini_cart_item( $cart_item_key, $cart_item ) {
1248 $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
1249 $is_product_visible = ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_widget_cart_item_visible', true, $cart_item, $cart_item_key ) );
1250
1251 if ( ! $is_product_visible ) {
1252 return;
1253 }
1254
1255 $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
1256 $product_price = apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key );
1257 $item_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
1258 ?>
1259 <div class="bdt-mini-cart-product-item <?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
1260
1261 <div class="bdt-mini-cart-product-thumbnail">
1262 <?php
1263 $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );
1264
1265 if ( ! $item_permalink ) {
1266 echo wp_kses_post( $thumbnail );
1267 } else {
1268 printf( '<a href="%s">%s</a>', esc_url( $item_permalink ), wp_kses_post( $thumbnail ) );
1269 }
1270 ?>
1271 </div>
1272
1273 <div class="usk-mini-cart-content-wrap">
1274 <div class="bdt-mini-cart-product-name">
1275 <?php
1276 if ( ! $item_permalink ) {
1277 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;' );
1278 } else {
1279 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $item_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );
1280 }
1281
1282 do_action( 'woocommerce_after_cart_item_name', $cart_item, $cart_item_key );
1283
1284 // Meta data.
1285 echo wp_kses_post( wc_get_formatted_cart_item_data( $cart_item ) ); // PHPCS: XSS ok.
1286 ?>
1287 </div>
1288
1289 <div class="bdt-mini-cart-product-price" data-title="<?php esc_attr_e( 'Price', 'ultimate-store-kit' ); ?>">
1290 <?php echo wp_kses_post( apply_filters( 'woocommerce_widget_cart_item_quantity', '<span class="quantity">' . sprintf( '%s &times; %s', $cart_item['quantity'], $product_price ) . '</span>', $cart_item, $cart_item_key ) ); ?>
1291 </div>
1292 </div>
1293 <div class="bdt-mini-cart-product-remove">
1294 <?php
1295 echo wp_kses_post( apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
1296 '<a href="%s" aria-label="%s" data-product_id="%s" data-cart_item_key="%s" data-product_sku="%s"><span><i class="usk-icon-close"></i></span></a>',
1297 esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
1298 esc_html__( 'Remove this item', 'ultimate-store-kit' ),
1299 esc_attr( $product_id ),
1300 esc_attr( $cart_item_key ),
1301 esc_attr( $_product->get_sku() )
1302 ), $cart_item_key ) );
1303 ?>
1304 </div>
1305 </div>
1306 <?php
1307 }
1308 }
1309