PluginProbe
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder / 3.0.7
Ultimate Store Kit – Store Builder Addons for Elementor, WooCommerce Store Builder, EDD Store Builder v3.0.7
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-single / widgets / page-single.php

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

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