PluginProbe
Ultimate Store Kit / 3.1.3
Ultimate Store Kit v3.1.3
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 2.0.6 All 92 releases
ultimate-store-kit / modules / page-single / widgets / page-single.php

page-single.php in Ultimate Store Kit 3.1.3, at modules/page-single/widgets/page-single.php

1,494 lines 55.4 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\PageSingle\Widgets;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Typography;
7 use Elementor\Group_Control_Box_Shadow;
8 use Elementor\Group_Control_Text_Shadow;
9 use Elementor\Group_Control_Border;
10 use Elementor\Group_Control_Background;
11 use Elementor\Icons_Manager;
12
13 use UltimateStoreKit\Base\Module_Base;
14
15 if (!defined('ABSPATH')) exit; // Exit if accessed directly
16
17 // 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.
18
19 // class Add_To_Cart extends Widget_Button {
20 class Page_Single extends Module_Base {
21
22 public function get_name() {
23 return 'usk-page-single';
24 }
25
26 public function get_title() {
27 return BDTUSK . esc_html__('Single Product (Page)', 'ultimate-store-kit');
28 }
29
30 public function get_icon() {
31 return 'usk-widget-icon usk-icon-page-single usk-new';
32 }
33
34 public function get_categories() {
35 return ['ultimate-store-kit-single'];
36 }
37 public function show_in_panel() {
38 return get_post_type() !== 'page';
39 }
40
41 public function get_keywords() {
42 return ['add', 'to', 'cart', 'woocommerce', 'wc', 'additional', 'info', 'single', 'product', 'page'];
43 }
44
45 public function get_style_depends() {
46 if ($this->usk_is_edit_mode()) {
47 return ['usk-all-styles'];
48 } else {
49 return ['usk-font', 'usk-page-single'];
50 }
51 }
52
53 public function has_widget_inner_wrapper(): bool {
54 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
55 }
56 protected function register_controls() {
57 $this->register_controls_title();
58 $this->register_controls_price();
59 $this->register_controls_add_to_cart();
60 $this->register_controls_tabs();
61 $this->register_controls_product_related();
62 $this->start_controls_section(
63 'section_style_badge',
64 [
65 'label' => __('Sale Badge', 'ultimate-store-kit'),
66 'tab' => Controls_Manager::TAB_STYLE,
67 ]
68 );
69 $this->add_control(
70 'sale_badge_color',
71 [
72 'label' => __('Color', 'ultimate-store-kit'),
73 'type' => Controls_Manager::COLOR,
74 'selectors' => [
75 '{{WRAPPER}} .usk-page-single span.onsale' => 'color: {{VALUE}}',
76 ],
77 ]
78 );
79 $this->add_group_control(
80 Group_Control_Background::get_type(),
81 [
82 'name' => 'sale_badge_background',
83 'label' => __('Background', 'ultimate-store-kit'),
84 'types' => ['classic', 'gradient'],
85 'selector' => '{{WRAPPER}} .usk-page-single span.onsale',
86 ]
87 );
88 $this->add_responsive_control(
89 'sale_badge_padding',
90 [
91 'label' => esc_html__('Padding', 'ultimate-store-kit'),
92 'type' => Controls_Manager::DIMENSIONS,
93 'size_units' => ['px', 'em', '%'],
94 'selectors' => [
95 '{{WRAPPER}} .usk-page-single span.onsale' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
96 ],
97 ]
98 );
99 $this->add_responsive_control(
100 'sale_badge_margin',
101 [
102 'label' => esc_html__('Margin', 'ultimate-store-kit'),
103 'type' => Controls_Manager::DIMENSIONS,
104 'size_units' => ['px', 'em', '%'],
105 'selectors' => [
106 '{{WRAPPER}} .usk-page-single span.onsale' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
107 ],
108 ]
109 );
110 $this->add_responsive_control(
111 'sale_badge_border_radius',
112 [
113 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
114 'type' => Controls_Manager::DIMENSIONS,
115 'size_units' => ['px', '%'],
116 'selectors' => [
117 '{{WRAPPER}} .usk-page-single span.onsale' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
118 ],
119 ]
120 );
121 $this->add_group_control(
122 Group_Control_Typography::get_type(),
123 [
124 'name' => 'sale_badge_typography',
125 'selector' => '{{WRAPPER}} .usk-page-single span.onsale',
126 ]
127 );
128 $this->end_controls_section();
129 }
130 protected function register_controls_title() {
131 $this->start_controls_section(
132 'section_style_title',
133 [
134 'label' => __('Product Title', 'ultimate-store-kit'),
135 'tab' => Controls_Manager::TAB_STYLE,
136 ]
137 );
138
139 $this->add_control(
140 'title_color',
141 [
142 'label' => __('Color', 'ultimate-store-kit'),
143 'type' => Controls_Manager::COLOR,
144 'selectors' => [
145 '{{WRAPPER}} .woocommerce div.product .product_title' => 'color: {{VALUE}};',
146 ],
147 ]
148 );
149
150 $this->add_group_control(
151 Group_Control_Typography::get_type(),
152 [
153 'name' => 'title_typography',
154 'selector' => '{{WRAPPER}} .woocommerce div.product .product_title',
155 ]
156 );
157
158 $this->end_controls_section();
159
160 $this->start_controls_section(
161 'section_product_gallery_style',
162 [
163 'label' => esc_html__('Product Image', 'ultimate-store-kit'),
164 'tab' => Controls_Manager::TAB_STYLE,
165 ]
166 );
167
168 $this->add_group_control(
169 Group_Control_Background::get_type(),
170 [
171 'name' => 'image_background',
172 'selector' => '.woocommerce {{WRAPPER}} .woocommerce-product-gallery__trigger + .woocommerce-product-gallery__wrapper,
173 .woocommerce {{WRAPPER}} .flex-viewport, .woocommerce {{WRAPPER}} .flex-control-thumbs img, {{WRAPPER}} .woocommerce .woocommerce-product-gallery__wrapper',
174 'separator' => 'before',
175 ]
176 );
177
178 $this->add_group_control(
179 Group_Control_Border::get_type(),
180 [
181 'name' => 'image_border',
182 'selector' => '.woocommerce {{WRAPPER}} .woocommerce-product-gallery__trigger + .woocommerce-product-gallery__wrapper,
183 .woocommerce {{WRAPPER}} .flex-viewport, .woocommerce {{WRAPPER}} .flex-control-thumbs img, {{WRAPPER}} .woocommerce .woocommerce-product-gallery__wrapper',
184
185 ]
186 );
187
188 $this->add_responsive_control(
189 'image_border_radius',
190 [
191 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
192 'type' => Controls_Manager::DIMENSIONS,
193 'size_units' => ['px', '%', 'em', 'rem', 'custom'],
194 'selectors' => [
195 '.woocommerce {{WRAPPER}} .woocommerce-product-gallery__trigger + .woocommerce-product-gallery__wrapper,
196 .woocommerce {{WRAPPER}} .flex-viewport, {{WRAPPER}} .woocommerce .woocommerce-product-gallery__wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
197 ],
198 ]
199 );
200
201 $this->add_control(
202 'spacing',
203 [
204 'label' => esc_html__('Spacing', 'ultimate-store-kit'),
205 'type' => Controls_Manager::SLIDER,
206 'size_units' => ['px', 'em', 'rem', 'custom'],
207 'selectors' => [
208 '.woocommerce {{WRAPPER}} .flex-viewport:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}}',
209 ],
210 ]
211 );
212
213 $this->add_control(
214 'heading_thumbs_style',
215 [
216 'label' => esc_html__('Thumbnails', 'ultimate-store-kit'),
217 'type' => Controls_Manager::HEADING,
218 'separator' => 'before',
219 ]
220 );
221
222 $this->add_group_control(
223 Group_Control_Border::get_type(),
224 [
225 'name' => 'thumbs_border',
226 'selector' => '.woocommerce {{WRAPPER}} .flex-control-thumbs img',
227 ]
228 );
229
230 $this->add_responsive_control(
231 'thumbs_border_radius',
232 [
233 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
234 'type' => Controls_Manager::DIMENSIONS,
235 'size_units' => ['px', '%', 'em', 'rem', 'custom'],
236 'selectors' => [
237 '.woocommerce {{WRAPPER}} .flex-control-thumbs img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
238 ],
239 ]
240 );
241
242 $this->add_control(
243 'spacing_thumbs',
244 [
245 'label' => esc_html__('Spacing', 'ultimate-store-kit'),
246 'type' => Controls_Manager::SLIDER,
247 'size_units' => ['px', 'em', 'rem', 'custom'],
248 'selectors' => [
249 '.woocommerce {{WRAPPER}} .flex-control-thumbs li' => 'padding-right: calc({{SIZE}}{{UNIT}} / 2); padding-left: calc({{SIZE}}{{UNIT}} / 2); padding-bottom: {{SIZE}}{{UNIT}}',
250 '.woocommerce {{WRAPPER}} .flex-control-thumbs' => 'margin-right: calc(-{{SIZE}}{{UNIT}} / 2); margin-left: calc(-{{SIZE}}{{UNIT}} / 2)',
251 ],
252 ]
253 );
254
255 $this->end_controls_section();
256 }
257
258 protected function register_controls_price() {
259 $this->start_controls_section(
260 'price',
261 [
262 'label' => __('Product Price', 'ultimate-store-kit'),
263 'tab' => Controls_Manager::TAB_STYLE,
264 ]
265 );
266
267 $this->add_control(
268 'regular_price_color',
269 [
270 'label' => esc_html__('Regular Color', 'ultimate-store-kit'),
271 'type' => Controls_Manager::COLOR,
272 'selectors' => [
273 '{{WRAPPER}} .woocommerce div.product p.price del, {{WRAPPER}} .woocommerce div.product span.price del' => 'color: {{VALUE}};',
274 ],
275 ]
276 );
277
278 $this->add_control(
279 'price_color',
280 [
281 'label' => esc_html__('Sale Color', 'ultimate-store-kit'),
282 'type' => Controls_Manager::COLOR,
283 'selectors' => [
284 '{{WRAPPER}} .woocommerce div.product p.price,{{WRAPPER}} .woocommerce div.product span.price' => 'color: {{VALUE}};',
285 '{{WRAPPER}} .woocommerce div.product p.price ins, {{WRAPPER}} .woocommerce div.product span.price ins' => 'color: {{VALUE}};',
286 ],
287 ]
288 );
289
290 $this->add_group_control(
291 Group_Control_Typography::get_type(),
292 [
293 'name' => 'price_typography',
294 'selector' => '{{WRAPPER}} .woocommerce div.product p.price,{{WRAPPER}} .woocommerce div.product span.price',
295 ]
296 );
297 $this->end_controls_section();
298 $this->start_controls_section(
299 'short_desc_color',
300 [
301 'label' => __('Product Description', 'ultimate-store-kit'),
302 'tab' => Controls_Manager::TAB_STYLE,
303 ]
304 );
305
306 $this->add_control(
307 'sd_color',
308 [
309 'label' => esc_html__('Color', 'ultimate-store-kit'),
310 'type' => Controls_Manager::COLOR,
311 'selectors' => [
312 '{{WRAPPER}} .woocommerce-product-details__short-description' => 'color: {{VALUE}};',
313 ],
314 ]
315 );
316
317 $this->add_group_control(
318 Group_Control_Typography::get_type(),
319 [
320 'name' => 'sd_color_typo',
321 'selector' => '{{WRAPPER}} .woocommerce-product-details__short-description',
322 ]
323 );
324
325 $this->end_controls_section();
326 }
327 protected function register_controls_add_to_cart() {
328
329 $this->start_controls_section(
330 'section_style_add_to_cart',
331 [
332 'label' => __('Add To Cart', 'ultimate-store-kit'),
333 'tab' => Controls_Manager::TAB_STYLE,
334 ]
335 );
336
337 $this->start_controls_tabs('tabs_add_to_cart_style');
338
339 $this->start_controls_tab(
340 'tab_add_to_cart_normal',
341 [
342 'label' => __('Normal', 'ultimate-store-kit'),
343 ]
344 );
345
346 $this->add_control(
347 'add_to_cart_text_color',
348 [
349 'label' => __('Color', 'ultimate-store-kit'),
350 'type' => Controls_Manager::COLOR,
351 'default' => '#fff',
352 'selectors' => [
353 '{{WRAPPER}} .woocommerce div.product form.cart .button' => 'color: {{VALUE}}; cursor:pointer;'
354 ],
355 ]
356 );
357
358 $this->add_group_control(
359 Group_Control_Background::get_type(),
360 [
361 'name' => 'add_to_cart_background',
362 'label' => __('Background', 'ultimate-store-kit'),
363 'types' => [
364 'classic', 'gradient'
365 ],
366 'exclude' => ['image'],
367 'fields_options' => [
368 'background' => [
369 'default' => 'classic',
370 ],
371 'color' => [
372 'default' => '#1E87F0',
373 ],
374 ],
375 'selector' => '{{WRAPPER}} .woocommerce div.product form.cart .button',
376 ]
377 );
378
379 $this->add_group_control(
380 Group_Control_Border::get_type(),
381 [
382 'name' => 'add_to_cart_border',
383 'label' => __('Border', 'ultimate-store-kit'),
384 'fields_options' => [
385 'border' => [
386 'default' => 'solid',
387 ],
388 'width' => [
389 'default' => [
390 'top' => '0',
391 'right' => '0',
392 'bottom' => '0',
393 'left' => '0',
394 'isLinked' => false,
395 ],
396 ],
397 // 'color' => [
398 // 'default' => '#8D99AE',
399 // ],
400 ],
401 'selector' => '{{WRAPPER}} .woocommerce div.product form.cart .button',
402 'separator' => 'before',
403 ]
404 );
405
406 $this->add_responsive_control(
407 'add_to_cart_border_radius',
408 [
409 'label' => __('Border Radius', 'ultimate-store-kit'),
410 'type' => Controls_Manager::DIMENSIONS,
411 'size_units' => ['px', '%'],
412 'selectors' => [
413 '{{WRAPPER}} .woocommerce div.product form.cart .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
414 ],
415 ]
416 );
417
418 $this->add_responsive_control(
419 'add_to_cart_padding',
420 [
421 'label' => __('Padding', 'ultimate-store-kit'),
422 'type' => Controls_Manager::DIMENSIONS,
423 'size_units' => ['px', 'em', '%'],
424 'selectors' => [
425 '{{WRAPPER}} .woocommerce div.product form.cart .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
426 ],
427 ]
428 );
429 $this->add_responsive_control(
430 'add_to_cart_size',
431 [
432 'label' => __('Size', 'ultimate-store-kit'),
433 'type' => Controls_Manager::SLIDER,
434 'size_units' => ['px'],
435 'selectors' => [
436 '{{WRAPPER}} .woocommerce div.product form.cart .button' => 'height: {{SIZE}}{{UNIT}};',
437 ],
438 ]
439 );
440
441 $this->add_group_control(
442 Group_Control_Typography::get_type(),
443 [
444 'name' => 'add_to_cart_typography',
445 'selector' => '{{WRAPPER}} .woocommerce div.product form.cart .button',
446 ]
447 );
448
449 $this->add_group_control(
450 Group_Control_Box_Shadow::get_type(),
451 [
452 'name' => 'add_to_cart_box_shadow',
453 'selector' => '{{WRAPPER}} .woocommerce div.product form.cart .button',
454 ]
455 );
456
457 $this->end_controls_tab();
458
459 $this->start_controls_tab(
460 'tab_add_to_cart_hover',
461 [
462 'label' => __('Hover', 'ultimate-store-kit'),
463 ]
464 );
465
466 $this->add_control(
467 'add_to_cart_hover_color',
468 [
469 'label' => __('Color', 'ultimate-store-kit'),
470 'type' => Controls_Manager::COLOR,
471 'selectors' => [
472 '{{WRAPPER}} .woocommerce div.product form.cart .button:hover, {{WRAPPER}} .woocommerce div.product form.cart .button:focus' => 'color: {{VALUE}};',
473 ],
474 ]
475 );
476
477 $this->add_control(
478 'add_to_cart_hover_border_color',
479 [
480 'label' => __('Border Color', 'ultimate-store-kit'),
481 'type' => Controls_Manager::COLOR,
482 'condition' => [
483 'add_to_cart_border_border!' => '',
484 ],
485 'selectors' => [
486 '{{WRAPPER}} .woocommerce div.product form.cart .button:hover, {{WRAPPER}} .woocommerce div.product form.cart .button:focus' => 'border-color: {{VALUE}};',
487 ],
488 ]
489 );
490
491 $this->add_group_control(
492 Group_Control_Background::get_type(),
493 [
494 'name' => 'add_to_cart_hover_background',
495 'label' => __('Background', 'ultimate-store-kit'),
496 'exclude' => ['image'],
497 'selector' => '{{WRAPPER}} .woocommerce div.product form.cart .button:hover, {{WRAPPER}} .elementor-button:focus',
498 ]
499 );
500
501 $this->end_controls_tab();
502 $this->end_controls_tabs();
503 $this->end_controls_section();
504
505 $this->start_controls_section(
506 'qty_style',
507 [
508 'label' => __('Quantity Field', 'ultimate-store-kit'),
509 'tab' => Controls_Manager::TAB_STYLE,
510 ]
511 );
512
513 $this->add_control(
514 'qty_fields_width',
515 [
516 'label' => esc_html__('Width', 'ultimate-store-kit'),
517 'type' => Controls_Manager::SLIDER,
518 'size_units' => ['px', 'em', '%'],
519 'range' => [
520 'px' => [
521 'min' => 0,
522 'max' => 500,
523 ],
524 '%' => [
525 'min' => 0,
526 'max' => 100,
527 ],
528 'em' => [
529 'min' => 0,
530 'max' => 20,
531 ],
532 ],
533 'selectors' => [
534 '{{WRAPPER}} .usk-page-single .woocommerce .quantity .qty' => 'width: {{SIZE}}{{UNIT}};',
535 ],
536 ]
537 );
538
539 $this->add_control(
540 'qty_fields_color',
541 [
542 'label' => __('Color', 'ultimate-store-kit'),
543 'type' => Controls_Manager::COLOR,
544 'selectors' => [
545 '{{WRAPPER}} .quantity input[type=number]' => 'color: {{VALUE}} ',
546 '{{WRAPPER}} .quantity input[type=number]::placeholder' => 'color: {{VALUE}} ',
547 ],
548 'separator' => 'before',
549 ]
550 );
551
552 $this->add_group_control(
553 Group_Control_Background::get_type(),
554 [
555 'name' => 'qty_fields_background',
556 'exclude' => ['image'],
557 'selector' => '{{WRAPPER}} .quantity input[type=number]',
558 ]
559 );
560
561 $this->add_group_control(
562 Group_Control_Border::get_type(),
563 [
564 'name' => 'qty_fields_border',
565 'label' => __(
566 'Border',
567 'ultimate-store-kit'
568 ),
569 'fields_options' => [
570 'border' => [
571 'default' => 'solid',
572 ],
573 'width' => [
574 'default' => [
575 'top' => '1',
576 'right' => '1',
577 'bottom' => '1',
578 'left' => '1',
579 'isLinked' => false,
580 ],
581 ],
582 'color' => [
583 'default' => '#a4afb7',
584 ],
585 ],
586 'selector' => '{{WRAPPER}} .quantity input[type=number]',
587 'separator' => 'before',
588 ]
589 );
590
591 $this->add_responsive_control(
592 'qty_fields_border_radius',
593 [
594 'label' => esc_html__('Border Radius', 'ultimate-store-kit'),
595 'type' => Controls_Manager::DIMENSIONS,
596 'size_units' => ['px', '%'],
597 'default' => [
598 'top' => '3',
599 'right' => '3',
600 'bottom' => '3',
601 'left' => '3',
602 'isLinked' => false
603 ],
604 'selectors' => [
605 '{{WRAPPER}} .quantity input[type=number]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
606 ],
607 ]
608 );
609
610 $this->add_control(
611 'qty_fields_padding',
612 [
613 'label' => __('Padding', 'ultimate-store-kit'),
614 'type' => Controls_Manager::DIMENSIONS,
615 'selectors' => [
616 '{{WRAPPER}} .quantity input[type=number]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
617 ],
618 ]
619 );
620
621 $this->add_responsive_control(
622 'qty_fields_margin',
623 [
624 'label' => __('Margin', 'ultimate-store-kit'),
625 'type' => Controls_Manager::DIMENSIONS,
626 'selectors' => [
627 '{{WRAPPER}} .quantity input[type=number]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} ;',
628 ],
629 ]
630 );
631
632 $this->add_group_control(
633 Group_Control_Typography::get_type(),
634 [
635 'name' => 'qty_fields_typography',
636 'selector' => '{{WRAPPER}} .quantity input[type=number]',
637 ]
638 );
639
640
641 $this->add_group_control(
642 Group_Control_Box_Shadow::get_type(),
643 [
644 'name' => 'qty_fields_shadow',
645 'selector' => '{{WRAPPER}} .quantity input[type=number]'
646 ]
647 );
648 $this->end_controls_section();
649 }
650
651 protected function register_controls_tabs() {
652
653 $this->start_controls_section(
654 'tabs_nav_item_style_section',
655 [
656 'label' => __('Tabs Item', 'ultimate-store-kit'),
657 'tab' => Controls_Manager::TAB_STYLE,
658 ]
659 );
660
661
662 $this->add_responsive_control(
663 'tabs_nav_item_padding',
664 [
665 'label' => esc_html__(
666 'Padding',
667 'ultimate-store-kit'
668 ),
669 'type' => Controls_Manager::DIMENSIONS,
670 'size_units' => ['px', 'em', '%'],
671 'selectors' => [
672 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
673 ],
674 ]
675 );
676
677 $this->add_responsive_control(
678 'tabs_nav_item_margin',
679 [
680 'label' => esc_html__('Margin', 'ultimate-store-kit'),
681 'type' => Controls_Manager::DIMENSIONS,
682 'size_units' => ['px', 'em', '%'],
683 'selectors' => [
684 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
685 ],
686 ]
687 );
688
689
690 $this->add_group_control(
691 Group_Control_Typography::get_type(),
692 [
693 'name' => 'tabs_nav_item_typography',
694 'selector' => '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li',
695 ]
696 );
697
698 $this->add_group_control(
699 Group_Control_Border::get_type(),
700 [
701 'name' => 'tabs_nav_item_border',
702 'selector' => '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a',
703 ]
704 );
705
706
707 $this->add_responsive_control(
708 'tabs_nav_item_border_radius',
709 [
710 'label' => __('Border Radius', 'ultimate-store-kit'),
711 'type' => Controls_Manager::DIMENSIONS,
712 'size_units' => ['px', '%'],
713 'selectors' => [
714 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
715 ],
716 ]
717 );
718
719 $this->start_controls_tabs('tabs_tabs_nav');
720
721 $this->start_controls_tab(
722 'tabs_nav_item_normal',
723 [
724 'label' => __('Normal', 'ultimate-store-kit'),
725 ]
726 );
727
728 $this->add_control(
729 'tabs_nav_item_color',
730 [
731 'label' => esc_html__('Color', 'ultimate-store-kit'),
732 'type' => Controls_Manager::COLOR,
733 'selectors' => [
734 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a' => 'color: {{VALUE}};',
735 ],
736 ]
737 );
738
739 $this->add_group_control(
740 Group_Control_Background::get_type(),
741 [
742 'name' => 'tabs_nav_item_bg',
743 'types' => ['classic', 'gradient'],
744 'selector' => '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a',
745 ]
746 );
747
748
749
750 $this->end_controls_tab();
751
752 $this->start_controls_tab(
753 'tabs_nav_item_hover',
754 [
755 'label' => __('Hover', 'ultimate-store-kit'),
756 ]
757 );
758
759 $this->add_control(
760 'tabs_nav_item_color_hover',
761 [
762 'label' => esc_html__('Color', 'ultimate-store-kit'),
763 'type' => Controls_Manager::COLOR,
764 'selectors' => [
765 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a:hover' => 'color: {{VALUE}};',
766 ],
767 ]
768 );
769
770 $this->add_group_control(
771 Group_Control_Background::get_type(),
772 [
773 'name' => 'tabs_nav_item_bg_hover',
774 'types' => ['classic', 'gradient'],
775 'selector' => '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a:hover',
776 ]
777 );
778
779 $this->add_control(
780 'tabs_nav_item_border_color_hover',
781 [
782 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
783 'type' => Controls_Manager::COLOR,
784 'condition' => [
785 'tabs_nav_item_border_border!' => '',
786 ],
787 'selectors' => [
788 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a:hover' => 'border-color: {{VALUE}};',
789 ],
790 ]
791 );
792
793
794 $this->end_controls_tab();
795
796 $this->start_controls_tab(
797 'tabs_nav_active',
798 [
799 'label' => __('Active', 'ultimate-store-kit'),
800 ]
801 );
802
803 $this->add_control(
804 'tabs_nav_color_active',
805 [
806 'label' => esc_html__('Color', 'ultimate-store-kit'),
807 'type' => Controls_Manager::COLOR,
808 'selectors' => [
809 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li.active a' => 'color: {{VALUE}};',
810 ],
811 ]
812 );
813
814 $this->add_group_control(
815 Group_Control_Background::get_type(),
816 [
817 'name' => 'tabs_nav_bg_active',
818 'types' => ['classic', 'gradient'],
819 'selector' => '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li.active a',
820 ]
821 );
822
823 $this->add_control(
824 'tabs_nav_item_border_color_active',
825 [
826 'label' => esc_html__('Border Color', 'ultimate-store-kit'),
827 'type' => Controls_Manager::COLOR,
828 'condition' => [
829 'tabs_nav_item_border_border!' => '',
830 ],
831 'selectors' => [
832 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li.active a' => 'border-color: {{VALUE}};',
833 ],
834 ]
835 );
836
837 $this->add_control(
838 'tabs_nav_active_line_color',
839 [
840 'label' => __('Active Line Color', 'ultimate-store-kit') . BDTUSK_NC,
841 'type' => Controls_Manager::COLOR,
842 'selectors' => [
843 '{{WRAPPER}} .woocommerce div.product .woocommerce-tabs ul.tabs li a::after' => 'background-color: {{VALUE}};',
844 ],
845 ]
846 );
847
848
849 $this->end_controls_tab();
850
851 $this->end_controls_tabs();
852
853 $this->end_controls_section();
854
855 $this->start_controls_section(
856 'tabs_content',
857 [
858 'label' => __('Tabs Content', 'ultimate-store-kit'),
859 'tab' => Controls_Manager::TAB_STYLE,
860 ]
861 );
862
863 $this->add_control(
864 'tabs_content_color',
865 [
866 'label' => __('Color', 'ultimate-store-kit'),
867 'type' => Controls_Manager::COLOR,
868 'selectors' => [
869 '{{WRAPPER}} .usk-page-single .woocommerce-tabs .wc-tab' => 'color: {{VALUE}}',
870 ],
871 ]
872 );
873 $this->add_group_control(
874 Group_Control_Background::get_type(),
875 [
876 'name' => 'tabs_content_bg',
877 'types' => ['classic', 'gradient'],
878 'selector' => '{{WRAPPER}} .usk-page-single .woocommerce-tabs .wc-tab',
879 ]
880 );
881
882 $this->add_responsive_control(
883 'tabs_content_padding',
884 [
885 'label' => esc_html__('Padding', 'ultimate-store-kit'),
886 'type' => Controls_Manager::DIMENSIONS,
887 'size_units' => ['px', 'em', '%'],
888 'selectors' => [
889 '{{WRAPPER}} .usk-page-single .woocommerce-tabs .wc-tab' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
890 ],
891 ]
892 );
893
894 $this->add_responsive_control(
895 'tabs_content_border_radius',
896 [
897 'label' => __('Border Radius', 'ultimate-store-kit'),
898 'type' => Controls_Manager::DIMENSIONS,
899 'size_units' => ['px', '%'],
900 'selectors' => [
901 '{{WRAPPER}} .usk-page-single .woocommerce-tabs .wc-tab' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;',
902 ],
903 ]
904 );
905
906 $this->add_group_control(
907 Group_Control_Border::get_type(),
908 [
909 'name' => 'tabs_content_border',
910 'selector' => '{{WRAPPER}} .usk-page-single .woocommerce-tabs .wc-tab',
911 ]
912 );
913
914 $this->add_group_control(
915 Group_Control_Typography::get_type(),
916 [
917 'name' => 'tabs_content_typography',
918 'selector' => '{{WRAPPER}} .usk-page-single .woocommerce-tabs .wc-tab',
919 ]
920 );
921
922 $this->end_controls_section();
923 }
924 protected function register_controls_product_related() {
925
926 $this->start_controls_section(
927 'section_style_product_related',
928 [
929 'label' => __('Related Product', 'ultimate-store-kit'),
930 'tab' => Controls_Manager::TAB_STYLE,
931 ]
932 );
933 $this->start_controls_tabs(
934 'tabs_product_related'
935 );
936 $this->start_controls_tab(
937 'tab_product_related_heading',
938 [
939 'label' => __('Heading', 'ultimate-store-kit'),
940 ]
941 );
942 $this->add_control(
943 'related_heading_color',
944 [
945 'label' => __( 'Color', 'ultimate-store-kit' ),
946 'type' => Controls_Manager::COLOR,
947 'selectors' => [
948 '{{WRAPPER}} .usk-page-single .related.products > h2' => 'color: {{VALUE}};',
949 ],
950 ]
951 );
952
953 $this->add_group_control(
954 Group_Control_Typography::get_type(),
955 [
956 'name' => 'related_heading_typography',
957 'selector' => '{{WRAPPER}} .usk-page-single .related.products > h2',
958 ]
959 );
960
961 $this->add_responsive_control(
962 'related_heading_margin',
963 [
964 'label' => __('Margin', 'ultimate-store-kit'),
965 'type' => Controls_Manager::DIMENSIONS,
966 'size_units' => [
967 'px', 'em', '%'
968 ],
969 'selectors' => [
970 '{{WRAPPER}} .usk-product-related .related.products > h2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
971 ],
972 ]
973 );
974 $this->end_controls_tab();
975 $this->start_controls_tab(
976 'tab_product_related_title',
977 [
978 'label' => __('Title', 'ultimate-store-kit'),
979 ]
980 );
981
982 $this->add_control(
983 'related_title_color',
984 [
985 'label' => __('Color', 'ultimate-store-kit'),
986 'type' => Controls_Manager::COLOR,
987 'selectors' => [
988 '{{WRAPPER}} .woocommerce ul.products li.product .woocommerce-loop-product__title' => 'color: {{VALUE}};',
989 ],
990 ]
991 );
992 $this->add_group_control(
993 Group_Control_Typography::get_type(),
994 [
995 'name' => 'related_title_typography',
996 'selector' => '{{WRAPPER}} .woocommerce ul.products li.product .woocommerce-loop-product__title',
997 ]
998 );
999 $this->end_controls_tab();
1000 $this->start_controls_tab(
1001 'tab_product_related_price',
1002 [
1003 'label' => __('Price', 'ultimate-store-kit'),
1004 ]
1005 );
1006 $this->add_control(
1007 'related_price_color',
1008 [
1009 'label' => esc_html__('Color', 'ultimate-store-kit'),
1010 'type' => Controls_Manager::COLOR,
1011 'selectors' => [
1012 '{{WRAPPER}} .woocommerce ul.products li.product .price' => 'color: {{VALUE}};',
1013 ],
1014 ]
1015 );
1016
1017 $this->add_group_control(
1018 Group_Control_Typography::get_type(),
1019 [
1020 'name' => 'related_price_typography',
1021 'selector' => '{{WRAPPER}} .woocommerce ul.products li.product .price',
1022 ]
1023 );
1024 $this->end_controls_tab();
1025 $this->start_controls_tab(
1026 'tab_product_related_cart',
1027 [
1028 'label' => __('Cart', 'ultimate-store-kit'),
1029 ]
1030 );
1031 $this->add_control(
1032 'related_cart_color',
1033 [
1034 'label' => esc_html__('Color', 'ultimate-store-kit'),
1035 'type' => Controls_Manager::COLOR,
1036 'selectors' => [
1037 '{{WRAPPER}} .woocommerce ul.products li.product a.button' => 'color: {{VALUE}};',
1038 ],
1039 ]
1040 );
1041 $this->add_control(
1042 'related_cart_background_color',
1043 [
1044 'label' => esc_html__('Background', 'ultimate-store-kit'),
1045 'type' => Controls_Manager::COLOR,
1046 'selectors' => [
1047 '{{WRAPPER}} .woocommerce ul.products li.product a.button' => 'background-color: {{VALUE}};',
1048 ],
1049 ]
1050 );
1051 $this->add_responsive_control(
1052 'related_cart_padding',
1053 [
1054 'label' => __( 'Padding', 'ultimate-store-kit' ),
1055 'type' => Controls_Manager::DIMENSIONS,
1056 'size_units' => ['px', '%', 'em'],
1057 'selectors' => [
1058 '{{WRAPPER}} .woocommerce ul.products li.product a.button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1059 ],
1060 ]
1061 );
1062 $this->add_group_control(
1063 Group_Control_Typography::get_type(),
1064 [
1065 'name' => 'related_cart_typography',
1066 'label' => __( 'Typography', 'ultimate-store-kit' ),
1067 'selector' => '{{WRAPPER}} .woocommerce ul.products li.product a.button',
1068 ]
1069 );
1070
1071 $this->end_controls_tab();
1072 $this->end_controls_tabs();
1073 $this->end_controls_section();
1074
1075 /**
1076 * Variation Swatches
1077 */
1078 $this->start_controls_section(
1079 'section_variation_swatches',
1080 [
1081 'label' => __('Variation Swatches', 'ultimate-store-kit'),
1082 'tab' => Controls_Manager::TAB_STYLE,
1083 ]
1084 );
1085 $this->add_control(
1086 'variation_label_color',
1087 [
1088 'label' => __('Label Color', 'ultimate-store-kit'),
1089 'type' => Controls_Manager::COLOR,
1090 'selectors' => [
1091 '{{WRAPPER}} .usk-page-single .variations label' => 'color: {{VALUE}};',
1092 ],
1093 ]
1094 );
1095 $this->add_responsive_control(
1096 'variation_label_spacing',
1097 [
1098 'label' => __('Right Spacing', 'ultimate-store-kit'),
1099 'type' => Controls_Manager::SLIDER,
1100 'selectors' => [
1101 '{{WRAPPER}} .usk-page-single form.cart table.variations td' => 'padding-left: {{SIZE}}{{UNIT}} !important;',
1102 ],
1103 ]
1104 );
1105 $this->add_group_control(
1106 Group_Control_Typography::get_type(),
1107 [
1108 'name' => 'variation_label_typography',
1109 'label' => __('Label Typography', 'ultimate-store-kit'),
1110 'selector' => '{{WRAPPER}} .usk-page-single .variations label',
1111 ]
1112 );
1113 $this->start_controls_tabs('variation_tabs');
1114 $this->start_controls_tab(
1115 'variation_tab_normal',
1116 [
1117 'label' => __('Normal', 'ultimate-store-kit'),
1118 ]
1119 );
1120 $this->add_control(
1121 'variation_color',
1122 [
1123 'label' => __('Text Color', 'ultimate-store-kit'),
1124 'type' => Controls_Manager::COLOR,
1125 'selectors' => [
1126 '{{WRAPPER}} .usk-page-single .variations select' => 'color: {{VALUE}};',
1127 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item' => 'color: {{VALUE}};',
1128 ],
1129 ]
1130 );
1131 $this->add_group_control(
1132 Group_Control_Background::get_type(),
1133 [
1134 'name' => 'variation_background',
1135 'types' => ['classic', 'gradient'],
1136 'selector' => '{{WRAPPER}} .usk-page-single .variations select, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item',
1137 'exclude' => ['image'],
1138 ]
1139 );
1140 $this->add_group_control(
1141 Group_Control_Border::get_type(),
1142 [
1143 'name' => 'variation_border',
1144 'selector' => '{{WRAPPER}} .usk-page-single .variations select, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item',
1145 'separator' => 'before',
1146 ]
1147 );
1148 $this->add_responsive_control(
1149 'variation_border_radius',
1150 [
1151 'label' => __('Border Radius', 'ultimate-store-kit'),
1152 'type' => Controls_Manager::DIMENSIONS,
1153 'size_units' => ['px', '%'],
1154 'selectors' => [
1155 '{{WRAPPER}} .usk-page-single .variations select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1156 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1157 ],
1158 ]
1159 );
1160 $this->add_responsive_control(
1161 'variation_padding',
1162 [
1163 'label' => __('Padding', 'ultimate-store-kit'),
1164 'type' => Controls_Manager::DIMENSIONS,
1165 'size_units' => ['px', 'em', '%'],
1166 'selectors' => [
1167 '{{WRAPPER}} .usk-page-single .variations select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1168 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1169 ],
1170 ]
1171 );
1172 $this->add_responsive_control(
1173 'variation_gap',
1174 [
1175 'label' => __('Gap', 'ultimate-store-kit'),
1176 'type' => Controls_Manager::SLIDER,
1177 'size_units' => ['px'],
1178 'range' => [
1179 'px' => [
1180 'min' => 0,
1181 'max' => 50,
1182 'step' => 1,
1183 ],
1184 ],
1185 'selectors' => [
1186 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__wrapper' => 'gap: {{SIZE}}{{UNIT}};',
1187 ],
1188 ]
1189 );
1190 $this->add_group_control(
1191 Group_Control_Box_Shadow::get_type(),
1192 [
1193 'name' => 'variation_box_shadow',
1194 'selector' => '{{WRAPPER}} .usk-page-single .variations select, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item',
1195 ]
1196 );
1197 $this->add_group_control(
1198 Group_Control_Typography::get_type(),
1199 [
1200 'name' => 'variation_typography',
1201 'selector' => '{{WRAPPER}} .usk-page-single .variations select, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item',
1202 ]
1203 );
1204
1205 $this->add_control(
1206 'variation_reset_color',
1207 [
1208 'label' => __('Reset Text Color', 'ultimate-store-kit'),
1209 'type' => Controls_Manager::COLOR,
1210 'selectors' => [
1211 '{{WRAPPER}} .usk-page-single .variations .reset_variations' => 'color: {{VALUE}};',
1212 ],
1213 'separator' => 'before',
1214 ]
1215 );
1216 $this->add_responsive_control(
1217 'variation_reset_gap',
1218 [
1219 'label' => __('Left Spacing', 'ultimate-store-kit'),
1220 'type' => Controls_Manager::SLIDER,
1221 'size_units' => ['px'],
1222 'range' => [
1223 'px' => [
1224 'min' => 40,
1225 'max' => 100,
1226 'step' => 1,
1227 ],
1228 ],
1229 'selectors' => [
1230 '{{WRAPPER}} .usk-page-single .variations .reset_variations' => 'right: -{{SIZE}}{{UNIT}};',
1231 ],
1232 ]
1233 );
1234 $this->add_group_control(
1235 Group_Control_Typography::get_type(),
1236 [
1237 'name' => 'variation_reset_typography',
1238 'label' => __('Reset Typography', 'ultimate-store-kit'),
1239 'selector' => '{{WRAPPER}} .usk-page-single .variations .reset_variations',
1240 ]
1241 );
1242 $this->end_controls_tab();
1243 $this->start_controls_tab(
1244 'variation_tab_hover',
1245 [
1246 'label' => __('Hover', 'ultimate-store-kit'),
1247 ]
1248 );
1249 $this->add_control(
1250 'variation_color_hover',
1251 [
1252 'label' => __('Text Color', 'ultimate-store-kit'),
1253 'type' => Controls_Manager::COLOR,
1254 'selectors' => [
1255 '{{WRAPPER}} .usk-page-single .variations select:hover' => 'color: {{VALUE}};',
1256 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item:hover' => 'color: {{VALUE}};',
1257 ],
1258 ]
1259 );
1260 $this->add_group_control(
1261 Group_Control_Background::get_type(),
1262 [
1263 'name' => 'variation_background_hover',
1264 'types' => ['classic', 'gradient'],
1265 'selector' => '{{WRAPPER}} .usk-page-single .variations select:hover, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item:hover',
1266 'exclude' => ['image'],
1267 ]
1268 );
1269 $this->add_control(
1270 'variation_border_color_hover',
1271 [
1272 'label' => __('Border Color', 'ultimate-store-kit'),
1273 'type' => Controls_Manager::COLOR,
1274 'selectors' => [
1275 '{{WRAPPER}} .usk-page-single .variations select:hover' => 'border-color: {{VALUE}};',
1276 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item:hover' => 'border-color: {{VALUE}};',
1277 ],
1278 'condition' => [
1279 'variation_border_border!' => '',
1280 ],
1281 'separator' => 'before',
1282 ]
1283 );
1284 $this->add_group_control(
1285 Group_Control_Box_Shadow::get_type(),
1286 [
1287 'name' => 'variation_box_shadow_hover',
1288 'selector' => '{{WRAPPER}} .usk-page-single .variations select:hover, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item:hover',
1289 ]
1290 );
1291 $this->end_controls_tab();
1292 $this->start_controls_tab(
1293 'variation_tab_active',
1294 [
1295 'label' => __('Active', 'ultimate-store-kit'),
1296 ]
1297 );
1298 $this->add_control(
1299 'variation_color_active',
1300 [
1301 'label' => __('Text Color', 'ultimate-store-kit'),
1302 'type' => Controls_Manager::COLOR,
1303 'selectors' => [
1304 '{{WRAPPER}} .usk-page-single .variations select:focus' => 'color: {{VALUE}};',
1305 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item.selected' => 'color: {{VALUE}};',
1306 ],
1307 ]
1308 );
1309 $this->add_group_control(
1310 Group_Control_Background::get_type(),
1311 [
1312 'name' => 'variation_background_active',
1313 'types' => ['classic', 'gradient'],
1314 'selector' => '{{WRAPPER}} .usk-page-single .variations select:focus, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item.selected',
1315 'exclude' => ['image'],
1316 ]
1317 );
1318 $this->add_control(
1319 'variation_border_color_active',
1320 [
1321 'label' => __('Border Color', 'ultimate-store-kit'),
1322 'type' => Controls_Manager::COLOR,
1323 'selectors' => [
1324 '{{WRAPPER}} .usk-page-single .variations select:focus' => 'border-color: {{VALUE}};',
1325 '{{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item.selected' => 'border-color: {{VALUE}};',
1326 ],
1327 'condition' => [
1328 'variation_border_border!' => '',
1329 ],
1330 'separator' => 'before',
1331 ]
1332 );
1333 $this->add_group_control(
1334 Group_Control_Box_Shadow::get_type(),
1335 [
1336 'name' => 'variation_box_shadow_active',
1337 'selector' => '{{WRAPPER}} .usk-page-single .variations select:focus, {{WRAPPER}} .usk-page-single .variations .usk-variation-swatches__item.selected',
1338 ]
1339 );
1340 $this->end_controls_tab();
1341 $this->end_controls_tabs();
1342 $this->end_controls_section();
1343
1344 /**
1345 * Quantity Plus Minus
1346 */
1347 $this->start_controls_section(
1348 'section_quantity_plus_minus',
1349 [
1350 'label' => __('Quantity Plus Minus', 'ultimate-store-kit'),
1351 'tab' => Controls_Manager::TAB_STYLE,
1352 ]
1353 );
1354 $this->start_controls_tabs('quantity_plus_minus_tabs');
1355 $this->start_controls_tab(
1356 'quantity_plus_minus_normal_tab',
1357 [
1358 'label' => __('Normal', 'ultimate-store-kit'),
1359 ]
1360 );
1361 $this->add_control(
1362 'quantity_plus_minus_color',
1363 [
1364 'label' => __('Color', 'ultimate-store-kit'),
1365 'type' => Controls_Manager::COLOR,
1366 'selectors' => [
1367 '{{WRAPPER}} .usk-page-single .quantity button' => 'color: {{VALUE}};',
1368 ],
1369 ]
1370 );
1371 $this->add_group_control(
1372 Group_Control_Background::get_type(),
1373 [
1374 'name' => 'quantity_plus_minus_background',
1375 'types' => ['classic', 'gradient'],
1376 'selector' => '{{WRAPPER}} .usk-page-single .quantity button',
1377 'exclude' => ['image'],
1378 ]
1379 );
1380 $this->add_group_control(
1381 Group_Control_Border::get_type(),
1382 [
1383 'name' => 'quantity_plus_minus_border',
1384 'selector' => '{{WRAPPER}} .usk-page-single .quantity button',
1385 'separator' => 'before',
1386 ]
1387 );
1388 $this->add_responsive_control(
1389 'quantity_plus_minus_border_radius',
1390 [
1391 'label' => __('Border Radius', 'ultimate-store-kit'),
1392 'type' => Controls_Manager::DIMENSIONS,
1393 'size_units' => ['px', '%'],
1394 'selectors' => [
1395 '{{WRAPPER}} .usk-page-single .quantity button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1396 ],
1397 ]
1398 );
1399 $this->add_responsive_control(
1400 'quantity_plus_minus_padding',
1401 [
1402 'label' => __('Padding', 'ultimate-store-kit'),
1403 'type' => Controls_Manager::DIMENSIONS,
1404 'size_units' => ['px', 'em', '%'],
1405 'selectors' => [
1406 '{{WRAPPER}} .usk-page-single .quantity button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1407 ],
1408 ]
1409 );
1410 $this->add_group_control(
1411 Group_Control_Box_Shadow::get_type(),
1412 [
1413 'name' => 'quantity_plus_minus_box_shadow',
1414 'selector' => '{{WRAPPER}} .usk-page-single .quantity button',
1415 ]
1416 );
1417 $this->add_responsive_control(
1418 'quantity_plus_minus_icon_size',
1419 [
1420 'label' => __('Icon Size', 'ultimate-store-kit'),
1421 'type' => Controls_Manager::SLIDER,
1422 'size_units' => ['px'],
1423 'selectors' => [
1424 '{{WRAPPER}} .usk-page-single .quantity button' => 'font-size: {{SIZE}}{{UNIT}};',
1425 ],
1426 ]
1427 );
1428 $this->end_controls_tab();
1429 $this->start_controls_tab(
1430 'quantity_plus_minus_hover_tab',
1431 [
1432 'label' => __('Hover', 'ultimate-store-kit'),
1433 ]
1434 );
1435 $this->add_control(
1436 'quantity_plus_minus_hover_color',
1437 [
1438 'label' => __('Color', 'ultimate-store-kit'),
1439 'type' => Controls_Manager::COLOR,
1440 'selectors' => [
1441 '{{WRAPPER}} .usk-page-single .quantity button:hover' => 'color: {{VALUE}};',
1442 ],
1443 ]
1444 );
1445 $this->add_group_control(
1446 Group_Control_Background::get_type(),
1447 [
1448 'name' => 'quantity_plus_minus_hover_background',
1449 'types' => ['classic', 'gradient'],
1450 'selector' => '{{WRAPPER}} .usk-page-single .quantity button:hover',
1451 'exclude' => ['image'],
1452 ]
1453 );
1454 $this->add_control(
1455 'quantity_plus_minus_hover_border_color',
1456 [
1457 'label' => __('Border Color', 'ultimate-store-kit'),
1458 'type' => Controls_Manager::COLOR,
1459 'selectors' => [
1460 '{{WRAPPER}} .usk-page-single .quantity button:hover' => 'border-color: {{VALUE}};',
1461 ],
1462 'condition' => [
1463 'quantity_plus_minus_border_border!' => '',
1464 ],
1465 'separator' => 'before',
1466 ]
1467 );
1468 $this->add_group_control(
1469 Group_Control_Box_Shadow::get_type(),
1470 [
1471 'name' => 'quantity_plus_minus_hover_box_shadow',
1472 'selector' => '{{WRAPPER}} .usk-page-single .quantity button:hover',
1473 ]
1474 );
1475 $this->end_controls_tab();
1476 $this->end_controls_tabs();
1477 $this->end_controls_section();
1478 }
1479
1480 public function render() {
1481 $product_id = '';
1482 $product = wc_get_product(get_the_ID());
1483 if ($product) {
1484 $product_id = $product->get_id();
1485 }
1486 ?>
1487 <div class="usk-page-single">
1488 <?php ultimate_store_kit_setup_quantity_buttons(); // this is for quantity plus minus button ?>
1489 <?php echo do_shortcode('[product_page id="' . $product_id . '"]'); ?>
1490 </div>
1491 <?php
1492 }
1493 }
1494