PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.49
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.49
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / widgets / WooCommerce_Grid / WooCommerce_Grid.php

WooCommerce_Grid.php in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.49, at includes/widgets/WooCommerce_Grid/WooCommerce_Grid.php

9,942 lines 381.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace King_Addons;
4
5 use Elementor\Embed;
6 use Elementor\Icons_Manager;
7 use Elementor\Plugin;
8 use Elementor\Widget_Base;
9 use Elementor\Controls_Manager;
10 use Elementor\Group_Control_Box_Shadow;
11 use Elementor\Group_Control_Text_Shadow;
12 use Elementor\Group_Control_Typography;
13 use Elementor\Repeater;
14 use Elementor\Group_Control_Image_Size;
15 use WP_Query;
16
17 if (!defined('ABSPATH')) {
18 exit;
19 }
20
21 class WooCommerce_Grid extends Widget_Base
22 {
23
24
25
26 public function get_name()
27 {
28 return 'king-addons-woocommerce-grid';
29 }
30
31 public function get_title()
32 {
33 return esc_html__('WooCommerce Grid & Slider', 'king-addons');
34 }
35
36 public function get_icon()
37 {
38 return 'king-addons-icon king-addons-woocommerce-grid';
39 }
40
41 public function get_categories()
42 {
43 return ['king-addons'];
44 }
45
46 public function get_keywords()
47 {
48 return ['king addons', 'king', 'addons', 'kingaddons', 'king-addons', 'shop grid', 'quick product grid', 'slick', 'loop', 'sales', 'filter',
49 'woo', 'commerce', 'woocommerce', 'shop', 'product', 'products', 'carousel', 'slider', 'grid', 'masonry', 'store', 'sale',
50 'woocommerce', 'product slider', 'quick product slider', 'isotope', 'masonry grid', 'filterable grid', 'loop grid'];
51 }
52
53 public function get_script_depends()
54 {
55 return [
56 KING_ADDONS_ASSETS_UNIQUE_KEY . '-grid-woocommerce',
57 KING_ADDONS_ASSETS_UNIQUE_KEY . '-isotope-kng',
58 KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-slick',
59 KING_ADDONS_ASSETS_UNIQUE_KEY . '-lightgallery-lightgallery'
60 ];
61 }
62
63 public function get_style_depends()
64 {
65 return [
66 KING_ADDONS_ASSETS_UNIQUE_KEY . '-grid-grid',
67 KING_ADDONS_ASSETS_UNIQUE_KEY . '-slick-helper',
68 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-button',
69 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-general',
70 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-timing',
71 KING_ADDONS_ASSETS_UNIQUE_KEY . '-animation-loading',
72 KING_ADDONS_ASSETS_UNIQUE_KEY . '-lightgallery-lightgallery',
73 KING_ADDONS_ASSETS_UNIQUE_KEY . '-general-general',
74 ];
75 }
76
77 public function get_custom_help_url()
78 {
79 return 'mailto:bug@kingaddons.com?subject=Bug Report - King Addons&body=Please describe the issue';
80 }
81
82 public function add_control_secondary_img_on_hover()
83 {
84 $this->add_control(
85 'secondary_img_on_hover',
86 [
87 'label' => sprintf(__('2nd Image on Hover %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
88 'type' => Controls_Manager::SWITCHER,
89 'classes' => 'king-addons-pro-control no-distance'
90 ]
91 );
92 }
93
94 public function add_control_open_links_in_new_tab()
95 {
96 $this->add_control(
97 'open_links_in_new_tab',
98 [
99 'label' => sprintf(__('Open Links in New Tab %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
100 'type' => Controls_Manager::SWITCHER,
101 'classes' => 'king-addons-pro-control no-distance'
102 ]
103 );
104 }
105
106 public function add_control_query_selection()
107 {
108 $this->add_control(
109 'query_selection',
110 [
111 'label' => esc_html__('Query Products', 'king-addons'),
112 'type' => Controls_Manager::SELECT,
113 'default' => 'dynamic',
114 'options' => [
115 'dynamic' => esc_html__('Dynamic', 'king-addons'),
116 'manual' => esc_html__('Manual', 'king-addons'),
117 'current' => esc_html__('Current Query', 'king-addons'),
118 'pro-fr' => esc_html__('Featured (Pro)', 'king-addons'),
119 'pro-os' => esc_html__('On Sale (Pro)', 'king-addons'),
120 'pro-us' => esc_html__('Upsell (Pro)', 'king-addons'),
121 'pro-cs' => esc_html__('Cross-sell (Pro)', 'king-addons'),
122 ],
123 ]
124 );
125 }
126
127 public function add_control_query_orderby()
128 {
129 $this->add_control(
130 'query_orderby',
131 [
132 'label' => esc_html__('Order By', 'king-addons'),
133 'type' => Controls_Manager::SELECT,
134 'default' => 'date',
135 'options' => [
136 'default' => esc_html__('Default', 'king-addons'),
137 'date' => esc_html__('Date', 'king-addons'),
138 'sales' => esc_html__('Sales', 'king-addons'),
139 'rating' => esc_html__('Rating', 'king-addons'),
140 'price-low' => esc_html__('Price - Low to High', 'king-addons'),
141 'price-high' => esc_html__('Price - High to Low', 'king-addons'),
142 'pro-rn' => esc_html__('Random (Pro)', 'king-addons'),
143 ],
144 'condition' => [
145 'query_selection' => ['dynamic', 'onsale', 'featured', 'upsell', 'cross-sell'],
146 ],
147 ]
148 );
149 }
150
151 public function add_control_layout_select()
152 {
153 $this->add_control(
154 'layout_select',
155 [
156 'label' => esc_html__('Select Layout', 'king-addons'),
157 'type' => Controls_Manager::SELECT,
158 'default' => 'fitRows',
159 'options' => [
160 'fitRows' => esc_html__('FitRows - Equal Height', 'king-addons'),
161 'list' => esc_html__('List Style', 'king-addons'),
162 'slider' => esc_html__('Slider / Carousel', 'king-addons'),
163 'pro-ms' => esc_html__('Masonry - Unlimited Height (Pro)', 'king-addons'),
164 ],
165 'label_block' => true,
166 'render_type' => 'template'
167 ]
168 );
169 }
170
171 public function add_control_layout_columns()
172 {
173 $this->add_responsive_control(
174 'layout_columns',
175 [
176 'label' => esc_html__('Columns', 'king-addons'),
177 'type' => Controls_Manager::SELECT,
178 'default' => 3,
179 'widescreen_default' => 3,
180 'laptop_default' => 3,
181 'tablet_extra_default' => 3,
182 'tablet_default' => 2,
183 'mobile_extra_default' => 2,
184 'mobile_default' => 1,
185 'options' => [
186 1 => esc_html__('One', 'king-addons'),
187 2 => esc_html__('Two', 'king-addons'),
188 3 => esc_html__('Three', 'king-addons'),
189 'pro-4' => esc_html__('Four (Pro)', 'king-addons'),
190 'pro-5' => esc_html__('Five (Pro)', 'king-addons'),
191 'pro-6' => esc_html__('Six (Pro)', 'king-addons'),
192 ],
193 'prefix_class' => 'king-addons-grid-columns-%s',
194 'render_type' => 'template',
195 'separator' => 'before',
196 'condition' => [
197 'layout_select' => ['fitRows', 'masonry', 'list'],
198 ]
199 ]
200 );
201 }
202
203 public function add_control_layout_animation()
204 {
205 $this->add_control(
206 'layout_animation',
207 [
208 'label' => esc_html__('Select Animation', 'king-addons'),
209 'type' => Controls_Manager::SELECT,
210 'default' => 'default',
211 'options' => [
212 'default' => esc_html__('Default', 'king-addons'),
213 'zoom' => esc_html__('Zoom', 'king-addons'),
214 'pro-fd' => esc_html__('Fade (Pro)', 'king-addons'),
215 'pro-fs' => esc_html__('Fade + SlideUp (Pro)', 'king-addons'),
216 ],
217 'selectors_dictionary' => [
218 'default' => '',
219 'zoom' => 'opacity: 0; transform: scale(0.01)',
220 ],
221 'selectors' => [
222 '{{WRAPPER}} .king-addons-grid-item-inner' => '{{VALUE}}',
223 ],
224 'render_type' => 'template',
225 'separator' => 'before',
226 'condition' => [
227 'layout_select!' => 'slider',
228 ]
229 ]
230 );
231 }
232
233 public function add_control_sort_and_results_count()
234 {
235 $this->add_control(
236 'layout_sort_and_results_count',
237 [
238 'label' => sprintf(__('Show Sorting %s', 'king-addons'), '<i class="eicon-pro-icon"></i>'),
239 'type' => Controls_Manager::SWITCHER,
240 'separator' => 'before',
241 'classes' => 'king-addons-pro-control',
242 'condition' => [
243 'layout_select!' => 'slider',
244 ]
245 ]
246 );
247 }
248
249 public function add_section_grid_sorting()
250 {
251 }
252
253 public function add_section_style_sort_and_results()
254 {
255 }
256
257 public function add_control_layout_slider_amount()
258 {
259 $this->add_responsive_control(
260 'layout_slider_amount',
261 [
262 'label' => esc_html__('Columns (Carousel)', 'king-addons'),
263 'type' => Controls_Manager::SELECT,
264 'label_block' => false,
265 'default' => 2,
266 'widescreen_default' => 2,
267 'laptop_default' => 2,
268 'tablet_extra_default' => 2,
269 'tablet_default' => 2,
270 'mobile_extra_default' => 2,
271 'mobile_default' => 1,
272 'options' => [
273 1 => esc_html__('One', 'king-addons'),
274 2 => esc_html__('Two', 'king-addons'),
275 'pro-3' => esc_html__('Three (Pro)', 'king-addons'),
276 'pro-4' => esc_html__('Four (Pro)', 'king-addons'),
277 'pro-5' => esc_html__('Five (Pro)', 'king-addons'),
278 'pro-6' => esc_html__('Six (Pro)', 'king-addons'),
279 ],
280 'prefix_class' => 'king-addons-grid-slider-columns-%s',
281 'render_type' => 'template',
282 'frontend_available' => true,
283 'separator' => 'before',
284 'condition' => [
285 'layout_select' => 'slider',
286 ],
287 ]
288 );
289 }
290
291 public function add_control_layout_slider_nav_hover()
292 {
293 }
294
295 public function add_control_layout_slider_dots_position()
296 {
297 $this->add_control(
298 'layout_slider_dots_position',
299 [
300 'label' => esc_html__('Pagination Layout', 'king-addons'),
301 'type' => Controls_Manager::SELECT,
302 'default' => 'horizontal',
303 'options' => [
304 'horizontal' => esc_html__('Horizontal', 'king-addons'),
305 'pro-vr' => esc_html__('Vertical (Pro)', 'king-addons'),
306 ],
307 'prefix_class' => 'king-addons-grid-slider-dots-',
308 'render_type' => 'template',
309 'condition' => [
310 'layout_slider_dots' => 'yes',
311 'layout_select' => 'slider',
312 ],
313 ]
314 );
315 }
316
317 public function add_control_stack_layout_slider_autoplay()
318 {
319 }
320
321 public function add_option_element_select()
322 {
323 return [
324 'title' => esc_html__('Title', 'king-addons'),
325 'excerpt' => esc_html__('Excerpt', 'king-addons'),
326 'product_cat' => esc_html__('Categories', 'king-addons'),
327 'product_tag' => esc_html__('Tags', 'king-addons'),
328 'pro-cfa' => esc_html__('Custom Fields/Attributes', 'king-addons'),
329 'status' => esc_html__('Status', 'king-addons'),
330 'price' => esc_html__('Price', 'king-addons'),
331 'pro-sd' => esc_html__('Sale Dates (Pro)', 'king-addons'),
332 'rating' => esc_html__('Rating', 'king-addons'),
333 'add-to-cart' => esc_html__('Add to Cart', 'king-addons'),
334 'pro-ws' => esc_html__('Wishlist Button (Pro)', 'king-addons'),
335 'pro-cm' => esc_html__('Compare Button (Pro)', 'king-addons'),
336 'lightbox' => esc_html__('Lightbox', 'king-addons'),
337 'separator' => esc_html__('Separator', 'king-addons'),
338 'pro-lk' => esc_html__('Likes (Pro)', 'king-addons'),
339 'pro-shr' => esc_html__('Sharing (Pro)', 'king-addons'),
340 ];
341 }
342
343 public function add_repeater_args_element_custom_field()
344 {
345 return [
346 'type' => Controls_Manager::HIDDEN,
347 'default' => ''
348 ];
349 }
350
351 public function add_repeater_args_element_custom_field_btn_link()
352 {
353 return [
354 'type' => Controls_Manager::HIDDEN,
355 'default' => ''
356 ];
357 }
358
359 public function add_repeater_args_element_custom_field_new_tab()
360 {
361 return [
362 'type' => Controls_Manager::HIDDEN,
363 'default' => ''
364 ];
365 }
366
367 public function add_repeater_args_element_custom_field_style()
368 {
369 return [
370 'type' => Controls_Manager::HIDDEN,
371 'default' => ''
372 ];
373 }
374
375 public function add_repeater_args_element_like_icon()
376 {
377 return [
378 'type' => Controls_Manager::HIDDEN,
379 'default' => ''
380 ];
381 }
382
383 public function add_repeater_args_element_like_text()
384 {
385 return [
386 'type' => Controls_Manager::HIDDEN,
387 'default' => ''
388 ];
389 }
390
391 public function add_repeater_args_element_like_show_count()
392 {
393 return [
394 'type' => Controls_Manager::HIDDEN,
395 'default' => ''
396 ];
397 }
398
399 public function add_repeater_args_element_sharing_icon_1()
400 {
401 return [
402 'type' => Controls_Manager::HIDDEN,
403 'default' => ''
404 ];
405 }
406
407 public function add_repeater_args_element_sharing_icon_2()
408 {
409 return [
410 'type' => Controls_Manager::HIDDEN,
411 'default' => ''
412 ];
413 }
414
415 public function add_repeater_args_element_sharing_icon_3()
416 {
417 return [
418 'type' => Controls_Manager::HIDDEN,
419 'default' => ''
420 ];
421 }
422
423 public function add_repeater_args_element_sharing_icon_4()
424 {
425 return [
426 'type' => Controls_Manager::HIDDEN,
427 'default' => ''
428 ];
429 }
430
431 public function add_repeater_args_element_sharing_icon_5()
432 {
433 return [
434 'type' => Controls_Manager::HIDDEN,
435 'default' => ''
436 ];
437 }
438
439 public function add_repeater_args_element_sharing_icon_6()
440 {
441 return [
442 'type' => Controls_Manager::HIDDEN,
443 'default' => ''
444 ];
445 }
446
447 public function add_repeater_args_element_sharing_trigger()
448 {
449 return [
450 'type' => Controls_Manager::HIDDEN,
451 'default' => ''
452 ];
453 }
454
455 public function add_repeater_args_element_sharing_trigger_icon()
456 {
457 return [
458 'type' => Controls_Manager::HIDDEN,
459 'default' => ''
460 ];
461 }
462
463 public function add_repeater_args_element_sharing_trigger_action()
464 {
465 return [
466 'type' => Controls_Manager::HIDDEN,
467 'default' => ''
468 ];
469 }
470
471 public function add_repeater_args_element_sharing_trigger_direction()
472 {
473 return [
474 'type' => Controls_Manager::HIDDEN,
475 'default' => ''
476 ];
477 }
478
479 public function add_repeater_args_element_sharing_tooltip()
480 {
481 return [
482 'type' => Controls_Manager::HIDDEN,
483 'default' => ''
484 ];
485 }
486
487 public function add_repeater_args_element_show_added_tc_popup()
488 {
489 return [
490 'type' => Controls_Manager::HIDDEN,
491 'default' => ''
492 ];
493 }
494
495 public function add_repeater_args_element_show_added_to_wishlist_popup()
496 {
497 return [
498 'type' => Controls_Manager::HIDDEN,
499 'default' => ''
500 ];
501 }
502
503 public function add_repeater_args_element_show_added_to_compare_popup()
504 {
505 return [
506 'type' => Controls_Manager::HIDDEN,
507 'default' => ''
508 ];
509 }
510
511 public function add_repeater_args_element_trim_text_by()
512 {
513 return [
514 'word_count' => esc_html__('Word Count', 'king-addons'),
515 'pro-lc' => esc_html__('Letter Count (Pro)', 'king-addons')
516 ];
517 }
518
519 public function add_control_overlay_animation_divider()
520 {
521 }
522
523 public function add_control_overlay_image()
524 {
525 }
526
527 public function add_control_overlay_image_width()
528 {
529 }
530
531 public function add_control_image_effects()
532 {
533 $this->add_control(
534 'image_effects',
535 [
536 'label' => esc_html__('Select Effect', 'king-addons'),
537 'type' => Controls_Manager::SELECT,
538 'options' => [
539 'none' => esc_html__('None', 'king-addons'),
540 'pro-zi' => esc_html__('Zoom In (Pro)', 'king-addons'),
541 'pro-zo' => esc_html__('Zoom Out (Pro)', 'king-addons'),
542 'grayscale-in' => esc_html__('Grayscale In', 'king-addons'),
543 'pro-go' => esc_html__('Grayscale Out (Pro)', 'king-addons'),
544 'blur-in' => esc_html__('Blur In', 'king-addons'),
545 'pro-bo' => esc_html__('Blur Out (Pro)', 'king-addons'),
546 'slide' => esc_html__('Slide', 'king-addons'),
547 ],
548 'default' => 'none',
549 ]
550 );
551 }
552
553 public function add_control_lightbox_popup_thumbnails()
554 {
555 }
556
557 public function add_control_lightbox_popup_thumbnails_default()
558 {
559 }
560
561 public function add_control_lightbox_popup_sharing()
562 {
563 }
564
565 public function add_control_filters_deeplinking()
566 {
567 }
568
569 public function add_control_filters_animation()
570 {
571 $this->add_control(
572 'filters_animation',
573 [
574 'label' => esc_html__('Select Animation', 'king-addons'),
575 'type' => Controls_Manager::SELECT,
576 'default' => 'default',
577 'options' => [
578 'default' => esc_html__('Default', 'king-addons'),
579 'zoom' => esc_html__('Zoom', 'king-addons'),
580 'pro-fd' => esc_html__('Fade (Pro)', 'king-addons'),
581 'pro-fs' => esc_html__('Fade + SlideUp (Pro)', 'king-addons'),
582 ],
583 'separator' => 'before',
584 ]
585 );
586 }
587
588 public function add_control_filters_icon()
589 {
590 }
591
592 public function add_control_filters_icon_align()
593 {
594 }
595
596 public function add_control_filters_count()
597 {
598 }
599
600 public function add_control_filters_count_superscript()
601 {
602 }
603
604 public function add_control_filters_count_brackets()
605 {
606 }
607
608 public function add_control_filters_default_filter()
609 {
610 }
611
612 public function add_control_pagination_type()
613 {
614 $this->add_control(
615 'pagination_type',
616 [
617 'label' => esc_html__('Select Type', 'king-addons'),
618 'type' => Controls_Manager::SELECT,
619 'default' => 'load-more',
620 'options' => [
621 'default' => esc_html__('Default', 'king-addons'),
622 'numbered' => esc_html__('Numbered', 'king-addons'),
623 'load-more' => esc_html__('Load More Button', 'king-addons'),
624 'pro-is' => esc_html__('Infinite Scrolling (Pro)', 'king-addons'),
625 ],
626 'render_type' => 'template',
627 'separator' => 'after'
628 ]
629 );
630 }
631
632 public function add_section_added_to_cart_popup()
633 {
634 }
635
636 public function add_section_style_likes()
637 {
638 }
639
640 public function add_section_style_sharing()
641 {
642 }
643
644 public function add_section_style_custom_field1()
645 {
646 }
647
648 public function add_section_style_custom_field2()
649 {
650 }
651
652 public function add_control_grid_item_even_bg_color()
653 {
654 }
655
656 public function add_control_grid_item_even_border_color()
657 {
658 }
659
660 public function add_control_overlay_color()
661 {
662 $this->add_control(
663 'overlay_color',
664 [
665 'label' => esc_html__('Background Color', 'king-addons'),
666 'type' => Controls_Manager::COLOR,
667 'default' => 'rgba(0, 0, 0, 0.25)',
668 'selectors' => [
669 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'background-color: {{VALUE}}',
670 ],
671 ]
672 );
673 }
674
675 public function add_control_overlay_blend_mode()
676 {
677 }
678
679 public function add_control_overlay_border_color()
680 {
681 }
682
683 public function add_control_overlay_border_type()
684 {
685 }
686
687 public function add_control_overlay_border_width()
688 {
689 }
690
691 public function add_control_title_pointer_color_hr()
692 {
693 }
694
695 public function add_control_title_pointer()
696 {
697 }
698
699 public function add_control_title_pointer_height()
700 {
701 }
702
703 public function add_control_title_pointer_animation()
704 {
705 }
706
707 public function add_control_categories_pointer_color_hr()
708 {
709 }
710
711 public function add_control_categories_pointer()
712 {
713 }
714
715 public function add_control_categories_pointer_height()
716 {
717 }
718
719 public function add_control_categories_pointer_animation()
720 {
721 }
722
723 public function add_control_tags_pointer_color_hr()
724 {
725 }
726
727 public function add_control_tags_pointer()
728 {
729 }
730
731 public function add_control_tags_pointer_height()
732 {
733 }
734
735 public function add_control_tags_pointer_animation()
736 {
737 }
738
739 public function add_control_add_to_cart_animation()
740 {
741 }
742
743 public function add_control_add_to_cart_animation_height()
744 {
745 }
746
747 public function add_control_filters_pointer_color_hr()
748 {
749 }
750
751 public function add_control_filters_pointer()
752 {
753 }
754
755 public function add_control_filters_pointer_height()
756 {
757 }
758
759 public function add_control_filters_pointer_animation()
760 {
761 }
762
763 public function add_control_stack_grid_slider_nav_position()
764 {
765 }
766
767 public function add_control_grid_slider_dots_hr()
768 {
769 }
770
771 protected function register_controls()
772 {
773
774
775 $this->start_controls_section(
776 'section_grid_query',
777 [
778 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Query', 'king-addons'),
779 'tab' => Controls_Manager::TAB_CONTENT,
780 ]
781 );
782
783 $this->add_control_query_selection();
784
785 $this->add_control(
786 'order_direction',
787 [
788 'label' => esc_html__('Order', 'king-addons'),
789 'type' => Controls_Manager::SELECT,
790 'default' => 'DESC',
791 'label_block' => false,
792 'options' => [
793 'ASC' => esc_html__('Ascending', 'king-addons'),
794 'DESC' => esc_html__('Descending', 'king-addons'),
795 ],
796 'condition' => [
797 'query_randomize!' => 'rand',
798 ]
799 ]
800 );
801
802
803 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'query_selection', ['pro-fr', 'pro-os', 'pro-us', 'pro-cs']);
804
805 $this->add_control_query_orderby();
806
807
808 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'query_orderby', ['pro-rn']);
809
810
811 $this->add_control(
812 'query_taxonomy_product_cat',
813 [
814 'label' => esc_html__('Categories', 'king-addons'),
815 'type' => 'king-addons-ajax-select2',
816 'options' => 'ajaxselect2/getTaxonomies',
817 'query_slug' => 'product_cat',
818 'multiple' => true,
819 'label_block' => true,
820 'condition' => [
821 'query_selection' => ['dynamic', 'onsale', 'featured'],
822 ],
823 ]
824 );
825
826
827 $this->add_control(
828 'query_taxonomy_product_tag',
829 [
830 'label' => esc_html__('Tags', 'king-addons'),
831 'type' => 'king-addons-ajax-select2',
832 'options' => 'ajaxselect2/getTaxonomies',
833 'query_slug' => 'product_tag',
834 'multiple' => true,
835 'label_block' => true,
836 'condition' => [
837 'query_selection' => ['dynamic', 'onsale', 'featured'],
838 ],
839 ]
840 );
841
842
843 $this->add_control(
844 'query_exclude_products',
845 [
846 'label' => esc_html__('Exclude Products', 'king-addons'),
847 'type' => 'king-addons-ajax-select2',
848 'options' => 'ajaxselect2/getPostsByPostType',
849 'query_slug' => 'product',
850 'multiple' => true,
851 'label_block' => true,
852 'condition' => [
853 'query_selection!' => ['manual', 'onsale', 'current', 'upsell', 'cross-sell'],
854 ],
855 ]
856 );
857
858
859 $this->add_control(
860 'query_manual_products',
861 [
862 'label' => esc_html__('Select Products', 'king-addons'),
863 'type' => 'king-addons-ajax-select2',
864 'options' => 'ajaxselect2/getPostsByPostType',
865 'query_slug' => 'product',
866 'multiple' => true,
867 'label_block' => true,
868 'condition' => [
869 'query_selection' => 'manual',
870 ],
871 'separator' => 'before',
872 ]
873 );
874
875 $this->add_control(
876 'query_posts_per_page',
877 [
878 'label' => esc_html__('Products Per Page', 'king-addons'),
879 'type' => Controls_Manager::NUMBER,
880 'default' => 9,
881 'min' => 0,
882 'condition' => [
883 'query_selection!' => 'current',
884 ],
885 ]
886 );
887
888 $this->add_control(
889 'query_offset',
890 [
891 'label' => esc_html__('Offset', 'king-addons'),
892 'type' => Controls_Manager::NUMBER,
893 'default' => 0,
894 'min' => 0,
895 'condition' => [
896 'query_selection' => ['dynamic', 'current'],
897 ]
898 ]
899 );
900
901 $this->add_control(
902 'query_not_found_text',
903 [
904 'label' => esc_html__('Not Found Text', 'king-addons'),
905 'type' => Controls_Manager::TEXT,
906 'dynamic' => [
907 'active' => true,
908 ],
909 'default' => esc_html__('No Products Found!', 'king-addons'),
910 'condition' => [
911 'query_selection' => ['dynamic', 'current'],
912 ]
913 ]
914 );
915
916 $this->add_control(
917 'query_randomize',
918 [
919 'label' => esc_html__('Randomize Query', 'king-addons'),
920 'type' => Controls_Manager::SWITCHER,
921 'return_value' => 'rand',
922 'condition' => [
923 'query_selection' => ['manual', 'current'],
924 ]
925 ]
926 );
927
928 $this->add_control(
929 'query_exclude_no_images',
930 [
931 'label' => esc_html__('Exclude Items without Thumbnail', 'king-addons'),
932 'type' => Controls_Manager::SWITCHER,
933 'return_value' => 'yes',
934 'label_block' => false
935 ]
936 );
937
938 $this->add_control(
939 'query_exclude_out_of_stock',
940 [
941 'label' => esc_html__('Exclude Out Of Stock', 'king-addons'),
942 'type' => Controls_Manager::SWITCHER,
943 'return_value' => 'yes',
944 'label_block' => false
945 ]
946 );
947
948 $this->end_controls_section();
949
950 $this->start_controls_section(
951 'section_grid_layout',
952 [
953 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Layout', 'king-addons'),
954 'tab' => Controls_Manager::TAB_CONTENT,
955 ]
956 );
957
958 $this->add_control_layout_select();
959
960
961 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'layout_select', ['pro-ms']);
962
963 $this->add_control(
964 'stick_last_element_to_bottom',
965 [
966 'label' => esc_html__('Last Element to Bottom', 'king-addons'),
967 'type' => Controls_Manager::SWITCHER,
968 'default' => '',
969 'render_type' => 'template',
970
971 'condition' => [
972 'layout_select' => 'fitRows',
973 ]
974 ]
975 );
976
977 $this->add_control(
978 'last_element_position',
979 [
980 'label' => esc_html__('Last Element Position', 'king-addons'),
981 'type' => Controls_Manager::CHOOSE,
982 'label_block' => false,
983 'default' => 'left',
984 'options' => [
985 'left' => [
986 'title' => esc_html__('Left', 'king-addons'),
987 'icon' => 'eicon-h-align-left',
988 ],
989 'center' => [
990 'title' => esc_html__('Center', 'king-addons'),
991 'icon' => 'eicon-h-align-center',
992 ],
993 'right' => [
994 'title' => esc_html__('Right', 'king-addons'),
995 'icon' => 'eicon-h-align-right',
996 ]
997 ],
998 'selectors_dictionary' => [
999 'left' => 'left: 0; right: auto;',
1000 'center' => 'left: 50%; transform: translateX(-50%);',
1001 'right' => 'left: auto; right: 0;'
1002 ],
1003 'selectors' => [
1004 '{{WRAPPER}}.king-addons-grid-last-element-yes .king-addons-grid-item-below-content>div:last-child' => '{{VALUE}}',
1005 ],
1006 'render_type' => 'template',
1007 'separator' => 'after'
1008 ]
1009 );
1010
1011 $this->add_group_control(
1012 Group_Control_Image_Size::get_type(),
1013 [
1014 'name' => 'layout_image_crop',
1015 'default' => 'full',
1016 ]
1017 );
1018
1019 $this->add_control_layout_columns();
1020
1021 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
1022 $this->add_control(
1023 'grid_columns_pro_notice',
1024 [
1025 'type' => Controls_Manager::RAW_HTML,
1026 'raw' => 'Grid Columns option is fully supported<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-woocommerce-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
1027 'content_classes' => 'king-addons-pro-notice',
1028 ]
1029 );
1030 }
1031
1032
1033 $this->add_control(
1034 'layout_list_media_section',
1035 [
1036 'label' => esc_html__('Media', 'king-addons'),
1037 'type' => Controls_Manager::HEADING,
1038 'separator' => 'before',
1039 'condition' => [
1040 'layout_select' => 'list',
1041 ],
1042 ]
1043 );
1044
1045 $this->add_control(
1046 'layout_list_align',
1047 [
1048 'label' => esc_html__('Alignment', 'king-addons'),
1049 'type' => Controls_Manager::SELECT,
1050 'default' => 'left',
1051 'options' => [
1052 'left' => esc_html__('Left', 'king-addons'),
1053 'right' => esc_html__('Right', 'king-addons'),
1054 'zigzag' => esc_html__('ZigZag', 'king-addons'),
1055 ],
1056 'condition' => [
1057 'layout_select' => 'list',
1058 ],
1059 ]
1060 );
1061
1062 $this->add_control(
1063 'layout_list_media_width',
1064 [
1065 'label' => esc_html__('Width', 'king-addons'),
1066 'type' => Controls_Manager::SLIDER,
1067 'default' => [
1068 'size' => 30,
1069 ],
1070 'range' => [
1071 '%' => [
1072 'min' => 0,
1073 'max' => 100,
1074 ],
1075 ],
1076 'condition' => [
1077 'layout_select' => 'list',
1078 ]
1079 ]
1080 );
1081
1082 $this->add_control(
1083 'layout_list_media_distance',
1084 [
1085 'label' => esc_html__('Distance', 'king-addons'),
1086 'type' => Controls_Manager::SLIDER,
1087 'default' => [
1088 'size' => 20,
1089 ],
1090 'range' => [
1091 'px' => [
1092 'min' => 0,
1093 'max' => 100,
1094 ],
1095 ],
1096 'condition' => [
1097 'layout_select' => 'list',
1098 ]
1099 ]
1100 );
1101
1102 $this->add_responsive_control(
1103 'layout_gutter_hr',
1104 [
1105 'label' => esc_html__('Horizontal Gutter', 'king-addons'),
1106 'type' => Controls_Manager::SLIDER,
1107 'default' => [
1108 'size' => 20,
1109 ],
1110 'widescreen_default' => [
1111 'size' => 20,
1112 ],
1113 'laptop_default' => [
1114 'size' => 20,
1115 ],
1116 'tablet_extra_default' => [
1117 'size' => 20,
1118 ],
1119 'tablet_default' => [
1120 'size' => 20,
1121 ],
1122 'mobile_extra_default' => [
1123 'size' => 20,
1124 ],
1125 'mobile_default' => [
1126 'size' => 20,
1127 ],
1128 'range' => [
1129 'px' => [
1130 'min' => 0,
1131 'max' => 150,
1132 ],
1133 ],
1134 'condition' => [
1135 'layout_select' => ['fitRows', 'masonry', 'list'],
1136 ],
1137 'separator' => 'before'
1138 ]
1139 );
1140
1141 $this->add_responsive_control(
1142 'layout_gutter_vr',
1143 [
1144 'label' => esc_html__('Vertical Gutter', 'king-addons'),
1145 'type' => Controls_Manager::SLIDER,
1146 'default' => [
1147 'size' => 30,
1148 ],
1149 'widescreen_default' => [
1150 'size' => 30,
1151 ],
1152 'laptop_default' => [
1153 'size' => 30,
1154 ],
1155 'tablet_extra_default' => [
1156 'size' => 30,
1157 ],
1158 'tablet_default' => [
1159 'size' => 30,
1160 ],
1161 'mobile_extra_default' => [
1162 'size' => 30,
1163 ],
1164 'mobile_default' => [
1165 'size' => 30,
1166 ],
1167 'range' => [
1168 'px' => [
1169 'min' => 0,
1170 'max' => 150,
1171 ],
1172 ],
1173 'condition' => [
1174 'layout_select' => ['fitRows', 'masonry', 'list'],
1175 ],
1176 ]
1177 );
1178
1179 $this->add_control_sort_and_results_count();
1180
1181 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
1182 $this->add_control(
1183 'sort_and_results_count_pro_notice',
1184 [
1185 'type' => Controls_Manager::RAW_HTML,
1186 'raw' => 'Grid Sorting option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-woocommerce-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
1187 'content_classes' => 'king-addons-pro-notice',
1188 ]
1189 );
1190 }
1191
1192 $this->add_responsive_control(
1193 'layout_filters',
1194 [
1195 'label' => esc_html__('Show Filters', 'king-addons'),
1196 'type' => Controls_Manager::SWITCHER,
1197 'default' => 'yes',
1198 'selectors_dictionary' => [
1199 '' => 'none',
1200 'yes' => 'block'
1201 ],
1202 'selectors' => [
1203 '{{WRAPPER}} .king-addons-grid-filters' => 'display:{{VALUE}};',
1204 ],
1205 'render_type' => 'template',
1206
1207 'condition' => [
1208 'layout_select!' => 'slider',
1209 ]
1210 ]
1211 );
1212
1213 $this->add_control(
1214 'layout_pagination',
1215 [
1216 'label' => esc_html__('Show Pagination', 'king-addons'),
1217 'description' => esc_html__('Please note that Pagination doesn\'t work in editor', 'king-addons'),
1218 'type' => Controls_Manager::SWITCHER,
1219 'default' => 'yes',
1220 'return_value' => 'yes',
1221 'render_type' => 'template',
1222 'condition' => [
1223 'layout_select!' => 'slider',
1224 ]
1225 ]
1226 );
1227
1228 $this->add_control(
1229 'filters_experiment',
1230 [
1231 'label' => esc_html__('Filters & Load More Experiment', 'king-addons'),
1232 'type' => Controls_Manager::SWITCHER,
1233 'default' => 'no',
1234 'return_value' => 'yes',
1235 'render_type' => 'template',
1236 'conditions' => [
1237 'relation' => 'and',
1238 'terms' => [
1239 [
1240 'name' => 'layout_filters',
1241 'operator' => '!=',
1242 'value' => '',
1243 ],
1244 [
1245 'relation' => 'or',
1246 'terms' => [
1247 [
1248 'relation' => 'and',
1249 'terms' => [
1250 [
1251 'name' => 'layout_pagination',
1252 'operator' => '!=',
1253 'value' => '',
1254 ],
1255 [
1256 'name' => 'pagination_type',
1257 'operator' => 'in',
1258 'value' => ['load-more', 'infinite'],
1259 ],
1260 ]
1261 ],
1262 [
1263 'name' => 'layout_pagination',
1264 'operator' => '==',
1265 'value' => '',
1266 ]
1267 ],
1268 ],
1269 ]
1270 ]
1271 ]
1272 );
1273
1274 $this->add_control_open_links_in_new_tab();
1275
1276 $this->add_control_layout_animation();
1277
1278
1279 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'layout_animation', ['pro-fd', 'pro-fs']);
1280
1281 $this->add_control(
1282 'layout_animation_duration',
1283 [
1284 'label' => esc_html__('Animation Duration', 'king-addons'),
1285 'type' => Controls_Manager::NUMBER,
1286 'default' => 0.3,
1287 'min' => 0,
1288 'max' => 5,
1289 'step' => 0.1,
1290 'condition' => [
1291 'layout_animation!' => 'default',
1292 'layout_select!' => 'slider',
1293 ],
1294 ]
1295 );
1296
1297 $this->add_control(
1298 'layout_animation_delay',
1299 [
1300 'label' => esc_html__('Animation Delay', 'king-addons'),
1301 'type' => Controls_Manager::NUMBER,
1302 'default' => 0.1,
1303 'min' => 0,
1304 'max' => 5,
1305 'step' => 0.05,
1306 'condition' => [
1307 'layout_animation!' => 'default',
1308 'layout_select!' => 'slider',
1309 ],
1310 ]
1311 );
1312
1313 $this->add_control_layout_slider_amount();
1314
1315 $this->add_control(
1316 'layout_slides_to_scroll',
1317 [
1318 'label' => esc_html__('Slides to Scroll', 'king-addons'),
1319 'type' => Controls_Manager::NUMBER,
1320 'min' => 1,
1321 'max' => 10,
1322 'frontend_available' => true,
1323 'default' => 2,
1324 'render_type' => 'template',
1325 'separator' => 'before',
1326 'condition' => [
1327 'layout_select' => 'slider',
1328 ],
1329 ]
1330 );
1331
1332 $this->add_responsive_control(
1333 'layout_slider_gutter',
1334 [
1335 'type' => Controls_Manager::SLIDER,
1336 'label' => esc_html__('Gutter', 'king-addons'),
1337 'size_units' => ['px'],
1338 'range' => [
1339 'px' => [
1340 'min' => 0,
1341 'max' => 50,
1342 ]
1343 ],
1344 'default' => [
1345 'unit' => 'px',
1346 'size' => 10,
1347 ],
1348 'selectors' => [
1349 '{{WRAPPER}} .king-addons-grid .slick-slide' => 'margin-left: {{SIZE}}{{UNIT}};',
1350 '{{WRAPPER}} .king-addons-grid .slick-list' => 'margin-left: -{{SIZE}}{{UNIT}};',
1351 ],
1352 'render_type' => 'template',
1353 'condition' => [
1354 'layout_slider_amount!' => '1',
1355 'layout_select' => 'slider',
1356 ],
1357 ]
1358 );
1359
1360 $this->add_responsive_control(
1361 'layout_slider_nav',
1362 [
1363 'label' => esc_html__('Navigation', 'king-addons'),
1364 'type' => Controls_Manager::SWITCHER,
1365 'default' => 'yes',
1366 'widescreen_default' => 'yes',
1367 'laptop_default' => 'yes',
1368 'tablet_extra_default' => 'yes',
1369 'tablet_default' => 'yes',
1370 'mobile_extra_default' => 'yes',
1371 'mobile_default' => 'yes',
1372 'selectors_dictionary' => [
1373 '' => 'none',
1374 'yes' => 'flex'
1375 ],
1376 'selectors' => [
1377 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'display:{{VALUE}} !important;',
1378 ],
1379 'separator' => 'before',
1380 'condition' => [
1381 'layout_select' => 'slider',
1382 ]
1383 ]
1384 );
1385
1386 $this->add_control_layout_slider_nav_hover();
1387
1388 $this->add_control(
1389 'layout_slider_nav_icon',
1390 [
1391 'label' => esc_html__('Select Icon', 'king-addons'),
1392 'type' => Controls_Manager::SELECT,
1393 'default' => 'fas fa-angle-left',
1394 'options' => [
1395 'fas fa-angle-left' => esc_html__('Angle', 'king-addons'),
1396 'fas fa-angle-double-left' => esc_html__('Angle Double', 'king-addons'),
1397 'fas fa-arrow-left' => esc_html__('Arrow', 'king-addons'),
1398 'fas fa-arrow-alt-circle-left' => esc_html__('Arrow Circle', 'king-addons'),
1399 'far fa-arrow-alt-circle-left' => esc_html__('Arrow Circle Alt', 'king-addons'),
1400 'fas fa-long-arrow-alt-left' => esc_html__('Long Arrow', 'king-addons'),
1401 'fas fa-chevron-left' => esc_html__('Chevron', 'king-addons'),
1402 ],
1403 'separator' => 'after',
1404 'condition' => [
1405 'layout_slider_nav' => 'yes',
1406 'layout_select' => 'slider',
1407 ],
1408 ]
1409 );
1410
1411 $this->add_responsive_control(
1412 'layout_slider_dots',
1413 [
1414 'label' => esc_html__('Pagination', 'king-addons'),
1415 'type' => Controls_Manager::SWITCHER,
1416 'default' => 'yes',
1417 'widescreen_default' => 'yes',
1418 'laptop_default' => 'yes',
1419 'tablet_extra_default' => 'yes',
1420 'tablet_default' => 'yes',
1421 'mobile_extra_default' => 'yes',
1422 'mobile_default' => 'yes',
1423 'selectors_dictionary' => [
1424 '' => 'none',
1425 'yes' => 'inline-table'
1426 ],
1427 'selectors' => [
1428 '{{WRAPPER}} .king-addons-grid-slider-dots' => 'display:{{VALUE}};',
1429 ],
1430 'render_type' => 'template',
1431 'condition' => [
1432 'layout_select' => 'slider',
1433 ],
1434 ]
1435 );
1436
1437 $this->add_control_layout_slider_dots_position();
1438
1439
1440 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'layout_slider_dots_position', ['pro-vr']);
1441
1442 $this->add_control_stack_layout_slider_autoplay();
1443
1444 $this->add_control(
1445 'layout_slider_loop',
1446 [
1447 'label' => esc_html__('Infinite Loop', 'king-addons'),
1448 'type' => Controls_Manager::SWITCHER,
1449 'default' => 'yes',
1450 'frontend_available' => true,
1451 'separator' => 'after',
1452 'condition' => [
1453 'layout_select' => 'slider',
1454 ],
1455 ]
1456 );
1457
1458 $this->add_control(
1459 'layout_slider_effect',
1460 [
1461 'type' => Controls_Manager::SELECT,
1462 'label' => esc_html__('Effect', 'king-addons'),
1463 'default' => 'slide',
1464 'options' => [
1465 'slide' => esc_html__('Slide', 'king-addons'),
1466 'fade' => esc_html__('Fade', 'king-addons'),
1467 ],
1468 'condition' => [
1469 'layout_slider_amount' => 1,
1470 'layout_select' => 'slider',
1471 ],
1472 ]
1473 );
1474
1475 $this->add_control(
1476 'layout_slider_effect_duration',
1477 [
1478 'label' => esc_html__('Effect Duration', 'king-addons'),
1479 'type' => Controls_Manager::NUMBER,
1480 'default' => 0.7,
1481 'min' => 0,
1482 'max' => 5,
1483 'step' => 0.1,
1484 'condition' => [
1485 'layout_slider_amount' => 1,
1486 'layout_select' => 'slider',
1487 ],
1488 ]
1489 );
1490
1491 $this->end_controls_section();
1492
1493
1494 $this->start_controls_section(
1495 'section_grid_linked_products',
1496 [
1497 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Upsell / Cross-sell Title', 'king-addons'),
1498 'tab' => Controls_Manager::TAB_CONTENT,
1499 'condition' => [
1500 'query_selection' => ['upsell', 'cross-sell'],
1501
1502 ]
1503 ]
1504 );
1505
1506 $this->add_control(
1507 'grid_linked_products_heading',
1508 [
1509 'label' => esc_html__('Heading', 'king-addons'),
1510 'type' => Controls_Manager::TEXT,
1511 'dynamic' => [
1512 'active' => true,
1513 ],
1514 'default' => 'You may be interested in...',
1515 'condition' => [
1516 'query_selection' => ['upsell', 'cross-sell'],
1517 ]
1518 ]
1519 );
1520
1521 $this->add_control(
1522 'grid_linked_products_heading_tag',
1523 [
1524 'label' => esc_html__('Title HTML Tag', 'king-addons'),
1525 'type' => Controls_Manager::SELECT,
1526 'options' => [
1527 'h1' => 'H1',
1528 'h2' => 'H2',
1529 'h3' => 'H3',
1530 'h4' => 'H4',
1531 'h5' => 'H5',
1532 'h6' => 'H6',
1533 'div' => 'div',
1534 'span' => 'span',
1535 'P' => 'p'
1536 ],
1537 'default' => 'h2',
1538 'condition' => [
1539 'query_selection' => ['upsell'],
1540 'grid_linked_products_heading!' => ''
1541 ]
1542 ]
1543 );
1544
1545 $this->end_controls_section();
1546
1547
1548 $this->start_controls_section(
1549 'section_grid_elements',
1550 [
1551 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Elements', 'king-addons'),
1552 'tab' => Controls_Manager::TAB_CONTENT,
1553 ]
1554 );
1555
1556 $repeater = new Repeater();
1557
1558 $element_select = $this->add_option_element_select();
1559
1560 $repeater->add_control(
1561 'element_select',
1562 [
1563 'label' => esc_html__('Select Element', 'king-addons'),
1564 'type' => Controls_Manager::SELECT,
1565 'default' => 'title',
1566 'options' => $element_select + Core::getWooCommerceTaxonomies(),
1567 'separator' => 'after'
1568 ]
1569 );
1570
1571 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_select', ['pro-lk', 'pro-shr', 'pro-sd']);
1572
1573 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_select', ['pro-ws', 'pro-cm']);
1574
1575 $repeater->add_control(
1576 'element_location',
1577 [
1578 'label' => esc_html__('Location', 'king-addons'),
1579 'type' => Controls_Manager::SELECT,
1580 'default' => 'below',
1581 'options' => [
1582 'above' => esc_html__('Above Media', 'king-addons'),
1583 'over' => esc_html__('Over Media', 'king-addons'),
1584 'below' => esc_html__('Below Media', 'king-addons'),
1585 ]
1586 ]
1587 );
1588
1589 $repeater->add_control(
1590 'element_display',
1591 [
1592 'label' => esc_html__('Display', 'king-addons'),
1593 'type' => Controls_Manager::SELECT,
1594 'default' => 'block',
1595 'options' => [
1596 'inline' => esc_html__('Inline', 'king-addons'),
1597 'block' => esc_html__('Seperate Line', 'king-addons'),
1598 'custom' => esc_html__('Custom Width', 'king-addons'),
1599 ],
1600 ]
1601 );
1602
1603 $repeater->add_control(
1604 'element_custom_width',
1605 [
1606 'label' => esc_html__('Element Width', 'king-addons'),
1607 'type' => Controls_Manager::SLIDER,
1608 'size_units' => ['%'],
1609 'range' => [
1610 '%' => [
1611 'min' => 0,
1612 'max' => 100,
1613 ],
1614 ],
1615 'default' => [
1616 'unit' => '%',
1617 'size' => 100,
1618 ],
1619 'selectors' => [
1620 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'width: {{SIZE}}%;',
1621 ],
1622 'condition' => [
1623 'element_display' => 'custom',
1624 ],
1625 ]
1626 );
1627
1628 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
1629 $repeater->add_control(
1630 'element_align_pro_notice',
1631 [
1632 'raw' => 'Vertical Align option is available<br> in the <strong><a href="https://kingaddons.com/pricing/?utm_source=kng-module-woocommerce-grid-settings-upgrade-pro&utm_medium=plugin&utm_campaign=kng" target="_blank">Pro version</a></strong>',
1633
1634 'type' => Controls_Manager::RAW_HTML,
1635 'content_classes' => 'king-addons-pro-notice',
1636 'condition' => [
1637 'element_location' => 'over',
1638 ],
1639 ]
1640 );
1641 }
1642
1643 $repeater->add_control(
1644 'element_align_vr',
1645 [
1646 'label' => esc_html__('Vertical Align', 'king-addons'),
1647 'type' => Controls_Manager::CHOOSE,
1648 'label_block' => false,
1649 'default' => 'middle',
1650 'options' => [
1651 'top' => [
1652 'title' => esc_html__('Top', 'king-addons'),
1653 'icon' => 'eicon-v-align-top',
1654 ],
1655 'middle' => [
1656 'title' => esc_html__('Middle', 'king-addons'),
1657 'icon' => 'eicon-v-align-middle',
1658 ],
1659 'bottom' => [
1660 'title' => esc_html__('Bottom', 'king-addons'),
1661 'icon' => 'eicon-v-align-bottom',
1662 ],
1663 ],
1664 'condition' => [
1665 'element_location' => 'over',
1666 ],
1667 ]
1668 );
1669
1670 $repeater->add_control(
1671 'element_align_hr',
1672 [
1673 'label' => esc_html__('Horizontal Align', 'king-addons'),
1674 'type' => Controls_Manager::CHOOSE,
1675 'label_block' => false,
1676 'default' => 'left',
1677 'options' => [
1678 'left' => [
1679 'title' => esc_html__('Left', 'king-addons'),
1680 'icon' => 'eicon-h-align-left',
1681 ],
1682 'center' => [
1683 'title' => esc_html__('Center', 'king-addons'),
1684 'icon' => 'eicon-h-align-center',
1685 ],
1686 'right' => [
1687 'title' => esc_html__('Right', 'king-addons'),
1688 'icon' => 'eicon-h-align-right',
1689 ]
1690 ],
1691 'selectors' => [
1692 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'text-align: {{VALUE}}',
1693 ],
1694 'render_type' => 'template',
1695 'separator' => 'after'
1696 ]
1697 );
1698
1699 $repeater->add_control(
1700 'element_title_tag',
1701 [
1702 'label' => esc_html__('Title HTML Tag', 'king-addons'),
1703 'type' => Controls_Manager::SELECT,
1704 'options' => [
1705 'h1' => 'H1',
1706 'h2' => 'H2',
1707 'h3' => 'H3',
1708 'h4' => 'H4',
1709 'h5' => 'H5',
1710 'h6' => 'H6',
1711 'div' => 'div',
1712 'span' => 'span',
1713 'P' => 'p'
1714 ],
1715 'default' => 'h2',
1716 'condition' => [
1717 'element_select' => 'title',
1718 ]
1719 ]
1720 );
1721
1722 $repeater->add_control(
1723 'element_trim_text_by',
1724 [
1725 'label' => esc_html__('Trim Text By', 'king-addons'),
1726 'type' => Controls_Manager::SELECT,
1727 'default' => 'word_count',
1728 'options' => $this->add_repeater_args_element_trim_text_by(),
1729 'separator' => 'after',
1730 'condition' => [
1731 'element_select' => ['title', 'excerpt'],
1732 ]
1733 ]
1734 );
1735
1736 $repeater->add_control(
1737 'element_word_count',
1738 [
1739 'label' => esc_html__('Word Count', 'king-addons'),
1740 'type' => Controls_Manager::NUMBER,
1741 'default' => 20,
1742 'min' => 1,
1743 'condition' => [
1744 'element_select' => ['title', 'excerpt'],
1745 'element_trim_text_by' => 'word_count'
1746 ]
1747 ]
1748 );
1749
1750 $repeater->add_control(
1751 'element_letter_count',
1752 [
1753 'label' => esc_html__('Letter Count', 'king-addons'),
1754 'type' => Controls_Manager::NUMBER,
1755 'default' => 40,
1756 'min' => 1,
1757 'condition' => [
1758 'element_select' => ['title', 'excerpt'],
1759 'element_trim_text_by' => 'letter_count'
1760 ]
1761 ]
1762 );
1763
1764 $repeater->add_control(
1765 'element_tax_sep',
1766 [
1767 'label' => esc_html__('Separator', 'king-addons'),
1768 'type' => Controls_Manager::TEXT,
1769 'dynamic' => [
1770 'active' => true,
1771 ],
1772 'default' => ', ',
1773 'condition' => [
1774 'element_select!' => [
1775 'title',
1776 'likes',
1777 'sharing',
1778 'lightbox',
1779 'separator',
1780 'post_format',
1781 'status',
1782 'price',
1783 'rating',
1784 'add-to-cart',
1785 'wishlist-button',
1786 'compare-button'
1787 ],
1788 ],
1789 'separator' => 'after'
1790 ]
1791 );
1792
1793 $repeater->add_control(
1794 'element_sale_dates_layout',
1795 [
1796 'label' => esc_html__('Layout', 'king-addons'),
1797 'type' => Controls_Manager::SELECT,
1798 'default' => 'inline',
1799 'options' => [
1800 'inline' => esc_html__('Inline', 'king-addons'),
1801 'block' => esc_html__('Block', 'king-addons'),
1802 ],
1803 'condition' => [
1804 'element_select' => [
1805 'sale_dates',
1806 ]
1807 ]
1808 ]
1809 );
1810
1811 $repeater->add_control(
1812 'element_sale_dates_sep',
1813 [
1814 'label' => esc_html__('Separator', 'king-addons'),
1815 'type' => Controls_Manager::TEXT,
1816 'default' => ' - ',
1817 'condition' => [
1818 'element_select' => [
1819 'sale_dates',
1820 ],
1821 'element_sale_dates_layout' => 'inline'
1822 ],
1823 'separator' => 'after'
1824 ]
1825 );
1826
1827 $repeater->add_control('element_custom_field', $this->add_repeater_args_element_custom_field());
1828
1829 $repeater->add_control('element_custom_field_btn_link', $this->add_repeater_args_element_custom_field_btn_link());
1830
1831 $repeater->add_control('element_custom_field_style', $this->add_repeater_args_element_custom_field_style());
1832
1833 $repeater->add_control('element_custom_field_new_tab', $this->add_repeater_args_element_custom_field_new_tab());
1834
1835 $repeater->add_control('element_like_icon', $this->add_repeater_args_element_like_icon());
1836
1837 $repeater->add_control('element_like_show_count', $this->add_repeater_args_element_like_show_count());
1838
1839 $repeater->add_control('element_like_text', $this->add_repeater_args_element_like_text());
1840
1841 $repeater->add_control('element_sharing_icon_1', $this->add_repeater_args_element_sharing_icon_1());
1842
1843 $repeater->add_control('element_sharing_icon_2', $this->add_repeater_args_element_sharing_icon_2());
1844
1845 $repeater->add_control('element_sharing_icon_3', $this->add_repeater_args_element_sharing_icon_3());
1846
1847 $repeater->add_control('element_sharing_icon_4', $this->add_repeater_args_element_sharing_icon_4());
1848
1849 $repeater->add_control('element_sharing_icon_5', $this->add_repeater_args_element_sharing_icon_5());
1850
1851 $repeater->add_control('element_sharing_icon_6', $this->add_repeater_args_element_sharing_icon_6());
1852
1853 $repeater->add_control('element_sharing_trigger', $this->add_repeater_args_element_sharing_trigger());
1854
1855 $repeater->add_control('element_sharing_trigger_icon', $this->add_repeater_args_element_sharing_trigger_icon());
1856
1857 $repeater->add_control('element_sharing_trigger_action', $this->add_repeater_args_element_sharing_trigger_action());
1858
1859 $repeater->add_control('element_sharing_trigger_direction', $this->add_repeater_args_element_sharing_trigger_direction());
1860
1861 $repeater->add_control('element_sharing_tooltip', $this->add_repeater_args_element_sharing_tooltip());
1862
1863 $repeater->add_control(
1864 'element_lightbox_pfa_select',
1865 [
1866 'label' => esc_html__('Post Format Audio', 'king-addons'),
1867 'type' => Controls_Manager::SELECT,
1868 'default' => 'default',
1869 'options' => [
1870 'default' => esc_html__('Default', 'king-addons'),
1871 'meta' => esc_html__('Meta Value', 'king-addons'),
1872 ],
1873 'condition' => [
1874 'element_select' => 'lightbox',
1875 ],
1876 ]
1877 );
1878
1879 $repeater->add_control(
1880 'element_lightbox_pfa_meta',
1881 [
1882 'label' => esc_html__('Audio Meta Value', 'king-addons'),
1883 'type' => 'king-addons-ajax-select2',
1884 'label_block' => true,
1885 'default' => 'default',
1886 'options' => 'ajaxselect2/getCustomMetaKeys',
1887 'query_slug' => 'product_cat',
1888 'condition' => [
1889 'element_select' => 'lightbox',
1890 'element_lightbox_pfa_select' => 'meta',
1891 ],
1892 ]
1893 );
1894
1895 $repeater->add_control(
1896 'element_lightbox_pfv_select',
1897 [
1898 'label' => esc_html__('Post Format Video', 'king-addons'),
1899 'type' => Controls_Manager::SELECT,
1900 'default' => 'default',
1901 'options' => [
1902 'default' => esc_html__('Default', 'king-addons'),
1903 'meta' => esc_html__('Meta Value', 'king-addons'),
1904 ],
1905 'condition' => [
1906 'element_select' => 'lightbox',
1907 ],
1908 ]
1909 );
1910
1911 $repeater->add_control(
1912 'element_lightbox_pfv_meta',
1913 [
1914 'label' => esc_html__('Video Meta Value', 'king-addons'),
1915 'type' => 'king-addons-ajax-select2',
1916 'label_block' => true,
1917 'default' => 'default',
1918 'options' => 'ajaxselect2/getCustomMetaKeys',
1919 'query_slug' => 'product_cat',
1920 'condition' => [
1921 'element_select' => 'lightbox',
1922 'element_lightbox_pfv_select' => 'meta',
1923 ],
1924 ]
1925 );
1926
1927 $repeater->add_control(
1928 'element_lightbox_overlay',
1929 [
1930 'label' => esc_html__('Media Overlay', 'king-addons'),
1931 'type' => Controls_Manager::SWITCHER,
1932 'return_value' => 'yes',
1933 'separator' => 'after',
1934 'condition' => [
1935 'element_select' => ['lightbox'],
1936 ],
1937 ]
1938 );
1939
1940 $repeater->add_control(
1941 'element_separator_style',
1942 [
1943 'label' => esc_html__('Select Styling', 'king-addons'),
1944 'type' => Controls_Manager::SELECT,
1945 'default' => 'king-addons-grid-sep-style-1',
1946 'options' => [
1947 'king-addons-grid-sep-style-1' => esc_html__('Separator Style 1', 'king-addons'),
1948 'king-addons-grid-sep-style-2' => esc_html__('Separator Style 2', 'king-addons'),
1949 ],
1950 'condition' => [
1951 'element_select' => 'separator',
1952 ]
1953 ]
1954 );
1955
1956 $repeater->add_control(
1957 'element_rating_style',
1958 [
1959 'label' => esc_html__('Select Icon', 'king-addons'),
1960 'type' => Controls_Manager::SELECT,
1961 'options' => [
1962 'style-1' => 'Icon 1',
1963 'style-2' => 'Icon 2',
1964 ],
1965 'default' => 'style-2',
1966 'condition' => [
1967 'element_select' => 'rating',
1968 ]
1969 ]
1970 );
1971
1972 $repeater->add_control(
1973 'element_rating_score',
1974 [
1975 'label' => esc_html__('Show Score', 'king-addons'),
1976 'type' => Controls_Manager::SWITCHER,
1977 'return_value' => 'yes',
1978 'condition' => [
1979 'element_select' => 'rating',
1980 ],
1981 ]
1982 );
1983
1984 $repeater->add_control(
1985 'element_rating_unmarked_style',
1986 [
1987 'label' => esc_html__('Unmarked Style', 'king-addons'),
1988 'type' => Controls_Manager::CHOOSE,
1989 'label_block' => false,
1990 'options' => [
1991 'solid' => [
1992 'title' => esc_html__('Solid', 'king-addons'),
1993 'icon' => 'eicon-star',
1994 ],
1995 'outline' => [
1996 'title' => esc_html__('Outline', 'king-addons'),
1997 'icon' => 'eicon-star-o',
1998 ],
1999 ],
2000 'default' => 'outline',
2001 'condition' => [
2002 'element_select' => 'rating',
2003 'element_rating_score!' => 'yes',
2004 ],
2005 ]
2006 );
2007
2008 $repeater->add_control(
2009 'element_status_offstock',
2010 [
2011 'label' => esc_html__('Show Out of Stock Badge', 'king-addons'),
2012 'type' => Controls_Manager::SWITCHER,
2013 'return_value' => 'yes',
2014 'condition' => [
2015 'element_select' => 'status',
2016 ],
2017 ]
2018 );
2019
2020 $repeater->add_control(
2021 'element_status_featured',
2022 [
2023 'label' => esc_html__('Show Featured Badge', 'king-addons'),
2024 'type' => Controls_Manager::SWITCHER,
2025 'default' => 'yes',
2026 'return_value' => 'yes',
2027 'condition' => [
2028 'element_select' => 'status',
2029 ],
2030 ]
2031 );
2032
2033 $repeater->add_control(
2034 'element_addcart_simple_txt',
2035 [
2036 'label' => esc_html__('Simple Item Text', 'king-addons'),
2037 'type' => Controls_Manager::TEXT,
2038 'dynamic' => [
2039 'active' => true,
2040 ],
2041 'default' => 'Add to Cart',
2042 'condition' => [
2043 'element_select' => 'add-to-cart',
2044 ]
2045 ]
2046 );
2047
2048 $repeater->add_control(
2049 'element_addcart_grouped_txt',
2050 [
2051 'label' => esc_html__('Grouped Item Text', 'king-addons'),
2052 'type' => Controls_Manager::TEXT,
2053 'dynamic' => [
2054 'active' => true,
2055 ],
2056 'default' => 'Select Options',
2057 'condition' => [
2058 'element_select' => 'add-to-cart',
2059 ]
2060 ]
2061 );
2062
2063 $repeater->add_control(
2064 'element_addcart_variable_txt',
2065 [
2066 'label' => esc_html__('Variable Item Text', 'king-addons'),
2067 'type' => Controls_Manager::TEXT,
2068 'dynamic' => [
2069 'active' => true,
2070 ],
2071 'default' => 'View Products',
2072 'separator' => 'after',
2073 'condition' => [
2074 'element_select' => 'add-to-cart',
2075 ]
2076 ]
2077 );
2078
2079 $repeater->add_control('element_show_added_tc_popup', $this->add_repeater_args_element_show_added_tc_popup());
2080
2081 $repeater->add_control('element_show_added_to_wishlist_popup', $this->add_repeater_args_element_show_added_to_wishlist_popup());
2082
2083 $repeater->add_control('element_show_added_to_compare_popup', $this->add_repeater_args_element_show_added_to_compare_popup());
2084
2085 $repeater->add_control(
2086 'element_open_links_in_new_tab',
2087 [
2088 'label' => esc_html__('Open Links in New Tab', 'king-addons'),
2089 'type' => Controls_Manager::SWITCHER,
2090 'condition' => [
2091 'element_select' => ['wishlist-button', 'compare-button']
2092 ]
2093 ]
2094 );
2095
2096 $repeater->add_control(
2097 'element_extra_text_pos',
2098 [
2099 'label' => esc_html__('Extra Text Display', 'king-addons'),
2100 'type' => Controls_Manager::SELECT,
2101 'options' => [
2102 'none' => esc_html__('None', 'king-addons'),
2103 'before' => esc_html__('Before Element', 'king-addons'),
2104 'after' => esc_html__('After Element', 'king-addons'),
2105 ],
2106 'default' => 'none',
2107 'condition' => [
2108 'element_select!' => [
2109 'title',
2110 'separator',
2111 'status',
2112 'price',
2113 'sale_dates',
2114 'rating',
2115 'add-to-cart',
2116 'wishlist-button',
2117 'compare-button',
2118 'excerpt'
2119 ],
2120 ]
2121 ]
2122 );
2123
2124 $repeater->add_control(
2125 'element_extra_text',
2126 [
2127 'label' => esc_html__('Extra Text', 'king-addons'),
2128 'type' => Controls_Manager::TEXT,
2129 'dynamic' => [
2130 'active' => true,
2131 ],
2132 'default' => '',
2133 'condition' => [
2134 'element_select!' => [
2135 'title',
2136 'separator',
2137 'status',
2138 'price',
2139 'sale_dates',
2140 'rating',
2141 'add-to-cart',
2142 'wishlist-button',
2143 'compare-button',
2144 'excerpt'
2145 ],
2146 'element_extra_text_pos!' => 'none'
2147 ]
2148 ]
2149 );
2150
2151 $repeater->add_control(
2152 'show_sale_starts_date',
2153 [
2154 'label' => esc_html__('Sale Starts Date', 'king-addons'),
2155 'type' => Controls_Manager::SWITCHER,
2156 'default' => 'yes',
2157 'return_value' => 'yes',
2158 'condition' => [
2159 'element_select' => [
2160 'sale_dates'
2161 ]
2162 ],
2163 ]
2164 );
2165
2166 $repeater->add_control(
2167 'element_sale_starts_text',
2168 [
2169 'label' => esc_html__('Text', 'king-addons'),
2170 'type' => Controls_Manager::TEXT,
2171 'default' => '',
2172 'condition' => [
2173 'element_select' => [
2174 'sale_dates'
2175 ],
2176 'show_sale_starts_date' => 'yes'
2177 ]
2178 ]
2179 );
2180
2181 $repeater->add_control(
2182 'show_sale_ends_date',
2183 [
2184 'label' => esc_html__('Sale Ends Date', 'king-addons'),
2185 'type' => Controls_Manager::SWITCHER,
2186 'default' => 'yes',
2187 'return_value' => 'yes',
2188 'condition' => [
2189 'element_select' => [
2190 'sale_dates'
2191 ]
2192 ],
2193 ]
2194 );
2195
2196 $repeater->add_control(
2197 'element_sale_ends_text',
2198 [
2199 'label' => esc_html__('Text', 'king-addons'),
2200 'type' => Controls_Manager::TEXT,
2201 'default' => '',
2202 'condition' => [
2203 'element_select' => [
2204 'sale_dates'
2205 ],
2206 'show_sale_ends_date' => 'yes'
2207 ]
2208 ]
2209 );
2210
2211 $repeater->add_control(
2212 'element_extra_icon_pos',
2213 [
2214 'label' => esc_html__('Extra Icon Position', 'king-addons'),
2215 'type' => Controls_Manager::SELECT,
2216 'options' => [
2217 'none' => esc_html__('None', 'king-addons'),
2218 'before' => esc_html__('Before Element', 'king-addons'),
2219 'after' => esc_html__('After Element', 'king-addons'),
2220 ],
2221 'default' => 'none',
2222 'condition' => [
2223 'element_select!' => [
2224 'title',
2225 'separator',
2226 'likes',
2227 'sharing',
2228 'status',
2229 'price',
2230 'sale_dates',
2231 'rating',
2232 'excerpt',
2233 'wishlist-button',
2234 'compare-button'
2235 ],
2236 ]
2237 ]
2238 );
2239
2240 $repeater->add_control(
2241 'element_extra_icon',
2242 [
2243 'label' => esc_html__('Select Icon', 'king-addons'),
2244 'type' => Controls_Manager::ICONS,
2245 'skin' => 'inline',
2246 'label_block' => false,
2247 'default' => [
2248 'value' => 'fas fa-search',
2249 'library' => 'fa-solid',
2250 ],
2251 'condition' => [
2252 'element_select!' => [
2253 'title',
2254 'separator',
2255 'likes',
2256 'sharing',
2257 'status',
2258 'price',
2259 'rating',
2260 'wishlist-button',
2261 'compare-button'
2262 ],
2263 'element_extra_icon_pos!' => 'none'
2264 ]
2265 ]
2266 );
2267
2268 $repeater->add_control(
2269 'show_icon',
2270 [
2271 'label' => esc_html__('Show Icon', 'king-addons'),
2272 'type' => Controls_Manager::SWITCHER,
2273 'default' => 'yes',
2274 'return_value' => 'yes',
2275 'separator' => 'before',
2276 'condition' => [
2277 'element_select' => [
2278 'wishlist-button',
2279 'compare-button'
2280 ]
2281 ]
2282 ]
2283 );
2284
2285 $repeater->add_control(
2286 'show_text',
2287 [
2288 'label' => esc_html__('Show Text', 'king-addons'),
2289 'type' => Controls_Manager::SWITCHER,
2290 'return_value' => 'yes',
2291 'condition' => [
2292 'element_select' => [
2293 'wishlist-button',
2294 'compare-button'
2295 ]
2296 ]
2297 ]
2298 );
2299
2300 $repeater->add_control(
2301 'add_to_wishlist_text',
2302 [
2303 'label' => esc_html__('Add Text', 'king-addons'),
2304 'type' => Controls_Manager::TEXT,
2305 'default' => 'Add to Wishlist',
2306 'condition' => [
2307 'element_select' => [
2308 'wishlist-button'
2309 ]
2310 ]
2311 ]
2312 );
2313
2314 $repeater->add_control(
2315 'add_to_compare_text',
2316 [
2317 'label' => esc_html__('Add Text', 'king-addons'),
2318 'type' => Controls_Manager::TEXT,
2319 'default' => 'Add to Compare',
2320 'condition' => [
2321 'element_select' => [
2322 'compare-button'
2323 ]
2324 ]
2325 ]
2326 );
2327
2328 $repeater->add_control(
2329 'remove_from_wishlist_text',
2330 [
2331 'label' => esc_html__('Remove Text', 'king-addons'),
2332 'type' => Controls_Manager::TEXT,
2333 'default' => 'Remove from Wishlist',
2334 'condition' => [
2335 'element_select' => [
2336 'wishlist-button'
2337 ]
2338 ]
2339 ]
2340 );
2341
2342 $repeater->add_control(
2343 'remove_from_compare_text',
2344 [
2345 'label' => esc_html__('Remove Text', 'king-addons'),
2346 'type' => Controls_Manager::TEXT,
2347 'default' => 'Remove from Compare',
2348 'condition' => [
2349 'element_select' => [
2350 'compare-button'
2351 ]
2352 ]
2353 ]
2354 );
2355
2356 $repeater->add_control(
2357 'animation_divider',
2358 [
2359 'type' => Controls_Manager::DIVIDER,
2360 'style' => 'thick',
2361 'condition' => [
2362 'element_location' => 'over'
2363 ],
2364 ]
2365 );
2366
2367 $repeater->add_control(
2368 'element_animation',
2369 [
2370 'label' => esc_html__('Select Animation', 'king-addons'),
2371 'type' => 'king-addons-animations',
2372 'default' => 'none',
2373 'condition' => [
2374 'element_location' => 'over'
2375 ],
2376 ]
2377 );
2378
2379
2380 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_animation', ['pro-slrt', 'pro-slxrt', 'pro-slbt', 'pro-sllt', 'pro-sltp', 'pro-slxlt', 'pro-sktp', 'pro-skrt', 'pro-skbt', 'pro-sklt', 'pro-scup', 'pro-scdn', 'pro-rllt', 'pro-rlrt',]);
2381
2382 $repeater->add_control(
2383 'element_animation_duration',
2384 [
2385 'label' => esc_html__('Animation Duration', 'king-addons'),
2386 'type' => Controls_Manager::NUMBER,
2387 'default' => 0.3,
2388 'min' => 0,
2389 'max' => 5,
2390 'step' => 0.1,
2391 'selectors' => [
2392 '{{WRAPPER}} {{CURRENT_ITEM}}' => 'transition-duration: {{VALUE}}s;'
2393 ],
2394 'condition' => [
2395 'element_animation!' => 'none',
2396 'element_location' => 'over',
2397 ],
2398 ]
2399 );
2400
2401 $repeater->add_control(
2402 'element_animation_delay',
2403 [
2404 'label' => esc_html__('Animation Delay', 'king-addons'),
2405 'type' => Controls_Manager::NUMBER,
2406 'default' => 0,
2407 'min' => 0,
2408 'max' => 5,
2409 'step' => 0.1,
2410 'selectors' => [
2411 '{{WRAPPER}} .king-addons-animation-wrap:hover {{CURRENT_ITEM}}' => 'transition-delay: {{VALUE}}s;'
2412 ],
2413 'condition' => [
2414 'element_animation!' => 'none',
2415 'element_location' => 'over'
2416 ],
2417 ]
2418 );
2419
2420 $repeater->add_control(
2421 'element_animation_timing',
2422 [
2423 'label' => esc_html__('Animation Timing', 'king-addons'),
2424 'type' => Controls_Manager::SELECT,
2425 'options' => Core::getAnimationTimings(),
2426 'default' => 'ease-default',
2427 'condition' => [
2428 'element_animation!' => 'none',
2429 'element_location' => 'over'
2430 ],
2431 ]
2432 );
2433
2434
2435 Core::renderUpgradeProNotice($repeater, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'element_animation_timing', Core::getAnimationTimingsConditionsPro());
2436
2437 $repeater->add_control(
2438 'element_animation_size',
2439 [
2440 'label' => esc_html__('Animation Size', 'king-addons'),
2441 'type' => Controls_Manager::SELECT,
2442 'options' => [
2443 'small' => esc_html__('Small', 'king-addons'),
2444 'medium' => esc_html__('Medium', 'king-addons'),
2445 'large' => esc_html__('Large', 'king-addons'),
2446 ],
2447 'default' => 'large',
2448 'condition' => [
2449 'element_animation!' => 'none',
2450 'element_location' => 'over'
2451 ],
2452 ]
2453 );
2454
2455 $repeater->add_control(
2456 'element_animation_tr',
2457 [
2458 'label' => esc_html__('Animation Transparency', 'king-addons'),
2459 'type' => Controls_Manager::SWITCHER,
2460 'default' => 'yes',
2461 'return_value' => 'yes',
2462 'condition' => [
2463 'element_animation!' => 'none',
2464 'element_location' => 'over'
2465 ],
2466 ]
2467 );
2468
2469 $repeater->add_control(
2470 'element_animation_disable_mobile',
2471 [
2472 'label' => esc_html__('Disable on Mobile/Tablet', 'king-addons'),
2473 'type' => Controls_Manager::SWITCHER,
2474 'return_value' => 'yes',
2475 'condition' => [
2476 'element_animation!' => 'none',
2477 'element_location' => 'over'
2478 ],
2479 ]
2480 );
2481
2482 $repeater->add_responsive_control(
2483 'element_show_on',
2484 [
2485 'label' => esc_html__('Show on this Device', 'king-addons'),
2486 'type' => Controls_Manager::SWITCHER,
2487 'default' => 'yes',
2488 'widescreen_default' => 'yes',
2489 'laptop_default' => 'yes',
2490 'tablet_extra_default' => 'yes',
2491 'tablet_default' => 'yes',
2492 'mobile_extra_default' => 'yes',
2493 'mobile_default' => 'yes',
2494 'selectors_dictionary' => [
2495 '' => 'position: absolute; left: -99999999px;',
2496 'yes' => 'position: static; left: auto;'
2497 ],
2498 'selectors' => [
2499 '{{WRAPPER}} {{CURRENT_ITEM}}' => '{{VALUE}}',
2500 ],
2501 'render_type' => 'template',
2502 ]
2503 );
2504
2505 $this->add_control(
2506 'grid_elements',
2507 [
2508 'label' => esc_html__('Grid Elements', 'king-addons'),
2509 'type' => Controls_Manager::REPEATER,
2510 'fields' => $repeater->get_controls(),
2511 'default' => [
2512 [
2513 'element_select' => 'status',
2514 'element_location' => 'over',
2515 'element_align_vr' => 'middle',
2516 'element_align_hr' => 'middle',
2517 'element_animation' => 'fade-in',
2518 ],
2519 [
2520 'element_select' => 'product_cat',
2521 ],
2522 [
2523 'element_select' => 'title',
2524 ],
2525 [
2526 'element_select' => 'rating',
2527 ],
2528 [
2529 'element_select' => 'price',
2530 ],
2531 [
2532 'element_select' => 'add-to-cart',
2533 ],
2534 ],
2535 'title_field' => '{{{ element_select.charAt(0).toUpperCase() + element_select.slice(1) }}}',
2536 ]
2537 );
2538
2539 $this->end_controls_section();
2540
2541
2542 $this->start_controls_section(
2543 'section_image_overlay',
2544 [
2545 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'),
2546 'tab' => Controls_Manager::TAB_CONTENT,
2547 ]
2548 );
2549
2550 $this->add_responsive_control(
2551 'overlay_width',
2552 [
2553 'label' => esc_html__('Overlay Width', 'king-addons'),
2554 'type' => Controls_Manager::SLIDER,
2555 'size_units' => ['%', 'px'],
2556 'default' => [
2557 'unit' => '%',
2558 'size' => 100,
2559 ],
2560 'range' => [
2561 '%' => [
2562 'min' => 0,
2563 'max' => 100,
2564 ],
2565 'px' => [
2566 'min' => 0,
2567 'max' => 500,
2568 ],
2569 ],
2570 'selectors' => [
2571 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'width: {{SIZE}}{{UNIT}};top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
2572 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-top"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
2573 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-bottom"]' => 'bottom:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
2574 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-right"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);right:calc((100% - {{SIZE}}{{UNIT}})/2);',
2575 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-left"]' => 'top:calc((100% - {{overlay_height.SIZE}}{{overlay_height.UNIT}})/2);left:calc((100% - {{SIZE}}{{UNIT}})/2);',
2576 ],
2577 ]
2578 );
2579
2580 $this->add_responsive_control(
2581 'overlay_height',
2582 [
2583 'label' => esc_html__('Overlay Height', 'king-addons'),
2584 'type' => Controls_Manager::SLIDER,
2585 'size_units' => ['%', 'px'],
2586 'default' => [
2587 'unit' => '%',
2588 'size' => 100,
2589 ],
2590 'range' => [
2591 '%' => [
2592 'min' => 0,
2593 'max' => 100,
2594 ],
2595 'px' => [
2596 'min' => 0,
2597 'max' => 500,
2598 ],
2599 ],
2600 'selectors' => [
2601 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'height: {{SIZE}}{{UNIT}};top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
2602 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-top"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
2603 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-bottom"]' => 'bottom:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
2604 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-right"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);right:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
2605 '{{WRAPPER}} .king-addons-grid-media-hover-bg[class*="-left"]' => 'top:calc((100% - {{SIZE}}{{UNIT}})/2);left:calc((100% - {{overlay_width.SIZE}}{{overlay_width.UNIT}})/2);',
2606 ],
2607 'separator' => 'after',
2608 ]
2609 );
2610
2611 $this->add_control(
2612 'overlay_post_link',
2613 [
2614 'label' => esc_html__('Link to Single Page', 'king-addons'),
2615 'type' => Controls_Manager::SWITCHER,
2616 'default' => 'yes',
2617 'return_value' => 'yes',
2618 'separator' => 'after',
2619 ]
2620 );
2621
2622 $this->add_control(
2623 'overlay_animation',
2624 [
2625 'label' => esc_html__('Select Animation', 'king-addons'),
2626 'type' => 'king-addons-animations-alt',
2627 'default' => 'fade-in',
2628 ]
2629 );
2630
2631
2632 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'overlay_animation', ['pro-slrt', 'pro-slxrt', 'pro-slbt', 'pro-sllt', 'pro-sltp', 'pro-slxlt', 'pro-sktp', 'pro-skrt', 'pro-skbt', 'pro-sklt', 'pro-scup', 'pro-scdn', 'pro-rllt', 'pro-rlrt',]);
2633
2634 $this->add_control(
2635 'overlay_animation_duration',
2636 [
2637 'label' => esc_html__('Animation Duration', 'king-addons'),
2638 'type' => Controls_Manager::NUMBER,
2639 'default' => 0.3,
2640 'min' => 0,
2641 'max' => 5,
2642 'step' => 0.1,
2643 'selectors' => [
2644 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'transition-duration: {{VALUE}}s;'
2645 ],
2646 'condition' => [
2647 'overlay_animation!' => 'none',
2648 ],
2649 ]
2650 );
2651
2652 $this->add_control(
2653 'overlay_animation_delay',
2654 [
2655 'label' => esc_html__('Animation Delay', 'king-addons'),
2656 'type' => Controls_Manager::NUMBER,
2657 'default' => 0,
2658 'min' => 0,
2659 'max' => 5,
2660 'step' => 0.1,
2661 'selectors' => [
2662 '{{WRAPPER}} .king-addons-animation-wrap:hover .king-addons-grid-media-hover-bg' => 'transition-delay: {{VALUE}}s;'
2663 ],
2664 'condition' => [
2665 'overlay_animation!' => 'none',
2666 ],
2667 ]
2668 );
2669
2670 $this->add_control(
2671 'overlay_animation_timing',
2672 [
2673 'label' => esc_html__('Animation Timing', 'king-addons'),
2674 'type' => Controls_Manager::SELECT,
2675 'options' => Core::getAnimationTimings(),
2676 'default' => 'ease-default',
2677 'condition' => [
2678 'overlay_animation!' => 'none',
2679 ],
2680 ]
2681 );
2682
2683
2684 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'overlay_animation_timing', Core::getAnimationTimingsConditionsPro());
2685
2686 $this->add_control(
2687 'overlay_animation_size',
2688 [
2689 'label' => esc_html__('Animation Size', 'king-addons'),
2690 'type' => Controls_Manager::SELECT,
2691 'options' => [
2692 'small' => esc_html__('Small', 'king-addons'),
2693 'medium' => esc_html__('Medium', 'king-addons'),
2694 'large' => esc_html__('Large', 'king-addons'),
2695 ],
2696 'default' => 'large',
2697 'condition' => [
2698 'overlay_animation!' => 'none',
2699 ],
2700 ]
2701 );
2702
2703 $this->add_control(
2704 'overlay_animation_tr',
2705 [
2706 'label' => esc_html__('Animation Transparency', 'king-addons'),
2707 'type' => Controls_Manager::SWITCHER,
2708 'default' => 'yes',
2709 'return_value' => 'yes',
2710 'condition' => [
2711 'overlay_animation!' => 'none',
2712 ],
2713 ]
2714 );
2715
2716 $this->add_control_overlay_animation_divider();
2717
2718 $this->add_control_overlay_image();
2719
2720 $this->add_control_overlay_image_width();
2721
2722 $this->end_controls_section();
2723
2724
2725 $this->start_controls_section(
2726 'section_image_effects',
2727 [
2728 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Image Effects', 'king-addons'),
2729 'tab' => Controls_Manager::TAB_CONTENT,
2730 ]
2731 );
2732
2733 $this->add_control_secondary_img_on_hover();
2734
2735 $this->add_control_image_effects();
2736
2737 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'image_effects', ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo']);
2738
2739 $this->add_control(
2740 'image_effects_duration',
2741 [
2742 'label' => esc_html__('Animation Duration', 'king-addons'),
2743 'type' => Controls_Manager::NUMBER,
2744 'default' => 0.5,
2745 'min' => 0,
2746 'max' => 5,
2747 'step' => 0.1,
2748 'selectors' => [
2749 '{{WRAPPER}} .king-addons-grid-media-wrap img' => 'transition-duration: {{VALUE}}s;'
2750 ],
2751 'condition' => [
2752 'image_effects!' => 'none',
2753 ],
2754 ]
2755 );
2756
2757 $this->add_control(
2758 'image_effects_delay',
2759 [
2760 'label' => esc_html__('Animation Delay', 'king-addons'),
2761 'type' => Controls_Manager::NUMBER,
2762 'default' => 0,
2763 'min' => 0,
2764 'max' => 5,
2765 'step' => 0.1,
2766 'selectors' => [
2767 '{{WRAPPER}} .king-addons-grid-media-wrap:hover img' => 'transition-delay: {{VALUE}}s;'
2768 ],
2769 'condition' => [
2770 'image_effects!' => 'none',
2771 ],
2772 ]
2773 );
2774
2775 $this->add_control(
2776 'image_effects_animation_timing',
2777 [
2778 'label' => esc_html__('Animation Timing', 'king-addons'),
2779 'type' => Controls_Manager::SELECT,
2780 'options' => Core::getAnimationTimings(),
2781 'default' => 'ease-default',
2782 'condition' => [
2783 'image_effects!' => 'none',
2784 ],
2785 ]
2786 );
2787
2788
2789 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'image_effects_animation_timing', Core::getAnimationTimingsConditionsPro());
2790
2791 $this->add_control(
2792 'image_effects_size',
2793 [
2794 'label' => esc_html__('Animation Size', 'king-addons'),
2795 'type' => Controls_Manager::SELECT,
2796 'options' => [
2797 'small' => esc_html__('Small', 'king-addons'),
2798 'medium' => esc_html__('Medium', 'king-addons'),
2799 'large' => esc_html__('Large', 'king-addons'),
2800 ],
2801 'default' => 'medium',
2802 'condition' => [
2803 'image_effects!' => ['none', 'slide'],
2804 ]
2805 ]
2806 );
2807
2808 $this->add_control(
2809 'image_effects_direction',
2810 [
2811 'label' => esc_html__('Animation Direction', 'king-addons'),
2812 'type' => Controls_Manager::SELECT,
2813 'options' => [
2814 'top' => esc_html__('Top', 'king-addons'),
2815 'right' => esc_html__('Right', 'king-addons'),
2816 'bottom' => esc_html__('Bottom', 'king-addons'),
2817 'left' => esc_html__('Left', 'king-addons'),
2818 ],
2819 'default' => 'bottom',
2820 'condition' => [
2821 'image_effects!' => 'none',
2822 'image_effects' => 'slide'
2823 ]
2824 ]
2825 );
2826
2827 $this->end_controls_section();
2828
2829
2830 $this->start_controls_section(
2831 'section_lightbox_popup',
2832 [
2833 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Lightbox Popup', 'king-addons'),
2834 'tab' => Controls_Manager::TAB_CONTENT,
2835 ]
2836 );
2837
2838 $this->add_control(
2839 'lightbox_popup_autoplay',
2840 [
2841 'label' => esc_html__('Autoplay Slides', 'king-addons'),
2842 'type' => Controls_Manager::SWITCHER,
2843 'default' => 'true',
2844 'return_value' => 'true',
2845 ]
2846 );
2847
2848 $this->add_control(
2849 'lightbox_popup_progressbar',
2850 [
2851 'label' => esc_html__('Show Progress Bar', 'king-addons'),
2852 'type' => Controls_Manager::SWITCHER,
2853 'default' => 'true',
2854 'return_value' => 'true',
2855 'condition' => [
2856 'lightbox_popup_autoplay' => 'true'
2857 ]
2858 ]
2859 );
2860
2861 $this->add_control(
2862 'lightbox_popup_pause',
2863 [
2864 'label' => esc_html__('Autoplay Speed', 'king-addons'),
2865 'type' => Controls_Manager::NUMBER,
2866 'default' => 5,
2867 'min' => 1,
2868 'max' => 10,
2869 'step' => 1,
2870 'condition' => [
2871 'lightbox_popup_autoplay' => 'true',
2872 ],
2873 ]
2874 );
2875
2876 $this->add_control(
2877 'lightbox_popup_counter',
2878 [
2879 'label' => esc_html__('Show Counter', 'king-addons'),
2880 'type' => Controls_Manager::SWITCHER,
2881 'default' => 'true',
2882 'return_value' => 'true',
2883 ]
2884 );
2885
2886 $this->add_control(
2887 'lightbox_popup_arrows',
2888 [
2889 'label' => esc_html__('Show Arrows', 'king-addons'),
2890 'type' => Controls_Manager::SWITCHER,
2891 'default' => 'true',
2892 'return_value' => 'true',
2893 ]
2894 );
2895
2896 $this->add_control(
2897 'lightbox_popup_captions',
2898 [
2899 'label' => esc_html__('Show Captions', 'king-addons'),
2900 'type' => Controls_Manager::SWITCHER,
2901 'default' => 'true',
2902 'return_value' => 'true',
2903 ]
2904 );
2905
2906 $this->add_control_lightbox_popup_thumbnails();
2907
2908 $this->add_control_lightbox_popup_thumbnails_default();
2909
2910 $this->add_control_lightbox_popup_sharing();
2911
2912 $this->add_control(
2913 'lightbox_popup_zoom',
2914 [
2915 'label' => esc_html__('Show Zoom Button', 'king-addons'),
2916 'type' => Controls_Manager::SWITCHER,
2917 'default' => 'true',
2918 'return_value' => 'true',
2919 ]
2920 );
2921
2922 $this->add_control(
2923 'lightbox_popup_fullscreen',
2924 [
2925 'label' => esc_html__('Show Full Screen Button', 'king-addons'),
2926 'type' => Controls_Manager::SWITCHER,
2927 'default' => 'true',
2928 'return_value' => 'true',
2929 ]
2930 );
2931
2932 $this->add_control(
2933 'lightbox_popup_download',
2934 [
2935 'label' => esc_html__('Show Download Button', 'king-addons'),
2936 'type' => Controls_Manager::SWITCHER,
2937 'default' => 'true',
2938 'return_value' => 'true',
2939 ]
2940 );
2941
2942 $this->add_control(
2943 'lightbox_popup_description',
2944 [
2945 'raw' => sprintf(__('You can change Lightbox Popup styling options globaly. Navigate to <strong>Dashboard > %s > Settings</strong>.', 'king-addons'), Core::getPluginName()),
2946 'type' => Controls_Manager::RAW_HTML,
2947 'separator' => 'before',
2948 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
2949 ]
2950 );
2951
2952 $this->end_controls_section();
2953
2954 $this->add_section_grid_sorting();
2955
2956
2957 $this->start_controls_section(
2958 'section_grid_filters',
2959 [
2960 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Filters', 'king-addons'),
2961 'tab' => Controls_Manager::TAB_CONTENT,
2962 'condition' => [
2963 'layout_select!' => 'slider',
2964 'layout_filters' => 'yes',
2965 ],
2966 ]
2967 );
2968
2969 $this->add_control(
2970 'filters_select',
2971 [
2972 'label' => esc_html__('Select Taxonomy', 'king-addons'),
2973 'type' => Controls_Manager::SELECT,
2974 'options' => [
2975 'product_cat' => esc_html__('Categories', 'king-addons'),
2976 'product_tag' => esc_html__('Tags', 'king-addons'),
2977 ],
2978 'default' => 'product_cat',
2979 'separator' => 'after',
2980 ]
2981 );
2982
2983 $this->add_control(
2984 'filters_linkable',
2985 [
2986 'label' => esc_html__('Set Linkable Filters', 'king-addons'),
2987 'type' => Controls_Manager::SWITCHER,
2988 'default' => 'no',
2989 'return_value' => 'yes',
2990 ]
2991 );
2992
2993 $this->add_control(
2994 'filters_hide_empty',
2995 [
2996 'label' => esc_html__('Hide Empty Filters', 'king-addons'),
2997 'type' => Controls_Manager::SWITCHER,
2998 'default' => 'no',
2999 'return_value' => 'yes',
3000 'condition' => [
3001 'filters_linkable!' => 'yes',
3002 ],
3003 ]
3004 );
3005
3006 $this->add_control_filters_deeplinking();
3007
3008 $this->add_control(
3009 'filters_all',
3010 [
3011 'label' => esc_html__('Show "All" Filter', 'king-addons'),
3012 'type' => Controls_Manager::SWITCHER,
3013 'default' => 'yes',
3014 'return_value' => 'yes',
3015 'condition' => [
3016 'filters_linkable!' => 'yes',
3017 ],
3018 ]
3019 );
3020
3021 $this->add_control(
3022 'filters_all_text',
3023 [
3024 'label' => esc_html__('"All" Filter Text', 'king-addons'),
3025 'type' => Controls_Manager::TEXT,
3026 'dynamic' => [
3027 'active' => true,
3028 ],
3029 'default' => 'All',
3030 'condition' => [
3031 'filters_all' => 'yes',
3032 'filters_linkable!' => 'yes',
3033 ],
3034 ]
3035 );
3036
3037 $this->add_control_filters_count();
3038
3039 $this->add_control_filters_count_superscript();
3040
3041 $this->add_control_filters_count_brackets();
3042
3043 $this->add_control_filters_default_filter();
3044
3045 $this->add_control_filters_icon();
3046
3047 $this->add_control_filters_icon_align();
3048
3049 $this->add_control(
3050 'filters_separator',
3051 [
3052 'label' => esc_html__('Separator', 'king-addons'),
3053 'type' => Controls_Manager::TEXT,
3054 'dynamic' => [
3055 'active' => true,
3056 ],
3057 'default' => '',
3058 'separator' => 'before',
3059 ]
3060 );
3061
3062 $this->add_control(
3063 'filters_separator_align',
3064 [
3065 'label' => esc_html__('Separator Position', 'king-addons'),
3066 'type' => Controls_Manager::CHOOSE,
3067 'label_block' => false,
3068 'default' => 'right',
3069 'options' => [
3070 'left' => [
3071 'title' => esc_html__('Left', 'king-addons'),
3072 'icon' => 'eicon-h-align-left',
3073 ],
3074 'right' => [
3075 'title' => esc_html__('Right', 'king-addons'),
3076 'icon' => 'eicon-h-align-right',
3077 ]
3078 ],
3079 'condition' => [
3080 'filters_separator!' => '',
3081 ],
3082 ]
3083 );
3084
3085 $this->add_responsive_control(
3086 'filters_align',
3087 [
3088 'label' => esc_html__('Align', 'king-addons'),
3089 'type' => Controls_Manager::CHOOSE,
3090 'label_block' => false,
3091 'default' => 'center',
3092 'options' => [
3093 'left' => [
3094 'title' => esc_html__('Left', 'king-addons'),
3095 'icon' => 'eicon-h-align-left',
3096 ],
3097 'center' => [
3098 'title' => esc_html__('Center', 'king-addons'),
3099 'icon' => 'eicon-h-align-center',
3100 ],
3101 'right' => [
3102 'title' => esc_html__('Right', 'king-addons'),
3103 'icon' => 'eicon-h-align-right',
3104 ]
3105 ],
3106 'selectors' => [
3107 '{{WRAPPER}} .king-addons-grid-filters' => 'text-align: {{VALUE}}',
3108 ],
3109 'separator' => 'before',
3110 ]
3111 );
3112
3113 $this->add_control_filters_animation();
3114
3115
3116 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'filters_animation', ['pro-fd', 'pro-fs']);
3117
3118 $this->add_control(
3119 'filters_animation_duration',
3120 [
3121 'label' => esc_html__('Animation Duration', 'king-addons'),
3122 'type' => Controls_Manager::NUMBER,
3123 'default' => 0.3,
3124 'min' => 0,
3125 'max' => 5,
3126 'step' => 0.1,
3127 'condition' => [
3128 'filters_animation!' => 'default',
3129 ],
3130 ]
3131 );
3132
3133 $this->add_control(
3134 'filters_animation_delay',
3135 [
3136 'label' => esc_html__('Animation Delay', 'king-addons'),
3137 'type' => Controls_Manager::NUMBER,
3138 'default' => 0.1,
3139 'min' => 0,
3140 'max' => 5,
3141 'step' => 0.05,
3142 'condition' => [
3143 'filters_animation!' => 'default'
3144 ],
3145 ]
3146 );
3147
3148 $this->end_controls_section();
3149
3150
3151 $this->start_controls_section(
3152 'section_grid_pagination',
3153 [
3154 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Pagination', 'king-addons'),
3155 'tab' => Controls_Manager::TAB_CONTENT,
3156 'condition' => [
3157 'layout_select!' => 'slider',
3158 'layout_pagination' => 'yes',
3159 ],
3160 ]
3161 );
3162
3163 $this->add_control_pagination_type();
3164
3165
3166 Core::renderUpgradeProNotice($this, Controls_Manager::RAW_HTML, 'woocommerce-grid', 'pagination_type', ['pro-is']);
3167
3168 $this->add_control(
3169 'pagination_older_text',
3170 [
3171 'label' => esc_html__('Older Posts Text', 'king-addons'),
3172 'type' => Controls_Manager::TEXT,
3173 'dynamic' => [
3174 'active' => true,
3175 ],
3176 'default' => 'Older Posts',
3177 'condition' => [
3178 'pagination_type' => 'default',
3179 ],
3180 ]
3181 );
3182
3183 $this->add_control(
3184 'pagination_newer_text',
3185 [
3186 'label' => esc_html__('Newer Posts Text', 'king-addons'),
3187 'type' => Controls_Manager::TEXT,
3188 'dynamic' => [
3189 'active' => true,
3190 ],
3191 'default' => 'Newer Posts',
3192 'condition' => [
3193 'pagination_type' => 'default',
3194 ]
3195 ]
3196 );
3197
3198 $this->add_control(
3199 'pagination_on_icon',
3200 [
3201 'label' => esc_html__('Select Icon', 'king-addons'),
3202 'type' => Controls_Manager::SELECT,
3203 'default' => 'fas fa-angle',
3204 'options' => [
3205 'fas fa-angle' => esc_html__('Angle', 'king-addons'),
3206 'fas fa-angle-double' => esc_html__('Angle Double', 'king-addons'),
3207 'fas fa-arrow' => esc_html__('Arrow', 'king-addons'),
3208 'fas fa-arrow-alt-circle' => esc_html__('Arrow Circle', 'king-addons'),
3209 'far fa-arrow-alt-circle' => esc_html__('Arrow Circle Alt', 'king-addons'),
3210 'fas fa-long-arrow-alt' => esc_html__('Long Arrow', 'king-addons'),
3211 'fas fa-chevron' => esc_html__('Chevron', 'king-addons'),
3212 ],
3213 'condition' => [
3214 'pagination_type' => 'default'
3215 ],
3216 ]
3217 );
3218
3219 $this->add_control(
3220 'pagination_prev_next',
3221 [
3222 'label' => esc_html__('Previous & Next Buttons', 'king-addons'),
3223 'type' => Controls_Manager::SWITCHER,
3224 'default' => 'no',
3225 'return_value' => 'yes',
3226 'condition' => [
3227 'pagination_type' => 'numbered',
3228 ],
3229 ]
3230 );
3231
3232 $this->add_control(
3233 'pagination_prev_text',
3234 [
3235 'label' => esc_html__('Prev Page Text', 'king-addons'),
3236 'type' => Controls_Manager::TEXT,
3237 'dynamic' => [
3238 'active' => true,
3239 ],
3240 'default' => 'Previous Page',
3241 'condition' => [
3242 'pagination_type' => 'numbered',
3243 'pagination_prev_next' => 'yes',
3244 ],
3245 ]
3246 );
3247
3248 $this->add_control(
3249 'pagination_next_text',
3250 [
3251 'label' => esc_html__('Next Page Text', 'king-addons'),
3252 'type' => Controls_Manager::TEXT,
3253 'dynamic' => [
3254 'active' => true,
3255 ],
3256 'default' => 'Next Page',
3257 'condition' => [
3258 'pagination_type' => 'numbered',
3259 'pagination_prev_next' => 'yes',
3260 ]
3261 ]
3262 );
3263
3264 $this->add_control(
3265 'pagination_pn_icon',
3266 [
3267 'label' => esc_html__('Select Icon', 'king-addons'),
3268 'type' => Controls_Manager::SELECT,
3269 'default' => 'fas fa-angle',
3270 'options' => [
3271 'fas fa-angle' => esc_html__('Angle', 'king-addons'),
3272 'fas fa-angle-double' => esc_html__('Angle Double', 'king-addons'),
3273 'fas fa-arrow' => esc_html__('Arrow', 'king-addons'),
3274 'fas fa-arrow-alt-circle' => esc_html__('Arrow Circle', 'king-addons'),
3275 'far fa-arrow-alt-circle' => esc_html__('Arrow Circle Alt', 'king-addons'),
3276 'fas fa-long-arrow-alt' => esc_html__('Long Arrow', 'king-addons'),
3277 'fas fa-chevron' => esc_html__('Chevron', 'king-addons'),
3278 ],
3279 'condition' => [
3280 'pagination_type' => 'numbered',
3281 'pagination_prev_next' => 'yes'
3282 ],
3283 ]
3284 );
3285
3286 $this->add_control(
3287 'pagination_first_last',
3288 [
3289 'label' => esc_html__('First & Last Buttons', 'king-addons'),
3290 'type' => Controls_Manager::SWITCHER,
3291 'default' => 'no',
3292 'return_value' => 'yes',
3293 'condition' => [
3294 'pagination_type' => 'numbered',
3295 ],
3296 ]
3297 );
3298
3299 $this->add_control(
3300 'pagination_first_text',
3301 [
3302 'label' => esc_html__('First Page Text', 'king-addons'),
3303 'type' => Controls_Manager::TEXT,
3304 'dynamic' => [
3305 'active' => true,
3306 ],
3307 'default' => 'First Page',
3308 'condition' => [
3309 'pagination_type' => 'numbered',
3310 'pagination_first_last' => 'yes',
3311 ],
3312 ]
3313 );
3314
3315 $this->add_control(
3316 'pagination_last_text',
3317 [
3318 'label' => esc_html__('Last Page Text', 'king-addons'),
3319 'type' => Controls_Manager::TEXT,
3320 'dynamic' => [
3321 'active' => true,
3322 ],
3323 'default' => 'Last Page',
3324 'condition' => [
3325 'pagination_type' => 'numbered',
3326 'pagination_first_last' => 'yes',
3327 ]
3328 ]
3329 );
3330
3331 $this->add_control(
3332 'pagination_fl_icon',
3333 [
3334 'label' => esc_html__('Select Icon', 'king-addons'),
3335 'type' => Controls_Manager::SELECT,
3336 'default' => 'fas fa-angle',
3337 'options' => [
3338 'fas fa-angle' => esc_html__('Angle', 'king-addons'),
3339 'fas fa-angle-double' => esc_html__('Angle Double', 'king-addons'),
3340 'fas fa-arrow' => esc_html__('Arrow', 'king-addons'),
3341 'fas fa-arrow-alt-circle' => esc_html__('Arrow Circle', 'king-addons'),
3342 'far fa-arrow-alt-circle' => esc_html__('Arrow Circle Alt', 'king-addons'),
3343 'fas fa-long-arrow-alt' => esc_html__('Long Arrow', 'king-addons'),
3344 'fas fa-chevron' => esc_html__('Chevron', 'king-addons'),
3345 ],
3346 'condition' => [
3347 'pagination_type' => 'numbered',
3348 'pagination_first_last' => 'yes'
3349 ],
3350 ]
3351 );
3352
3353 $this->add_control(
3354 'pagination_disabled_arrows',
3355 [
3356 'label' => esc_html__('Show Disabled Buttons', 'king-addons'),
3357 'type' => Controls_Manager::SWITCHER,
3358 'return_value' => 'yes',
3359 'condition' => [
3360 'pagination_type' => ['default', 'numbered'],
3361 ],
3362 ]
3363 );
3364
3365 $this->add_control(
3366 'pagination_range',
3367 [
3368 'label' => esc_html__('Range', 'king-addons'),
3369 'type' => Controls_Manager::NUMBER,
3370 'default' => 2,
3371 'min' => 1,
3372 'condition' => [
3373 'pagination_type' => 'numbered',
3374 ]
3375 ]
3376 );
3377
3378 $this->add_control(
3379 'pagination_load_more_text',
3380 [
3381 'label' => esc_html__('Load More Text', 'king-addons'),
3382 'type' => Controls_Manager::TEXT,
3383 'dynamic' => [
3384 'active' => true,
3385 ],
3386 'default' => 'Load More',
3387 'condition' => [
3388 'pagination_type' => 'load-more',
3389 ]
3390 ]
3391 );
3392
3393 $this->add_control(
3394 'pagination_finish_text',
3395 [
3396 'label' => esc_html__('Finish Text', 'king-addons'),
3397 'type' => Controls_Manager::TEXT,
3398 'dynamic' => [
3399 'active' => true,
3400 ],
3401 'default' => 'End of Content.',
3402 'condition' => [
3403 'pagination_type' => ['load-more', 'infinite-scroll'],
3404 ]
3405 ]
3406 );
3407
3408 $this->add_control(
3409 'pagination_animation',
3410 [
3411 'label' => esc_html__('Select Animation', 'king-addons'),
3412 'type' => Controls_Manager::SELECT,
3413 'default' => 'loader-1',
3414 'options' => [
3415 'none' => esc_html__('None', 'king-addons'),
3416 'loader-1' => esc_html__('Loader 1', 'king-addons'),
3417 'loader-2' => esc_html__('Loader 2', 'king-addons'),
3418 'loader-3' => esc_html__('Loader 3', 'king-addons'),
3419 'loader-4' => esc_html__('Loader 4', 'king-addons'),
3420 'loader-5' => esc_html__('Loader 5', 'king-addons'),
3421 'loader-6' => esc_html__('Loader 6', 'king-addons'),
3422 ],
3423 'condition' => [
3424 'pagination_type' => ['load-more', 'infinite-scroll'],
3425 ]
3426 ]
3427 );
3428
3429 $this->add_control(
3430 'pagination_align',
3431 [
3432 'label' => esc_html__('Alignment', 'king-addons'),
3433 'type' => Controls_Manager::CHOOSE,
3434 'options' => [
3435 'left' => [
3436 'title' => esc_html__('Left', 'king-addons'),
3437 'icon' => 'eicon-text-align-left',
3438 ],
3439 'center' => [
3440 'title' => esc_html__('Center', 'king-addons'),
3441 'icon' => 'eicon-text-align-center',
3442 ],
3443 'right' => [
3444 'title' => esc_html__('Right', 'king-addons'),
3445 'icon' => 'eicon-text-align-right',
3446 ],
3447 'justify' => [
3448 'title' => esc_html__('Justified', 'king-addons'),
3449 'icon' => 'eicon-text-align-justify',
3450 ],
3451 ],
3452 'default' => 'center',
3453 'prefix_class' => 'king-addons-grid-pagination-',
3454 'render_type' => 'template',
3455 'separator' => 'before',
3456 'condition' => [
3457 'pagination_type!' => 'infinite-scroll',
3458 ]
3459 ]
3460 );
3461
3462 $this->end_controls_section();
3463
3464 Core::renderProFeaturesSection($this, '', Controls_Manager::RAW_HTML, 'woocommerce-grid', [
3465 'Grid Columns 1, 2, 3, 4, 5, 6',
3466 'Masonry Layout',
3467 'Products Slider Columns (Carousel) 1, 2, 3, 4, 5, 6',
3468 'Products Slider Autoplay Options',
3469 'Products Slider Advanced Navigation Positioning',
3470 'Products Slider Advanced Pagination Positioning',
3471 'Infinite Scrolling Pagination',
3472 'Current Page Query, Random Products Query',
3473 'Custom Fields/Attributes Support',
3474 'Wishlist & Compare Buttons',
3475 'Advanced Grid Loading Animations (Fade In & Slide Up)',
3476 'Advanced Grid Elements Positioning',
3477 'Advanced Products Likes',
3478 'Advanced Products Sharing',
3479 'Unlimited Image Overlay Animations',
3480 'Image Overlay GIF Upload Option',
3481 'Image Overlay Blend Mode',
3482 'Image Effects: Zoom, Grayscale, Blur',
3483 'Lightbox Thumbnail Gallery, Lightbox Image Sharing Button',
3484 'Grid Category Filter Deeplinking',
3485 'Grid Category Filter Icons Select',
3486 'Grid Category Filter Count',
3487 'Grid Item Even/Odd Background Color',
3488 'Title, Category, Read More Advanced Link Hover Animation',
3489 'Secondary Featured Image',
3490 'Open Links in New Tab'
3491 ]);
3492
3493 $this->start_controls_section(
3494 'section_style_grid_item',
3495 [
3496 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Grid Item', 'king-addons'),
3497 'tab' => Controls_Manager::TAB_STYLE,
3498 'show_label' => false,
3499 ]
3500 );
3501
3502 $this->add_control(
3503 'grid_item_styles_selector',
3504 [
3505 'label' => esc_html__('Apply Styles To', 'king-addons'),
3506 'type' => Controls_Manager::SELECT,
3507 'options' => [
3508 'inner' => esc_html__('Inner Elements', 'king-addons'),
3509 'wrapper' => esc_html__('Wrapper', 'king-addons')
3510 ],
3511 'default' => 'inner',
3512 'prefix_class' => 'king-addons-item-styles-'
3513 ]
3514 );
3515
3516 $this->add_control(
3517 'grid_item_bg_color',
3518 [
3519 'label' => esc_html__('Background Color', 'king-addons'),
3520 'type' => Controls_Manager::COLOR,
3521 'default' => '',
3522 'selectors' => [
3523 '{{WRAPPER}} .king-addons-grid-item-above-content' => 'background-color: {{VALUE}}',
3524 '{{WRAPPER}} .king-addons-grid-item-below-content' => 'background-color: {{VALUE}}',
3525 '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'background-color: {{VALUE}}'
3526 ]
3527 ]
3528 );
3529
3530 $this->add_control(
3531 'grid_item_border_color',
3532 [
3533 'label' => esc_html__('Border Color', 'king-addons'),
3534 'type' => Controls_Manager::COLOR,
3535 'default' => '#E8E8E8',
3536 'selectors' => [
3537 '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-above-content' => 'border-color: {{VALUE}}',
3538 '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-below-content' => 'border-color: {{VALUE}}',
3539 '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'border-color: {{VALUE}}'
3540 ]
3541 ]
3542 );
3543
3544 $this->add_control_grid_item_even_bg_color();
3545
3546 $this->add_control_grid_item_even_border_color();
3547
3548 $this->add_control(
3549 'grid_item_border_type',
3550 [
3551 'label' => esc_html__('Border Type', 'king-addons'),
3552 'type' => Controls_Manager::SELECT,
3553 'options' => [
3554 'none' => esc_html__('None', 'king-addons'),
3555 'solid' => esc_html__('Solid', 'king-addons'),
3556 'double' => esc_html__('Double', 'king-addons'),
3557 'dotted' => esc_html__('Dotted', 'king-addons'),
3558 'dashed' => esc_html__('Dashed', 'king-addons'),
3559 'groove' => esc_html__('Groove', 'king-addons'),
3560 ],
3561 'default' => 'none',
3562 'selectors' => [
3563 '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-above-content' => 'border-style: {{VALUE}};',
3564 '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-below-content' => 'border-style: {{VALUE}};',
3565 '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'border-style: {{VALUE}}'
3566 ],
3567 'separator' => 'before',
3568 ]
3569 );
3570
3571 $this->add_control(
3572 'grid_item_border_width',
3573 [
3574 'label' => esc_html__('Border Width', 'king-addons'),
3575 'type' => Controls_Manager::DIMENSIONS,
3576 'size_units' => ['px'],
3577 'default' => [
3578 'top' => 1,
3579 'right' => 1,
3580 'bottom' => 1,
3581 'left' => 1,
3582 ],
3583 'selectors' => [
3584 '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-above-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3585 '{{WRAPPER}}.king-addons-item-styles-inner .king-addons-grid-item-below-content' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3586 '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
3587 ],
3588 'condition' => [
3589 'grid_item_border_type!' => 'none',
3590 ],
3591 'render_type' => 'template'
3592 ]
3593 );
3594
3595 $this->add_responsive_control(
3596 'grid_item_padding',
3597 [
3598 'label' => esc_html__('Padding', 'king-addons'),
3599 'type' => Controls_Manager::DIMENSIONS,
3600 'size_units' => ['px', '%'],
3601 'default' => [
3602 'top' => 10,
3603 'right' => 0,
3604 'bottom' => 0,
3605 'left' => 0,
3606 ],
3607 'selectors' => [
3608 '{{WRAPPER}} .king-addons-grid-item-above-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3609 '{{WRAPPER}} .king-addons-grid-item-below-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3610 '{{WRAPPER}}.king-addons-item-styles-wrapper .king-addons-grid-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
3611 ],
3612 'render_type' => 'template'
3613 ]
3614 );
3615
3616 $this->add_control(
3617 'grid_item_radius',
3618 [
3619 'label' => esc_html__('Border Radius', 'king-addons'),
3620 'type' => Controls_Manager::DIMENSIONS,
3621 'size_units' => ['px', '%'],
3622 'default' => [
3623 'top' => 0,
3624 'right' => 0,
3625 'bottom' => 0,
3626 'left' => 0,
3627 ],
3628 'selectors' => [
3629 '{{WRAPPER}} .king-addons-grid-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3630 '{{WRAPPER}} .king-addons-grid-item-above-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3631 '{{WRAPPER}} .king-addons-grid-item-below-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3632 ],
3633 'separator' => 'before',
3634 ]
3635 );
3636
3637 $this->add_group_control(
3638 Group_Control_Box_Shadow::get_type(),
3639 [
3640 'name' => 'grid_item_shadow',
3641 'selector' => '{{WRAPPER}} .king-addons-grid-item',
3642 ]
3643 );
3644
3645 $this->end_controls_section();
3646
3647
3648 $this->start_controls_section(
3649 'section_style_grid_media',
3650 [
3651 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Grid Media', 'king-addons'),
3652 'tab' => Controls_Manager::TAB_STYLE,
3653 'show_label' => false,
3654 ]
3655 );
3656
3657 $this->add_control(
3658 'grid_media_border_color',
3659 [
3660 'label' => esc_html__('Border Color', 'king-addons'),
3661 'type' => Controls_Manager::COLOR,
3662 'default' => '#E8E8E8',
3663 'selectors' => [
3664 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-color: {{VALUE}}',
3665 ],
3666 ]
3667 );
3668
3669 $this->add_control(
3670 'grid_media_border_type',
3671 [
3672 'label' => esc_html__('Border Type', 'king-addons'),
3673 'type' => Controls_Manager::SELECT,
3674 'options' => [
3675 'none' => esc_html__('None', 'king-addons'),
3676 'solid' => esc_html__('Solid', 'king-addons'),
3677 'double' => esc_html__('Double', 'king-addons'),
3678 'dotted' => esc_html__('Dotted', 'king-addons'),
3679 'dashed' => esc_html__('Dashed', 'king-addons'),
3680 'groove' => esc_html__('Groove', 'king-addons'),
3681 ],
3682 'default' => 'none',
3683 'selectors' => [
3684 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-style: {{VALUE}};',
3685 ],
3686 ]
3687 );
3688
3689 $this->add_control(
3690 'grid_media_border_width',
3691 [
3692 'label' => esc_html__('Border Width', 'king-addons'),
3693 'type' => Controls_Manager::DIMENSIONS,
3694 'size_units' => ['px'],
3695 'default' => [
3696 'top' => 1,
3697 'right' => 1,
3698 'bottom' => 1,
3699 'left' => 1,
3700 ],
3701 'selectors' => [
3702 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3703 ],
3704 'condition' => [
3705 'grid_media_border_type!' => 'none',
3706 ],
3707 ]
3708 );
3709
3710 $this->add_control(
3711 'grid_media_radius',
3712 [
3713 'label' => esc_html__('Border Radius', 'king-addons'),
3714 'type' => Controls_Manager::DIMENSIONS,
3715 'size_units' => ['px', '%'],
3716 'default' => [
3717 'top' => 0,
3718 'right' => 0,
3719 'bottom' => 0,
3720 'left' => 0,
3721 ],
3722 'selectors' => [
3723 '{{WRAPPER}} .king-addons-grid-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3724 ],
3725 'separator' => 'before',
3726 ]
3727 );
3728
3729 $this->end_controls_section();
3730
3731
3732 $this->start_controls_section(
3733 'section_style_overlay',
3734 [
3735 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Media Overlay', 'king-addons'),
3736 'tab' => Controls_Manager::TAB_STYLE,
3737 'show_label' => false,
3738 ]
3739 );
3740
3741 $this->add_control_overlay_color();
3742
3743 $this->add_control_overlay_blend_mode();
3744
3745 $this->add_control_overlay_border_color();
3746
3747 $this->add_control_overlay_border_type();
3748
3749 $this->add_control_overlay_border_width();
3750
3751 $this->add_control(
3752 'overlay_radius',
3753 [
3754 'label' => esc_html__('Border Radius', 'king-addons'),
3755 'type' => Controls_Manager::DIMENSIONS,
3756 'size_units' => ['px', '%'],
3757 'default' => [
3758 'top' => 0,
3759 'right' => 0,
3760 'bottom' => 0,
3761 'left' => 0,
3762 ],
3763 'selectors' => [
3764 '{{WRAPPER}} .king-addons-grid-media-hover-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3765 ],
3766 'separator' => 'before',
3767 ]
3768 );
3769
3770 $this->end_controls_section();
3771
3772
3773 $this->start_controls_section(
3774 'section_style_title',
3775 [
3776 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Title', 'king-addons'),
3777 'tab' => Controls_Manager::TAB_STYLE,
3778 'show_label' => false,
3779 ]
3780 );
3781
3782 $this->start_controls_tabs('tabs_grid_title_style');
3783
3784 $this->start_controls_tab(
3785 'tab_grid_title_normal',
3786 [
3787 'label' => esc_html__('Normal', 'king-addons'),
3788 ]
3789 );
3790
3791 $this->add_control(
3792 'title_color',
3793 [
3794 'label' => esc_html__('Color', 'king-addons'),
3795 'type' => Controls_Manager::COLOR,
3796 'default' => '#333333',
3797 'selectors' => [
3798 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'color: {{VALUE}}',
3799 ],
3800 ]
3801 );
3802
3803 $this->add_control(
3804 'title_bg_color',
3805 [
3806 'label' => esc_html__('Background Color', 'king-addons'),
3807 'type' => Controls_Manager::COLOR,
3808 'selectors' => [
3809 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'background-color: {{VALUE}}',
3810 ]
3811 ]
3812 );
3813
3814 $this->add_control(
3815 'title_border_color',
3816 [
3817 'label' => esc_html__('Border Color', 'king-addons'),
3818 'type' => Controls_Manager::COLOR,
3819 'default' => '#E8E8E8',
3820 'selectors' => [
3821 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-color: {{VALUE}}',
3822 ],
3823 'separator' => 'after',
3824 ]
3825 );
3826
3827 $this->end_controls_tab();
3828
3829 $this->start_controls_tab(
3830 'tab_grid_title_hover',
3831 [
3832 'label' => esc_html__('Hover', 'king-addons'),
3833 ]
3834 );
3835
3836 $this->add_control(
3837 'title_color_hr',
3838 [
3839 'label' => esc_html__('Color', 'king-addons'),
3840 'type' => Controls_Manager::COLOR,
3841 'default' => '#54595f',
3842 'selectors' => [
3843 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'color: {{VALUE}}',
3844 ],
3845 ]
3846 );
3847
3848 $this->add_control(
3849 'title_bg_color_hr',
3850 [
3851 'label' => esc_html__('Background Color', 'king-addons'),
3852 'type' => Controls_Manager::COLOR,
3853 'selectors' => [
3854 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'background-color: {{VALUE}}',
3855 ]
3856 ]
3857 );
3858
3859 $this->add_control(
3860 'title_border_color_hr',
3861 [
3862 'label' => esc_html__('Border Color', 'king-addons'),
3863 'type' => Controls_Manager::COLOR,
3864 'default' => '#E8E8E8',
3865 'selectors' => [
3866 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a:hover' => 'border-color: {{VALUE}}',
3867 ],
3868 ]
3869 );
3870
3871 $this->add_control_title_pointer_color_hr();
3872
3873 $this->end_controls_tab();
3874
3875 $this->end_controls_tabs();
3876
3877 $this->add_control_title_pointer();
3878
3879 $this->add_control_title_pointer_height();
3880
3881 $this->add_control_title_pointer_animation();
3882
3883 $this->add_control(
3884 'title_transition_duration',
3885 [
3886 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
3887 'type' => Controls_Manager::NUMBER,
3888 'default' => 0.3,
3889 'min' => 0,
3890 'max' => 5,
3891 'step' => 0.1,
3892 'selectors' => [
3893 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'transition-duration: {{VALUE}}s',
3894 '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
3895 '{{WRAPPER}} .king-addons-grid-item-title .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
3896 ],
3897 'separator' => 'after',
3898 ]
3899 );
3900
3901 $this->add_group_control(
3902 Group_Control_Typography::get_type(),
3903 [
3904 'name' => 'title_typography',
3905 'selector' => '{{WRAPPER}} .king-addons-grid-item-title a'
3906 ]
3907 );
3908
3909 $this->add_control(
3910 'title_border_type',
3911 [
3912 'label' => esc_html__('Border Type', 'king-addons'),
3913 'type' => Controls_Manager::SELECT,
3914 'options' => [
3915 'none' => esc_html__('None', 'king-addons'),
3916 'solid' => esc_html__('Solid', 'king-addons'),
3917 'double' => esc_html__('Double', 'king-addons'),
3918 'dotted' => esc_html__('Dotted', 'king-addons'),
3919 'dashed' => esc_html__('Dashed', 'king-addons'),
3920 'groove' => esc_html__('Groove', 'king-addons'),
3921 ],
3922 'default' => 'none',
3923 'selectors' => [
3924 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-style: {{VALUE}};',
3925 ],
3926 'render_type' => 'template',
3927 'separator' => 'before',
3928 ]
3929 );
3930
3931 $this->add_control(
3932 'title_border_width',
3933 [
3934 'label' => esc_html__('Border Width', 'king-addons'),
3935 'type' => Controls_Manager::DIMENSIONS,
3936 'size_units' => ['px'],
3937 'default' => [
3938 'top' => 1,
3939 'right' => 1,
3940 'bottom' => 1,
3941 'left' => 1,
3942 ],
3943 'selectors' => [
3944 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3945 ],
3946 'render_type' => 'template',
3947 'condition' => [
3948 'title_border_type!' => 'none',
3949 ],
3950 ]
3951 );
3952
3953 $this->add_responsive_control(
3954 'title_padding',
3955 [
3956 'label' => esc_html__('Padding', 'king-addons'),
3957 'type' => Controls_Manager::DIMENSIONS,
3958 'size_units' => ['px', '%'],
3959 'default' => [
3960 'top' => 0,
3961 'right' => 0,
3962 'bottom' => 0,
3963 'left' => 0,
3964 ],
3965 'selectors' => [
3966 '{{WRAPPER}} .king-addons-grid-item-title .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3967 ],
3968 'render_type' => 'template',
3969 'separator' => 'before',
3970 ]
3971 );
3972
3973 $this->add_responsive_control(
3974 'title_margin',
3975 [
3976 'label' => esc_html__('Margin', 'king-addons'),
3977 'type' => Controls_Manager::DIMENSIONS,
3978 'size_units' => ['px', '%'],
3979 'default' => [
3980 'top' => 0,
3981 'right' => 0,
3982 'bottom' => 0,
3983 'left' => 0,
3984 ],
3985 'selectors' => [
3986 '{{WRAPPER}} .king-addons-grid-item-title .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3987 ],
3988 'render_type' => 'template',
3989 ]
3990 );
3991
3992 $this->end_controls_section();
3993
3994
3995 $this->start_controls_section(
3996 'section_style_excerpt',
3997 [
3998 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Excerpt', 'king-addons'),
3999 'tab' => Controls_Manager::TAB_STYLE,
4000 'show_label' => false,
4001 ]
4002 );
4003
4004 $this->add_control(
4005 'excerpt_color',
4006 [
4007 'label' => esc_html__('Color', 'king-addons'),
4008 'type' => Controls_Manager::COLOR,
4009 'default' => '#333333',
4010 'selectors' => [
4011 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'color: {{VALUE}}',
4012 ],
4013 ]
4014 );
4015
4016 $this->add_control(
4017 'excerpt_bg_color',
4018 [
4019 'label' => esc_html__('Background Color', 'king-addons'),
4020 'type' => Controls_Manager::COLOR,
4021 'selectors' => [
4022 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'background-color: {{VALUE}}',
4023 ]
4024 ]
4025 );
4026
4027 $this->add_control(
4028 'excerpt_border_color',
4029 [
4030 'label' => esc_html__('Border Color', 'king-addons'),
4031 'type' => Controls_Manager::COLOR,
4032 'default' => '#E8E8E8',
4033 'selectors' => [
4034 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-color: {{VALUE}}',
4035 ],
4036 'separator' => 'after',
4037 ]
4038 );
4039
4040 $this->add_group_control(
4041 Group_Control_Typography::get_type(),
4042 [
4043 'name' => 'excerpt_typography',
4044 'selector' => '{{WRAPPER}} .king-addons-grid-item-excerpt'
4045 ]
4046 );
4047
4048 $this->add_responsive_control(
4049 'excerpt_justify',
4050 [
4051 'label' => esc_html__('Justify Text', 'king-addons'),
4052 'type' => Controls_Manager::SWITCHER,
4053 'default' => '',
4054 'widescreen_default' => '',
4055 'laptop_default' => '',
4056 'tablet_extra_default' => '',
4057 'tablet_default' => '',
4058 'mobile_extra_default' => '',
4059 'mobile_default' => '',
4060 'selectors_dictionary' => [
4061 '' => '',
4062 'yes' => 'text-align: justify;'
4063 ],
4064 'selectors' => [
4065 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => '{{VALUE}}',
4066 ],
4067 'render_type' => 'template',
4068 ]
4069 );
4070
4071 $this->add_control(
4072 'excerpt_border_type',
4073 [
4074 'label' => esc_html__('Border Type', 'king-addons'),
4075 'type' => Controls_Manager::SELECT,
4076 'options' => [
4077 'none' => esc_html__('None', 'king-addons'),
4078 'solid' => esc_html__('Solid', 'king-addons'),
4079 'double' => esc_html__('Double', 'king-addons'),
4080 'dotted' => esc_html__('Dotted', 'king-addons'),
4081 'dashed' => esc_html__('Dashed', 'king-addons'),
4082 'groove' => esc_html__('Groove', 'king-addons'),
4083 ],
4084 'default' => 'none',
4085 'selectors' => [
4086 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-style: {{VALUE}};',
4087 ],
4088 'render_type' => 'template',
4089 'separator' => 'before',
4090 ]
4091 );
4092
4093 $this->add_control(
4094 'excerpt_border_width',
4095 [
4096 'label' => esc_html__('Border Width', 'king-addons'),
4097 'type' => Controls_Manager::DIMENSIONS,
4098 'size_units' => ['px'],
4099 'default' => [
4100 'top' => 1,
4101 'right' => 1,
4102 'bottom' => 1,
4103 'left' => 1,
4104 ],
4105 'selectors' => [
4106 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4107 ],
4108 'render_type' => 'template',
4109 'condition' => [
4110 'excerpt_border_type!' => 'none',
4111 ],
4112 ]
4113 );
4114
4115 $this->add_responsive_control(
4116 'excerpt_padding',
4117 [
4118 'label' => esc_html__('Padding', 'king-addons'),
4119 'type' => Controls_Manager::DIMENSIONS,
4120 'size_units' => ['px', '%'],
4121 'default' => [
4122 'top' => 0,
4123 'right' => 0,
4124 'bottom' => 0,
4125 'left' => 0,
4126 ],
4127 'selectors' => [
4128 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4129 ],
4130 'render_type' => 'template',
4131 'separator' => 'before',
4132 ]
4133 );
4134
4135 $this->add_responsive_control(
4136 'excerpt_margin',
4137 [
4138 'label' => esc_html__('Margin', 'king-addons'),
4139 'type' => Controls_Manager::DIMENSIONS,
4140 'size_units' => ['px', '%'],
4141 'default' => [
4142 'top' => 0,
4143 'right' => 0,
4144 'bottom' => 0,
4145 'left' => 0,
4146 ],
4147 'render_type' => 'template',
4148 'selectors' => [
4149 '{{WRAPPER}} .king-addons-grid-item-excerpt .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4150 ],
4151 ]
4152 );
4153
4154 $this->end_controls_section();
4155
4156
4157 $this->start_controls_section(
4158 'section_style_categories',
4159 [
4160 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Categories', 'king-addons'),
4161 'tab' => Controls_Manager::TAB_STYLE,
4162 'show_label' => false,
4163 ]
4164 );
4165
4166 $this->start_controls_tabs('tabs_grid_categories_style');
4167
4168 $this->start_controls_tab(
4169 'tab_grid_categories_normal',
4170 [
4171 'label' => esc_html__('Normal', 'king-addons'),
4172 ]
4173 );
4174
4175 $this->add_control(
4176 'categories_color',
4177 [
4178 'label' => esc_html__('Color', 'king-addons'),
4179 'type' => Controls_Manager::COLOR,
4180 'default' => '#9C9C9C',
4181 'selectors' => [
4182 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'color: {{VALUE}}',
4183 ],
4184 ]
4185 );
4186
4187 $this->add_control(
4188 'categories_bg_color',
4189 [
4190 'label' => esc_html__('Background Color', 'king-addons'),
4191 'type' => Controls_Manager::COLOR,
4192 'selectors' => [
4193 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'background-color: {{VALUE}}',
4194 ]
4195 ]
4196 );
4197
4198 $this->add_control(
4199 'categories_border_color',
4200 [
4201 'label' => esc_html__('Border Color', 'king-addons'),
4202 'type' => Controls_Manager::COLOR,
4203 'default' => '#E8E8E8',
4204 'selectors' => [
4205 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'border-color: {{VALUE}}',
4206 ],
4207 ]
4208 );
4209
4210 $this->add_control(
4211 'categories_extra_text_color',
4212 [
4213 'label' => esc_html__('Extra Text Color', 'king-addons'),
4214 'type' => Controls_Manager::COLOR,
4215 'default' => '#9C9C9C',
4216 'selectors' => [
4217 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
4218 ],
4219 ]
4220 );
4221
4222 $this->add_control(
4223 'categories_extra_icon_color',
4224 [
4225 'label' => esc_html__('Extra Icon Color', 'king-addons'),
4226 'type' => Controls_Manager::COLOR,
4227 'default' => '#9C9C9C',
4228 'selectors' => [
4229 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}',
4230 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
4231 ],
4232 'separator' => 'after',
4233 ]
4234 );
4235
4236 $this->end_controls_tab();
4237
4238 $this->start_controls_tab(
4239 'tab_grid_categories_hover',
4240 [
4241 'label' => esc_html__('Hover', 'king-addons'),
4242 ]
4243 );
4244
4245 $this->add_control(
4246 'categories_color_hr',
4247 [
4248 'label' => esc_html__('Color', 'king-addons'),
4249 'type' => Controls_Manager::COLOR,
4250 'default' => '#5B03FF',
4251 'selectors' => [
4252 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a:hover' => 'color: {{VALUE}}',
4253 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-pointer-item:before' => 'background-color: {{VALUE}}',
4254 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-pointer-item:after' => 'background-color: {{VALUE}}',
4255 ],
4256 ]
4257 );
4258
4259 $this->add_control(
4260 'categories_bg_color_hr',
4261 [
4262 'label' => esc_html__('Background Color', 'king-addons'),
4263 'type' => Controls_Manager::COLOR,
4264 'selectors' => [
4265 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a:hover' => 'background-color: {{VALUE}}',
4266 ]
4267 ]
4268 );
4269
4270 $this->add_control(
4271 'categories_border_color_hr',
4272 [
4273 'label' => esc_html__('Border Color', 'king-addons'),
4274 'type' => Controls_Manager::COLOR,
4275 'default' => '#E8E8E8',
4276 'selectors' => [
4277 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a:hover' => 'border-color: {{VALUE}}',
4278 ],
4279 ]
4280 );
4281
4282 $this->add_control_categories_pointer_color_hr();
4283
4284 $this->end_controls_tab();
4285
4286 $this->end_controls_tabs();
4287
4288 $this->add_control_categories_pointer();
4289
4290 $this->add_control_categories_pointer_height();
4291
4292 $this->add_control_categories_pointer_animation();
4293
4294 $this->add_control(
4295 'categories_transition_duration',
4296 [
4297 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
4298 'type' => Controls_Manager::NUMBER,
4299 'default' => 0.1,
4300 'min' => 0,
4301 'max' => 5,
4302 'step' => 0.1,
4303 'selectors' => [
4304 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'transition-duration: {{VALUE}}s',
4305 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
4306 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
4307 ],
4308 'separator' => 'after',
4309 ]
4310 );
4311
4312 $this->add_group_control(
4313 Group_Control_Typography::get_type(),
4314 [
4315 'name' => 'categories_typography',
4316 'selector' => '{{WRAPPER}} .king-addons-grid-product-categories'
4317 ]
4318 );
4319
4320 $this->add_control(
4321 'categories_border_type',
4322 [
4323 'label' => esc_html__('Border Type', 'king-addons'),
4324 'type' => Controls_Manager::SELECT,
4325 'options' => [
4326 'none' => esc_html__('None', 'king-addons'),
4327 'solid' => esc_html__('Solid', 'king-addons'),
4328 'double' => esc_html__('Double', 'king-addons'),
4329 'dotted' => esc_html__('Dotted', 'king-addons'),
4330 'dashed' => esc_html__('Dashed', 'king-addons'),
4331 'groove' => esc_html__('Groove', 'king-addons'),
4332 ],
4333 'default' => 'none',
4334 'selectors' => [
4335 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'border-style: {{VALUE}};',
4336 ],
4337 'render_type' => 'template',
4338 'separator' => 'before',
4339 ]
4340 );
4341
4342 $this->add_control(
4343 'categories_border_width',
4344 [
4345 'label' => esc_html__('Border Width', 'king-addons'),
4346 'type' => Controls_Manager::DIMENSIONS,
4347 'size_units' => ['px'],
4348 'default' => [
4349 'top' => 1,
4350 'right' => 1,
4351 'bottom' => 1,
4352 'left' => 1,
4353 ],
4354 'selectors' => [
4355 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4356 ],
4357 'render_type' => 'template',
4358 'condition' => [
4359 'categories_border_type!' => 'none',
4360 ],
4361 ]
4362 );
4363
4364 $this->add_control(
4365 'categories_text_spacing',
4366 [
4367 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
4368 'type' => Controls_Manager::SLIDER,
4369 'size_units' => ['px'],
4370 'range' => [
4371 'px' => [
4372 'min' => 0,
4373 'max' => 25,
4374 ],
4375 ],
4376 'default' => [
4377 'unit' => 'px',
4378 'size' => 10,
4379 ],
4380 'selectors' => [
4381 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4382 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4383 ],
4384 'render_type' => 'template',
4385 'separator' => 'before',
4386 ]
4387 );
4388
4389 $this->add_control(
4390 'categories_icon_spacing',
4391 [
4392 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
4393 'type' => Controls_Manager::SLIDER,
4394 'size_units' => ['px'],
4395 'range' => [
4396 'px' => [
4397 'min' => 0,
4398 'max' => 25,
4399 ],
4400 ],
4401 'default' => [
4402 'unit' => 'px',
4403 'size' => 10,
4404 ],
4405 'selectors' => [
4406 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4407 '{{WRAPPER}} .king-addons-grid-product-categories .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4408 ],
4409 ]
4410 );
4411
4412 $this->add_control(
4413 'categories_gutter',
4414 [
4415 'label' => esc_html__('Gutter', 'king-addons'),
4416 'type' => Controls_Manager::SLIDER,
4417 'size_units' => ['px'],
4418 'range' => [
4419 'px' => [
4420 'min' => 0,
4421 'max' => 20,
4422 ],
4423 ],
4424 'default' => [
4425 'unit' => 'px',
4426 'size' => 3,
4427 ],
4428 'selectors' => [
4429 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};',
4430 ],
4431 'render_type' => 'template',
4432 'separator' => 'before',
4433 ]
4434 );
4435
4436 $this->add_responsive_control(
4437 'categories_padding',
4438 [
4439 'label' => esc_html__('Padding', 'king-addons'),
4440 'type' => Controls_Manager::DIMENSIONS,
4441 'size_units' => ['px', '%'],
4442 'default' => [
4443 'top' => 0,
4444 'right' => 0,
4445 'bottom' => 0,
4446 'left' => 0,
4447 ],
4448 'selectors' => [
4449 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4450 ],
4451 'render_type' => 'template',
4452 ]
4453 );
4454
4455 $this->add_responsive_control(
4456 'categories_margin',
4457 [
4458 'label' => esc_html__('Margin', 'king-addons'),
4459 'type' => Controls_Manager::DIMENSIONS,
4460 'size_units' => ['px', '%'],
4461 'default' => [
4462 'top' => 0,
4463 'right' => 0,
4464 'bottom' => 0,
4465 'left' => 0,
4466 ],
4467 'selectors' => [
4468 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4469 ],
4470 'render_type' => 'template',
4471 ]
4472 );
4473
4474 $this->add_control(
4475 'categories_radius',
4476 [
4477 'label' => esc_html__('Border Radius', 'king-addons'),
4478 'type' => Controls_Manager::DIMENSIONS,
4479 'size_units' => ['px', '%'],
4480 'default' => [
4481 'top' => 2,
4482 'right' => 2,
4483 'bottom' => 2,
4484 'left' => 2,
4485 ],
4486 'selectors' => [
4487 '{{WRAPPER}} .king-addons-grid-product-categories .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4488 ],
4489 'separator' => 'before',
4490 ]
4491 );
4492
4493 $this->end_controls_section();
4494
4495
4496 $this->start_controls_section(
4497 'section_style_tags',
4498 [
4499 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Tags', 'king-addons'),
4500 'tab' => Controls_Manager::TAB_STYLE,
4501 'show_label' => false,
4502 ]
4503 );
4504
4505 $this->start_controls_tabs('tabs_grid_tags_style');
4506
4507 $this->start_controls_tab(
4508 'tab_grid_tags_normal',
4509 [
4510 'label' => esc_html__('Normal', 'king-addons'),
4511 ]
4512 );
4513
4514 $this->add_control(
4515 'tags_color',
4516 [
4517 'label' => esc_html__('Color', 'king-addons'),
4518 'type' => Controls_Manager::COLOR,
4519 'default' => '#9C9C9C',
4520 'selectors' => [
4521 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'color: {{VALUE}}',
4522 ],
4523 ]
4524 );
4525
4526 $this->add_control(
4527 'tags_bg_color',
4528 [
4529 'label' => esc_html__('Background Color', 'king-addons'),
4530 'type' => Controls_Manager::COLOR,
4531 'selectors' => [
4532 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'background-color: {{VALUE}}',
4533 ]
4534 ]
4535 );
4536
4537 $this->add_control(
4538 'tags_border_color',
4539 [
4540 'label' => esc_html__('Border Color', 'king-addons'),
4541 'type' => Controls_Manager::COLOR,
4542 'default' => '#E8E8E8',
4543 'selectors' => [
4544 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'border-color: {{VALUE}}',
4545 ]
4546 ]
4547 );
4548
4549 $this->add_control(
4550 'tags_extra_text_color',
4551 [
4552 'label' => esc_html__('Extra Text Color', 'king-addons'),
4553 'type' => Controls_Manager::COLOR,
4554 'default' => '#9C9C9C',
4555 'selectors' => [
4556 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block span[class*="king-addons-grid-extra-text"]' => 'color: {{VALUE}}',
4557 ],
4558 ]
4559 );
4560
4561 $this->add_control(
4562 'tags_extra_icon_color',
4563 [
4564 'label' => esc_html__('Extra Icon Color', 'king-addons'),
4565 'type' => Controls_Manager::COLOR,
4566 'default' => '#9C9C9C',
4567 'selectors' => [
4568 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block [class*="king-addons-grid-extra-icon"] i' => 'color: {{VALUE}}',
4569 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block [class*="king-addons-grid-extra-icon"] svg' => 'fill: {{VALUE}}'
4570 ],
4571 'separator' => 'after',
4572 ]
4573 );
4574
4575 $this->end_controls_tab();
4576
4577 $this->start_controls_tab(
4578 'tab_grid_tags_hover',
4579 [
4580 'label' => esc_html__('Hover', 'king-addons'),
4581 ]
4582 );
4583
4584 $this->add_control(
4585 'tags_color_hr',
4586 [
4587 'label' => esc_html__('Color', 'king-addons'),
4588 'type' => Controls_Manager::COLOR,
4589 'default' => '#5B03FF',
4590 'selectors' => [
4591 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a:hover' => 'color: {{VALUE}}',
4592 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-pointer-item:before' => 'background-color: {{VALUE}}',
4593 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-pointer-item:after' => 'background-color: {{VALUE}}',
4594 ],
4595 ]
4596 );
4597
4598 $this->add_control(
4599 'tags_bg_color_hr',
4600 [
4601 'label' => esc_html__('Background Color', 'king-addons'),
4602 'type' => Controls_Manager::COLOR,
4603 'selectors' => [
4604 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a:hover' => 'background-color: {{VALUE}}',
4605 ]
4606 ]
4607 );
4608
4609 $this->add_control(
4610 'tags_border_color_hr',
4611 [
4612 'label' => esc_html__('Border Color', 'king-addons'),
4613 'type' => Controls_Manager::COLOR,
4614 'default' => '#E8E8E8',
4615 'selectors' => [
4616 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a:hover' => 'border-color: {{VALUE}}',
4617 ],
4618 ]
4619 );
4620
4621 $this->add_control_tags_pointer_color_hr();
4622
4623 $this->end_controls_tab();
4624
4625 $this->end_controls_tabs();
4626
4627 $this->add_control_tags_pointer();
4628
4629 $this->add_control_tags_pointer_height();
4630
4631 $this->add_control_tags_pointer_animation();
4632
4633 $this->add_control(
4634 'tags_transition_duration',
4635 [
4636 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
4637 'type' => Controls_Manager::NUMBER,
4638 'default' => 0.1,
4639 'min' => 0,
4640 'max' => 5,
4641 'step' => 0.1,
4642 'selectors' => [
4643 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'transition-duration: {{VALUE}}s',
4644 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
4645 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
4646 ],
4647 'separator' => 'after',
4648 ]
4649 );
4650
4651 $this->add_group_control(
4652 Group_Control_Typography::get_type(),
4653 [
4654 'name' => 'tags_typography',
4655 'selector' => '{{WRAPPER}} .king-addons-grid-product-tags'
4656 ]
4657 );
4658
4659 $this->add_control(
4660 'tags_border_type',
4661 [
4662 'label' => esc_html__('Border Type', 'king-addons'),
4663 'type' => Controls_Manager::SELECT,
4664 'options' => [
4665 'none' => esc_html__('None', 'king-addons'),
4666 'solid' => esc_html__('Solid', 'king-addons'),
4667 'double' => esc_html__('Double', 'king-addons'),
4668 'dotted' => esc_html__('Dotted', 'king-addons'),
4669 'dashed' => esc_html__('Dashed', 'king-addons'),
4670 'groove' => esc_html__('Groove', 'king-addons'),
4671 ],
4672 'default' => 'none',
4673 'selectors' => [
4674 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'border-style: {{VALUE}};',
4675 ],
4676 'render_type' => 'template',
4677 'separator' => 'before',
4678 ]
4679 );
4680
4681 $this->add_control(
4682 'tags_border_width',
4683 [
4684 'label' => esc_html__('Border Width', 'king-addons'),
4685 'type' => Controls_Manager::DIMENSIONS,
4686 'size_units' => ['px'],
4687 'default' => [
4688 'top' => 1,
4689 'right' => 1,
4690 'bottom' => 1,
4691 'left' => 1,
4692 ],
4693 'selectors' => [
4694 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4695 ],
4696 'render_type' => 'template',
4697 'condition' => [
4698 'tags_border_type!' => 'none',
4699 ],
4700 ]
4701 );
4702
4703 $this->add_control(
4704 'tags_text_spacing',
4705 [
4706 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
4707 'type' => Controls_Manager::SLIDER,
4708 'size_units' => ['px'],
4709 'range' => [
4710 'px' => [
4711 'min' => 0,
4712 'max' => 25,
4713 ],
4714 ],
4715 'default' => [
4716 'unit' => 'px',
4717 'size' => 10,
4718 ],
4719 'selectors' => [
4720 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4721 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4722 ],
4723 'separator' => 'before',
4724 ]
4725 );
4726
4727 $this->add_control(
4728 'tags_icon_spacing',
4729 [
4730 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
4731 'type' => Controls_Manager::SLIDER,
4732 'size_units' => ['px'],
4733 'range' => [
4734 'px' => [
4735 'min' => 0,
4736 'max' => 25,
4737 ],
4738 ],
4739 'default' => [
4740 'unit' => 'px',
4741 'size' => 10,
4742 ],
4743 'selectors' => [
4744 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
4745 '{{WRAPPER}} .king-addons-grid-product-tags .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
4746 ],
4747 ]
4748 );
4749
4750 $this->add_control(
4751 'tags_gutter',
4752 [
4753 'label' => esc_html__('Gutter', 'king-addons'),
4754 'type' => Controls_Manager::SLIDER,
4755 'size_units' => ['px'],
4756 'range' => [
4757 'px' => [
4758 'min' => 0,
4759 'max' => 20,
4760 ],
4761 ],
4762 'default' => [
4763 'unit' => 'px',
4764 'size' => 3,
4765 ],
4766 'selectors' => [
4767 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'margin-right: {{SIZE}}{{UNIT}};',
4768 ],
4769 'render_type' => 'template',
4770 'separator' => 'before',
4771 ]
4772 );
4773
4774 $this->add_responsive_control(
4775 'tags_padding',
4776 [
4777 'label' => esc_html__('Padding', 'king-addons'),
4778 'type' => Controls_Manager::DIMENSIONS,
4779 'size_units' => ['px', '%'],
4780 'default' => [
4781 'top' => 0,
4782 'right' => 0,
4783 'bottom' => 0,
4784 'left' => 0,
4785 ],
4786 'selectors' => [
4787 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4788 ],
4789 'render_type' => 'template',
4790 ]
4791 );
4792
4793 $this->add_responsive_control(
4794 'tags_margin',
4795 [
4796 'label' => esc_html__('Margin', 'king-addons'),
4797 'type' => Controls_Manager::DIMENSIONS,
4798 'size_units' => ['px', '%'],
4799 'default' => [
4800 'top' => 0,
4801 'right' => 0,
4802 'bottom' => 0,
4803 'left' => 0,
4804 ],
4805 'selectors' => [
4806 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4807 ],
4808 'render_type' => 'template',
4809 ]
4810 );
4811
4812 $this->add_control(
4813 'tags_radius',
4814 [
4815 'label' => esc_html__('Border Radius', 'king-addons'),
4816 'type' => Controls_Manager::DIMENSIONS,
4817 'size_units' => ['px', '%'],
4818 'default' => [
4819 'top' => 2,
4820 'right' => 2,
4821 'bottom' => 2,
4822 'left' => 2,
4823 ],
4824 'selectors' => [
4825 '{{WRAPPER}} .king-addons-grid-product-tags .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4826 ],
4827 'separator' => 'before',
4828 ]
4829 );
4830
4831 $this->end_controls_section();
4832
4833
4834 $this->start_controls_section(
4835 'section_style_product_rating',
4836 [
4837 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Rating', 'king-addons'),
4838 'tab' => Controls_Manager::TAB_STYLE,
4839 'show_label' => false,
4840 ]
4841 );
4842
4843 $this->add_control(
4844 'product_rating_color',
4845 [
4846 'label' => esc_html__('Color', 'king-addons'),
4847 'type' => Controls_Manager::COLOR,
4848 'default' => '#ffd726',
4849 'selectors' => [
4850 '{{WRAPPER}} .king-addons-woocommerce-rating i:before' => 'color: {{VALUE}};',
4851 ],
4852 ]
4853 );
4854
4855 $this->add_control(
4856 'product_rating_unmarked_color',
4857 [
4858 'label' => esc_html__('Unmarked Color', 'king-addons'),
4859 'type' => Controls_Manager::COLOR,
4860 'default' => '#D2CDCD',
4861 'selectors' => [
4862 '{{WRAPPER}} .king-addons-woocommerce-rating i' => 'color: {{VALUE}};',
4863 '{{WRAPPER}} .king-addons-woocommerce-rating .king-addons-rating-unmarked svg' => 'fill: {{VALUE}};'
4864 ],
4865 ]
4866 );
4867
4868 $this->add_control(
4869 'product_rating_score_color',
4870 [
4871 'label' => esc_html__('Score Color', 'king-addons'),
4872 'type' => Controls_Manager::COLOR,
4873 'default' => '#ffd726',
4874 'selectors' => [
4875 '{{WRAPPER}} .king-addons-woocommerce-rating span' => 'color: {{VALUE}};',
4876 '{{WRAPPER}} .king-addons-woocommerce-rating .king-addons-rating-marked svg' => 'fill: {{VALUE}};',
4877 ],
4878 ]
4879 );
4880
4881 $this->add_control(
4882 'product_rating_size',
4883 [
4884 'label' => esc_html__('Size', 'king-addons'),
4885 'type' => Controls_Manager::SLIDER,
4886 'size_units' => ['px'],
4887 'range' => [
4888 'px' => [
4889 'min' => 0,
4890 'max' => 50,
4891 ],
4892 ],
4893 'default' => [
4894 'unit' => 'px',
4895 'size' => 22,
4896 ],
4897 'selectors' => [
4898 '{{WRAPPER}} .king-addons-woocommerce-rating i' => 'font-size: {{SIZE}}{{UNIT}};',
4899 '{{WRAPPER}} .king-addons-woocommerce-rating svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
4900 ],
4901 'separator' => 'before',
4902 ]
4903 );
4904
4905 $this->add_control(
4906 'product_rating_gutter',
4907 [
4908 'type' => Controls_Manager::SLIDER,
4909 'label' => esc_html__('Gutter', 'king-addons'),
4910 'size_units' => ['px'],
4911 'range' => [
4912 'px' => [
4913 'min' => 0,
4914 'max' => 25,
4915 ]
4916 ],
4917 'default' => [
4918 'unit' => 'px',
4919 'size' => 0,
4920 ],
4921 'selectors' => [
4922 '{{WRAPPER}} .king-addons-woocommerce-rating i' => 'margin-right: {{SIZE}}{{UNIT}};',
4923 '{{WRAPPER}} .king-addons-woocommerce-rating .king-addons-rating-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
4924 '{{WRAPPER}} .king-addons-woocommerce-rating span.king-addons-rating-icon' => 'margin-right: {{SIZE}}{{UNIT}};',
4925 '{{WRAPPER}} .king-addons-woocommerce-rating span:not(.king-addons-rating-icon, .king-addons-rating-icon span)' => 'margin-left: {{SIZE}}{{UNIT}};',
4926 ],
4927 'separator' => 'after'
4928 ]
4929 );
4930
4931 $this->add_group_control(
4932 Group_Control_Typography::get_type(),
4933 [
4934 'name' => 'product_rating_typography',
4935 'selector' => '{{WRAPPER}} .king-addons-woocommerce-rating span'
4936 ]
4937 );
4938
4939 $this->add_responsive_control(
4940 'product_rating_margin',
4941 [
4942 'label' => esc_html__('Margin', 'king-addons'),
4943 'type' => Controls_Manager::DIMENSIONS,
4944 'size_units' => ['px'],
4945 'default' => [
4946 'top' => 0,
4947 'right' => 0,
4948 'bottom' => 0,
4949 'left' => 0,
4950 ],
4951 'selectors' => [
4952 '{{WRAPPER}} .king-addons-grid-item-rating .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
4953 ],
4954 'separator' => 'before'
4955 ]
4956 );
4957
4958 $this->end_controls_section();
4959
4960
4961 $this->start_controls_section(
4962 'section_style_product_status',
4963 [
4964 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Status', 'king-addons'),
4965 'tab' => Controls_Manager::TAB_STYLE,
4966 'show_label' => false,
4967 ]
4968 );
4969
4970 $this->add_control(
4971 'product_status_os_color',
4972 [
4973 'label' => esc_html__('On Sale Color', 'king-addons'),
4974 'type' => Controls_Manager::COLOR,
4975 'default' => '#ffffff',
4976 'selectors' => [
4977 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-onsale' => 'color: {{VALUE}}',
4978 ],
4979 ]
4980 );
4981
4982 $this->add_control(
4983 'product_status_os_bg_color',
4984 [
4985 'label' => esc_html__('On Sale BG Color', 'king-addons'),
4986 'type' => Controls_Manager::COLOR,
4987 'default' => '#5B03FF',
4988 'selectors' => [
4989 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-onsale' => 'background-color: {{VALUE}}',
4990 ],
4991 ]
4992 );
4993
4994 $this->add_control(
4995 'product_status_os_border_color',
4996 [
4997 'label' => esc_html__('On Sale Border Color', 'king-addons'),
4998 'type' => Controls_Manager::COLOR,
4999 'default' => '#E8E8E8',
5000 'selectors' => [
5001 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-onsale' => 'border-color: {{VALUE}}',
5002 ],
5003 'separator' => 'after'
5004 ]
5005 );
5006
5007 $this->add_control(
5008 'product_status_ft_color',
5009 [
5010 'label' => esc_html__('Featured Color', 'king-addons'),
5011 'type' => Controls_Manager::COLOR,
5012 'default' => '#ffffff',
5013 'selectors' => [
5014 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-featured' => 'color: {{VALUE}}',
5015 ],
5016 ]
5017 );
5018
5019 $this->add_control(
5020 'product_status_ft_bg_color',
5021 [
5022 'label' => esc_html__('Featured BG Color', 'king-addons'),
5023 'type' => Controls_Manager::COLOR,
5024 'default' => '#5B03FF',
5025 'selectors' => [
5026 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-featured' => 'background-color: {{VALUE}}',
5027 ],
5028 ]
5029 );
5030
5031 $this->add_control(
5032 'product_status_ft_border_color',
5033 [
5034 'label' => esc_html__('Featured Border Color', 'king-addons'),
5035 'type' => Controls_Manager::COLOR,
5036 'default' => '#E8E8E8',
5037 'selectors' => [
5038 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-featured' => 'border-color: {{VALUE}}',
5039 ],
5040 'separator' => 'after'
5041 ]
5042 );
5043
5044 $this->add_control(
5045 'product_status_oos_color',
5046 [
5047 'label' => esc_html__('Out of Stock Color', 'king-addons'),
5048 'type' => Controls_Manager::COLOR,
5049 'default' => '#9C9C9C',
5050 'selectors' => [
5051 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-outofstock' => 'color: {{VALUE}}',
5052 ],
5053 ]
5054 );
5055
5056 $this->add_control(
5057 'product_status_oos_bg_color',
5058 [
5059 'label' => esc_html__('Out of Stock BG Color', 'king-addons'),
5060 'type' => Controls_Manager::COLOR,
5061 'default' => '#ffffff',
5062 'selectors' => [
5063 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-outofstock' => 'background-color: {{VALUE}}',
5064 ],
5065 ]
5066 );
5067
5068 $this->add_control(
5069 'product_status_oos_border_color',
5070 [
5071 'label' => esc_html__('Out of Stock Border Color', 'king-addons'),
5072 'type' => Controls_Manager::COLOR,
5073 'default' => '#E8E8E8',
5074 'selectors' => [
5075 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > .king-addons-woocommerce-outofstock' => 'border-color: {{VALUE}}',
5076 ],
5077 'separator' => 'after'
5078 ]
5079 );
5080
5081 $this->add_group_control(
5082 Group_Control_Typography::get_type(),
5083 [
5084 'name' => 'product_status_typography',
5085 'selector' => '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span'
5086 ]
5087 );
5088
5089 $this->add_control(
5090 'product_status_border_type',
5091 [
5092 'label' => esc_html__('Border Type', 'king-addons'),
5093 'type' => Controls_Manager::SELECT,
5094 'options' => [
5095 'none' => esc_html__('None', 'king-addons'),
5096 'solid' => esc_html__('Solid', 'king-addons'),
5097 'double' => esc_html__('Double', 'king-addons'),
5098 'dotted' => esc_html__('Dotted', 'king-addons'),
5099 'dashed' => esc_html__('Dashed', 'king-addons'),
5100 'groove' => esc_html__('Groove', 'king-addons'),
5101 ],
5102 'default' => 'none',
5103 'selectors' => [
5104 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span' => 'border-style: {{VALUE}};',
5105 ],
5106 'separator' => 'before',
5107 ]
5108 );
5109
5110 $this->add_control(
5111 'product_status_border_width',
5112 [
5113 'label' => esc_html__('Border Width', 'king-addons'),
5114 'type' => Controls_Manager::DIMENSIONS,
5115 'size_units' => ['px'],
5116 'default' => [
5117 'top' => 1,
5118 'right' => 1,
5119 'bottom' => 1,
5120 'left' => 1,
5121 ],
5122 'selectors' => [
5123 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5124 ],
5125 'condition' => [
5126 'product_status_border_type!' => 'none',
5127 ],
5128 'render_type' => 'template'
5129 ]
5130 );
5131
5132 $this->add_responsive_control(
5133 'product_status_padding',
5134 [
5135 'label' => esc_html__('Padding', 'king-addons'),
5136 'type' => Controls_Manager::DIMENSIONS,
5137 'size_units' => ['px', '%'],
5138 'default' => [
5139 'top' => 3,
5140 'right' => 10,
5141 'bottom' => 3,
5142 'left' => 10,
5143 ],
5144 'selectors' => [
5145 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5146 ],
5147 'render_type' => 'template',
5148 'separator' => 'before',
5149 ]
5150 );
5151
5152 $this->add_responsive_control(
5153 'product_status_margin',
5154 [
5155 'label' => esc_html__('Margin', 'king-addons'),
5156 'type' => Controls_Manager::DIMENSIONS,
5157 'size_units' => ['px', '%'],
5158 'default' => [
5159 'top' => 0,
5160 'right' => 5,
5161 'bottom' => 0,
5162 'left' => 0,
5163 ],
5164 'selectors' => [
5165 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5166 ],
5167 'render_type' => 'template',
5168 ]
5169 );
5170
5171 $this->add_control(
5172 'product_status_radius',
5173 [
5174 'label' => esc_html__('Border Radius', 'king-addons'),
5175 'type' => Controls_Manager::DIMENSIONS,
5176 'size_units' => ['px', '%'],
5177 'default' => [
5178 'top' => 2,
5179 'right' => 2,
5180 'bottom' => 2,
5181 'left' => 2,
5182 ],
5183 'selectors' => [
5184 '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5185 ],
5186 'separator' => 'after',
5187 ]
5188 );
5189
5190 $this->add_group_control(
5191 Group_Control_Box_Shadow::get_type(),
5192 [
5193 'name' => 'product_status_shadow',
5194 'selector' => '{{WRAPPER}} .king-addons-grid-item-status .inner-block > span',
5195 ]
5196 );
5197
5198 $this->end_controls_section();
5199
5200
5201 $this->start_controls_section(
5202 'section_style_product_price',
5203 [
5204 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Price', 'king-addons'),
5205 'tab' => Controls_Manager::TAB_STYLE,
5206 'show_label' => false,
5207 ]
5208 );
5209
5210 $this->add_control(
5211 'product_price_color',
5212 [
5213 'label' => esc_html__('Color', 'king-addons'),
5214 'type' => Controls_Manager::COLOR,
5215 'default' => '#9C9C9C',
5216 'selectors' => [
5217 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'color: {{VALUE}}',
5218 ],
5219 ]
5220 );
5221
5222 $this->add_control(
5223 'product_price_old_color',
5224 [
5225 'label' => esc_html__('Old Price Color', 'king-addons'),
5226 'type' => Controls_Manager::COLOR,
5227 'default' => '#9C9C9C',
5228 'selectors' => [
5229 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span del' => 'color: {{VALUE}}',
5230 ],
5231 ]
5232 );
5233
5234 $this->add_control(
5235 'product_price_bg_color',
5236 [
5237 'label' => esc_html__('Background Color', 'king-addons'),
5238 'type' => Controls_Manager::COLOR,
5239 'default' => '',
5240 'selectors' => [
5241 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'background-color: {{VALUE}}',
5242 ],
5243 ]
5244 );
5245
5246 $this->add_control(
5247 'product_price_border_color',
5248 [
5249 'label' => esc_html__('Border Color', 'king-addons'),
5250 'type' => Controls_Manager::COLOR,
5251 'default' => '#E8E8E8',
5252 'selectors' => [
5253 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'border-color: {{VALUE}}',
5254 ],
5255 'separator' => 'after'
5256 ]
5257 );
5258
5259 $this->add_group_control(
5260 Group_Control_Typography::get_type(),
5261 [
5262 'name' => 'product_price_typography',
5263 'selector' => '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span'
5264 ]
5265 );
5266
5267 $this->add_control(
5268 'product_price_old_font_size',
5269 [
5270 'type' => Controls_Manager::SLIDER,
5271 'label' => esc_html__('Old Price Font Size', 'king-addons'),
5272 'size_units' => ['px'],
5273 'range' => [
5274 'px' => [
5275 'min' => 10,
5276 'max' => 100,
5277 ]
5278 ],
5279 'default' => [
5280 'unit' => 'px',
5281 'size' => 14,
5282 ],
5283 'selectors' => [
5284 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span del' => 'font-size: {{SIZE}}{{UNIT}};',
5285 ],
5286 'separator' => 'before'
5287 ]
5288 );
5289
5290 $this->add_control(
5291 'product_price_border_type',
5292 [
5293 'label' => esc_html__('Border Type', 'king-addons'),
5294 'type' => Controls_Manager::SELECT,
5295 'options' => [
5296 'none' => esc_html__('None', 'king-addons'),
5297 'solid' => esc_html__('Solid', 'king-addons'),
5298 'double' => esc_html__('Double', 'king-addons'),
5299 'dotted' => esc_html__('Dotted', 'king-addons'),
5300 'dashed' => esc_html__('Dashed', 'king-addons'),
5301 'groove' => esc_html__('Groove', 'king-addons'),
5302 ],
5303 'default' => 'none',
5304 'selectors' => [
5305 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'border-style: {{VALUE}};',
5306 ],
5307 'separator' => 'before',
5308 ]
5309 );
5310
5311 $this->add_control(
5312 'product_price_border_width',
5313 [
5314 'label' => esc_html__('Border Width', 'king-addons'),
5315 'type' => Controls_Manager::DIMENSIONS,
5316 'size_units' => ['px'],
5317 'default' => [
5318 'top' => 1,
5319 'right' => 1,
5320 'bottom' => 1,
5321 'left' => 1,
5322 ],
5323 'selectors' => [
5324 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5325 ],
5326 'condition' => [
5327 'product_price_border_type!' => 'none',
5328 ],
5329 'render_type' => 'template'
5330 ]
5331 );
5332
5333 $this->add_responsive_control(
5334 'product_price_padding',
5335 [
5336 'label' => esc_html__('Padding', 'king-addons'),
5337 'type' => Controls_Manager::DIMENSIONS,
5338 'size_units' => ['px', '%'],
5339 'default' => [
5340 'top' => 0,
5341 'right' => 0,
5342 'bottom' => 0,
5343 'left' => 0,
5344 ],
5345 'selectors' => [
5346 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5347 ],
5348 'render_type' => 'template',
5349 'separator' => 'before',
5350 ]
5351 );
5352
5353 $this->add_responsive_control(
5354 'product_price_margin',
5355 [
5356 'label' => esc_html__('Margin', 'king-addons'),
5357 'type' => Controls_Manager::DIMENSIONS,
5358 'size_units' => ['px', '%'],
5359 'default' => [
5360 'top' => 0,
5361 'right' => 0,
5362 'bottom' => 0,
5363 'left' => 0,
5364 ],
5365 'selectors' => [
5366 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5367 ],
5368 'render_type' => 'template',
5369 ]
5370 );
5371
5372 $this->add_control(
5373 'product_price_radius',
5374 [
5375 'label' => esc_html__('Border Radius', 'king-addons'),
5376 'type' => Controls_Manager::DIMENSIONS,
5377 'size_units' => ['px', '%'],
5378 'default' => [
5379 'top' => 0,
5380 'right' => 0,
5381 'bottom' => 0,
5382 'left' => 0,
5383 ],
5384 'selectors' => [
5385 '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5386 ],
5387 'separator' => 'after',
5388 ]
5389 );
5390
5391 $this->add_group_control(
5392 Group_Control_Box_Shadow::get_type(),
5393 [
5394 'name' => 'product_price_shadow',
5395 'selector' => '{{WRAPPER}} .king-addons-grid-item-price .inner-block > span',
5396 ]
5397 );
5398
5399 $this->end_controls_section();
5400
5401
5402 $this->start_controls_section(
5403 'section_style_product_sale_dates',
5404 [
5405 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Sale Dates', 'king-addons'),
5406 'tab' => Controls_Manager::TAB_STYLE,
5407 'show_label' => false,
5408 ]
5409 );
5410
5411 $this->add_control(
5412 'product_sale_dates_color',
5413 [
5414 'label' => esc_html__('Color', 'king-addons'),
5415 'type' => Controls_Manager::COLOR,
5416 'default' => '#9C9C9C',
5417 'selectors' => [
5418 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > span' => 'color: {{VALUE}}',
5419 ],
5420 ]
5421 );
5422
5423 $this->add_control(
5424 'product_sale_dates_old_color',
5425 [
5426 'label' => esc_html__('Text Color', 'king-addons'),
5427 'type' => Controls_Manager::COLOR,
5428 'default' => '#9C9C9C',
5429 'selectors' => [
5430 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block span.king-addons-grid-extra-text-left' => 'color: {{VALUE}} !important',
5431 ],
5432 ]
5433 );
5434
5435 $this->add_control(
5436 'product_sale_dates_bg_color',
5437 [
5438 'label' => esc_html__('Background Color', 'king-addons'),
5439 'type' => Controls_Manager::COLOR,
5440 'default' => '',
5441 'selectors' => [
5442 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > span' => 'background-color: {{VALUE}}',
5443 ],
5444 ]
5445 );
5446
5447 $this->add_control(
5448 'product_sale_dates_border_color',
5449 [
5450 'label' => esc_html__('Border Color', 'king-addons'),
5451 'type' => Controls_Manager::COLOR,
5452 'default' => '#E8E8E8',
5453 'selectors' => [
5454 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > span.king-addons-sale-dates' => 'border-color: {{VALUE}}',
5455 ],
5456 'separator' => 'after'
5457 ]
5458 );
5459
5460 $this->add_group_control(
5461 Group_Control_Typography::get_type(),
5462 [
5463 'name' => 'product_sale_dates_typography',
5464 'selector' => '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > .king-addons-sale-dates'
5465 ]
5466 );
5467
5468 $this->add_control(
5469 'product_sale_dates_border_type',
5470 [
5471 'label' => esc_html__('Border Type', 'king-addons'),
5472 'type' => Controls_Manager::SELECT,
5473 'options' => [
5474 'none' => esc_html__('None', 'king-addons'),
5475 'solid' => esc_html__('Solid', 'king-addons'),
5476 'double' => esc_html__('Double', 'king-addons'),
5477 'dotted' => esc_html__('Dotted', 'king-addons'),
5478 'dashed' => esc_html__('Dashed', 'king-addons'),
5479 'groove' => esc_html__('Groove', 'king-addons'),
5480 ],
5481 'default' => 'none',
5482 'selectors' => [
5483 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > .king-addons-sale-dates' => 'border-style: {{VALUE}};',
5484 ],
5485 'separator' => 'before',
5486 ]
5487 );
5488
5489 $this->add_control(
5490 'product_sale_dates_border_width',
5491 [
5492 'label' => esc_html__('Border Width', 'king-addons'),
5493 'type' => Controls_Manager::DIMENSIONS,
5494 'size_units' => ['px'],
5495 'default' => [
5496 'top' => 1,
5497 'right' => 1,
5498 'bottom' => 1,
5499 'left' => 1,
5500 ],
5501 'selectors' => [
5502 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > .king-addons-sale-dates' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5503 ],
5504 'condition' => [
5505 'product_sale_dates_border_type!' => 'none',
5506 ],
5507 'render_type' => 'template'
5508 ]
5509 );
5510
5511 $this->add_responsive_control(
5512 'product_sale_dates_padding',
5513 [
5514 'label' => esc_html__('Padding', 'king-addons'),
5515 'type' => Controls_Manager::DIMENSIONS,
5516 'size_units' => ['px', '%'],
5517 'default' => [
5518 'top' => 0,
5519 'right' => 0,
5520 'bottom' => 0,
5521 'left' => 0,
5522 ],
5523 'selectors' => [
5524 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > .king-addons-sale-dates' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5525 ],
5526 'render_type' => 'template',
5527 'separator' => 'before',
5528 ]
5529 );
5530
5531 $this->add_responsive_control(
5532 'product_sale_dates_margin',
5533 [
5534 'label' => esc_html__('Margin', 'king-addons'),
5535 'type' => Controls_Manager::DIMENSIONS,
5536 'size_units' => ['px', '%'],
5537 'default' => [
5538 'top' => 0,
5539 'right' => 0,
5540 'bottom' => 0,
5541 'left' => 0,
5542 ],
5543 'selectors' => [
5544 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > .king-addons-sale-dates' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5545 ],
5546 'render_type' => 'template',
5547 ]
5548 );
5549
5550 $this->add_control(
5551 'product_sale_dates_radius',
5552 [
5553 'label' => esc_html__('Border Radius', 'king-addons'),
5554 'type' => Controls_Manager::DIMENSIONS,
5555 'size_units' => ['px', '%'],
5556 'default' => [
5557 'top' => 0,
5558 'right' => 0,
5559 'bottom' => 0,
5560 'left' => 0,
5561 ],
5562 'selectors' => [
5563 '{{WRAPPER}} .king-addons-grid-item-sale_dates .inner-block > .king-addons-sale-dates' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5564 ],
5565 'separator' => 'after',
5566 ]
5567 );
5568
5569 $this->end_controls_section();
5570
5571
5572 $this->start_controls_section(
5573 'section_style_add_to_cart',
5574 [
5575 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Add to Cart', 'king-addons'),
5576 'tab' => Controls_Manager::TAB_STYLE,
5577 'show_label' => false,
5578 ]
5579 );
5580
5581 $this->start_controls_tabs('tabs_grid_add_to_cart_style');
5582
5583 $this->start_controls_tab(
5584 'tab_grid_add_to_cart_normal',
5585 [
5586 'label' => esc_html__('Normal', 'king-addons'),
5587 ]
5588 );
5589
5590 $this->add_control(
5591 'add_to_cart_color',
5592 [
5593 'label' => esc_html__('Color', 'king-addons'),
5594 'type' => Controls_Manager::COLOR,
5595 'default' => '#333333',
5596 'selectors' => [
5597 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'color: {{VALUE}}',
5598 ],
5599 ]
5600 );
5601
5602 $this->add_control(
5603 'add_to_cart_bg_color',
5604 [
5605 'label' => esc_html__('Background Color', 'king-addons'),
5606 'type' => Controls_Manager::COLOR,
5607 'selectors' => [
5608 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'background-color: {{VALUE}}',
5609 ]
5610 ]
5611 );
5612
5613 $this->add_control(
5614 'add_to_cart_border_color',
5615 [
5616 'label' => esc_html__('Border Color', 'king-addons'),
5617 'type' => Controls_Manager::COLOR,
5618 'default' => '#E8E8E8',
5619 'selectors' => [
5620 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'border-color: {{VALUE}}',
5621 ],
5622 ]
5623 );
5624
5625 $this->add_group_control(
5626 Group_Control_Box_Shadow::get_type(),
5627 [
5628 'name' => 'add_to_cart_box_shadow',
5629 'selector' => '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a',
5630 ]
5631 );
5632
5633 $this->end_controls_tab();
5634
5635 $this->start_controls_tab(
5636 'tab_grid_add_to_cart_hover',
5637 [
5638 'label' => esc_html__('Hover', 'king-addons'),
5639 ]
5640 );
5641
5642 $this->add_control(
5643 'add_to_cart_color_hr',
5644 [
5645 'label' => esc_html__('Color', 'king-addons'),
5646 'type' => Controls_Manager::COLOR,
5647 'default' => '#5B03FF',
5648 'selectors' => [
5649 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a:hover' => 'color: {{VALUE}}',
5650 ],
5651 ]
5652 );
5653
5654 $this->add_control(
5655 'add_to_cart_bg_color_hr',
5656 [
5657 'label' => esc_html__('Background Color', 'king-addons'),
5658 'type' => Controls_Manager::COLOR,
5659 'selectors' => [
5660 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a.king-addons-button-none:hover' => 'background-color: {{VALUE}}',
5661 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a.added_to_cart:hover' => 'background-color: {{VALUE}}',
5662 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a:before' => 'background-color: {{VALUE}}',
5663 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a:after' => 'background-color: {{VALUE}}',
5664 ]
5665 ]
5666 );
5667
5668 $this->add_control(
5669 'add_to_cart_border_color_hr',
5670 [
5671 'label' => esc_html__('Border Color', 'king-addons'),
5672 'type' => Controls_Manager::COLOR,
5673 'default' => '#5B03FF',
5674 'selectors' => [
5675 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a:hover' => 'border-color: {{VALUE}}',
5676 ]
5677 ]
5678 );
5679
5680 $this->add_group_control(
5681 Group_Control_Box_Shadow::get_type(),
5682 [
5683 'name' => 'add_to_cart_box_shadow_hr',
5684 'selector' => '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block :hover a',
5685 ]
5686 );
5687
5688 $this->end_controls_tab();
5689
5690 $this->end_controls_tabs();
5691
5692 $this->add_control(
5693 'add_to_cart_divider',
5694 [
5695 'type' => Controls_Manager::DIVIDER,
5696 'style' => 'thick',
5697 ]
5698 );
5699
5700 $this->add_control_add_to_cart_animation();
5701
5702 $this->add_control(
5703 'add_to_cart_transition_duration',
5704 [
5705 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
5706 'type' => Controls_Manager::NUMBER,
5707 'default' => 0.1,
5708 'min' => 0,
5709 'max' => 5,
5710 'step' => 0.1,
5711 'selectors' => [
5712 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'transition-duration: {{VALUE}}s',
5713 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a:before' => 'transition-duration: {{VALUE}}s',
5714 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a:after' => 'transition-duration: {{VALUE}}s',
5715 ],
5716 ]
5717 );
5718
5719 $this->add_control_add_to_cart_animation_height();
5720
5721 $this->add_control(
5722 'add_to_cart_typo_divider',
5723 [
5724 'type' => Controls_Manager::DIVIDER,
5725 'style' => 'thick',
5726 ]
5727 );
5728
5729 $this->add_group_control(
5730 Group_Control_Typography::get_type(),
5731 [
5732 'name' => 'add_to_cart_typography',
5733 'selector' => '{{WRAPPER}} .king-addons-grid-item-add-to-cart a'
5734 ]
5735 );
5736
5737 $this->add_control(
5738 'add_to_cart_icon_spacing',
5739 [
5740 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
5741 'type' => Controls_Manager::SLIDER,
5742 'size_units' => ['px'],
5743 'range' => [
5744 'px' => [
5745 'min' => 0,
5746 'max' => 25,
5747 ],
5748 ],
5749 'default' => [
5750 'unit' => 'px',
5751 'size' => 5,
5752 ],
5753 'selectors' => [
5754 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .king-addons-grid-extra-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
5755 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .king-addons-grid-extra-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
5756 ],
5757 'separator' => 'before',
5758 ]
5759 );
5760
5761 $this->add_control(
5762 'add_to_cart_border_type',
5763 [
5764 'label' => esc_html__('Border Type', 'king-addons'),
5765 'type' => Controls_Manager::SELECT,
5766 'options' => [
5767 'none' => esc_html__('None', 'king-addons'),
5768 'solid' => esc_html__('Solid', 'king-addons'),
5769 'double' => esc_html__('Double', 'king-addons'),
5770 'dotted' => esc_html__('Dotted', 'king-addons'),
5771 'dashed' => esc_html__('Dashed', 'king-addons'),
5772 'groove' => esc_html__('Groove', 'king-addons'),
5773 ],
5774 'default' => 'solid',
5775 'selectors' => [
5776 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'border-style: {{VALUE}};',
5777 ],
5778 'render_type' => 'template',
5779 'separator' => 'before',
5780 ]
5781 );
5782
5783 $this->add_control(
5784 'add_to_cart_border_width',
5785 [
5786 'label' => esc_html__('Border Width', 'king-addons'),
5787 'type' => Controls_Manager::DIMENSIONS,
5788 'size_units' => ['px'],
5789 'default' => [
5790 'top' => 2,
5791 'right' => 2,
5792 'bottom' => 2,
5793 'left' => 2,
5794 ],
5795 'selectors' => [
5796 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5797 ],
5798 'render_type' => 'template',
5799 'condition' => [
5800 'add_to_cart_border_type!' => 'none',
5801 ],
5802 ]
5803 );
5804
5805 $this->add_responsive_control(
5806 'add_to_cart_padding',
5807 [
5808 'label' => esc_html__('Padding', 'king-addons'),
5809 'type' => Controls_Manager::DIMENSIONS,
5810 'size_units' => ['px', '%'],
5811 'default' => [
5812 'top' => 5,
5813 'right' => 15,
5814 'bottom' => 5,
5815 'left' => 15,
5816 ],
5817 'selectors' => [
5818 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5819 ],
5820 'separator' => 'before',
5821 ]
5822 );
5823
5824 $this->add_responsive_control(
5825 'add_to_cart_margin',
5826 [
5827 'label' => esc_html__('Margin', 'king-addons'),
5828 'type' => Controls_Manager::DIMENSIONS,
5829 'size_units' => ['px', '%'],
5830 'default' => [
5831 'top' => 15,
5832 'right' => 0,
5833 'bottom' => 0,
5834 'left' => 0,
5835 ],
5836 'selectors' => [
5837 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5838 ],
5839 'render_type' => 'template',
5840 ]
5841 );
5842
5843 $this->add_control(
5844 'add_to_cart_radius',
5845 [
5846 'label' => esc_html__('Border Radius', 'king-addons'),
5847 'type' => Controls_Manager::DIMENSIONS,
5848 'size_units' => ['px', '%'],
5849 'default' => [
5850 'top' => 2,
5851 'right' => 2,
5852 'bottom' => 2,
5853 'left' => 2,
5854 ],
5855 'selectors' => [
5856 '{{WRAPPER}} .king-addons-grid-item-add-to-cart .inner-block a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
5857 ],
5858 'render_type' => 'template',
5859 'separator' => 'before',
5860 ]
5861 );
5862
5863 $this->end_controls_section();
5864
5865
5866 $this->start_controls_section(
5867 'section_wishlist_button_styles',
5868 [
5869 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Add to Wishlist', 'king-addons'),
5870 'tab' => Controls_Manager::TAB_STYLE,
5871 ]
5872 );
5873
5874 $this->start_controls_tabs('tabs_btn_styles');
5875
5876 $this->start_controls_tab(
5877 'tab_btn_normal',
5878 [
5879 'label' => esc_html__('Normal', 'king-addons'),
5880 ]
5881 );
5882
5883 $this->add_control(
5884 'btn_color',
5885 [
5886 'label' => esc_html__('Color', 'king-addons'),
5887 'type' => Controls_Manager::COLOR,
5888 'default' => '#333333',
5889 'selectors' => [
5890 '{{WRAPPER}} .king-addons-wishlist-add span' => 'color: {{VALUE}}',
5891 '{{WRAPPER}} .king-addons-wishlist-add i' => 'color: {{VALUE}}',
5892 '{{WRAPPER}} .king-addons-wishlist-add svg' => 'fill: {{VALUE}}'
5893 ]
5894 ]
5895 );
5896
5897 $this->add_control(
5898 'btn_border_color',
5899 [
5900 'label' => esc_html__('Border Color', 'king-addons'),
5901 'type' => Controls_Manager::COLOR,
5902 'default' => '#E8E8E8',
5903 'selectors' => [
5904 '{{WRAPPER}} .king-addons-wishlist-add' => 'border-color: {{VALUE}}'
5905 ]
5906 ]
5907 );
5908
5909 $this->add_control(
5910 'btn_bg_color',
5911 [
5912 'label' => esc_html__('Background Color', 'king-addons'),
5913 'type' => Controls_Manager::COLOR,
5914 'default' => '#FFF',
5915 'selectors' => [
5916 '{{WRAPPER}} .king-addons-wishlist-add' => 'background-color: {{VALUE}}'
5917 ]
5918 ]
5919 );
5920
5921 $this->add_group_control(
5922 Group_Control_Box_Shadow::get_type(),
5923 [
5924 'name' => 'btn_box_shadow',
5925 'selector' => '{{WRAPPER}} .king-addons-wishlist-add, {{WRAPPER}} .king-addons-wishlist-remove',
5926 ]
5927 );
5928
5929 $this->add_group_control(
5930 Group_Control_Typography::get_type(),
5931 [
5932 'name' => 'btn_typography',
5933 'selector' => '{{WRAPPER}} .king-addons-wishlist-add span, {{WRAPPER}} .king-addons-wishlist-add i, .king-addons-wishlist-remove span, {{WRAPPER}} .king-addons-wishlist-remove i',
5934 'fields_options' => [
5935 'typography' => [
5936 'default' => 'custom',
5937 ],
5938 'font_size' => [
5939 'default' => [
5940 'size' => '16',
5941 'unit' => 'px',
5942 ],
5943 ],
5944 ]
5945 ]
5946 );
5947
5948 $this->add_control(
5949 'btn_transition_duration',
5950 [
5951 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
5952 'type' => Controls_Manager::NUMBER,
5953 'default' => 0.5,
5954 'min' => 0,
5955 'max' => 5,
5956 'step' => 0.1,
5957 'selectors' => [
5958 '{{WRAPPER}} .king-addons-wishlist-add' => 'transition-duration: {{VALUE}}s',
5959 '{{WRAPPER}} .king-addons-wishlist-add span' => 'transition-duration: {{VALUE}}s',
5960 '{{WRAPPER}} .king-addons-wishlist-add i' => 'transition-duration: {{VALUE}}s',
5961 '{{WRAPPER}} .king-addons-wishlist-remove' => 'transition-duration: {{VALUE}}s',
5962 '{{WRAPPER}} .king-addons-wishlist-remove span' => 'transition-duration: {{VALUE}}s',
5963 '{{WRAPPER}} .king-addons-wishlist-remove i' => 'transition-duration: {{VALUE}}s'
5964 ],
5965 ]
5966 );
5967
5968 $this->end_controls_tab();
5969
5970 $this->start_controls_tab(
5971 'tab_btn_hover',
5972 [
5973 'label' => esc_html__('Hover', 'king-addons'),
5974 ]
5975 );
5976
5977 $this->add_control(
5978 'btn_hover_color',
5979 [
5980 'label' => esc_html__('Color', 'king-addons'),
5981 'type' => Controls_Manager::COLOR,
5982 'default' => '#FF4400',
5983 'selectors' => [
5984 '{{WRAPPER}} .king-addons-wishlist-add:hover i' => 'color: {{VALUE}}',
5985 '{{WRAPPER}} .king-addons-wishlist-add:hover svg' => 'fill: {{VALUE}}',
5986 '{{WRAPPER}} .king-addons-wishlist-add:hover span' => 'color: {{VALUE}}'
5987 ]
5988 ]
5989 );
5990
5991 $this->add_control(
5992 'btn_hover_border_color',
5993 [
5994 'label' => esc_html__('Border Color', 'king-addons'),
5995 'type' => Controls_Manager::COLOR,
5996 'default' => '#FF4400',
5997 'selectors' => [
5998 '{{WRAPPER}} .king-addons-wishlist-add:hover' => 'border-color: {{VALUE}}'
5999 ]
6000 ]
6001 );
6002
6003 $this->add_control(
6004 'btn_hover_bg_color',
6005 [
6006 'label' => esc_html__('Background Color', 'king-addons'),
6007 'type' => Controls_Manager::COLOR,
6008 'default' => '#FFF',
6009 'selectors' => [
6010 '{{WRAPPER}} .king-addons-wishlist-add:hover' => 'background-color: {{VALUE}}'
6011 ]
6012 ]
6013 );
6014
6015 $this->add_group_control(
6016 Group_Control_Box_Shadow::get_type(),
6017 [
6018 'name' => 'btn_box_shadow_hr',
6019 'selector' => '{{WRAPPER}} .king-addons-wishlist-add:hover, WRAPPER}} .king-addons-wishlist-remove:hover',
6020 ]
6021 );
6022
6023 $this->end_controls_tab();
6024
6025 $this->start_controls_tab(
6026 'tab_remove_btn',
6027 [
6028 'label' => esc_html__('Remove', 'king-addons'),
6029 ]
6030 );
6031
6032 $this->add_control(
6033 'remove_btn_text_color',
6034 [
6035 'label' => esc_html__('Color', 'king-addons'),
6036 'type' => Controls_Manager::COLOR,
6037 'default' => '#FF4400',
6038 'selectors' => [
6039 '{{WRAPPER}} .king-addons-wishlist-remove span' => 'color: {{VALUE}}',
6040 '{{WRAPPER}} .king-addons-wishlist-remove i' => 'color: {{VALUE}}',
6041 '{{WRAPPER}} .king-addons-wishlist-remove svg' => 'fill: {{VALUE}}',
6042 '{{WRAPPER}} .king-addons-wishlist-remove:hover span' => 'color: {{VALUE}}',
6043 '{{WRAPPER}} .king-addons-wishlist-remove:hover i' => 'color: {{VALUE}}',
6044 '{{WRAPPER}} .king-addons-wishlist-remove:hover svg' => 'fill: {{VALUE}}'
6045 ]
6046 ]
6047 );
6048
6049 $this->add_control(
6050 'remove_btn_border_color',
6051 [
6052 'label' => esc_html__('Border Color', 'king-addons'),
6053 'type' => Controls_Manager::COLOR,
6054 'default' => '#FF4F40',
6055 'selectors' => [
6056 '{{WRAPPER}} .king-addons-wishlist-remove' => 'border-color: {{VALUE}}',
6057 '{{WRAPPER}} .king-addons-wishlist-remove:hover' => 'border-color: {{VALUE}}'
6058 ]
6059 ]
6060 );
6061
6062 $this->add_control(
6063 'remove_btn_bg_color',
6064 [
6065 'label' => esc_html__('Background Color', 'king-addons'),
6066 'type' => Controls_Manager::COLOR,
6067 'default' => '#FFF',
6068 'selectors' => [
6069 '{{WRAPPER}} .king-addons-wishlist-remove' => 'background-color: {{VALUE}}',
6070 '{{WRAPPER}} .king-addons-wishlist-remove:hover' => 'background-color: {{VALUE}}'
6071 ]
6072 ]
6073 );
6074
6075 $this->end_controls_tab();
6076
6077 $this->end_controls_tabs();
6078
6079 $this->add_responsive_control(
6080 'button_padding',
6081 [
6082 'label' => esc_html__('Padding', 'king-addons'),
6083 'type' => Controls_Manager::DIMENSIONS,
6084 'size_units' => ['px'],
6085 'default' => [
6086 'top' => 5,
6087 'right' => 15,
6088 'bottom' => 5,
6089 'left' => 15,
6090 ],
6091 'selectors' => [
6092 '{{WRAPPER}} .king-addons-wishlist-add' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6093 '{{WRAPPER}} .king-addons-wishlist-remove' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
6094 ],
6095 'separator' => 'before',
6096 ]
6097 );
6098
6099 $this->add_responsive_control(
6100 'button_margin',
6101 [
6102 'label' => esc_html__('Margin', 'king-addons'),
6103 'type' => Controls_Manager::DIMENSIONS,
6104 'size_units' => ['px'],
6105 'default' => [
6106 'top' => 5,
6107 'right' => 0,
6108 'bottom' => 0,
6109 'left' => 0,
6110 ],
6111 'selectors' => [
6112
6113
6114 '{{WRAPPER}} .king-addons-grid-item-wishlist-button .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6115 ]
6116 ]
6117 );
6118
6119 $this->add_control(
6120 'button_border_type',
6121 [
6122 'label' => esc_html__('Border Type', 'king-addons'),
6123 'type' => Controls_Manager::SELECT,
6124 'options' => [
6125 'none' => esc_html__('None', 'king-addons'),
6126 'solid' => esc_html__('Solid', 'king-addons'),
6127 'double' => esc_html__('Double', 'king-addons'),
6128 'dotted' => esc_html__('Dotted', 'king-addons'),
6129 'dashed' => esc_html__('Dashed', 'king-addons'),
6130 'groove' => esc_html__('Groove', 'king-addons'),
6131 ],
6132 'default' => 'none',
6133 'selectors' => [
6134 '{{WRAPPER}} .king-addons-wishlist-add' => 'border-style: {{VALUE}};',
6135 '{{WRAPPER}} .king-addons-wishlist-remove' => 'border-style: {{VALUE}};'
6136 ],
6137 'separator' => 'before',
6138 ]
6139 );
6140
6141 $this->add_responsive_control(
6142 'button_border_width',
6143 [
6144 'label' => esc_html__('Border Width', 'king-addons'),
6145 'type' => Controls_Manager::DIMENSIONS,
6146 'size_units' => ['px', '%'],
6147 'default' => [
6148 'top' => 2,
6149 'right' => 2,
6150 'bottom' => 2,
6151 'left' => 2,
6152 ],
6153 'selectors' => [
6154 '{{WRAPPER}} .king-addons-wishlist-add' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6155 '{{WRAPPER}} .king-addons-wishlist-remove' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6156 ],
6157 'condition' => [
6158 'button_border_type!' => 'none',
6159 ],
6160 ]
6161 );
6162
6163 $this->add_responsive_control(
6164 'button_border_radius',
6165 [
6166 'label' => esc_html__('Border Radius', 'king-addons'),
6167 'type' => Controls_Manager::DIMENSIONS,
6168 'size_units' => ['px', '%'],
6169 'default' => [
6170 'top' => 1,
6171 'right' => 1,
6172 'bottom' => 1,
6173 'left' => 1,
6174 ],
6175 'selectors' => [
6176 '{{WRAPPER}} .king-addons-wishlist-add' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6177 '{{WRAPPER}} .king-addons-wishlist-remove' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6178 ]
6179 ]
6180 );
6181
6182 $this->end_controls_section();
6183
6184
6185 $this->start_controls_section(
6186 'section_compare_button_styles',
6187 [
6188 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Add to Compare', 'king-addons'),
6189 'tab' => Controls_Manager::TAB_STYLE,
6190 ]
6191 );
6192
6193 $this->start_controls_tabs('comp_tabs_btn_styles');
6194
6195 $this->start_controls_tab(
6196 'comp_tab_btn_normal',
6197 [
6198 'label' => esc_html__('Normal', 'king-addons'),
6199 ]
6200 );
6201
6202 $this->add_control(
6203 'comp_btn_text_color',
6204 [
6205 'label' => esc_html__('Color', 'king-addons'),
6206 'type' => Controls_Manager::COLOR,
6207 'default' => '#333333',
6208 'selectors' => [
6209 '{{WRAPPER}} .king-addons-compare-add span' => 'color: {{VALUE}}',
6210 '{{WRAPPER}} .king-addons-compare-add i' => 'color: {{VALUE}}',
6211 '{{WRAPPER}} .king-addons-compare-add svg' => 'fill: {{VALUE}}'
6212 ]
6213 ]
6214 );
6215
6216 $this->add_control(
6217 'comp_btn_border_color',
6218 [
6219 'label' => esc_html__('Border Color', 'king-addons'),
6220 'type' => Controls_Manager::COLOR,
6221 'default' => '#E8E8E8',
6222 'selectors' => [
6223 '{{WRAPPER}} .king-addons-compare-add' => 'border-color: {{VALUE}}'
6224 ]
6225 ]
6226 );
6227
6228 $this->add_control(
6229 'comp_btn_bg_color',
6230 [
6231 'label' => esc_html__('Background Color', 'king-addons'),
6232 'type' => Controls_Manager::COLOR,
6233 'default' => '#FFF',
6234 'selectors' => [
6235 '{{WRAPPER}} .king-addons-compare-add' => 'background-color: {{VALUE}}'
6236 ]
6237 ]
6238 );
6239
6240 $this->add_group_control(
6241 Group_Control_Box_Shadow::get_type(),
6242 [
6243 'name' => 'comp_btn_box_shadow',
6244 'selector' => '{{WRAPPER}} .king-addons-compare-add, {{WRAPPER}} .king-addons-compare-remove',
6245 ]
6246 );
6247
6248 $this->add_group_control(
6249 Group_Control_Typography::get_type(),
6250 [
6251 'name' => 'comp_btn_typography',
6252 'selector' => '{{WRAPPER}} .king-addons-compare-add span, {{WRAPPER}} .king-addons-compare-add i, .king-addons-compare-remove span, {{WRAPPER}} .king-addons-compare-remove i',
6253 'fields_options' => [
6254 'typography' => [
6255 'default' => 'custom',
6256 ],
6257 'font_size' => [
6258 'default' => [
6259 'size' => '16',
6260 'unit' => 'px',
6261 ],
6262 ],
6263 ]
6264 ]
6265 );
6266
6267 $this->add_control(
6268 'comp_btn_transition_duration',
6269 [
6270 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
6271 'type' => Controls_Manager::NUMBER,
6272 'default' => 0.5,
6273 'min' => 0,
6274 'max' => 5,
6275 'step' => 0.1,
6276 'selectors' => [
6277 '{{WRAPPER}} .king-addons-compare-add' => 'transition-duration: {{VALUE}}s',
6278 '{{WRAPPER}} .king-addons-compare-add span' => 'transition-duration: {{VALUE}}s',
6279 '{{WRAPPER}} .king-addons-compare-add i' => 'transition-duration: {{VALUE}}s',
6280 '{{WRAPPER}} .king-addons-compare-remove' => 'transition-duration: {{VALUE}}s',
6281 '{{WRAPPER}} .king-addons-compare-remove span' => 'transition-duration: {{VALUE}}s',
6282 '{{WRAPPER}} .king-addons-compare-remove i' => 'transition-duration: {{VALUE}}s'
6283 ],
6284 ]
6285 );
6286
6287 $this->end_controls_tab();
6288
6289 $this->start_controls_tab(
6290 'comp_tab_btn_hover',
6291 [
6292 'label' => esc_html__('Hover', 'king-addons'),
6293 ]
6294 );
6295
6296 $this->add_control(
6297 'comp_btn_hover_color',
6298 [
6299 'label' => esc_html__('Color', 'king-addons'),
6300 'type' => Controls_Manager::COLOR,
6301 'default' => '#FF4400',
6302 'selectors' => [
6303 '{{WRAPPER}} .king-addons-compare-add:hover i' => 'color: {{VALUE}}',
6304 '{{WRAPPER}} .king-addons-compare-add:hover svg' => 'fill: {{VALUE}}',
6305 '{{WRAPPER}} .king-addons-compare-add:hover span' => 'color: {{VALUE}}'
6306 ]
6307 ]
6308 );
6309
6310 $this->add_control(
6311 'comp_btn_hover_border_color',
6312 [
6313 'label' => esc_html__('Border Color', 'king-addons'),
6314 'type' => Controls_Manager::COLOR,
6315 'default' => '#FF4400',
6316 'selectors' => [
6317 '{{WRAPPER}} .king-addons-compare-add:hover' => 'border-color: {{VALUE}}'
6318 ]
6319 ]
6320 );
6321
6322 $this->add_control(
6323 'comp_btn_hover_bg_color',
6324 [
6325 'label' => esc_html__('Background Color', 'king-addons'),
6326 'type' => Controls_Manager::COLOR,
6327 'default' => '#FFF',
6328 'selectors' => [
6329 '{{WRAPPER}} .king-addons-compare-add:hover' => 'background-color: {{VALUE}}'
6330 ]
6331 ]
6332 );
6333
6334 $this->add_group_control(
6335 Group_Control_Box_Shadow::get_type(),
6336 [
6337 'name' => 'comp_btn_box_shadow_hr',
6338 'selector' => '{{WRAPPER}} .king-addons-compare-add:hover, WRAPPER}} .king-addons-compare-remove:hover',
6339 ]
6340 );
6341
6342 $this->end_controls_tab();
6343
6344 $this->start_controls_tab(
6345 'comp_tab_remove_btn',
6346 [
6347 'label' => esc_html__('Remove', 'king-addons'),
6348 ]
6349 );
6350
6351 $this->add_control(
6352 'comp_remove_btn_color',
6353 [
6354 'label' => esc_html__('Color', 'king-addons'),
6355 'type' => Controls_Manager::COLOR,
6356 'default' => '#FF4400',
6357 'selectors' => [
6358 '{{WRAPPER}} .king-addons-compare-remove span' => 'color: {{VALUE}}',
6359 '{{WRAPPER}} .king-addons-compare-remove i' => 'color: {{VALUE}}',
6360 '{{WRAPPER}} .king-addons-compare-remove svg' => 'fill: {{VALUE}}',
6361 '{{WRAPPER}} .king-addons-compare-remove:hover span' => 'color: {{VALUE}}',
6362 '{{WRAPPER}} .king-addons-compare-remove:hover i' => 'color: {{VALUE}}',
6363 '{{WRAPPER}} .king-addons-compare-remove:hover svg' => 'fill: {{VALUE}}'
6364 ]
6365 ]
6366 );
6367
6368 $this->add_control(
6369 'comp_remove_btn_border_color',
6370 [
6371 'label' => esc_html__('Border Color', 'king-addons'),
6372 'type' => Controls_Manager::COLOR,
6373 'default' => '#FF4F40',
6374 'selectors' => [
6375 '{{WRAPPER}} .king-addons-compare-remove' => 'border-color: {{VALUE}}',
6376 '{{WRAPPER}} .king-addons-compare-remove:hover' => 'border-color: {{VALUE}}'
6377 ]
6378 ]
6379 );
6380
6381 $this->add_control(
6382 'comp_remove_btn_bg_color',
6383 [
6384 'label' => esc_html__('Background Color', 'king-addons'),
6385 'type' => Controls_Manager::COLOR,
6386 'default' => '#FFF',
6387 'selectors' => [
6388 '{{WRAPPER}} .king-addons-compare-remove' => 'background-color: {{VALUE}}',
6389 '{{WRAPPER}} .king-addons-compare-remove:hover' => 'background-color: {{VALUE}}'
6390 ]
6391 ]
6392 );
6393
6394 $this->end_controls_tab();
6395
6396 $this->end_controls_tabs();
6397
6398 $this->add_responsive_control(
6399 'comp_button_padding',
6400 [
6401 'label' => esc_html__('Padding', 'king-addons'),
6402 'type' => Controls_Manager::DIMENSIONS,
6403 'size_units' => ['px'],
6404 'default' => [
6405 'top' => 5,
6406 'right' => 15,
6407 'bottom' => 5,
6408 'left' => 15,
6409 ],
6410 'selectors' => [
6411 '{{WRAPPER}} .king-addons-compare-add' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6412 '{{WRAPPER}} .king-addons-compare-remove' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
6413 ],
6414 'separator' => 'before',
6415 ]
6416 );
6417
6418 $this->add_responsive_control(
6419 'comp_button_margin',
6420 [
6421 'label' => esc_html__('Margin', 'king-addons'),
6422 'type' => Controls_Manager::DIMENSIONS,
6423 'size_units' => ['px'],
6424 'default' => [
6425 'top' => 5,
6426 'right' => 0,
6427 'bottom' => 0,
6428 'left' => 0,
6429 ],
6430 'selectors' => [
6431
6432
6433 '{{WRAPPER}} .king-addons-grid-item-compare-button .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6434 ]
6435 ]
6436 );
6437
6438 $this->add_control(
6439 'comp_button_border_type',
6440 [
6441 'label' => esc_html__('Border Type', 'king-addons'),
6442 'type' => Controls_Manager::SELECT,
6443 'options' => [
6444 'none' => esc_html__('None', 'king-addons'),
6445 'solid' => esc_html__('Solid', 'king-addons'),
6446 'double' => esc_html__('Double', 'king-addons'),
6447 'dotted' => esc_html__('Dotted', 'king-addons'),
6448 'dashed' => esc_html__('Dashed', 'king-addons'),
6449 'groove' => esc_html__('Groove', 'king-addons'),
6450 ],
6451 'default' => 'none',
6452 'selectors' => [
6453 '{{WRAPPER}} .king-addons-compare-add' => 'border-style: {{VALUE}};',
6454 '{{WRAPPER}} .king-addons-compare-remove' => 'border-style: {{VALUE}};'
6455 ],
6456 'separator' => 'before',
6457 ]
6458 );
6459
6460 $this->add_responsive_control(
6461 'comp_button_border_width',
6462 [
6463 'label' => esc_html__('Border Width', 'king-addons'),
6464 'type' => Controls_Manager::DIMENSIONS,
6465 'size_units' => ['px', '%'],
6466 'default' => [
6467 'top' => 2,
6468 'right' => 2,
6469 'bottom' => 2,
6470 'left' => 2,
6471 ],
6472 'selectors' => [
6473 '{{WRAPPER}} .king-addons-compare-add' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6474 '{{WRAPPER}} .king-addons-compare-remove' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6475 ],
6476 'condition' => [
6477 'button_border_type!' => 'none',
6478 ],
6479 ]
6480 );
6481
6482 $this->add_responsive_control(
6483 'comp_button_border_radius',
6484 [
6485 'label' => esc_html__('Border Radius', 'king-addons'),
6486 'type' => Controls_Manager::DIMENSIONS,
6487 'size_units' => ['px', '%'],
6488 'default' => [
6489 'top' => 0,
6490 'right' => 0,
6491 'bottom' => 0,
6492 'left' => 0,
6493 ],
6494 'selectors' => [
6495 '{{WRAPPER}} .king-addons-compare-add' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6496 '{{WRAPPER}} .king-addons-compare-remove' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6497 ]
6498 ]
6499 );
6500
6501 $this->end_controls_section();
6502
6503 $this->add_section_added_to_cart_popup();
6504
6505
6506 $this->add_section_style_likes();
6507
6508
6509 $this->add_section_style_sharing();
6510
6511
6512 $this->start_controls_section(
6513 'section_style_lightbox',
6514 [
6515 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Lightbox', 'king-addons'),
6516 'tab' => Controls_Manager::TAB_STYLE,
6517 'show_label' => false,
6518 ]
6519 );
6520
6521 $this->start_controls_tabs('tabs_grid_lightbox_style');
6522
6523 $this->start_controls_tab(
6524 'tab_grid_lightbox_normal',
6525 [
6526 'label' => esc_html__('Normal', 'king-addons'),
6527 ]
6528 );
6529
6530 $this->add_control(
6531 'lightbox_color',
6532 [
6533 'label' => esc_html__('Color', 'king-addons'),
6534 'type' => Controls_Manager::COLOR,
6535 'default' => '#ffffff',
6536 'selectors' => [
6537 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'color: {{VALUE}}',
6538 ],
6539 ]
6540 );
6541
6542 $this->add_control(
6543 'lightbox_bg_color',
6544 [
6545 'label' => esc_html__('Background Color', 'king-addons'),
6546 'type' => Controls_Manager::COLOR,
6547 'selectors' => [
6548 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'background-color: {{VALUE}}',
6549 ]
6550 ]
6551 );
6552
6553 $this->add_control(
6554 'lightbox_border_color',
6555 [
6556 'label' => esc_html__('Border Color', 'king-addons'),
6557 'type' => Controls_Manager::COLOR,
6558 'default' => '#E8E8E8',
6559 'selectors' => [
6560 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-color: {{VALUE}}',
6561 ],
6562 ]
6563 );
6564
6565 $this->add_group_control(
6566 Group_Control_Text_Shadow::get_type(),
6567 [
6568 'name' => 'lightbox_shadow',
6569 'selector' => '{{WRAPPER}} .king-addons-grid-item-lightbox i',
6570 ]
6571 );
6572
6573 $this->end_controls_tab();
6574
6575 $this->start_controls_tab(
6576 'tab_grid_lightbox_hover',
6577 [
6578 'label' => esc_html__('Hover', 'king-addons'),
6579 ]
6580 );
6581
6582 $this->add_control(
6583 'lightbox_color_hr',
6584 [
6585 'label' => esc_html__('Color', 'king-addons'),
6586 'type' => Controls_Manager::COLOR,
6587 'default' => '#FFFFFF',
6588 'selectors' => [
6589 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span:hover' => 'color: {{VALUE}}',
6590 ],
6591 ]
6592 );
6593
6594 $this->add_control(
6595 'lightbox_bg_color_hr',
6596 [
6597 'label' => esc_html__('Background Color', 'king-addons'),
6598 'type' => Controls_Manager::COLOR,
6599 'selectors' => [
6600 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span:hover' => 'background-color: {{VALUE}}',
6601 ]
6602 ]
6603 );
6604
6605 $this->add_control(
6606 'lightbox_border_color_hr',
6607 [
6608 'label' => esc_html__('Border Color', 'king-addons'),
6609 'type' => Controls_Manager::COLOR,
6610 'default' => '#E8E8E8',
6611 'selectors' => [
6612 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span:hover' => 'border-color: {{VALUE}}',
6613 ],
6614 'separator' => 'after',
6615 ]
6616 );
6617
6618 $this->end_controls_tab();
6619
6620 $this->end_controls_tabs();
6621
6622 $this->add_control(
6623 'lightbox_shadow_divider',
6624 [
6625 'type' => Controls_Manager::DIVIDER,
6626 'style' => 'thick',
6627 ]
6628 );
6629
6630 $this->add_control(
6631 'lightbox_transition_duration',
6632 [
6633 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
6634 'type' => Controls_Manager::NUMBER,
6635 'default' => 0.1,
6636 'min' => 0,
6637 'max' => 5,
6638 'step' => 0.1,
6639 'selectors' => [
6640 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'transition-duration: {{VALUE}}s',
6641 ],
6642 'separator' => 'after',
6643 ]
6644 );
6645
6646 $this->add_group_control(
6647 Group_Control_Typography::get_type(),
6648 [
6649 'name' => 'lightbox_typography',
6650 'selector' => '{{WRAPPER}} .king-addons-grid-item-lightbox'
6651 ]
6652 );
6653
6654 $this->add_control(
6655 'lightbox_border_type',
6656 [
6657 'label' => esc_html__('Border Type', 'king-addons'),
6658 'type' => Controls_Manager::SELECT,
6659 'options' => [
6660 'none' => esc_html__('None', 'king-addons'),
6661 'solid' => esc_html__('Solid', 'king-addons'),
6662 'double' => esc_html__('Double', 'king-addons'),
6663 'dotted' => esc_html__('Dotted', 'king-addons'),
6664 'dashed' => esc_html__('Dashed', 'king-addons'),
6665 'groove' => esc_html__('Groove', 'king-addons'),
6666 ],
6667 'default' => 'none',
6668 'selectors' => [
6669 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-style: {{VALUE}};',
6670 ],
6671 'render_type' => 'template',
6672 'separator' => 'before',
6673 ]
6674 );
6675
6676 $this->add_control(
6677 'lightbox_border_width',
6678 [
6679 'label' => esc_html__('Border Width', 'king-addons'),
6680 'type' => Controls_Manager::DIMENSIONS,
6681 'size_units' => ['px'],
6682 'default' => [
6683 'top' => 1,
6684 'right' => 1,
6685 'bottom' => 1,
6686 'left' => 1,
6687 ],
6688 'selectors' => [
6689 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6690 ],
6691 'render_type' => 'template',
6692 'condition' => [
6693 'lightbox_border_type!' => 'none',
6694 ],
6695 ]
6696 );
6697
6698 $this->add_control(
6699 'lightbox_text_spacing',
6700 [
6701 'label' => esc_html__('Extra Text Spacing', 'king-addons'),
6702 'type' => Controls_Manager::SLIDER,
6703 'size_units' => ['px'],
6704 'range' => [
6705 'px' => [
6706 'min' => 0,
6707 'max' => 25,
6708 ],
6709 ],
6710 'default' => [
6711 'unit' => 'px',
6712 'size' => 10,
6713 ],
6714 'selectors' => [
6715 '{{WRAPPER}} .king-addons-grid-item-lightbox .king-addons-grid-extra-text-left' => 'padding-right: {{SIZE}}{{UNIT}};',
6716 '{{WRAPPER}} .king-addons-grid-item-lightbox .king-addons-grid-extra-text-right' => 'padding-left: {{SIZE}}{{UNIT}};',
6717 ],
6718 'separator' => 'before'
6719 ]
6720 );
6721
6722 $this->add_responsive_control(
6723 'lightbox_padding',
6724 [
6725 'label' => esc_html__('Padding', 'king-addons'),
6726 'type' => Controls_Manager::DIMENSIONS,
6727 'size_units' => ['px', '%'],
6728 'default' => [
6729 'top' => 0,
6730 'right' => 0,
6731 'bottom' => 0,
6732 'left' => 0,
6733 ],
6734 'selectors' => [
6735 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6736 ],
6737 'render_type' => 'template',
6738 'separator' => 'before',
6739 ]
6740 );
6741
6742 $this->add_responsive_control(
6743 'lightbox_margin',
6744 [
6745 'label' => esc_html__('Margin', 'king-addons'),
6746 'type' => Controls_Manager::DIMENSIONS,
6747 'size_units' => ['px', '%'],
6748 'default' => [
6749 'top' => 0,
6750 'right' => 0,
6751 'bottom' => 0,
6752 'left' => 0,
6753 ],
6754 'render_type' => 'template',
6755 'selectors' => [
6756 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6757 ],
6758 ]
6759 );
6760
6761 $this->add_control(
6762 'lightbox_radius',
6763 [
6764 'label' => esc_html__('Border Radius', 'king-addons'),
6765 'type' => Controls_Manager::DIMENSIONS,
6766 'size_units' => ['px', '%'],
6767 'default' => [
6768 'top' => 2,
6769 'right' => 2,
6770 'bottom' => 2,
6771 'left' => 2,
6772 ],
6773 'selectors' => [
6774 '{{WRAPPER}} .king-addons-grid-item-lightbox .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6775 ],
6776 'separator' => 'before',
6777 ]
6778 );
6779
6780 $this->end_controls_section();
6781
6782
6783 $this->start_controls_section(
6784 'section_style_separator1',
6785 [
6786 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 1', 'king-addons'),
6787 'tab' => Controls_Manager::TAB_STYLE,
6788 'show_label' => false,
6789 ]
6790 );
6791
6792 $this->add_control(
6793 'separator1_color',
6794 [
6795 'label' => esc_html__('Color', 'king-addons'),
6796 'type' => Controls_Manager::COLOR,
6797 'default' => '#9C9C9C',
6798 'selectors' => [
6799 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-color: {{VALUE}}',
6800 ],
6801 ]
6802 );
6803
6804 $this->add_control(
6805 'separator1_width',
6806 [
6807 'label' => esc_html__('Width', 'king-addons'),
6808 'type' => Controls_Manager::SLIDER,
6809 'size_units' => ['px', '%'],
6810 'range' => [
6811 'px' => [
6812 'min' => 0,
6813 'max' => 300,
6814 ],
6815 '%' => [
6816 'min' => 0,
6817 'max' => 100,
6818 ],
6819 ],
6820 'default' => [
6821 'unit' => '%',
6822 'size' => 100,
6823 ],
6824 'selectors' => [
6825 '{{WRAPPER}} .king-addons-grid-sep-style-1:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};',
6826 '{{WRAPPER}} .king-addons-grid-sep-style-1.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};',
6827 ],
6828 'render_type' => 'template',
6829 'separator' => 'before',
6830 ]
6831 );
6832
6833 $this->add_control(
6834 'separator1_height',
6835 [
6836 'label' => esc_html__('Height', 'king-addons'),
6837 'type' => Controls_Manager::SLIDER,
6838 'size_units' => ['px'],
6839 'range' => [
6840 'px' => [
6841 'min' => 1,
6842 'max' => 100,
6843 ],
6844 ],
6845 'default' => [
6846 'unit' => 'px',
6847 'size' => 2,
6848 ],
6849 'render_type' => 'template',
6850 'selectors' => [
6851 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
6852 ],
6853 ]
6854 );
6855
6856 $this->add_control(
6857 'separator1_border_type',
6858 [
6859 'label' => esc_html__('Type', 'king-addons'),
6860 'type' => Controls_Manager::SELECT,
6861 'options' => [
6862 'solid' => esc_html__('Solid', 'king-addons'),
6863 'double' => esc_html__('Double', 'king-addons'),
6864 'dotted' => esc_html__('Dotted', 'king-addons'),
6865 'dashed' => esc_html__('Dashed', 'king-addons'),
6866 'groove' => esc_html__('Groove', 'king-addons'),
6867 ],
6868 'default' => 'solid',
6869 'selectors' => [
6870 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-bottom-style: {{VALUE}};',
6871 ],
6872 'separator' => 'before',
6873 ]
6874 );
6875
6876 $this->add_responsive_control(
6877 'separator1_margin',
6878 [
6879 'label' => esc_html__('Margin', 'king-addons'),
6880 'type' => Controls_Manager::DIMENSIONS,
6881 'size_units' => ['px', '%'],
6882 'default' => [
6883 'top' => 0,
6884 'right' => 0,
6885 'bottom' => 0,
6886 'left' => 0,
6887 ],
6888 'render_type' => 'template',
6889 'selectors' => [
6890 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6891 ],
6892 ]
6893 );
6894
6895 $this->add_control(
6896 'separator1_radius',
6897 [
6898 'label' => esc_html__('Border Radius', 'king-addons'),
6899 'type' => Controls_Manager::DIMENSIONS,
6900 'size_units' => ['px', '%'],
6901 'default' => [
6902 'top' => 0,
6903 'right' => 0,
6904 'bottom' => 0,
6905 'left' => 0,
6906 ],
6907 'selectors' => [
6908 '{{WRAPPER}} .king-addons-grid-sep-style-1 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
6909 ],
6910 'separator' => 'before',
6911 ]
6912 );
6913
6914 $this->end_controls_section();
6915
6916
6917 $this->start_controls_section(
6918 'section_style_separator2',
6919 [
6920 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Separator Style 2', 'king-addons'),
6921 'tab' => Controls_Manager::TAB_STYLE,
6922 'show_label' => false,
6923 ]
6924 );
6925
6926 $this->add_control(
6927 'separator2_color',
6928 [
6929 'label' => esc_html__('Color', 'king-addons'),
6930 'type' => Controls_Manager::COLOR,
6931 'default' => '#5B03FF',
6932 'selectors' => [
6933 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-color: {{VALUE}}',
6934 ],
6935 ]
6936 );
6937
6938 $this->add_control(
6939 'separator2_width',
6940 [
6941 'label' => esc_html__('Width', 'king-addons'),
6942 'type' => Controls_Manager::SLIDER,
6943 'size_units' => ['px', '%'],
6944 'range' => [
6945 'px' => [
6946 'min' => 0,
6947 'max' => 300,
6948 ],
6949 '%' => [
6950 'min' => 0,
6951 'max' => 100,
6952 ],
6953 ],
6954 'default' => [
6955 'unit' => '%',
6956 'size' => 20,
6957 ],
6958 'selectors' => [
6959 '{{WRAPPER}} .king-addons-grid-sep-style-2:not(.king-addons-grid-item-display-inline) .inner-block > span' => 'width: {{SIZE}}{{UNIT}};',
6960 '{{WRAPPER}} .king-addons-grid-sep-style-2.king-addons-grid-item-display-inline' => 'width: {{SIZE}}{{UNIT}};',
6961 ],
6962 'render_type' => 'template',
6963 'separator' => 'before',
6964 ]
6965 );
6966
6967 $this->add_control(
6968 'separator2_height',
6969 [
6970 'label' => esc_html__('Height', 'king-addons'),
6971 'type' => Controls_Manager::SLIDER,
6972 'size_units' => ['px'],
6973 'range' => [
6974 'px' => [
6975 'min' => 0,
6976 'max' => 100,
6977 ],
6978 ],
6979 'default' => [
6980 'unit' => 'px',
6981 'size' => 2,
6982 ],
6983 'selectors' => [
6984 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-width: {{SIZE}}{{UNIT}};',
6985 ],
6986 'render_type' => 'template',
6987 ]
6988 );
6989
6990 $this->add_control(
6991 'separator2_border_type',
6992 [
6993 'label' => esc_html__('Type', 'king-addons'),
6994 'type' => Controls_Manager::SELECT,
6995 'options' => [
6996 'solid' => esc_html__('Solid', 'king-addons'),
6997 'double' => esc_html__('Double', 'king-addons'),
6998 'dotted' => esc_html__('Dotted', 'king-addons'),
6999 'dashed' => esc_html__('Dashed', 'king-addons'),
7000 'groove' => esc_html__('Groove', 'king-addons'),
7001 ],
7002 'default' => 'solid',
7003 'selectors' => [
7004 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-bottom-style: {{VALUE}};',
7005 ],
7006 'separator' => 'before',
7007 ]
7008 );
7009
7010 $this->add_responsive_control(
7011 'separator2_margin',
7012 [
7013 'label' => esc_html__('Margin', 'king-addons'),
7014 'type' => Controls_Manager::DIMENSIONS,
7015 'size_units' => ['px', '%'],
7016 'default' => [
7017 'top' => 0,
7018 'right' => 0,
7019 'bottom' => 0,
7020 'left' => 0,
7021 ],
7022 'selectors' => [
7023 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7024 ],
7025 'render_type' => 'template',
7026 ]
7027 );
7028
7029 $this->add_control(
7030 'separator2_radius',
7031 [
7032 'label' => esc_html__('Border Radius', 'king-addons'),
7033 'type' => Controls_Manager::DIMENSIONS,
7034 'size_units' => ['px', '%'],
7035 'default' => [
7036 'top' => 0,
7037 'right' => 0,
7038 'bottom' => 0,
7039 'left' => 0,
7040 ],
7041 'selectors' => [
7042 '{{WRAPPER}} .king-addons-grid-sep-style-2 .inner-block > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7043 ],
7044 'separator' => 'before',
7045 ]
7046 );
7047
7048 $this->end_controls_section();
7049
7050
7051 $this->start_controls_section(
7052 'settings_section_style_grid_slider_nav',
7053 [
7054 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Slider Navigation', 'king-addons'),
7055 'tab' => Controls_Manager::TAB_STYLE,
7056 'condition' => [
7057 'layout_select' => 'slider',
7058 ],
7059 ]
7060 );
7061
7062 $this->start_controls_tabs('tabs_grid_slider_nav_style');
7063
7064 $this->start_controls_tab(
7065 'tab_grid_slider_nav_normal',
7066 [
7067 'label' => esc_html__('Normal', 'king-addons'),
7068 ]
7069 );
7070
7071 $this->add_control(
7072 'grid_slider_nav_color',
7073 [
7074 'label' => esc_html__('Color', 'king-addons'),
7075 'type' => Controls_Manager::COLOR,
7076 'default' => '#5B03FF',
7077 'selectors' => [
7078 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'color: {{VALUE}};',
7079 '{{WRAPPER}} .king-addons-grid-slider-arrow svg' => 'fill: {{VALUE}};',
7080 ],
7081 ]
7082 );
7083
7084 $this->add_control(
7085 'grid_slider_nav_bg_color',
7086 [
7087 'label' => esc_html__('Background Color', 'king-addons'),
7088 'type' => Controls_Manager::COLOR,
7089 'selectors' => [
7090 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'background-color: {{VALUE}};',
7091 ],
7092 ]
7093 );
7094
7095 $this->add_control(
7096 'grid_slider_nav_border_color',
7097 [
7098 'label' => esc_html__('Border Color', 'king-addons'),
7099 'type' => Controls_Manager::COLOR,
7100 'default' => '#E8E8E8',
7101 'selectors' => [
7102 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-color: {{VALUE}};',
7103 ],
7104 ]
7105 );
7106
7107 $this->end_controls_tab();
7108
7109 $this->start_controls_tab(
7110 'tab_grid_slider_nav_hover',
7111 [
7112 'label' => esc_html__('Hover', 'king-addons'),
7113 ]
7114 );
7115
7116 $this->add_control(
7117 'grid_slider_nav_hover_color',
7118 [
7119 'label' => esc_html__('Color', 'king-addons'),
7120 'type' => Controls_Manager::COLOR,
7121 'default' => '#4D02D8',
7122 'selectors' => [
7123 '{{WRAPPER}} .king-addons-grid-slider-arrow:hover' => 'color: {{VALUE}};',
7124 '{{WRAPPER}} .king-addons-grid-slider-arrow:hover svg' => 'fill: {{VALUE}};',
7125 ],
7126 ]
7127 );
7128
7129 $this->add_control(
7130 'grid_slider_nav_hover_bg_color',
7131 [
7132 'label' => esc_html__('Background Color', 'king-addons'),
7133 'type' => Controls_Manager::COLOR,
7134 'selectors' => [
7135 '{{WRAPPER}} .king-addons-grid-slider-arrow:hover' => 'background-color: {{VALUE}};',
7136 ],
7137 ]
7138 );
7139
7140 $this->add_control(
7141 'grid_slider_nav_hover_border_color',
7142 [
7143 'label' => esc_html__('Border Color', 'king-addons'),
7144 'type' => Controls_Manager::COLOR,
7145 'default' => '#E8E8E8',
7146 'selectors' => [
7147 '{{WRAPPER}} .king-addons-grid-slider-arrow:hover' => 'border-color: {{VALUE}};',
7148 ],
7149 ]
7150 );
7151
7152 $this->end_controls_tab();
7153
7154 $this->end_controls_tabs();
7155
7156 $this->add_control(
7157 'grid_slider_nav_transition_duration',
7158 [
7159 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
7160 'type' => Controls_Manager::NUMBER,
7161 'default' => 0.1,
7162 'min' => 0,
7163 'max' => 5,
7164 'step' => 0.1,
7165 'selectors' => [
7166 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'transition-duration: {{VALUE}}s',
7167 '{{WRAPPER}} .king-addons-grid-slider-arrow svg' => 'transition-duration: {{VALUE}}s',
7168 ],
7169 'separator' => 'before',
7170 ]
7171 );
7172
7173 $this->add_responsive_control(
7174 'grid_slider_nav_font_size',
7175 [
7176 'label' => esc_html__('Font Size', 'king-addons'),
7177 'type' => Controls_Manager::SLIDER,
7178 'size_units' => ['px',],
7179 'range' => [
7180 'px' => [
7181 'min' => 10,
7182 'max' => 200,
7183 ],
7184 ],
7185 'default' => [
7186 'unit' => 'px',
7187 'size' => 25,
7188 ],
7189 'selectors' => [
7190 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'font-size: {{SIZE}}{{UNIT}};',
7191 '{{WRAPPER}} .king-addons-grid-slider-arrow svg' => 'width: {{SIZE}}{{UNIT}};',
7192 ],
7193 'separator' => 'before',
7194 ]
7195 );
7196
7197 $this->add_responsive_control(
7198 'grid_slider_nav_size',
7199 [
7200 'label' => esc_html__('Box Size', 'king-addons'),
7201 'type' => Controls_Manager::SLIDER,
7202 'size_units' => ['px',],
7203 'range' => [
7204 'px' => [
7205 'min' => 10,
7206 'max' => 200,
7207 ],
7208 ],
7209 'default' => [
7210 'unit' => 'px',
7211 'size' => 60,
7212 ],
7213 'selectors' => [
7214 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
7215 ],
7216 'separator' => 'after',
7217 ]
7218 );
7219
7220 $this->add_control(
7221 'grid_slider_nav_border_type',
7222 [
7223 'label' => esc_html__('Border Type', 'king-addons'),
7224 'type' => Controls_Manager::SELECT,
7225 'options' => [
7226 'none' => esc_html__('None', 'king-addons'),
7227 'solid' => esc_html__('Solid', 'king-addons'),
7228 'double' => esc_html__('Double', 'king-addons'),
7229 'dotted' => esc_html__('Dotted', 'king-addons'),
7230 'dashed' => esc_html__('Dashed', 'king-addons'),
7231 'groove' => esc_html__('Groove', 'king-addons'),
7232 ],
7233 'default' => 'none',
7234 'selectors' => [
7235 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-style: {{VALUE}};',
7236 ],
7237 ]
7238 );
7239
7240 $this->add_control(
7241 'grid_slider_nav_border_width',
7242 [
7243 'label' => esc_html__('Border Width', 'king-addons'),
7244 'type' => Controls_Manager::DIMENSIONS,
7245 'size_units' => ['px'],
7246 'default' => [
7247 'top' => 2,
7248 'right' => 2,
7249 'bottom' => 2,
7250 'left' => 2,
7251 ],
7252 'selectors' => [
7253 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7254 ],
7255 'condition' => [
7256 'grid_slider_nav_border_type!' => 'none',
7257 ],
7258 ]
7259 );
7260
7261 $this->add_control(
7262 'grid_slider_nav_border_radius',
7263 [
7264 'label' => esc_html__('Border Radius', 'king-addons'),
7265 'type' => Controls_Manager::DIMENSIONS,
7266 'size_units' => ['px', '%'],
7267 'selectors' => [
7268 '{{WRAPPER}} .king-addons-grid-slider-arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7269 ],
7270 'separator' => 'after',
7271 ]
7272 );
7273
7274 $this->add_control_stack_grid_slider_nav_position();
7275
7276 $this->end_controls_section();
7277
7278
7279 $this->start_controls_section(
7280 'settings_section_style_grid_slider_dots',
7281 [
7282 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Slider Pagination', 'king-addons'),
7283 'tab' => Controls_Manager::TAB_STYLE,
7284 'condition' => [
7285 'layout_select' => 'slider',
7286 ],
7287 ]
7288 );
7289
7290 $this->start_controls_tabs('tabs_grid_slider_dots');
7291
7292 $this->start_controls_tab(
7293 'tab_grid_slider_dots_normal',
7294 [
7295 'label' => esc_html__('Normal', 'king-addons'),
7296 ]
7297 );
7298
7299 $this->add_control(
7300 'grid_slider_dots_bg_color',
7301 [
7302 'label' => esc_html__('Background Color', 'king-addons'),
7303 'type' => Controls_Manager::COLOR,
7304 'default' => 'rgba(0,0,0,0.35)',
7305 'selectors' => [
7306 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'background-color: {{VALUE}};',
7307 ],
7308 ]
7309 );
7310
7311 $this->add_control(
7312 'grid_slider_dots_border_color',
7313 [
7314 'label' => esc_html__('Border Color', 'king-addons'),
7315 'type' => Controls_Manager::COLOR,
7316 'default' => '#E8E8E8',
7317 'selectors' => [
7318 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-color: {{VALUE}}',
7319 ],
7320 ]
7321 );
7322
7323 $this->end_controls_tab();
7324
7325 $this->start_controls_tab(
7326 'tab_grid_slider_dots_active',
7327 [
7328 'label' => esc_html__('Active', 'king-addons'),
7329 ]
7330 );
7331
7332 $this->add_control(
7333 'grid_slider_dots_active_bg_color',
7334 [
7335 'label' => esc_html__('Background Color', 'king-addons'),
7336 'type' => Controls_Manager::COLOR,
7337 'default' => '#5B03FF',
7338 'selectors' => [
7339 '{{WRAPPER}} .king-addons-grid-slider-dots .slick-active .king-addons-grid-slider-dot' => 'background-color: {{VALUE}}',
7340 ],
7341 ]
7342 );
7343
7344 $this->add_control(
7345 'grid_slider_dots_active_border_color',
7346 [
7347 'label' => esc_html__('Border Color', 'king-addons'),
7348 'type' => Controls_Manager::COLOR,
7349 'default' => '#E8E8E8',
7350 'selectors' => [
7351 '{{WRAPPER}} .king-addons-grid-slider-dots .slick-active .king-addons-grid-slider-dot' => 'border-color: {{VALUE}}',
7352 ],
7353 ]
7354 );
7355
7356 $this->end_controls_tab();
7357
7358 $this->end_controls_tabs();
7359
7360 $this->add_responsive_control(
7361 'grid_slider_dots_width',
7362 [
7363 'label' => esc_html__('Box Width', 'king-addons'),
7364 'type' => Controls_Manager::SLIDER,
7365 'size_units' => ['px',],
7366 'range' => [
7367 'px' => [
7368 'min' => 1,
7369 'max' => 100,
7370 ],
7371 ],
7372 'default' => [
7373 'unit' => 'px',
7374 'size' => 8,
7375 ],
7376 'selectors' => [
7377 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'width: {{SIZE}}{{UNIT}};',
7378 ],
7379 'separator' => 'before',
7380 'render_type' => 'template'
7381 ]
7382 );
7383
7384 $this->add_responsive_control(
7385 'grid_slider_dots_height',
7386 [
7387 'label' => esc_html__('Box Height', 'king-addons'),
7388 'type' => Controls_Manager::SLIDER,
7389 'size_units' => ['px',],
7390 'range' => [
7391 'px' => [
7392 'min' => 1,
7393 'max' => 100,
7394 ],
7395 ],
7396 'default' => [
7397 'unit' => 'px',
7398 'size' => 8,
7399 ],
7400 'selectors' => [
7401 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'height: {{SIZE}}{{UNIT}};',
7402 ],
7403 'render_type' => 'template'
7404 ]
7405 );
7406
7407 $this->add_control(
7408 'grid_slider_dots_border_type',
7409 [
7410 'label' => esc_html__('Border Type', 'king-addons'),
7411 'type' => Controls_Manager::SELECT,
7412 'options' => [
7413 'none' => esc_html__('None', 'king-addons'),
7414 'solid' => esc_html__('Solid', 'king-addons'),
7415 'double' => esc_html__('Double', 'king-addons'),
7416 'dotted' => esc_html__('Dotted', 'king-addons'),
7417 'dashed' => esc_html__('Dashed', 'king-addons'),
7418 'groove' => esc_html__('Groove', 'king-addons'),
7419 ],
7420 'default' => 'none',
7421 'selectors' => [
7422 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-style: {{VALUE}};',
7423 ],
7424 'render_type' => 'template',
7425 'separator' => 'before',
7426 ]
7427 );
7428
7429 $this->add_control(
7430 'grid_slider_dots_border_width',
7431 [
7432 'label' => esc_html__('Border Width', 'king-addons'),
7433 'type' => Controls_Manager::DIMENSIONS,
7434 'size_units' => ['px'],
7435 'default' => [
7436 'top' => 1,
7437 'right' => 1,
7438 'bottom' => 1,
7439 'left' => 1,
7440 ],
7441 'selectors' => [
7442 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7443 ],
7444 'render_type' => 'template',
7445 'condition' => [
7446 'grid_slider_dots_border_type!' => 'none',
7447 ],
7448 ]
7449 );
7450
7451 $this->add_control(
7452 'grid_slider_dots_border_radius',
7453 [
7454 'label' => esc_html__('Border Radius', 'king-addons'),
7455 'type' => Controls_Manager::DIMENSIONS,
7456 'default' => [
7457 'top' => 50,
7458 'right' => 50,
7459 'bottom' => 50,
7460 'left' => 50,
7461 'unit' => '%',
7462 ],
7463 'size_units' => ['px', '%'],
7464 'selectors' => [
7465 '{{WRAPPER}} .king-addons-grid-slider-dot' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7466 ],
7467 'separator' => 'before',
7468 ]
7469 );
7470
7471 $this->add_responsive_control(
7472 'grid_slider_dots_gutter',
7473 [
7474 'type' => Controls_Manager::SLIDER,
7475 'label' => esc_html__('Gutter', 'king-addons'),
7476 'size_units' => ['px'],
7477 'range' => [
7478 'px' => [
7479 'min' => 0,
7480 'max' => 100,
7481 ],
7482 ],
7483 'default' => [
7484 'unit' => 'px',
7485 'size' => 7,
7486 ],
7487 'selectors' => [
7488 '{{WRAPPER}}.king-addons-grid-slider-dots-horizontal .king-addons-grid-slider-dot' => 'margin-right: {{SIZE}}{{UNIT}};',
7489 '{{WRAPPER}}.king-addons-grid-slider-dots-vertical .king-addons-grid-slider-dot' => 'margin-bottom: {{SIZE}}{{UNIT}};',
7490 ],
7491 'render_type' => 'template',
7492 'separator' => 'before',
7493 ]
7494 );
7495
7496 $this->add_control_grid_slider_dots_hr();
7497
7498 $this->add_responsive_control(
7499 'grid_slider_dots_vr',
7500 [
7501 'type' => Controls_Manager::SLIDER,
7502 'label' => esc_html__('Vertical Position', 'king-addons'),
7503 'size_units' => ['%', 'px'],
7504 'range' => [
7505 '%' => [
7506 'min' => -20,
7507 'max' => 120,
7508 ],
7509 'px' => [
7510 'min' => -200,
7511 'max' => 2000,
7512 ],
7513 ],
7514 'default' => [
7515 'unit' => '%',
7516 'size' => 96,
7517 ],
7518 'selectors' => [
7519 '{{WRAPPER}} .king-addons-grid-slider-dots' => 'top: {{SIZE}}{{UNIT}};',
7520 ],
7521 ]
7522 );
7523
7524 $this->end_controls_section();
7525
7526
7527 $this->start_controls_section(
7528 'section_style_linked_products',
7529 [
7530 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Upsell / Cross-sell Title', 'king-addons'),
7531 'tab' => Controls_Manager::TAB_STYLE,
7532 'show_label' => false,
7533 'condition' => [
7534 'query_selection' => ['upsell', 'cross-sell'],
7535
7536 ]
7537 ]
7538 );
7539
7540 $this->add_control(
7541 'linked_products_color',
7542 [
7543 'label' => esc_html__('Color', 'king-addons'),
7544 'type' => Controls_Manager::COLOR,
7545 'selectors' => [
7546 '{{WRAPPER}} .king-addons-grid-linked-products-heading' => 'color: {{VALUE}}',
7547 ]
7548 ]
7549 );
7550
7551 $this->add_group_control(
7552 Group_Control_Typography::get_type(),
7553 [
7554 'name' => 'linked_products',
7555 'selector' => '{{WRAPPER}} .king-addons-grid-linked-products-heading *'
7556 ]
7557 );
7558
7559 $this->add_responsive_control(
7560 'linked_products_padding',
7561 [
7562 'label' => esc_html__('Padding', 'king-addons'),
7563 'type' => Controls_Manager::DIMENSIONS,
7564 'size_units' => ['px'],
7565 'default' => [
7566 'top' => 3,
7567 'right' => 15,
7568 'bottom' => 3,
7569 'left' => 15,
7570 ],
7571 'selectors' => [
7572 '{{WRAPPER}} .king-addons-grid-linked-products-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7573 ]
7574 ]
7575 );
7576
7577 $this->add_responsive_control(
7578 'linked_products_distance_from_grid',
7579 [
7580 'label' => esc_html__('Distance From Grid', 'king-addons'),
7581 'type' => Controls_Manager::SLIDER,
7582 'size_units' => ['px'],
7583 'range' => [
7584 'px' => [
7585 'min' => 0,
7586 'max' => 100,
7587 ],
7588 ],
7589 'default' => [
7590 'unit' => 'px',
7591 'size' => 25,
7592 ],
7593 'selectors' => [
7594 '{{WRAPPER}} .king-addons-grid-linked-products-heading' => 'margin-bottom: {{SIZE}}{{UNIT}};',
7595 ]
7596
7597 ]
7598 );
7599
7600 $this->add_control(
7601 'linked_products_alignment',
7602 [
7603 'label' => esc_html__('Alignment', 'king-addons'),
7604 'type' => Controls_Manager::CHOOSE,
7605 'options' => [
7606 'left' => [
7607 'title' => esc_html__('Left', 'king-addons'),
7608 'icon' => 'eicon-text-align-left',
7609 ],
7610 'center' => [
7611 'title' => esc_html__('Center', 'king-addons'),
7612 'icon' => 'eicon-text-align-center',
7613 ],
7614 'right' => [
7615 'title' => esc_html__('Right', 'king-addons'),
7616 'icon' => 'eicon-text-align-right',
7617 ]
7618 ],
7619 'default' => 'left',
7620 'separator' => 'before',
7621 'selectors' => [
7622 '{{WRAPPER}} .king-addons-grid-linked-products-heading *' => 'text-align: {{VALUE}};',
7623 ]
7624 ]
7625 );
7626
7627 $this->end_controls_section();
7628
7629 $this->add_section_style_sort_and_results();
7630
7631
7632 $this->start_controls_section(
7633 'section_style_filters',
7634 [
7635 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Filters', 'king-addons'),
7636 'tab' => Controls_Manager::TAB_STYLE,
7637 'show_label' => false,
7638 'condition' => [
7639 'layout_select!' => 'slider',
7640 'layout_filters' => 'yes',
7641 ],
7642 ]
7643 );
7644
7645 $this->add_control(
7646 'active_styles_notice',
7647 [
7648 'type' => Controls_Manager::RAW_HTML,
7649 'raw' => esc_html__('Apply active filter styles from the hover tab.', 'king-addons'),
7650 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info'
7651 ]
7652 );
7653
7654 $this->start_controls_tabs('tabs_grid_filters_style');
7655
7656 $this->start_controls_tab(
7657 'tab_grid_filters_normal',
7658 [
7659 'label' => esc_html__('Normal', 'king-addons'),
7660 ]
7661 );
7662
7663 $this->add_control(
7664 'filters_color',
7665 [
7666 'label' => esc_html__('Color', 'king-addons'),
7667 'type' => Controls_Manager::COLOR,
7668 'default' => '#7A7A7A',
7669 'selectors' => [
7670 '{{WRAPPER}} .king-addons-grid-filters li' => 'color: {{VALUE}}',
7671 '{{WRAPPER}} .king-addons-grid-filters li a' => 'color: {{VALUE}}',
7672 ],
7673 ]
7674 );
7675
7676 $this->add_control(
7677 'filters_bg_color',
7678 [
7679 'label' => esc_html__('Background Color', 'king-addons'),
7680 'type' => Controls_Manager::COLOR,
7681 'selectors' => [
7682 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'background-color: {{VALUE}}',
7683 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'background-color: {{VALUE}}',
7684 ]
7685 ]
7686 );
7687
7688 $this->add_control(
7689 'filters_border_color',
7690 [
7691 'label' => esc_html__('Border Color', 'king-addons'),
7692 'type' => Controls_Manager::COLOR,
7693 'default' => '#E8E8E8',
7694 'selectors' => [
7695 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-color: {{VALUE}}',
7696 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-color: {{VALUE}}',
7697 ],
7698 ]
7699 );
7700
7701 $this->add_group_control(
7702 Group_Control_Box_Shadow::get_type(),
7703 [
7704 'name' => 'filters_box_shadow',
7705 'selector' => '{{WRAPPER}} .king-addons-grid-filters li > a, {{WRAPPER}} .king-addons-grid-filters li > span',
7706 ]
7707 );
7708
7709 $this->add_control(
7710 'filters_wrapper_color',
7711 [
7712 'label' => esc_html__('Wrapper Color', 'king-addons'),
7713 'type' => Controls_Manager::COLOR,
7714 'selectors' => [
7715 '{{WRAPPER}} .king-addons-grid-filters' => 'background-color: {{VALUE}}',
7716 ],
7717 'separator' => 'after',
7718 ]
7719 );
7720
7721 $this->end_controls_tab();
7722
7723 $this->start_controls_tab(
7724 'tab_grid_filters_hover',
7725 [
7726 'label' => esc_html__('Hover', 'king-addons'),
7727 ]
7728 );
7729
7730 $this->add_control(
7731 'filters_color_hr',
7732 [
7733 'label' => esc_html__('Color', 'king-addons'),
7734 'type' => Controls_Manager::COLOR,
7735 'default' => '#FFFFFF',
7736 'selectors' => [
7737 '{{WRAPPER}} .king-addons-grid-filters li > a:hover' => 'color: {{VALUE}}',
7738 '{{WRAPPER}} .king-addons-grid-filters li > span:hover' => 'color: {{VALUE}}',
7739 '{{WRAPPER}} .king-addons-grid-filters li > .king-addons-active-filter' => 'color: {{VALUE}}',
7740 ],
7741 ]
7742 );
7743
7744 $this->add_control(
7745 'filters_bg_color_hr',
7746 [
7747 'label' => esc_html__('Background Color', 'king-addons'),
7748 'type' => Controls_Manager::COLOR,
7749 'default' => '#5B03FF',
7750 'selectors' => [
7751 '{{WRAPPER}} .king-addons-grid-filters li > a:hover' => 'background-color: {{VALUE}}',
7752 '{{WRAPPER}} .king-addons-grid-filters li > span:hover' => 'background-color: {{VALUE}}',
7753 '{{WRAPPER}} .king-addons-grid-filters li > .king-addons-active-filter' => 'background-color: {{VALUE}}',
7754 ]
7755 ]
7756 );
7757
7758 $this->add_control(
7759 'filters_border_color_hr',
7760 [
7761 'label' => esc_html__('Border Color', 'king-addons'),
7762 'type' => Controls_Manager::COLOR,
7763 'default' => '#E8E8E8',
7764 'selectors' => [
7765 '{{WRAPPER}} .king-addons-grid-filters li > a:hover' => 'border-color: {{VALUE}}',
7766 '{{WRAPPER}} .king-addons-grid-filters li > span:hover' => 'border-color: {{VALUE}}',
7767 '{{WRAPPER}} .king-addons-grid-filters li > .king-addons-active-filter' => 'border-color: {{VALUE}}',
7768 ]
7769 ]
7770 );
7771
7772 $this->add_control_filters_pointer_color_hr();
7773
7774 $this->add_group_control(
7775 Group_Control_Box_Shadow::get_type(),
7776 [
7777 'name' => 'filters_box_shadow_hr',
7778 'selector' => '{{WRAPPER}} .king-addons-grid-filters li > a:hover, {{WRAPPER}} .king-addons-grid-filters li > span:hover',
7779 'separator' => 'after',
7780 ]
7781 );
7782
7783 $this->end_controls_tab();
7784
7785 $this->end_controls_tabs();
7786
7787 $this->add_control_filters_pointer();
7788
7789 $this->add_control_filters_pointer_height();
7790
7791 $this->add_control_filters_pointer_animation();
7792
7793 $this->add_control(
7794 'filters_transition_duration',
7795 [
7796 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
7797 'type' => Controls_Manager::NUMBER,
7798 'default' => 0.1,
7799 'min' => 0,
7800 'max' => 5,
7801 'step' => 0.1,
7802 'selectors' => [
7803 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'transition-duration: {{VALUE}}s',
7804 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'transition-duration: {{VALUE}}s',
7805 '{{WRAPPER}} .king-addons-pointer-item:before' => 'transition-duration: {{VALUE}}s',
7806 '{{WRAPPER}} .king-addons-pointer-item:after' => 'transition-duration: {{VALUE}}s',
7807 ],
7808 'separator' => 'after',
7809 ]
7810 );
7811
7812 $this->add_group_control(
7813 Group_Control_Typography::get_type(),
7814 [
7815 'name' => 'filters_typography',
7816 'selector' => '{{WRAPPER}} .king-addons-grid-filters li'
7817 ]
7818 );
7819
7820 $this->add_control(
7821 'filters_border_type',
7822 [
7823 'label' => esc_html__('Border Type', 'king-addons'),
7824 'type' => Controls_Manager::SELECT,
7825 'options' => [
7826 'none' => esc_html__('None', 'king-addons'),
7827 'solid' => esc_html__('Solid', 'king-addons'),
7828 'double' => esc_html__('Double', 'king-addons'),
7829 'dotted' => esc_html__('Dotted', 'king-addons'),
7830 'dashed' => esc_html__('Dashed', 'king-addons'),
7831 'groove' => esc_html__('Groove', 'king-addons'),
7832 ],
7833 'default' => 'none',
7834 'selectors' => [
7835 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-style: {{VALUE}};',
7836 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-style: {{VALUE}};',
7837 ],
7838 'separator' => 'before',
7839 ]
7840 );
7841
7842 $this->add_control(
7843 'filters_border_width',
7844 [
7845 'label' => esc_html__('Border Width', 'king-addons'),
7846 'type' => Controls_Manager::DIMENSIONS,
7847 'size_units' => ['px'],
7848 'default' => [
7849 'top' => 1,
7850 'right' => 1,
7851 'bottom' => 1,
7852 'left' => 1,
7853 ],
7854 'selectors' => [
7855 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7856 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7857 ],
7858 'condition' => [
7859 'filters_border_type!' => 'none',
7860 ],
7861 ]
7862 );
7863
7864 $this->add_responsive_control(
7865 'filters_distance_from_grid',
7866 [
7867 'label' => esc_html__('Distance From Grid', 'king-addons'),
7868 'type' => Controls_Manager::SLIDER,
7869 'size_units' => ['px'],
7870 'range' => [
7871 'px' => [
7872 'min' => 0,
7873 'max' => 100,
7874 ],
7875 ],
7876 'default' => [
7877 'unit' => 'px',
7878 'size' => 25,
7879 ],
7880 'selectors' => [
7881 '{{WRAPPER}} .king-addons-grid-filters' => 'margin-bottom: {{SIZE}}{{UNIT}};',
7882 ],
7883 'separator' => 'before'
7884 ]
7885 );
7886
7887 $this->add_control(
7888 'filters_icon_spacing',
7889 [
7890 'label' => esc_html__('Extra Icon Spacing', 'king-addons'),
7891 'type' => Controls_Manager::SLIDER,
7892 'size_units' => ['px'],
7893 'range' => [
7894 'px' => [
7895 'min' => 0,
7896 'max' => 25,
7897 ],
7898 ],
7899 'default' => [
7900 'unit' => 'px',
7901 'size' => 0,
7902 ],
7903 'selectors' => [
7904 '{{WRAPPER}} .king-addons-grid-filters-icon-left' => 'padding-right: {{SIZE}}{{UNIT}};',
7905 '{{WRAPPER}} .king-addons-grid-filters-icon-right' => 'padding-left: {{SIZE}}{{UNIT}};',
7906 ],
7907 ]
7908 );
7909
7910 $this->add_responsive_control(
7911 'filters_margin',
7912 [
7913 'label' => esc_html__('Margin', 'king-addons'),
7914 'type' => Controls_Manager::DIMENSIONS,
7915 'size_units' => ['px'],
7916 'default' => [
7917 'top' => 0,
7918 'right' => 5,
7919 'bottom' => 0,
7920 'left' => 0,
7921 ],
7922 'selectors' => [
7923 '{{WRAPPER}} .king-addons-grid-filters li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7924 ],
7925 ]
7926 );
7927
7928 $this->add_responsive_control(
7929 'filters_padding',
7930 [
7931 'label' => esc_html__('Padding', 'king-addons'),
7932 'type' => Controls_Manager::DIMENSIONS,
7933 'size_units' => ['px'],
7934 'default' => [
7935 'top' => 3,
7936 'right' => 15,
7937 'bottom' => 3,
7938 'left' => 15,
7939 ],
7940 'selectors' => [
7941 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7942 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7943 ],
7944 ]
7945 );
7946
7947 $this->add_responsive_control(
7948 'filters_wrapper_padding',
7949 [
7950 'label' => esc_html__('Wrapper Padding', 'king-addons'),
7951 'type' => Controls_Manager::DIMENSIONS,
7952 'size_units' => ['px',],
7953 'default' => [
7954 'top' => 0,
7955 'right' => 0,
7956 'bottom' => 0,
7957 'left' => 0,
7958 ],
7959 'selectors' => [
7960 '{{WRAPPER}} .king-addons-grid-filters' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7961 ],
7962 ]
7963 );
7964
7965 $this->add_control(
7966 'filters_radius',
7967 [
7968 'label' => esc_html__('Border Radius', 'king-addons'),
7969 'type' => Controls_Manager::DIMENSIONS,
7970 'size_units' => ['px', '%'],
7971 'default' => [
7972 'top' => 3,
7973 'right' => 3,
7974 'bottom' => 3,
7975 'left' => 3,
7976 ],
7977 'selectors' => [
7978 '{{WRAPPER}} .king-addons-grid-filters li > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7979 '{{WRAPPER}} .king-addons-grid-filters li > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
7980 ],
7981 'separator' => 'before',
7982 ]
7983 );
7984
7985 $this->end_controls_section();
7986
7987
7988 $this->start_controls_section(
7989 'section_style_pagination',
7990 [
7991 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Pagination', 'king-addons'),
7992 'tab' => Controls_Manager::TAB_STYLE,
7993 'show_label' => false,
7994 'condition' => [
7995 'layout_select!' => 'slider',
7996 'layout_pagination' => 'yes',
7997 ],
7998 ]
7999 );
8000
8001 $this->start_controls_tabs('tabs_grid_pagination_style');
8002
8003 $this->start_controls_tab(
8004 'tab_grid_pagination_normal',
8005 [
8006 'label' => esc_html__('Normal', 'king-addons'),
8007 ]
8008 );
8009
8010 $this->add_control(
8011 'pagination_color',
8012 [
8013 'label' => esc_html__('Color', 'king-addons'),
8014 'type' => Controls_Manager::COLOR,
8015 'default' => '#FFFFFF',
8016 'selectors' => [
8017 '{{WRAPPER}} .king-addons-grid-pagination a' => 'color: {{VALUE}}',
8018 '{{WRAPPER}} .king-addons-grid-pagination svg' => 'fill: {{VALUE}}',
8019 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'color: {{VALUE}}',
8020 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'color: {{VALUE}}',
8021 ],
8022 ]
8023 );
8024
8025 $this->add_control(
8026 'pagination_bg_color',
8027 [
8028 'label' => esc_html__('Background Color', 'king-addons'),
8029 'type' => Controls_Manager::COLOR,
8030 'default' => '#5B03FF',
8031 'selectors' => [
8032 '{{WRAPPER}} .king-addons-grid-pagination a' => 'background-color: {{VALUE}}',
8033 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'background-color: {{VALUE}}',
8034 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'background-color: {{VALUE}}',
8035 '{{WRAPPER}} .king-addons-pagination-finish' => 'color: {{VALUE}}',
8036 ]
8037 ]
8038 );
8039
8040 $this->add_control(
8041 'pagination_border_color',
8042 [
8043 'label' => esc_html__('Border Color', 'king-addons'),
8044 'type' => Controls_Manager::COLOR,
8045 'default' => '#E8E8E8',
8046 'selectors' => [
8047 '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-color: {{VALUE}}',
8048 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-color: {{VALUE}}',
8049 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'border-color: {{VALUE}}',
8050 ],
8051 ]
8052 );
8053
8054 $this->add_group_control(
8055 Group_Control_Box_Shadow::get_type(),
8056 [
8057 'name' => 'pagination_box_shadow',
8058 'selector' => '{{WRAPPER}} .king-addons-grid-pagination a, {{WRAPPER}} .king-addons-grid-pagination > div > span',
8059 ]
8060 );
8061
8062 $this->add_control(
8063 'pagination_loader_color',
8064 [
8065 'label' => esc_html__('Loader Color', 'king-addons'),
8066 'type' => Controls_Manager::COLOR,
8067 'default' => '#5B03FF',
8068 'selectors' => [
8069 '{{WRAPPER}} .king-addons-double-bounce .king-addons-child' => 'background-color: {{VALUE}}',
8070 '{{WRAPPER}} .king-addons-wave .king-addons-rect' => 'background-color: {{VALUE}}',
8071 '{{WRAPPER}} .king-addons-spinner-pulse' => 'background-color: {{VALUE}}',
8072 '{{WRAPPER}} .king-addons-chasing-dots .king-addons-child' => 'background-color: {{VALUE}}',
8073 '{{WRAPPER}} .king-addons-three-bounce .king-addons-child' => 'background-color: {{VALUE}}',
8074 '{{WRAPPER}} .king-addons-fading-circle .king-addons-circle:before' => 'background-color: {{VALUE}}',
8075 '{{WRAPPER}} .king-addons-ring div' => 'border-color: {{VALUE}} transparent transparent transparent',
8076 ],
8077 'condition' => [
8078 'pagination_type' => ['load-more', 'infinite-scroll']
8079 ]
8080 ]
8081 );
8082
8083 $this->add_control(
8084 'pagination_wrapper_color',
8085 [
8086 'label' => esc_html__('Wrapper Color', 'king-addons'),
8087 'type' => Controls_Manager::COLOR,
8088 'selectors' => [
8089 '{{WRAPPER}} .king-addons-grid-pagination' => 'background-color: {{VALUE}}',
8090 ],
8091 'separator' => 'after',
8092 ]
8093 );
8094
8095 $this->end_controls_tab();
8096
8097 $this->start_controls_tab(
8098 'tab_grid_pagination_hover',
8099 [
8100 'label' => esc_html__('Hover', 'king-addons'),
8101 ]
8102 );
8103
8104 $this->add_control(
8105 'pagination_color_hr',
8106 [
8107 'label' => esc_html__('Color', 'king-addons'),
8108 'type' => Controls_Manager::COLOR,
8109 'default' => '#FFFFFF',
8110 'selectors' => [
8111 '{{WRAPPER}} .king-addons-grid-pagination a:hover' => 'color: {{VALUE}}',
8112 '{{WRAPPER}} .king-addons-grid-pagination a:hover svg' => 'fill: {{VALUE}}',
8113 '{{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover' => 'color: {{VALUE}}',
8114 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'color: {{VALUE}}',
8115 ],
8116 ]
8117 );
8118
8119 $this->add_control(
8120 'pagination_bg_color_hr',
8121 [
8122 'label' => esc_html__('Background Color', 'king-addons'),
8123 'type' => Controls_Manager::COLOR,
8124 'default' => '#4D02D8',
8125 'selectors' => [
8126 '{{WRAPPER}} .king-addons-grid-pagination a:hover' => 'background-color: {{VALUE}}',
8127 '{{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover' => 'background-color: {{VALUE}}',
8128 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'background-color: {{VALUE}}',
8129 ]
8130 ]
8131 );
8132
8133 $this->add_control(
8134 'pagination_border_color_hr',
8135 [
8136 'label' => esc_html__('Border Color', 'king-addons'),
8137 'type' => Controls_Manager::COLOR,
8138 'default' => '#E8E8E8',
8139 'selectors' => [
8140 '{{WRAPPER}} .king-addons-grid-pagination a:hover' => 'border-color: {{VALUE}}',
8141 '{{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover' => 'border-color: {{VALUE}}',
8142 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-color: {{VALUE}}',
8143 ]
8144 ]
8145 );
8146
8147 $this->add_group_control(
8148 Group_Control_Box_Shadow::get_type(),
8149 [
8150 'name' => 'pagination_box_shadow_hr',
8151 'selector' => '{{WRAPPER}} .king-addons-grid-pagination a:hover, {{WRAPPER}} .king-addons-grid-pagination > div > span:not(.king-addons-disabled-arrow):hover',
8152 'separator' => 'after',
8153 ]
8154 );
8155
8156 $this->end_controls_tab();
8157
8158 $this->end_controls_tabs();
8159
8160 $this->add_control(
8161 'pagination_transition_duration',
8162 [
8163 'label' => esc_html__('Transition Duration (seconds)', 'king-addons'),
8164 'type' => Controls_Manager::NUMBER,
8165 'default' => 0.1,
8166 'min' => 0,
8167 'max' => 5,
8168 'step' => 0.1,
8169 'selectors' => [
8170 '{{WRAPPER}} .king-addons-grid-pagination a' => 'transition-duration: {{VALUE}}s',
8171 '{{WRAPPER}} .king-addons-grid-pagination svg' => 'transition-duration: {{VALUE}}s',
8172 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'transition-duration: {{VALUE}}s',
8173 ],
8174 'separator' => 'after',
8175 ]
8176 );
8177
8178 $this->add_group_control(
8179 Group_Control_Typography::get_type(),
8180 [
8181 'name' => 'pagination_typography',
8182 'selector' => '{{WRAPPER}} .king-addons-grid-pagination'
8183 ]
8184 );
8185
8186 $this->add_responsive_control(
8187 'pagination_icon_size',
8188 [
8189 'label' => esc_html__('Icon Size', 'king-addons'),
8190 'type' => Controls_Manager::SLIDER,
8191 'size_units' => ['px'],
8192 'range' => [
8193 'px' => [
8194 'min' => 5,
8195 'max' => 30,
8196 ],
8197 ],
8198 'default' => [
8199 'unit' => 'px',
8200 'size' => 15,
8201 ],
8202 'selectors' => [
8203 '{{WRAPPER}} .king-addons-grid-pagination i' => 'font-size: {{SIZE}}{{UNIT}};',
8204 '{{WRAPPER}} .king-addons-grid-pagination svg' => 'width: {{SIZE}}{{UNIT}};',
8205 ],
8206 ]
8207 );
8208
8209 $this->add_control(
8210 'pagination_border_type',
8211 [
8212 'label' => esc_html__('Border Type', 'king-addons'),
8213 'type' => Controls_Manager::SELECT,
8214 'options' => [
8215 'none' => esc_html__('None', 'king-addons'),
8216 'solid' => esc_html__('Solid', 'king-addons'),
8217 'double' => esc_html__('Double', 'king-addons'),
8218 'dotted' => esc_html__('Dotted', 'king-addons'),
8219 'dashed' => esc_html__('Dashed', 'king-addons'),
8220 'groove' => esc_html__('Groove', 'king-addons'),
8221 ],
8222 'default' => 'none',
8223 'selectors' => [
8224 '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-style: {{VALUE}};',
8225 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-style: {{VALUE}};',
8226 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-style: {{VALUE}};',
8227 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'border-style: {{VALUE}}',
8228 ],
8229 'separator' => 'before',
8230 ]
8231 );
8232
8233 $this->add_control(
8234 'pagination_border_width',
8235 [
8236 'label' => esc_html__('Border Width', 'king-addons'),
8237 'type' => Controls_Manager::DIMENSIONS,
8238 'size_units' => ['px'],
8239 'default' => [
8240 'top' => 1,
8241 'right' => 1,
8242 'bottom' => 1,
8243 'left' => 1,
8244 ],
8245 'selectors' => [
8246 '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8247 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8248 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8249 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8250 ],
8251 'condition' => [
8252 'pagination_border_type!' => 'none',
8253 ],
8254 ]
8255 );
8256
8257 $this->add_responsive_control(
8258 'pagination_distance_from_grid',
8259 [
8260 'label' => esc_html__('Distance From Grid', 'king-addons'),
8261 'type' => Controls_Manager::SLIDER,
8262 'size_units' => ['px'],
8263 'range' => [
8264 'px' => [
8265 'min' => 0,
8266 'max' => 100,
8267 ],
8268 ],
8269 'default' => [
8270 'unit' => 'px',
8271 'size' => 30,
8272 ],
8273 'selectors' => [
8274 '{{WRAPPER}} .king-addons-grid-pagination' => 'margin-top: {{SIZE}}{{UNIT}};',
8275 ],
8276 'separator' => 'before'
8277 ]
8278 );
8279
8280 $this->add_control(
8281 'pagination_gutter',
8282 [
8283 'label' => esc_html__('Gutter', 'king-addons'),
8284 'type' => Controls_Manager::SLIDER,
8285 'size_units' => ['px'],
8286 'range' => [
8287 'px' => [
8288 'min' => 0,
8289 'max' => 25,
8290 ],
8291 ],
8292 'default' => [
8293 'unit' => 'px',
8294 'size' => 10,
8295 ],
8296 'selectors' => [
8297 '{{WRAPPER}} .king-addons-grid-pagination a' => 'margin-right: {{SIZE}}{{UNIT}};',
8298 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'margin-right: {{SIZE}}{{UNIT}};',
8299 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'margin-right: {{SIZE}}{{UNIT}};',
8300 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'margin-right: {{SIZE}}{{UNIT}};',
8301 ],
8302 ]
8303 );
8304
8305 $this->add_control(
8306 'pagination_icon_spacing',
8307 [
8308 'label' => esc_html__('Icon Spacing', 'king-addons'),
8309 'type' => Controls_Manager::SLIDER,
8310 'size_units' => ['px'],
8311 'range' => [
8312 'px' => [
8313 'min' => 0,
8314 'max' => 25,
8315 ],
8316 ],
8317 'default' => [
8318 'unit' => 'px',
8319 'size' => 10,
8320 ],
8321 'selectors' => [
8322 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-post-link i' => 'padding-right: {{SIZE}}{{UNIT}};',
8323 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-post-link i' => 'padding-left: {{SIZE}}{{UNIT}};',
8324 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-first-page i' => 'padding-right: {{SIZE}}{{UNIT}};',
8325 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-page i' => 'padding-right: {{SIZE}}{{UNIT}};',
8326 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-page i' => 'padding-left: {{SIZE}}{{UNIT}};',
8327 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-last-page i' => 'padding-left: {{SIZE}}{{UNIT}};',
8328 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-post-link svg' => 'margin-right: {{SIZE}}{{UNIT}};',
8329 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-post-link svg' => 'margin-left: {{SIZE}}{{UNIT}};',
8330 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-first-page svg' => 'margin-right: {{SIZE}}{{UNIT}};',
8331 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-prev-page svg' => 'margin-right: {{SIZE}}{{UNIT}};',
8332 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-next-page svg' => 'margin-left: {{SIZE}}{{UNIT}};',
8333 '{{WRAPPER}} .king-addons-grid-pagination .king-addons-last-page svg' => 'margin-left: {{SIZE}}{{UNIT}};',
8334 ],
8335 ]
8336 );
8337
8338 $this->add_responsive_control(
8339 'pagination_padding',
8340 [
8341 'label' => esc_html__('Padding', 'king-addons'),
8342 'type' => Controls_Manager::DIMENSIONS,
8343 'size_units' => ['px'],
8344 'default' => [
8345 'top' => 8,
8346 'right' => 20,
8347 'bottom' => 8,
8348 'left' => 20,
8349 ],
8350 'selectors' => [
8351 '{{WRAPPER}} .king-addons-grid-pagination a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8352 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8353 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-disabled-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8354 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8355 ],
8356 ]
8357 );
8358
8359 $this->add_responsive_control(
8360 'pagination_wrapper_padding',
8361 [
8362 'label' => esc_html__('Wrapper Padding', 'king-addons'),
8363 'type' => Controls_Manager::DIMENSIONS,
8364 'size_units' => ['px'],
8365 'default' => [
8366 'top' => 0,
8367 'right' => 0,
8368 'bottom' => 0,
8369 'left' => 0,
8370 ],
8371 'selectors' => [
8372 '{{WRAPPER}} .king-addons-grid-pagination' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8373 ],
8374 ]
8375 );
8376
8377 $this->add_control(
8378 'pagination_radius',
8379 [
8380 'label' => esc_html__('Border Radius', 'king-addons'),
8381 'type' => Controls_Manager::DIMENSIONS,
8382 'size_units' => ['px', '%'],
8383 'default' => [
8384 'top' => 3,
8385 'right' => 3,
8386 'bottom' => 3,
8387 'left' => 3,
8388 ],
8389 'selectors' => [
8390 '{{WRAPPER}} .king-addons-grid-pagination a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8391 '{{WRAPPER}} .king-addons-grid-pagination > div > span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8392 '{{WRAPPER}} .king-addons-grid-pagination span.king-addons-grid-current-page' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
8393 ],
8394 'separator' => 'before',
8395 ]
8396 );
8397
8398 $this->end_controls_section();
8399
8400
8401 $this->start_controls_section(
8402 'section_style_pwd_protected',
8403 [
8404 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Password Protected', 'king-addons'),
8405 'tab' => Controls_Manager::TAB_STYLE,
8406 'show_label' => false,
8407 ]
8408 );
8409
8410 $this->add_control(
8411 'pwd_protected_color',
8412 [
8413 'label' => esc_html__('Color', 'king-addons'),
8414 'type' => Controls_Manager::COLOR,
8415 'default' => '#ffffff',
8416 'selectors' => [
8417 '{{WRAPPER}} .king-addons-grid-item-protected' => 'color: {{VALUE}}',
8418 ],
8419 ]
8420 );
8421
8422 $this->add_control(
8423 'pwd_protected_bg_color',
8424 [
8425 'label' => esc_html__('Background Color', 'king-addons'),
8426 'type' => Controls_Manager::COLOR,
8427 'default' => '#5B03FF',
8428 'selectors' => [
8429 '{{WRAPPER}} .king-addons-grid-item-protected' => 'background-color: {{VALUE}}',
8430 ]
8431 ]
8432 );
8433
8434 $this->add_control(
8435 'pwd_protected_input_color',
8436 [
8437 'label' => esc_html__('Input Background Color', 'king-addons'),
8438 'type' => Controls_Manager::COLOR,
8439 'default' => '#ffffff',
8440 'selectors' => [
8441 '{{WRAPPER}} .king-addons-grid-item-protected input' => 'background-color: {{VALUE}}',
8442 ]
8443 ]
8444 );
8445
8446 $this->add_group_control(
8447 Group_Control_Typography::get_type(),
8448 [
8449 'name' => 'pwd_protected_typography',
8450 'selector' => '{{WRAPPER}} .king-addons-grid-item-protected p'
8451 ]
8452 );
8453
8454 $this->end_controls_section();
8455
8456
8457 $this->add_section_style_custom_field1();
8458
8459
8460 $this->add_section_style_custom_field2();
8461 }
8462
8463
8464 public function get_related_taxonomies()
8465 {
8466 $relations = [];
8467 foreach (Core::getCustomTypes('post', false) as $slug => $title) {
8468 $relations[$slug] = get_object_taxonomies($slug);
8469 }
8470 return json_encode($relations);
8471 }
8472
8473 public function get_max_num_pages()
8474 {
8475 $query = new WP_Query($this->get_main_query_args());
8476 $max_num_pages = intval(ceil($query->max_num_pages));
8477 wp_reset_postdata();
8478 return $max_num_pages;
8479 }
8480
8481 public function get_main_query_args()
8482 {
8483 $settings = $this->get_settings();
8484
8485 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
8486 if ('pro-cr' === $settings['query_selection']) {
8487 $settings['query_selection'] = 'dynamic';
8488 }
8489 if ('pro-rn' === $settings['query_orderby']) {
8490 $settings['query_orderby'] = 'date';
8491 }
8492 }
8493
8494 $paged = max(1, get_query_var('paged'), get_query_var('page'));
8495 if (empty($settings['query_offset'])) {
8496 $settings['query_offset'] = 0;
8497 }
8498 $query_posts_per_page = empty($settings['query_posts_per_page']) ? -1 : $settings['query_posts_per_page'];
8499 $offset = ($paged - 1) * $query_posts_per_page + $settings['query_offset'];
8500
8501 $args = [
8502 'post_type' => 'product',
8503 'tax_query' => $this->get_tax_query_args(),
8504 'meta_query' => $this->get_meta_query_args(),
8505 'post__not_in' => $settings['query_exclude_products'],
8506 'posts_per_page' => $query_posts_per_page,
8507 'orderby' => 'date',
8508 'paged' => $paged,
8509 'offset' => $offset,
8510 ];
8511
8512 // Handle special query_selection
8513 if ('featured' === $settings['query_selection']) {
8514 $args['tax_query'][] = [
8515 'taxonomy' => 'product_visibility',
8516 'field' => 'term_taxonomy_id',
8517 'terms' => wc_get_product_visibility_term_ids()['featured'],
8518 ];
8519 } elseif ('onsale' === $settings['query_selection']) {
8520 $args['meta_query'] = [
8521 'relation' => 'OR',
8522 [
8523 'key' => '_sale_price',
8524 'value' => 0,
8525 'compare' => '>',
8526 'type' => 'numeric',
8527 ],
8528 [
8529 'key' => '_min_variation_sale_price',
8530 'value' => 0,
8531 'compare' => '>',
8532 'type' => 'numeric',
8533 ]
8534 ];
8535 } elseif ('upsell' === $settings['query_selection']) {
8536 $product = wc_get_product();
8537 if (!$product) return null;
8538 $meta_query = WC()->query->get_meta_query();
8539 $this->my_upsells = $product->get_upsell_ids();
8540 if (!empty($this->my_upsells)) {
8541 /** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
8542 $args = [
8543 'post_type' => 'product',
8544 'post__not_in' => $settings['query_exclude_products'],
8545 'ignore_sticky_posts' => 1,
8546 'posts_per_page' => $settings['query_posts_per_page'],
8547 'orderby' => 'post__in',
8548 'order' => $settings['order_direction'],
8549 'paged' => $paged,
8550 'post__in' => $this->my_upsells,
8551 'meta_query' => $meta_query,
8552 ];
8553 } else {
8554 $args['post_type'] = ['none'];
8555 }
8556 } elseif ('cross-sell' === $settings['query_selection']) {
8557 $this->crossell_ids = [];
8558 if (is_cart()) {
8559 foreach (WC()->cart->get_cart() as $values) {
8560 foreach ($values['data']->get_cross_sell_ids() as $cs_product) {
8561 $this->crossell_ids[] = $cs_product;
8562 }
8563 }
8564 }
8565 if (is_single()) {
8566 $product = wc_get_product();
8567 if (!$product) return null;
8568 $this->crossell_ids = $product->get_cross_sell_ids();
8569 }
8570 if (!empty($this->crossell_ids)) {
8571 $args = [
8572 'post_type' => 'product',
8573 'post__not_in' => $settings['query_exclude_products'],
8574 'tax_query' => $this->get_tax_query_args(),
8575 'ignore_sticky_posts' => 1,
8576 'posts_per_page' => $settings['query_posts_per_page'],
8577 'order' => $settings['order_direction'],
8578 'paged' => $paged,
8579 'post__in' => $this->crossell_ids,
8580 ];
8581 } else {
8582 $args['post_type'] = 'none';
8583 }
8584 }
8585
8586 // Handle query_orderby
8587 switch ($settings['query_orderby']) {
8588 case 'sales':
8589 $args['meta_key'] = 'total_sales';
8590 $args['orderby'] = 'meta_value_num';
8591 break;
8592 case 'rating':
8593 $args['meta_key'] = '_wc_average_rating';
8594 $args['orderby'] = 'meta_value_num';
8595 break;
8596 case 'price-low':
8597 case 'price-high':
8598 $args['meta_key'] = '_price';
8599 $args['order'] = $settings['order_direction'];
8600 $args['orderby'] = 'meta_value_num';
8601 break;
8602 case 'random':
8603 $args['orderby'] = 'rand';
8604 break;
8605 case 'date':
8606 $args['orderby'] = 'date';
8607 break;
8608 default:
8609 $args['orderby'] = 'menu_order';
8610 $args['order'] = $settings['order_direction'];
8611 break;
8612 }
8613
8614 // Exclude no images
8615 if ('yes' === $settings['query_exclude_no_images']) {
8616 $args['meta_key'] = '_thumbnail_id';
8617 }
8618
8619 // Exclude out of stock
8620 if ('yes' === $settings['query_exclude_out_of_stock']) {
8621 $args['meta_query'] = [
8622 [
8623 'key' => '_stock_status',
8624 'value' => 'outofstock',
8625 'compare' => 'NOT LIKE',
8626 ]
8627 ];
8628 }
8629
8630 // Manual selection
8631 if ('manual' === $settings['query_selection']) {
8632 $post_ids = !empty($settings['query_manual_products']) ? $settings['query_manual_products'] : [''];
8633 $args = [
8634 'post_type' => 'product',
8635 'post__in' => $post_ids,
8636 'posts_per_page' => $settings['query_posts_per_page'],
8637 'orderby' => $settings['query_randomize'],
8638 'paged' => $paged,
8639 ];
8640 }
8641
8642 // Current archive query
8643 if ('current' === $settings['query_selection'] && true !== Plugin::$instance->editor->is_edit_mode()) {
8644 global $wp_query;
8645 if (is_product_category()) {
8646 $posts_per_page = intval(get_option('king_addons_woocommerce_shop_cat_ppp', 9));
8647 } elseif (is_product_tag()) {
8648 $posts_per_page = intval(get_option('king_addons_woocommerce_shop_tag_ppp', 9));
8649 } else {
8650 $posts_per_page = intval(get_option('king_addons_woocommerce_shop_ppp', 9));
8651 }
8652 $args = $wp_query->query_vars;
8653 $args['tax_query'] = $this->get_tax_query_args();
8654 $args['meta_query'] = $this->get_meta_query_args();
8655 $args['posts_per_page'] = $posts_per_page;
8656 if (!empty($settings['query_randomize'])) {
8657 $args['orderby'] = $settings['query_randomize'];
8658 }
8659 $args['post_type'] = 'product';
8660 }
8661
8662 // Handle GET orderby
8663 if (isset($_GET['orderby'])) {
8664 switch ($_GET['orderby']) {
8665 case 'popularity':
8666 $args['meta_key'] = 'total_sales';
8667 $args['orderby'] = 'meta_value_num';
8668 break;
8669 case 'rating':
8670 $args['meta_key'] = '_wc_average_rating';
8671 $args['order'] = $settings['order_direction'];
8672 $args['orderby'] = 'meta_value_num';
8673 break;
8674 case 'price':
8675 $args['meta_key'] = '_price';
8676 $args['order'] = 'ASC';
8677 $args['orderby'] = 'meta_value_num';
8678 break;
8679 case 'price-desc':
8680 $args['meta_key'] = '_price';
8681 $args['order'] = 'DESC';
8682 $args['orderby'] = 'meta_value_num';
8683 break;
8684 case 'random':
8685 $args['orderby'] = 'rand';
8686 break;
8687 case 'date':
8688 $args['orderby'] = 'date';
8689 break;
8690 case 'title':
8691 $args['orderby'] = 'title';
8692 $args['order'] = 'ASC';
8693 break;
8694 case 'title-desc':
8695 $args['orderby'] = 'title';
8696 $args['order'] = 'DESC';
8697 break;
8698 default:
8699 $args['order'] = $settings['order_direction'];
8700 $args['orderby'] = 'menu_order';
8701 break;
8702 }
8703 }
8704
8705 // Handle GET psearch
8706 if (isset($_GET['psearch'])) {
8707 $args['s'] = $_GET['psearch'];
8708 }
8709 return $args;
8710 }
8711
8712 public function get_tax_query_args()
8713 {
8714 $tax_query = [];
8715 if (isset($_GET['kingaddonsfilters'])) {
8716 $selected_filters = WC()->query->get_layered_nav_chosen_attributes();
8717 if (!empty($selected_filters)) {
8718 foreach ($selected_filters as $taxonomy => $data) {
8719 $tax_query[] = [
8720 'taxonomy' => $taxonomy,
8721 'field' => 'slug',
8722 'terms' => $data['terms'],
8723 'operator' => ('and' === $data['query_type']) ? 'AND' : 'IN',
8724 'include_children' => false,
8725 ];
8726 }
8727 }
8728 if (isset($_GET['filter_product_cat'])) {
8729 $tax_query[] = [
8730 'taxonomy' => 'product_cat',
8731 'field' => 'slug',
8732 'terms' => explode(',', $_GET['filter_product_cat']),
8733 'operator' => 'IN',
8734 'include_children' => true,
8735 ];
8736 }
8737 if (isset($_GET['filter_product_tag'])) {
8738 $tax_query[] = [
8739 'taxonomy' => 'product_tag',
8740 'field' => 'slug',
8741 'terms' => explode(',', $_GET['filter_product_tag']),
8742 'operator' => 'IN',
8743 'include_children' => true,
8744 ];
8745 }
8746 } else {
8747 $settings = $this->get_settings();
8748 if (isset($_GET['king_addons_select_product_cat']) && '0' !== $_GET['king_addons_select_product_cat']) {
8749 $tax_query[] = [
8750 'taxonomy' => 'product_cat',
8751 'field' => 'id',
8752 'terms' => sanitize_text_field($_GET['king_addons_select_product_cat'])
8753 ];
8754 }
8755 if (isset($_GET['product_cat']) && '0' !== $_GET['product_cat']) {
8756 $tax_query[] = [
8757 'taxonomy' => 'product_cat',
8758 'field' => 'id',
8759 'terms' => sanitize_text_field($_GET['product_cat'])
8760 ];
8761 } else {
8762 foreach (get_object_taxonomies('product') as $tax) {
8763 if (!empty($settings['query_taxonomy_' . $tax])) {
8764 $tax_query[] = [
8765 'taxonomy' => $tax,
8766 'field' => 'id',
8767 'terms' => $settings['query_taxonomy_' . $tax]
8768 ];
8769 }
8770 }
8771 }
8772 }
8773
8774 if (isset($_GET['filter_rating'])) {
8775 $product_visibility_terms = wc_get_product_visibility_term_ids();
8776 $filter_rating = array_filter(array_map('absint', explode(',', wp_unslash($_GET['filter_rating']))));
8777 $rating_terms = [];
8778 for ($i = 1; $i <= 5; $i++) {
8779 if (in_array($i, $filter_rating, true) && isset($product_visibility_terms['rated-' . $i])) {
8780 $rating_terms[] = $product_visibility_terms['rated-' . $i];
8781 }
8782 }
8783 if (!empty($rating_terms)) {
8784 $tax_query[] = [
8785 'taxonomy' => 'product_visibility',
8786 'field' => 'term_taxonomy_id',
8787 'terms' => $rating_terms,
8788 'operator' => 'IN',
8789 ];
8790 }
8791 }
8792 return $tax_query;
8793 }
8794
8795 public function get_meta_query_args()
8796 {
8797 $meta_query = WC()->query->get_meta_query();
8798 if (isset($_GET['min_price']) || isset($_GET['max_price'])) {
8799 $meta_query = array_merge(['relation' => 'AND'], $meta_query);
8800 $meta_query[] = [
8801 [
8802 'key' => '_price',
8803 'value' => [$_GET['min_price'], $_GET['max_price']],
8804 'compare' => 'BETWEEN',
8805 'type' => 'NUMERIC'
8806 ],
8807 ];
8808 }
8809 return $meta_query;
8810 }
8811
8812 public function get_animation_class($data, $object)
8813 {
8814 $class = '';
8815 if ('overlay' !== $object && 'yes' === $data[$object . '_animation_disable_mobile'] && wp_is_mobile()) {
8816 return $class;
8817 }
8818 if ('none' !== $data[$object . '_animation']) {
8819 $class .= ' king-addons-' . $object . '-' . $data[$object . '_animation'];
8820 $class .= ' king-addons-anim-size-' . $data[$object . '_animation_size'];
8821 $class .= ' king-addons-animation-timing-' . $data[$object . '_animation_timing'];
8822 if ('yes' === $data[$object . '_animation_tr']) {
8823 $class .= ' king-addons-anim-transparency';
8824 }
8825 }
8826 return $class;
8827 }
8828
8829 public function get_image_effect_class($settings)
8830 {
8831 $class = '';
8832 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
8833 if (in_array($settings['image_effects'], ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo'])) {
8834 $settings['image_effects'] = 'none';
8835 }
8836 }
8837 if ('none' !== $settings['image_effects']) {
8838 $class .= ' king-addons-' . $settings['image_effects'];
8839 }
8840 if ('slide' !== $settings['image_effects']) {
8841 $class .= ' king-addons-effect-size-' . $settings['image_effects_size'];
8842 } else {
8843 $class .= ' king-addons-effect-dir-' . $settings['image_effects_direction'];
8844 }
8845 return $class;
8846 }
8847
8848 public function render_password_protected_input()
8849 {
8850 if (!post_password_required()) return;
8851 add_filter('the_password_form', function () {
8852 $output = '<form action="' . esc_url(home_url('wp-login.php?action=postpass')) . '" method="post">';
8853 $output .= '<i class="fas fa-lock"></i><p>' . esc_html(get_the_title()) . '</p>';
8854 $output .= '<input type="password" name="post_password" id="post-' . esc_attr(get_the_id()) . '" placeholder="' . esc_html__('Type and hit Enter...', 'king-addons') . '">';
8855 $output .= '</form>';
8856 return $output;
8857 });
8858 echo '<div class="king-addons-grid-item-protected king-addons-cv-container"><div class="king-addons-cv-outer"><div class="king-addons-cv-inner">';
8859 echo get_the_password_form();
8860 echo '</div></div></div>';
8861 }
8862
8863 public function render_product_thumbnail($settings)
8864 {
8865 $id = get_post_thumbnail_id();
8866 $src = Group_Control_Image_Size::get_attachment_image_src($id, 'layout_image_crop', $settings);
8867 $alt = '' === wp_get_attachment_caption($id) ? get_the_title() : wp_get_attachment_caption($id);
8868 $src2 = '';
8869 if (get_post_meta(get_the_ID(), 'king_addons_secondary_image_id')) {
8870 $second_id = get_post_meta(get_the_ID(), 'king_addons_secondary_image_id', true);
8871 if (!empty($second_id)) {
8872 $src2 = Group_Control_Image_Size::get_attachment_image_src($second_id, 'layout_image_crop', $settings);
8873 }
8874 }
8875 if (has_post_thumbnail()) {
8876 echo '<div class="king-addons-grid-image-wrap" data-src="' . esc_url($src) . '" data-img-on-hover="' . esc_attr($settings['secondary_img_on_hover']) . '" data-src-secondary="' . esc_url($src2) . '">';
8877 echo '<img src="' . esc_url($src) . '" alt="' . esc_attr($alt) . '" class="king-addons-animation-timing-' . esc_attr($settings['image_effects_animation_timing']) . '">';
8878 if ('yes' === $settings['secondary_img_on_hover']) {
8879 echo '<img src="' . esc_url($src2) . '" alt="' . esc_attr($alt) . '" class="king-addons-hidden-img king-addons-animation-timing-' . esc_attr($settings['image_effects_animation_timing']) . '">';
8880 }
8881 echo '</div>';
8882 }
8883 }
8884
8885 public function render_media_overlay($settings)
8886 {
8887 echo '<div class="king-addons-grid-media-hover-bg ' . esc_attr($this->get_animation_class($settings, 'overlay')) . '" data-url="' . esc_url(get_the_permalink()) . '">';
8888 if (king_addons_freemius()->can_use_premium_code__premium_only() && '' !== $settings['overlay_image']['url']) {
8889 echo '<img src="' . esc_url($settings['overlay_image']['url']) . '" alt="' . esc_attr($settings['overlay_image']['alt']) . '">';
8890 }
8891 echo '</div>';
8892 }
8893
8894 public function render_product_title($settings, $class)
8895 {
8896 $title_pointer = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'none' : $this->get_settings()['title_pointer'];
8897 $title_pointer_animation = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'fade' : $this->get_settings()['title_pointer_animation'];
8898 $pointer_item_class = ('none' !== $title_pointer) ? 'class="king-addons-pointer-item"' : '';
8899 $open_links_in_new_tab = ('yes' === $this->get_settings()['open_links_in_new_tab']) ? '_blank' : '_self';
8900 $class .= ' king-addons-pointer-' . $title_pointer . ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $title_pointer_animation;
8901 $tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p'];
8902 $element_title_tag = Core::validateHTMLTags($settings['element_title_tag'], 'h2', $tags_whitelist);
8903 echo '<' . esc_attr($element_title_tag) . ' class="' . esc_attr($class) . '"><div class="inner-block"><a target="' . $open_links_in_new_tab . '" ' . $pointer_item_class . ' href="' . esc_url(get_the_permalink()) . '">';
8904 if ('word_count' === $settings['element_trim_text_by']) {
8905 echo esc_html(wp_trim_words(get_the_title(), $settings['element_word_count']));
8906 } else {
8907 echo esc_html(mb_substr(html_entity_decode(get_the_title()), 0, $settings['element_letter_count'])) . '...';
8908 }
8909 echo '</a></div></' . esc_attr($element_title_tag) . '>';
8910 }
8911
8912 public function render_product_excerpt($settings, $class)
8913 {
8914 if ('' === get_the_excerpt()) return;
8915 echo '<div class="' . esc_attr($class) . '"><div class="inner-block">';
8916 if ('word_count' === $settings['element_trim_text_by']) {
8917 echo '<p>' . esc_html(wp_trim_words(get_the_excerpt(), $settings['element_word_count'])) . '</p>';
8918 } else {
8919 echo '<p>' . esc_html(mb_substr(get_the_excerpt(), 0, $settings['element_letter_count'])) . '...</p>';
8920 }
8921 echo '</div></div>';
8922 }
8923
8924 public function render_product_categories($settings, $class, $post_id)
8925 {
8926 $terms = wp_get_post_terms($post_id, $settings['element_select']);
8927 if (!$terms || is_wp_error($terms)) return;
8928 $count = 0;
8929 $categories_pointer = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'none' : $this->get_settings()['categories_pointer'];
8930 $categories_pointer_animation = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'fade' : $this->get_settings()['categories_pointer_animation'];
8931 $pointer_item_class = ('none' !== $categories_pointer) ? 'class="king-addons-pointer-item"' : '';
8932 $class .= ' king-addons-pointer-' . $categories_pointer . ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $categories_pointer_animation;
8933 echo '<div class="' . esc_attr($class) . ' king-addons-grid-product-categories"><div class="inner-block">';
8934 if ('before' === $settings['element_extra_text_pos']) {
8935 echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>';
8936 }
8937 if ('before' === $settings['element_extra_icon_pos']) {
8938 ob_start();
8939 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
8940 echo '<span class="king-addons-grid-extra-icon-left">' . ob_get_clean() . '</span>';
8941 }
8942 foreach ($terms as $term) {
8943 echo '<a ' . $pointer_item_class . ' href="' . esc_url(get_term_link($term->term_id)) . '">' . esc_html($term->name);
8944 if (++$count !== count($terms)) {
8945 echo '<span class="tax-sep">' . esc_html($settings['element_tax_sep']) . '</span>';
8946 }
8947 echo '</a>';
8948 }
8949 if ('after' === $settings['element_extra_icon_pos']) {
8950 ob_start();
8951 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
8952 echo '<span class="king-addons-grid-extra-icon-right">' . ob_get_clean() . '</span>';
8953 }
8954 if ('after' === $settings['element_extra_text_pos']) {
8955 echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>';
8956 }
8957 echo '</div></div>';
8958 }
8959
8960 public function render_product_tags($settings, $class, $post_id)
8961 {
8962 $terms = wp_get_post_terms($post_id, $settings['element_select']);
8963 if (!$terms || is_wp_error($terms)) return;
8964 $count = 0;
8965 $tags_pointer = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'none' : $this->get_settings()['tags_pointer'];
8966 $tags_pointer_animation = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'fade' : $this->get_settings()['tags_pointer_animation'];
8967 $pointer_item_class = ('none' !== $tags_pointer) ? 'class="king-addons-pointer-item"' : '';
8968 $class .= ' king-addons-pointer-' . $tags_pointer . ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $tags_pointer_animation;
8969 echo '<div class="' . esc_attr($class) . ' king-addons-grid-product-tags"><div class="inner-block">';
8970 if ('before' === $settings['element_extra_text_pos']) {
8971 echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>';
8972 }
8973 if ('before' === $settings['element_extra_icon_pos']) {
8974 ob_start();
8975 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
8976 echo '<span class="king-addons-grid-extra-icon-left">' . ob_get_clean() . '</span>';
8977 }
8978 foreach ($terms as $term) {
8979 echo '<a ' . $pointer_item_class . ' href="' . esc_url(get_term_link($term->term_id)) . '">' . esc_html($term->name);
8980 if (++$count !== count($terms)) {
8981 echo '<span class="tax-sep">' . esc_html($settings['element_tax_sep']) . '</span>';
8982 }
8983 echo '</a>';
8984 }
8985 if ('after' === $settings['element_extra_icon_pos']) {
8986 ob_start();
8987 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
8988 echo '<span class="king-addons-grid-extra-icon-right">' . ob_get_clean() . '</span>';
8989 }
8990 if ('after' === $settings['element_extra_text_pos']) {
8991 echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>';
8992 }
8993 echo '</div></div>';
8994 }
8995
8996 // Stub for custom fields, left empty as in original
8997 public function render_product_custom_fields($settings, $class, $post_id)
8998 {
8999 }
9000
9001 // Stub for likes, left empty as in original
9002 public function render_product_likes($settings, $class, $post_id)
9003 {
9004 }
9005
9006 // Stub for sharing icons, left empty as in original
9007 public function render_product_sharing_icons($settings, $class)
9008 {
9009 }
9010
9011 public function render_product_lightbox($settings, $class, $post_id)
9012 {
9013 echo '<div class="' . esc_attr($class) . '"><div class="inner-block">';
9014 $lightbox_source = get_the_post_thumbnail_url($post_id);
9015 if ('audio' === get_post_format()) {
9016 if ('meta' === $settings['element_lightbox_pfa_select']) {
9017 $meta_value = get_post_meta($post_id, $settings['element_lightbox_pfa_meta'], true);
9018 if (false === strpos($meta_value, '<iframe ')) {
9019 add_filter('oembed_result', $woocommerce_grid_filter = function ($html) {
9020 preg_match('/<iframe.*src=\"(.*)\".*><\/iframe>/isU', $html, $matches);
9021 return $matches[1] . '&auto_play=true';
9022 }, 50, 3);
9023 $track_url = wp_oembed_get($meta_value);
9024 remove_filter('oembed_result', $woocommerce_grid_filter, 50);
9025 } else {
9026 $track_url = Core::filterOembedResults($meta_value);
9027 }
9028 $lightbox_source = $track_url;
9029 }
9030 } elseif ('video' === get_post_format()) {
9031 if ('meta' === $settings['element_lightbox_pfv_select']) {
9032 $meta_value = get_post_meta($post_id, $settings['element_lightbox_pfv_meta'], true);
9033 if (false === strpos($meta_value, '<iframe ')) {
9034 $video = Embed::get_video_properties($meta_value);
9035 } else {
9036 $video = Embed::get_video_properties(Core::filterOembedResults($meta_value));
9037 }
9038 if ('youtube' === $video['provider']) {
9039 $lightbox_source = 'https://www.youtube.com/embed/' . $video['video_id'] . '?feature=oembed&autoplay=1&controls=1';
9040 } elseif ('vimeo' === $video['provider']) {
9041 $lightbox_source = 'https://player.vimeo.com/video/' . $video['video_id'] . '?autoplay=1#t=0';
9042 }
9043 }
9044 }
9045 echo '<span data-src="' . esc_url($lightbox_source) . '">';
9046 if ('before' === $settings['element_extra_text_pos']) {
9047 echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_extra_text']) . '</span>';
9048 }
9049 echo '<i class="' . esc_attr($settings['element_extra_icon']['value']) . '"></i>';
9050 if ('after' === $settings['element_extra_text_pos']) {
9051 echo '<span class="king-addons-grid-extra-text-right">' . esc_html($settings['element_extra_text']) . '</span>';
9052 }
9053 echo '</span>';
9054 if ('yes' === $settings['element_lightbox_overlay']) {
9055 echo '<div class="king-addons-grid-lightbox-overlay"></div>';
9056 }
9057 echo '</div></div>';
9058 }
9059
9060 public function render_product_element_separator($settings, $class)
9061 {
9062 echo '<div class="' . esc_attr($class . ' ' . $settings['element_separator_style']) . '"><div class="inner-block"><span></span></div></div>';
9063 }
9064
9065 public function render_product_status($settings, $class)
9066 {
9067 global $product;
9068 if (is_null($product)) return;
9069 echo '<div class="' . esc_attr($class) . '"><div class="inner-block">';
9070 if ($product->is_on_sale()) {
9071 echo '<span class="king-addons-woocommerce-onsale">' . esc_html__('Sale', 'king-addons') . '</span>';
9072 }
9073 if ('yes' === $settings['element_status_offstock'] && !$product->is_in_stock() && !($product->is_type('variable') && $product->get_stock_quantity() > 0)) {
9074 echo '<span class="king-addons-woocommerce-outofstock">' . esc_html__('Out of Stock', 'king-addons') . '</span>';
9075 }
9076 if ('yes' === $settings['element_status_featured'] && $product->is_featured()) {
9077 echo '<span class="king-addons-woocommerce-featured">' . esc_html__('Featured', 'king-addons') . '</span>';
9078 }
9079 echo '</div></div>';
9080 }
9081
9082 public function render_product_add_to_cart($settings, $class)
9083 {
9084 global $product;
9085 if (is_null($product)) return;
9086 $button_class = implode(' ', array_filter([
9087 'product_type_' . $product->get_type(),
9088 ($product->is_purchasable() && $product->is_in_stock()) ? 'add_to_cart_button' : '',
9089 $product->supports('ajax_add_to_cart') ? 'ajax_add_to_cart' : '',
9090 ]));
9091 $add_to_cart_animation = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'king-addons-button-none' : $this->get_settings()['add_to_cart_animation'];
9092 $popup_animation = $this->get_settings_for_display()['popup_notification_animation'] ?? '';
9093 $fade_out_in = $this->get_settings_for_display()['popup_notification_fade_out_in'] ?? '';
9094 $animation_duration = $this->get_settings_for_display()['popup_notification_animation_duration'] ?? '';
9095 $attributes = [
9096 'rel="nofollow"',
9097 'class="' . esc_attr($button_class) . ' king-addons-button-effect ' . esc_attr($add_to_cart_animation) . ($product->is_in_stock() ? '' : ' king-addons-atc-not-clickable') . '"',
9098 'aria-label="' . esc_attr($product->add_to_cart_description()) . '"',
9099 'data-product_id="' . esc_attr($product->get_id()) . '"',
9100 'data-product_sku="' . esc_attr($product->get_sku()) . '"',
9101 'data-atc-popup="' . esc_attr($settings['element_show_added_tc_popup']) . '"',
9102 'data-atc-animation="' . esc_attr($popup_animation) . '"',
9103 'data-atc-fade-out-in="' . esc_attr($fade_out_in) . '"',
9104 'data-atc-animation-time="' . esc_attr($animation_duration) . '"'
9105 ];
9106 $button_HTML = '';
9107 $page_id = get_queried_object_id();
9108 if ('before' === $settings['element_extra_icon_pos']) {
9109 ob_start();
9110 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
9111 $button_HTML .= '<span class="king-addons-grid-extra-icon-left">' . ob_get_clean() . '</span>';
9112 }
9113 switch ($product->get_type()) {
9114 case 'simple':
9115 $button_HTML .= $settings['element_addcart_simple_txt'];
9116 if ('yes' === get_option('woocommerce_enable_ajax_add_to_cart')) {
9117 $attributes[] = 'href="' . esc_url(get_permalink($page_id) . '/?add-to-cart=' . get_the_ID()) . '"';
9118 } else {
9119 $attributes[] = 'href="' . esc_url(get_permalink()) . '"';
9120 }
9121 break;
9122 case 'grouped':
9123 $button_HTML .= $settings['element_addcart_grouped_txt'];
9124 $attributes[] = 'href="' . esc_url(get_permalink()) . '"';
9125 break;
9126 case 'variable':
9127 $button_HTML .= $settings['element_addcart_variable_txt'];
9128 $attributes[] = 'href="' . esc_url(get_permalink()) . '"';
9129 break;
9130 case 'pw-gift-card':
9131 case 'ywf_deposit':
9132 $button_HTML .= esc_html__('Select Amount', 'king-addons');
9133 $attributes[] = 'href="' . esc_url(get_permalink()) . '"';
9134 break;
9135 case 'stm_lms_product':
9136 case 'redq_rental':
9137 $button_HTML .= esc_html__('View Product', 'king-addons');
9138 $attributes[] = 'href="' . esc_url(get_permalink()) . '"';
9139 break;
9140 default:
9141 if (is_callable([$product, 'get_product_url'])) {
9142 $attributes[] = 'href="' . esc_url($product->get_product_url()) . '"';
9143 $custom_text = get_post_meta(get_the_ID(), '_button_text', true);
9144 $button_HTML .= $custom_text ?: esc_html__('Buy Product', 'king-addons');
9145 } else {
9146 $button_HTML .= esc_html__('View Product', 'king-addons');
9147 $attributes[] = 'href="' . esc_url(get_permalink()) . '"';
9148 }
9149 break;
9150 }
9151 if ('after' === $settings['element_extra_icon_pos']) {
9152 ob_start();
9153 Icons_Manager::render_icon($settings['element_extra_icon'], ['aria-hidden' => 'true']);
9154 $button_HTML .= '<span class="king-addons-grid-extra-icon-right">' . ob_get_clean() . '</span>';
9155 }
9156 echo '<div class="' . esc_attr($class) . '"><div class="inner-block">';
9157 $final = apply_filters('woocommerce_loop_add_to_cart_link', $button_HTML, $product);
9158 if ($final !== $button_HTML) {
9159 echo $final;
9160 } else {
9161 echo '<a ' . implode(' ', $attributes) . '><span>' . $button_HTML . '</span></a>';
9162 }
9163 echo '</div></div>';
9164 }
9165
9166 // Retrieve wishlist from cookie if user not logged in
9167 public function get_wishlist_from_cookie()
9168 {
9169 if (isset($_COOKIE['king_addons_wishlist'])) {
9170 return json_decode(stripslashes($_COOKIE['king_addons_wishlist']), true);
9171 } elseif (isset($_COOKIE['king_addons_wishlist_' . get_current_blog_id()])) {
9172 return json_decode(stripslashes($_COOKIE['king_addons_wishlist_' . get_current_blog_id()]), true);
9173 }
9174 return [];
9175 }
9176
9177 public function render_product_wishlist_button($settings, $class)
9178 {
9179 if (!king_addons_freemius()->can_use_premium_code__premium_only()) return;
9180 global $product;
9181 if (is_null($product)) return;
9182 $user_id = get_current_user_id();
9183 $wishlist = $user_id > 0 ? get_user_meta($user_id, 'king_addons_wishlist', true) : $this->get_wishlist_from_cookie();
9184 if (!$wishlist) $wishlist = [];
9185 $popup_animation = $this->get_settings_for_display()['popup_notification_animation'] ?? '';
9186 $fade_out_in = $this->get_settings_for_display()['popup_notification_fade_out_in'] ?? '';
9187 $animation_duration = $this->get_settings_for_display()['popup_notification_animation_duration'] ?? '';
9188 $wishlist_attrs = [
9189 'data-wishlist-url="' . (get_option('king_addons_wishlist_page') ?: '') . '"',
9190 'data-atw-popup="' . $settings['element_show_added_to_wishlist_popup'] . '"',
9191 'data-atw-animation="' . $popup_animation . '"',
9192 'data-atw-fade-out-in="' . $fade_out_in . '"',
9193 'data-atw-animation-time="' . $animation_duration . '"',
9194 'data-open-in-new-tab="' . $settings['element_open_links_in_new_tab'] . '"'
9195 ];
9196 $button_add_title = '';
9197 $button_remove_title = '';
9198 $add_content = '';
9199 $remove_content = '';
9200 if ('yes' === $settings['show_icon']) {
9201 $add_content .= '<i class="far fa-heart"></i>';
9202 $remove_content .= '<i class="fas fa-heart"></i>';
9203 }
9204 if ('yes' === $settings['show_text']) {
9205 $add_content .= ' <span>' . esc_html($settings['add_to_wishlist_text']) . '</span>';
9206 $remove_content .= ' <span>' . esc_html($settings['remove_from_wishlist_text']) . '</span>';
9207 } else {
9208 $button_add_title = 'title="' . esc_html($settings['add_to_wishlist_text']) . '"';
9209 $button_remove_title = 'title="' . esc_html($settings['remove_from_wishlist_text']) . '"';
9210 }
9211 echo '<div class="' . esc_attr($class) . '"><div class="inner-block">';
9212 $rm_hidden = !in_array($product->get_id(), $wishlist) ? 'king-addons-button-hidden' : '';
9213 $add_hidden = in_array($product->get_id(), $wishlist) ? 'king-addons-button-hidden' : '';
9214 echo '<button class="king-addons-wishlist-add ' . $add_hidden . '" ' . $button_add_title . ' data-product-id="' . $product->get_id() . '" ' . implode(' ', $wishlist_attrs) . '>' . $add_content . '</button>';
9215 echo '<button class="king-addons-wishlist-remove ' . $rm_hidden . '" ' . $button_remove_title . ' data-product-id="' . $product->get_id() . '">' . $remove_content . '</button>';
9216 echo '</div></div>';
9217 }
9218
9219 // Retrieve compare from cookie if user not logged in
9220 public function get_compare_from_cookie()
9221 {
9222 if (isset($_COOKIE['king_addons_compare'])) {
9223 return json_decode(stripslashes($_COOKIE['king_addons_compare']), true);
9224 } elseif (isset($_COOKIE['king_addons_compare_' . get_current_blog_id()])) {
9225 return json_decode(stripslashes($_COOKIE['king_addons_compare_' . get_current_blog_id()]), true);
9226 }
9227 return [];
9228 }
9229
9230 public function render_product_compare_button($settings, $class)
9231 {
9232 if (!king_addons_freemius()->can_use_premium_code__premium_only()) return;
9233 global $product;
9234 if (is_null($product)) return;
9235 $user_id = get_current_user_id();
9236 $compare = $user_id > 0 ? get_user_meta($user_id, 'king_addons_compare', true) : $this->get_compare_from_cookie();
9237 if (!$compare) $compare = [];
9238 $popup_animation = $this->get_settings_for_display()['popup_notification_animation'] ?? '';
9239 $fade_out_in = $this->get_settings_for_display()['popup_notification_fade_out_in'] ?? '';
9240 $animation_duration = $this->get_settings_for_display()['popup_notification_animation_duration'] ?? '';
9241 $compare_attrs = [
9242 'data-compare-url="' . (get_option('king_addons_compare_page') ?: '') . '"',
9243 'data-atcompare-popup="' . $settings['element_show_added_to_compare_popup'] . '"',
9244 'data-atcompare-animation="' . $popup_animation . '"',
9245 'data-atcompare-fade-out-in="' . $fade_out_in . '"',
9246 'data-atcompare-animation-time="' . $animation_duration . '"',
9247 'data-open-in-new-tab="' . $settings['element_open_links_in_new_tab'] . '"'
9248 ];
9249 $add_content = '';
9250 $remove_content = '';
9251 $button_add_title = '';
9252 $button_remove_title = '';
9253 if ('yes' === $settings['show_icon']) {
9254 $add_content .= '<i class="fas fa-exchange-alt"></i>';
9255 $remove_content .= '<i class="fas fa-exchange-alt"></i>';
9256 }
9257 if ('yes' === $settings['show_text']) {
9258 $add_content .= ' <span>' . esc_html($settings['add_to_compare_text']) . '</span>';
9259 $remove_content .= ' <span>' . esc_html($settings['remove_from_compare_text']) . '</span>';
9260 } else {
9261 $button_add_title = 'title="' . esc_html($settings['add_to_compare_text']) . '"';
9262 $button_remove_title = 'title="' . esc_html($settings['remove_from_compare_text']) . '"';
9263 }
9264 echo '<div class="' . esc_attr($class) . '"><div class="inner-block">';
9265 $rm_hidden = !in_array($product->get_id(), $compare) ? 'king-addons-button-hidden' : '';
9266 $add_hidden = in_array($product->get_id(), $compare) ? 'king-addons-button-hidden' : '';
9267 echo '<button class="king-addons-compare-add ' . $add_hidden . '" ' . $button_add_title . ' data-product-id="' . $product->get_id() . '" ' . implode(' ', $compare_attrs) . '>' . $add_content . '</button>';
9268 echo '<button class="king-addons-compare-remove ' . $rm_hidden . '" ' . $button_remove_title . ' data-product-id="' . $product->get_id() . '">' . $remove_content . '</button>';
9269 echo '</div></div>';
9270 }
9271
9272 public function render_rating_icon($class, $unmarked_style)
9273 {
9274 ?>
9275 <span class="king-addons-rating-icon <?php echo esc_attr($class); ?>">
9276 <span class="king-addons-rating-marked">
9277 <?php Icons_Manager::render_icon(['value' => 'fas fa-star', 'library' => 'fa-solid'], ['aria-hidden' => 'true']); ?>
9278 </span>
9279 <span class="king-addons-rating-unmarked">
9280 <?php
9281 if ('outline' === $unmarked_style) {
9282 Icons_Manager::render_icon(['value' => 'far fa-star', 'library' => 'fa-regular'], ['aria-hidden' => 'true']);
9283 } else {
9284 Icons_Manager::render_icon(['value' => 'fas fa-star', 'library' => 'fa-solid'], ['aria-hidden' => 'true']);
9285 }
9286 ?>
9287 </span>
9288 </span>
9289 <?php
9290 }
9291
9292 public function render_product_rating($settings, $class)
9293 {
9294 global $product;
9295 if (is_null($product)) return;
9296 /** @noinspection PhpCastIsUnnecessaryInspection */
9297 $rating_amount = floatval($product->get_average_rating());
9298 $round_rating = (int)$rating_amount;
9299 $rating_icon = '&#xE934;';
9300 $style_class = '';
9301 if ('style-1' === $settings['element_rating_style']) {
9302 $style_class = ' king-addons-woocommerce-rating-style-1';
9303 if ('outline' === $settings['element_rating_unmarked_style']) {
9304 $rating_icon = '&#xE933;';
9305 }
9306 } elseif ('style-2' === $settings['element_rating_style']) {
9307 $rating_icon = '&#9733;';
9308 $style_class = ' king-addons-woocommerce-rating-style-2';
9309 if ('outline' === $settings['element_rating_unmarked_style']) {
9310 $rating_icon = '&#9734;';
9311 }
9312 }
9313 echo '<div class="' . esc_attr($class . $style_class) . '"><div class="inner-block"><div class="king-addons-woocommerce-rating">';
9314 if ('yes' === $settings['element_rating_score']) {
9315 if (in_array($rating_amount, [1, 2, 3, 4, 5])) {
9316 $rating_amount = $rating_amount . '.0';
9317 }
9318 echo '<i class="king-addons-rating-icon-10">' . $rating_icon . '</i><span>' . esc_html($rating_amount) . '</span>';
9319 } else {
9320 if (Plugin::$instance->experiments->is_feature_active('e_font_icon_svg') && 'style-1' === $settings['element_rating_style']) {
9321 for ($i = 1; $i <= 5; $i++) {
9322 if ($i <= $rating_amount) {
9323 $this->render_rating_icon('king-addons-rating-icon-full', $settings['element_rating_unmarked_style']);
9324 } elseif ($i === $round_rating + 1 && $rating_amount !== $round_rating) {
9325 $this->render_rating_icon('king-addons-rating-icon-' . (($rating_amount - $round_rating) * 10), $settings['element_rating_unmarked_style']);
9326 } else {
9327 $this->render_rating_icon('king-addons-rating-icon-0', $settings['element_rating_unmarked_style']);
9328 }
9329 }
9330 } else {
9331 for ($i = 1; $i <= 5; $i++) {
9332 if ($i <= $rating_amount) {
9333 echo '<i class="king-addons-rating-icon-full">' . $rating_icon . '</i>';
9334 } elseif ($i === $round_rating + 1 && $rating_amount !== $round_rating) {
9335 echo '<i class="king-addons-rating-icon-' . (($rating_amount - $round_rating) * 10) . '">' . $rating_icon . '</i>';
9336 } else {
9337 echo '<i class="king-addons-rating-icon-empty">' . $rating_icon . '</i>';
9338 }
9339 }
9340 }
9341 }
9342 echo '</div></div></div>';
9343 }
9344
9345 public function render_product_price($class)
9346 {
9347 global $product;
9348 if (is_null($product)) return;
9349 echo '<div class="' . esc_attr($class) . '"><div class="inner-block"><span>' . wp_kses_post($product->get_price_html()) . '</span>';
9350 $sale_price_dates_to = ($date = get_post_meta($product->get_id(), '_sale_price_dates_to', true)) ? date_i18n('Y-m-d', $date) : '';
9351 $sale_price_dates_to = apply_filters('king_addons_custom_sale_price_dates_to_filter', $sale_price_dates_to, $product);
9352 echo $sale_price_dates_to;
9353 echo '</div></div>';
9354 }
9355
9356 public function render_product_sale_dates($settings, $class)
9357 {
9358 global $product;
9359 if (is_null($product)) return;
9360 $from_date = ($date = get_post_meta($product->get_id(), '_sale_price_dates_from', true)) ? date_i18n(get_option('date_format'), $date) : '';
9361 $to_date = ($date = get_post_meta($product->get_id(), '_sale_price_dates_to', true)) ? date_i18n(get_option('date_format'), $date) : '';
9362 if (('yes' === $settings['show_sale_starts_date'] && $from_date) || ('yes' === $settings['show_sale_ends_date'] && $to_date)) {
9363 echo '<div class="' . esc_attr($class) . '"><div class="inner-block"><span class="king-addons-sale-dates">';
9364 if ($from_date && '' !== $settings['element_sale_starts_text']) {
9365 echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_sale_starts_text']) . '</span> ';
9366 }
9367 if ($from_date) {
9368 echo '<span>' . $from_date . '</span>';
9369 }
9370 if ($from_date && $to_date && 'inline' === $settings['element_sale_dates_layout']) {
9371 echo esc_html($settings['element_sale_dates_sep']);
9372 }
9373 if ($from_date && $to_date && 'block' === $settings['element_sale_dates_layout']) {
9374 echo '<br>';
9375 }
9376 if ($to_date && '' !== $settings['element_sale_ends_text']) {
9377 echo '<span class="king-addons-grid-extra-text-left">' . esc_html($settings['element_sale_ends_text']) . '</span> ';
9378 }
9379 if ($to_date) {
9380 echo '<span>' . $to_date . '</span>';
9381 }
9382 echo '</span></div></div>';
9383 }
9384 }
9385
9386 public function get_elements($type, $settings, $class, $post_id)
9387 {
9388 if (in_array($type, ['pro-lk', 'pro-shr', 'pro-sd', 'pro-ws', 'pro-cm', 'pro-cfa'])) {
9389 $type = 'title';
9390 }
9391 switch ($type) {
9392 case 'title':
9393 $this->render_product_title($settings, $class);
9394 break;
9395 case 'excerpt':
9396 $this->render_product_excerpt($settings, $class);
9397 break;
9398 case 'product_tag':
9399 $this->render_product_tags($settings, $class, $post_id);
9400 break;
9401 case 'likes':
9402 $this->render_product_likes($settings, $class, $post_id);
9403 break;
9404 case 'sharing':
9405 $this->render_product_sharing_icons($settings, $class);
9406 break;
9407 case 'lightbox':
9408 $this->render_product_lightbox($settings, $class, $post_id);
9409 break;
9410 case 'separator':
9411 $this->render_product_element_separator($settings, $class);
9412 break;
9413 case 'status':
9414 $this->render_product_status($settings, $class);
9415 break;
9416 case 'price':
9417 $this->render_product_price($class);
9418 break;
9419 case 'sale_dates':
9420 $this->render_product_sale_dates($settings, $class);
9421 break;
9422 case 'rating':
9423 $this->render_product_rating($settings, $class);
9424 break;
9425 case 'add-to-cart':
9426 $this->render_product_add_to_cart($settings, $class);
9427 break;
9428 case 'wishlist-button':
9429 if (king_addons_freemius()->can_use_premium_code__premium_only()) {
9430 $this->render_product_wishlist_button($settings, $class);
9431 }
9432 break;
9433 case 'compare-button':
9434 if (king_addons_freemius()->can_use_premium_code__premium_only()) {
9435 $this->render_product_compare_button($settings, $class);
9436 }
9437 break;
9438 case 'custom-field':
9439 $this->render_product_custom_fields($settings, $class, $post_id);
9440 break;
9441 case 'product_cat':
9442 default:
9443 $this->render_product_categories($settings, $class, $post_id);
9444 break;
9445 }
9446 }
9447
9448 public function get_elements_by_location($location, $settings, $post_id)
9449 {
9450 $locations = [];
9451 foreach ($settings['grid_elements'] as $data) {
9452 $place = $data['element_location'];
9453 $align_vr = !king_addons_freemius()->can_use_premium_code__premium_only() ? 'middle' : $data['element_align_vr'];
9454 if (!isset($locations[$place])) {
9455 $locations[$place] = [];
9456 }
9457 if ('over' === $place) {
9458 if (!isset($locations[$place][$align_vr])) {
9459 $locations[$place][$align_vr] = [];
9460 }
9461 $locations[$place][$align_vr][] = $data;
9462 } else {
9463 $locations[$place][] = $data;
9464 }
9465 }
9466 if (!empty($locations[$location])) {
9467 if ('over' === $location) {
9468 foreach ($locations[$location] as $align => $elements) {
9469 if ('middle' === $align) {
9470 echo '<div class="king-addons-cv-container"><div class="king-addons-cv-outer"><div class="king-addons-cv-inner">';
9471 }
9472 echo '<div class="king-addons-grid-media-hover-' . esc_attr($align) . ' elementor-clearfix">';
9473 foreach ($elements as $data) {
9474 $class = 'king-addons-grid-item-' . $data['element_select'] . ' elementor-repeater-item-' . $data['_id'] . ' king-addons-grid-item-display-' . $data['element_display'] . ' king-addons-grid-item-align-' . $data['element_align_hr'] . $this->get_animation_class($data, 'element');
9475 $this->get_elements($data['element_select'], $data, $class, $post_id);
9476 }
9477 echo '</div>';
9478 if ('middle' === $align) {
9479 echo '</div></div></div>';
9480 }
9481 }
9482 } else {
9483 echo '<div class="king-addons-grid-item-' . esc_attr($location) . '-content elementor-clearfix">';
9484 foreach ($locations[$location] as $data) {
9485 $class = 'king-addons-grid-item-' . $data['element_select'] . ' elementor-repeater-item-' . $data['_id'] . ' king-addons-grid-item-display-' . $data['element_display'] . ' king-addons-grid-item-align-' . $data['element_align_hr'];
9486 $this->get_elements($data['element_select'], $data, $class, $post_id);
9487 }
9488 echo '</div>';
9489 }
9490 }
9491 }
9492
9493 // Stub for sorting, left empty as in original
9494 public function render_grid_sorting($settings, $posts)
9495 {
9496 }
9497
9498 // Renders filters
9499 public function render_grid_filters($settings)
9500 {
9501 $taxonomy = $settings['filters_select'];
9502 if ('' === $taxonomy || !isset($settings['query_taxonomy_' . $taxonomy])) return;
9503 $custom_filters = $settings['query_taxonomy_' . $taxonomy];
9504 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
9505 $settings['filters_default_filter'] = '';
9506 $settings['filters_icon_align'] = '';
9507 $settings['filters_count'] = '';
9508 $settings['filters_pointer'] = 'none';
9509 $settings['filters_pointer_animation'] = 'none';
9510 }
9511 $left_icon = ('left' === $settings['filters_icon_align']) ? '<i class="' . esc_attr($settings['filters_icon']['value']) . ' king-addons-grid-filters-icon-left"></i>' : '';
9512 $right_icon = ('right' === $settings['filters_icon_align']) ? '<i class="' . esc_attr($settings['filters_icon']['value']) . ' king-addons-grid-filters-icon-right"></i>' : '';
9513 $left_sep = ('left' === $settings['filters_separator_align']) ? '<em class="king-addons-grid-filters-sep">' . esc_html($settings['filters_separator']) . '</em>' : '';
9514 $right_sep = ('right' === $settings['filters_separator_align']) ? '<em class="king-addons-grid-filters-sep">' . esc_html($settings['filters_separator']) . '</em>' : '';
9515 $post_count = ('yes' === $settings['filters_count']) ? '<sup data-brackets="' . esc_attr($settings['filters_count_brackets']) . '"></sup>' : '';
9516 $pointer_class = ' king-addons-pointer-' . $settings['filters_pointer'] . ' king-addons-pointer-line-fx king-addons-pointer-fx-' . $settings['filters_pointer_animation'];
9517 $pointer_item_class = ('none' !== $settings['filters_pointer']) ? 'class="king-addons-pointer-item"' : '';
9518 $pointer_item_name = ('none' !== $settings['filters_pointer']) ? 'king-addons-pointer-item' : '';
9519 echo '<ul class="king-addons-grid-filters elementor-clearfix king-addons-grid-filters-sep-' . esc_attr($settings['filters_separator_align']) . '">';
9520 if ('yes' === $settings['filters_all'] && 'yes' !== $settings['filters_linkable']) {
9521 echo '<li class="' . esc_attr($pointer_class) . '"><span data-filter="*" class="king-addons-active-filter ' . $pointer_item_name . '">' . $left_icon . esc_html($settings['filters_all_text']) . $right_icon . $post_count . '</span>' . $right_sep . '</li>';
9522 }
9523 if ('dynamic' === $settings['query_selection'] && !empty($custom_filters)) {
9524 $parent_filters = [];
9525 foreach ($custom_filters as $term_id) {
9526 $filter = get_term_by('id', $term_id, $taxonomy);
9527 if (!$filter) continue;
9528 $data_attr = ('post_tag' === $taxonomy) ? 'tag-' . $filter->slug : $taxonomy . '-' . $filter->slug;
9529 $tax_data_attr = ('post_tag' === $taxonomy) ? 'tag' : $taxonomy;
9530 $term_data = $filter->slug;
9531 if (0 === $filter->parent) {
9532 $children = get_term_children($filter->term_id, $taxonomy);
9533 $data_role = !empty($children) ? ' data-role="parent"' : '';
9534 echo '<li' . $data_role . ' class="' . esc_attr($pointer_class) . '">';
9535 if ('yes' !== $settings['filters_linkable']) {
9536 echo $left_sep . '<span ' . $pointer_item_class . ' data-ajax-filter=' . json_encode([$tax_data_attr, $term_data]) . ' data-filter=".' . esc_attr(urldecode($data_attr)) . '">' . $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</span>' . $right_sep;
9537 } else {
9538 echo $left_sep . '<a ' . $pointer_item_class . ' href="' . esc_url(get_term_link($filter->term_id, $taxonomy)) . '">' . $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</a>' . $right_sep;
9539 }
9540 echo '</li>';
9541 } else {
9542 $parent_filters[] = $filter->parent;
9543 }
9544 }
9545 } else {
9546 $all_filters = get_terms($taxonomy);
9547 $parent_filters = [];
9548 if (!is_wp_error($all_filters)) {
9549 foreach ($all_filters as $filter) {
9550 $data_attr = ('post_tag' === $taxonomy) ? 'tag-' . $filter->slug : $taxonomy . '-' . $filter->slug;
9551 $tax_data_attr = ('post_tag' === $taxonomy) ? 'tag' : $taxonomy;
9552 if (0 === $filter->parent) {
9553 $children = get_term_children($filter->term_id, $taxonomy);
9554 $data_role = !empty($children) ? ' data-role="parent"' : '';
9555 $hidden_class = $this->get_hidden_filter_class($filter->slug, $settings);
9556 echo '<li' . $data_role . ' class="' . esc_attr($pointer_class . $hidden_class) . '">';
9557 if ('yes' !== $settings['filters_linkable']) {
9558 echo $left_sep . '<span ' . $pointer_item_class . ' data-ajax-filter=' . json_encode([$tax_data_attr, $filter->slug]) . ' data-filter=".' . esc_attr(urldecode($data_attr)) . '">' . $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</span>' . $right_sep;
9559 } else {
9560 echo $left_sep . '<a ' . $pointer_item_class . ' href="' . esc_url(get_term_link($filter->term_id, $taxonomy)) . '" data-ajax-filter=' . json_encode([$tax_data_attr, $filter->slug]) . ' data-filter=".' . esc_attr(urldecode($data_attr)) . '">' . $left_icon . esc_html($filter->name) . $right_icon . $post_count . '</a>' . $right_sep;
9561 }
9562 echo '</li>';
9563 } else {
9564 $parent_filters[] = $filter->parent;
9565 }
9566 }
9567 }
9568 }
9569 if ('yes' !== $settings['filters_linkable']) {
9570 foreach (array_unique($parent_filters) as $pf) {
9571 $parent = get_term_by('id', $pf, $taxonomy);
9572 if (!$parent) continue;
9573 $children = get_term_children($pf, $taxonomy);
9574 $data_attr = ('post_tag' === $taxonomy) ? 'tag-' . $parent->slug : $taxonomy . '-' . $parent->slug;
9575 echo '<ul data-parent=".' . esc_attr(urldecode($data_attr)) . '" class="king-addons-sub-filters">';
9576 echo '<li data-role="back" class="' . esc_attr($pointer_class) . '">';
9577 echo '<span class="king-addons-back-filter" data-ajax-filter=' . json_encode([$taxonomy, $parent->slug]) . ' data-filter=".' . esc_attr(urldecode($data_attr)) . '"><i class="fas fa-long-arrow-alt-left"></i>&nbsp;&nbsp;' . esc_html__('Back', 'king-addons') . '</span>';
9578 echo '</li>';
9579 foreach ($children as $child_id) {
9580 $sub_filter = get_term_by('id', $child_id, $taxonomy);
9581 if (!$sub_filter) continue;
9582 $data_attr2 = ('post_tag' === $taxonomy) ? 'tag-' . $sub_filter->slug : $taxonomy . '-' . $sub_filter->slug;
9583 echo '<li data-role="sub" class="' . esc_attr($pointer_class) . '">';
9584 echo $left_sep . '<span ' . $pointer_item_class . ' data-ajax-filter=' . json_encode([$taxonomy, $sub_filter->slug]) . ' data-filter=".' . esc_attr(urldecode($data_attr2)) . '">' . $left_icon . esc_html($sub_filter->name) . $right_icon . $post_count . '</span>' . $right_sep;
9585 echo '</li>';
9586 }
9587 echo '</ul>';
9588 }
9589 }
9590 echo '</ul>';
9591 }
9592
9593 public function get_hidden_filter_class($slug, $settings)
9594 {
9595 $posts = new WP_Query($this->get_main_query_args());
9596 $visible_categories = [];
9597 if ($posts->have_posts()) {
9598 while ($posts->have_posts()) {
9599 $posts->the_post();
9600 foreach (get_the_category() as $category) {
9601 $visible_categories[] = $category->slug;
9602 }
9603 }
9604 $visible_categories = array_unique($visible_categories);
9605 wp_reset_postdata();
9606 }
9607 return (!in_array($slug, $visible_categories) && 'yes' === $settings['filters_hide_empty']) ? ' king-addons-hidden-element' : '';
9608 }
9609
9610 public function render_grid_pagination($settings)
9611 {
9612 if ('yes' !== $settings['layout_pagination'] || 1 === $this->get_max_num_pages() || 'slider' === $settings['layout_select']) {
9613 return;
9614 }
9615 // In upsell/cross-sell: if total upsell/cross-sell <= per_page, no pagination
9616 if ((isset($this->my_upsells) && count($this->my_upsells) <= $settings['query_posts_per_page']) ||
9617 (isset($this->crossell_ids) && count($this->crossell_ids) <= $settings['query_posts_per_page'])) {
9618 return;
9619 }
9620 global $paged;
9621 $pages = $this->get_max_num_pages();
9622 $paged = empty($paged) ? 1 : $paged;
9623 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
9624 if ('pro-is' === $settings['pagination_type']) {
9625 $settings['pagination_type'] = 'default';
9626 }
9627 }
9628 echo '<div class="king-addons-grid-pagination elementor-clearfix king-addons-grid-pagination-' . esc_attr($settings['pagination_type']) . '">';
9629 if ('default' === $settings['pagination_type']) {
9630 if ($paged < $pages) {
9631 echo '<a href="' . esc_url(get_pagenum_link($paged + 1)) . '" class="king-addons-prev-post-link">' . Core::getIcon($settings['pagination_on_icon'], 'left') . esc_html($settings['pagination_older_text']) . '</a>';
9632 } elseif ('yes' === $settings['pagination_disabled_arrows']) {
9633 echo '<span class="king-addons-prev-post-link king-addons-disabled-arrow">' . Core::getIcon($settings['pagination_on_icon'], 'left') . esc_html($settings['pagination_older_text']) . '</span>';
9634 }
9635 if ($paged > 1) {
9636 echo '<a href="' . esc_url(get_pagenum_link($paged - 1)) . '" class="king-addons-next-post-link">' . esc_html($settings['pagination_newer_text']) . Core::getIcon($settings['pagination_on_icon'], 'right') . '</a>';
9637 } elseif ('yes' === $settings['pagination_disabled_arrows']) {
9638 echo '<span class="king-addons-next-post-link king-addons-disabled-arrow">' . esc_html($settings['pagination_newer_text']) . Core::getIcon($settings['pagination_on_icon'], 'right') . '</span>';
9639 }
9640 } elseif ('numbered' === $settings['pagination_type']) {
9641 $range = $settings['pagination_range'];
9642 $showitems = ($range * 2) + 1;
9643 if (1 !== $pages) {
9644 if ('yes' === $settings['pagination_prev_next'] || 'yes' === $settings['pagination_first_last']) {
9645 echo '<div class="king-addons-grid-pagination-left-arrows">';
9646 if ('yes' === $settings['pagination_first_last']) {
9647 if ($paged >= 2) {
9648 echo '<a href="' . esc_url(get_pagenum_link()) . '" class="king-addons-first-page">' . Core::getIcon($settings['pagination_fl_icon'], 'left') . '<span>' . esc_html($settings['pagination_first_text']) . '</span></a>';
9649 } elseif ('yes' === $settings['pagination_disabled_arrows']) {
9650 echo '<span class="king-addons-first-page king-addons-disabled-arrow">' . Core::getIcon($settings['pagination_fl_icon'], 'left') . '<span>' . esc_html($settings['pagination_first_text']) . '</span></span>';
9651 }
9652 }
9653 if ('yes' === $settings['pagination_prev_next']) {
9654 if ($paged > 1) {
9655 echo '<a href="' . esc_url(get_pagenum_link($paged - 1)) . '" class="king-addons-prev-page">' . Core::getIcon($settings['pagination_pn_icon'], 'left') . '<span>' . esc_html($settings['pagination_prev_text']) . '</span></a>';
9656 } elseif ('yes' === $settings['pagination_disabled_arrows']) {
9657 echo '<span class="king-addons-prev-page king-addons-disabled-arrow">' . Core::getIcon($settings['pagination_pn_icon'], 'left') . '<span>' . esc_html($settings['pagination_prev_text']) . '</span></span>';
9658 }
9659 }
9660 echo '</div>';
9661 }
9662 for ($i = 1; $i <= $pages; $i++) {
9663 if (1 !== $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {
9664 if ($paged === $i) {
9665 echo '<span class="king-addons-grid-current-page">' . $i . '</span>';
9666 } else {
9667 echo '<a href="' . esc_url(get_pagenum_link($i)) . '">' . $i . '</a>';
9668 }
9669 }
9670 }
9671 if ('yes' === $settings['pagination_prev_next'] || 'yes' === $settings['pagination_first_last']) {
9672 echo '<div class="king-addons-grid-pagination-right-arrows">';
9673 if ('yes' === $settings['pagination_prev_next']) {
9674 if ($paged < $pages) {
9675 echo '<a href="' . esc_url(get_pagenum_link($paged + 1)) . '" class="king-addons-next-page"><span>' . esc_html($settings['pagination_next_text']) . '</span>' . Core::getIcon($settings['pagination_pn_icon'], 'right') . '</a>';
9676 } elseif ('yes' === $settings['pagination_disabled_arrows']) {
9677 echo '<span class="king-addons-next-page king-addons-disabled-arrow"><span>' . esc_html($settings['pagination_next_text']) . '</span>' . Core::getIcon($settings['pagination_pn_icon'], 'right') . '</span>';
9678 }
9679 }
9680 if ('yes' === $settings['pagination_first_last']) {
9681 if ($paged <= $pages - 1) {
9682 echo '<a href="' . esc_url(get_pagenum_link($pages)) . '" class="king-addons-last-page"><span>' . esc_html($settings['pagination_last_text']) . '</span>' . Core::getIcon($settings['pagination_fl_icon'], 'right') . '</a>';
9683 } elseif ('yes' === $settings['pagination_disabled_arrows']) {
9684 echo '<span class="king-addons-last-page king-addons-disabled-arrow"><span>' . esc_html($settings['pagination_last_text']) . '</span>' . Core::getIcon($settings['pagination_fl_icon'], 'right') . '</span>';
9685 }
9686 }
9687 echo '</div>';
9688 }
9689 }
9690 } else {
9691 echo '<a href="' . esc_url(get_pagenum_link($paged + 1)) . '" class="king-addons-load-more-btn" data-e-disable-page-transition>';
9692 echo esc_html($settings['pagination_load_more_text']) . '</a>';
9693 echo '<div class="king-addons-pagination-loading">';
9694 switch ($settings['pagination_animation']) {
9695 case 'loader-1':
9696 echo '<div class="king-addons-double-bounce"><div class="king-addons-child king-addons-double-bounce1"></div><div class="king-addons-child king-addons-double-bounce2"></div></div>';
9697 break;
9698 case 'loader-2':
9699 echo '<div class="king-addons-wave"><div class="king-addons-rect king-addons-rect1"></div><div class="king-addons-rect king-addons-rect2"></div><div class="king-addons-rect king-addons-rect3"></div><div class="king-addons-rect king-addons-rect4"></div><div class="king-addons-rect king-addons-rect5"></div></div>';
9700 break;
9701 case 'loader-3':
9702 echo '<div class="king-addons-spinner king-addons-spinner-pulse"></div>';
9703 break;
9704 case 'loader-4':
9705 echo '<div class="king-addons-chasing-dots"><div class="king-addons-child king-addons-dot1"></div><div class="king-addons-child king-addons-dot2"></div></div>';
9706 break;
9707 case 'loader-5':
9708 echo '<div class="king-addons-three-bounce"><div class="king-addons-child king-addons-bounce1"></div><div class="king-addons-child king-addons-bounce2"></div><div class="king-addons-child king-addons-bounce3"></div></div>';
9709 break;
9710 case 'loader-6':
9711 echo '<div class="king-addons-fading-circle">';
9712 for ($i = 1; $i <= 12; $i++) {
9713 echo '<div class="king-addons-circle king-addons-circle' . $i . '"></div>';
9714 }
9715 echo '</div>';
9716 break;
9717 }
9718 echo '</div><p class="king-addons-pagination-finish">' . esc_html($settings['pagination_finish_text']) . '</p>';
9719 }
9720 echo '</div>';
9721 }
9722
9723 public function add_grid_settings($settings)
9724 {
9725 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
9726 if ('pro-ms' === $settings['layout_select']) {
9727 $settings['layout_select'] = 'fitRows';
9728 }
9729 $settings['filters_deeplinking'] = '';
9730 $settings['filters_count'] = '';
9731 $settings['filters_default_filter'] = '';
9732 if (in_array($settings['filters_animation'], ['pro-fd', 'pro-fs'])) {
9733 $settings['filters_animation'] = 'zoom';
9734 }
9735 }
9736 $stick_last = ('fitRows' === $settings['layout_select']) ? $settings['stick_last_element_to_bottom'] : 'no';
9737 $ghr_wide = $settings['layout_gutter_hr_widescreen']['size'] ?? $settings['layout_gutter_hr']['size'];
9738 $ghr_desktop = $settings['layout_gutter_hr']['size'];
9739 $ghr_laptop = $settings['layout_gutter_hr_laptop']['size'] ?? $ghr_desktop;
9740 $ghr_tab_ex = $settings['layout_gutter_hr_tablet_extra']['size'] ?? $ghr_laptop;
9741 $ghr_tab = $settings['layout_gutter_hr_tablet']['size'] ?? $ghr_tab_ex;
9742 $ghr_mob_ex = $settings['layout_gutter_hr_mobile_extra']['size'] ?? $ghr_tab;
9743 $ghr_mobile = $settings['layout_gutter_hr_mobile']['size'] ?? $ghr_mob_ex;
9744
9745 $gvr_wide = $settings['layout_gutter_vr_widescreen']['size'] ?? $settings['layout_gutter_vr']['size'];
9746 $gvr_desktop = $settings['layout_gutter_vr']['size'];
9747 $gvr_laptop = $settings['layout_gutter_vr_laptop']['size'] ?? $gvr_desktop;
9748 $gvr_tab_ex = $settings['layout_gutter_vr_tablet_extra']['size'] ?? $gvr_laptop;
9749 $gvr_tab = $settings['layout_gutter_vr_tablet']['size'] ?? $gvr_tab_ex;
9750 $gvr_mob_ex = $settings['layout_gutter_vr_mobile_extra']['size'] ?? $gvr_tab;
9751 $gvr_mobile = $settings['layout_gutter_vr_mobile']['size'] ?? $gvr_mob_ex;
9752
9753 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
9754 $settings['lightbox_popup_thumbnails'] = '';
9755 $settings['lightbox_popup_thumbnails_default'] = '';
9756 $settings['lightbox_popup_sharing'] = '';
9757 }
9758 $layout_settings = [
9759 'layout' => $settings['layout_select'],
9760 'stick_last_element_to_bottom' => $stick_last,
9761 'columns_desktop' => $settings['layout_columns'],
9762 'gutter_hr' => $ghr_desktop,
9763 'gutter_hr_mobile' => $ghr_mobile,
9764 'gutter_hr_mobile_extra' => $ghr_mob_ex,
9765 'gutter_hr_tablet' => $ghr_tab,
9766 'gutter_hr_tablet_extra' => $ghr_tab_ex,
9767 'gutter_hr_laptop' => $ghr_laptop,
9768 'gutter_hr_widescreen' => $ghr_wide,
9769 'gutter_vr' => $gvr_desktop,
9770 'gutter_vr_mobile' => $gvr_mobile,
9771 'gutter_vr_mobile_extra' => $gvr_mob_ex,
9772 'gutter_vr_tablet' => $gvr_tab,
9773 'gutter_vr_tablet_extra' => $gvr_tab_ex,
9774 'gutter_vr_laptop' => $gvr_laptop,
9775 'gutter_vr_widescreen' => $gvr_wide,
9776 'animation' => $settings['layout_animation'],
9777 'animation_duration' => $settings['layout_animation_duration'],
9778 'animation_delay' => $settings['layout_animation_delay'],
9779 'deeplinking' => $settings['filters_deeplinking'],
9780 'filters_linkable' => $settings['filters_linkable'],
9781 'filters_default_filter' => $settings['filters_default_filter'],
9782 'filters_count' => $settings['filters_count'],
9783 'filters_hide_empty' => $settings['filters_hide_empty'],
9784 'filters_animation' => $settings['filters_animation'],
9785 'filters_animation_duration' => $settings['filters_animation_duration'],
9786 'filters_animation_delay' => $settings['filters_animation_delay'],
9787 'pagination_type' => $settings['pagination_type'],
9788 'pagination_max_pages' => $this->get_max_num_pages(),
9789 'lightbox' => [
9790 'selector' => '.king-addons-grid-image-wrap',
9791 'iframeMaxWidth' => '60%',
9792 'hash' => false,
9793 'autoplay' => $settings['lightbox_popup_autoplay'],
9794 'pause' => $settings['lightbox_popup_pause'] * 1000,
9795 'progressBar' => $settings['lightbox_popup_progressbar'],
9796 'counter' => $settings['lightbox_popup_counter'],
9797 'controls' => $settings['lightbox_popup_arrows'],
9798 'getCaptionFromTitleOrAlt' => $settings['lightbox_popup_captions'],
9799 'thumbnail' => $settings['lightbox_popup_thumbnails'],
9800 'showThumbByDefault' => $settings['lightbox_popup_thumbnails_default'],
9801 'share' => $settings['lightbox_popup_sharing'],
9802 'zoom' => $settings['lightbox_popup_zoom'],
9803 'fullScreen' => $settings['lightbox_popup_fullscreen'],
9804 'download' => $settings['lightbox_popup_download'],
9805 ],
9806 ];
9807 if ('current' !== $settings['query_selection']) {
9808 $layout_settings['query_posts_per_page'] = $settings['query_posts_per_page'];
9809 }
9810 if ('list' === $settings['layout_select']) {
9811 $layout_settings['media_align'] = $settings['layout_list_align'];
9812 $layout_settings['media_width'] = $settings['layout_list_media_width']['size'];
9813 $layout_settings['media_distance'] = $settings['layout_list_media_distance']['size'];
9814 }
9815 if ('yes' === $settings['filters_experiment']) {
9816 $layout_settings['grid_settings'] = $settings;
9817 }
9818 $this->add_render_attribute('grid-settings', ['data-settings' => wp_json_encode($layout_settings)]);
9819 }
9820
9821 public function add_slider_settings($settings)
9822 {
9823 $slider_is_rtl = is_rtl();
9824 $slider_dir = $slider_is_rtl ? 'rtl' : 'ltr';
9825 if (!king_addons_freemius()->can_use_premium_code__premium_only()) {
9826 $settings['layout_slider_autoplay'] = '';
9827 $settings['layout_slider_autoplay_duration'] = 0;
9828 $settings['layout_slider_pause_on_hover'] = '';
9829 $settings['lightbox_popup_thumbnails'] = '';
9830 $settings['lightbox_popup_thumbnails_default'] = '';
9831 $settings['lightbox_popup_sharing'] = '';
9832 }
9833 $slider_opts = [
9834 'rtl' => $slider_is_rtl,
9835 'infinite' => ('yes' === $settings['layout_slider_loop']),
9836 'speed' => absint($settings['layout_slider_effect_duration'] * 1000),
9837 'arrows' => true,
9838 'dots' => true,
9839 'autoplay' => ('yes' === $settings['layout_slider_autoplay']),
9840 'autoplaySpeed' => absint($settings['layout_slider_autoplay_duration'] * 1000),
9841 'pauseOnHover' => $settings['layout_slider_pause_on_hover'],
9842 'prevArrow' => '#king-addons-grid-slider-prev-' . $this->get_id(),
9843 'nextArrow' => '#king-addons-grid-slider-next-' . $this->get_id(),
9844 'sliderSlidesToScroll' => +$settings['layout_slides_to_scroll'],
9845 'lightbox' => [
9846 'selector' => 'article:not(.slick-cloned) .king-addons-grid-image-wrap',
9847 'iframeMaxWidth' => '60%',
9848 'hash' => false,
9849 'autoplay' => $settings['lightbox_popup_autoplay'],
9850 'pause' => $settings['lightbox_popup_pause'] * 1000,
9851 'progressBar' => $settings['lightbox_popup_progressbar'],
9852 'counter' => $settings['lightbox_popup_counter'],
9853 'controls' => $settings['lightbox_popup_arrows'],
9854 'getCaptionFromTitleOrAlt' => $settings['lightbox_popup_captions'],
9855 'thumbnail' => $settings['lightbox_popup_thumbnails'],
9856 'showThumbByDefault' => $settings['lightbox_popup_thumbnails_default'],
9857 'share' => $settings['lightbox_popup_sharing'],
9858 'zoom' => $settings['lightbox_popup_zoom'],
9859 'fullScreen' => $settings['lightbox_popup_fullscreen'],
9860 'download' => $settings['lightbox_popup_download'],
9861 ]
9862 ];
9863 if ($settings['layout_slider_amount'] === 1 && $settings['layout_slider_effect'] === 'fade') {
9864 $slider_opts['fade'] = true;
9865 }
9866 $this->add_render_attribute('slider-settings', [
9867 'dir' => esc_attr($slider_dir),
9868 'data-slick' => wp_json_encode($slider_opts),
9869 ]);
9870 }
9871
9872 // For storing upsells/cross-sells
9873
9874 /** @noinspection PhpMissingFieldTypeInspection */
9875 public $my_upsells;
9876 /** @noinspection PhpMissingFieldTypeInspection */
9877 public $crossell_ids;
9878
9879 protected function render()
9880 {
9881 $settings = $this->get_settings();
9882 if (!class_exists('WooCommerce')) {
9883 echo '<h2>' . esc_html__('WooCommerce is NOT active!', 'king-addons') . '</h2>';
9884 return;
9885 }
9886 $posts = new WP_Query($this->get_main_query_args());
9887 if ($posts->have_posts()) :
9888 $tags_whitelist = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'span', 'p'];
9889 $linked_tag = Core::validateHTMLTags($settings['grid_linked_products_heading_tag'], 'h2', $tags_whitelist);
9890 if (('upsell' === $settings['query_selection'] || 'cross-sell' === $settings['query_selection']) && '' !== $settings['grid_linked_products_heading']) {
9891 echo '<div class="king-addons-grid-linked-products-heading"><' . $linked_tag . '>' . esc_html($settings['grid_linked_products_heading']) . '</' . $linked_tag . '></div>';
9892 }
9893 if ('slider' !== $settings['layout_select']) {
9894 if (!in_array($settings['query_selection'], ['upsell', 'cross-sell'])) {
9895 $this->render_grid_sorting($settings, $posts);
9896 if (!((is_product_category() || is_product_tag()) && !king_addons_freemius()->can_use_premium_code__premium_only())) {
9897 $this->render_grid_filters($settings);
9898 }
9899 }
9900 $this->add_grid_settings($settings);
9901 $render_attr = $this->get_render_attribute_string('grid-settings');
9902 } else {
9903 $this->add_slider_settings($settings);
9904 $render_attr = $this->get_render_attribute_string('slider-settings');
9905 }
9906 echo '<section class="king-addons-grid elementor-clearfix" ' . $render_attr . ' data-found-posts="' . $posts->found_posts . '">';
9907 while ($posts->have_posts()): $posts->the_post();
9908 $post_class = implode(' ', get_post_class('king-addons-grid-item elementor-clearfix', get_the_ID()));
9909 echo '<article class="' . esc_attr($post_class) . '">';
9910 $this->render_password_protected_input();
9911 echo '<div class="king-addons-grid-item-inner">';
9912 $this->get_elements_by_location('above', $settings, get_the_ID());
9913 echo '<div class="king-addons-grid-media-wrap' . esc_attr($this->get_image_effect_class($settings)) . '" data-overlay-link="' . esc_attr($settings['overlay_post_link']) . '">';
9914 $this->render_product_thumbnail($settings);
9915 echo '<div class="king-addons-grid-media-hover king-addons-animation-wrap">';
9916 echo apply_filters('king_addons_grid_media_hover_content', '', get_the_ID());
9917 $this->render_media_overlay($settings);
9918 $this->get_elements_by_location('over', $settings, get_the_ID());
9919 echo '</div></div>';
9920 $this->get_elements_by_location('below', $settings, get_the_ID());
9921 echo '</div></article>';
9922 endwhile;
9923 wp_reset_postdata();
9924 echo '</section>';
9925 if ('slider' === $settings['layout_select']) {
9926 if ($posts->found_posts > (int)$settings['layout_slider_amount'] && (int)$settings['layout_slider_amount'] < $settings['query_posts_per_page']) {
9927 echo '<div class="king-addons-grid-slider-arrow-container">';
9928 echo '<div class="king-addons-grid-slider-prev-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-prev-' . esc_attr($this->get_id()) . '">' . Core::getIcon($settings['layout_slider_nav_icon'], '') . '</div>';
9929 echo '<div class="king-addons-grid-slider-next-arrow king-addons-grid-slider-arrow" id="king-addons-grid-slider-next-' . esc_attr($this->get_id()) . '">' . Core::getIcon($settings['layout_slider_nav_icon'], '') . '</div>';
9930 echo '</div><div class="king-addons-grid-slider-dots"></div>';
9931 }
9932 }
9933 $this->render_grid_pagination($settings);
9934 else:
9935 if (!in_array($settings['query_selection'], ['upsell', 'cross-sell'])) {
9936 echo '<h2>' . esc_html($settings['query_not_found_text']) . '</h2>';
9937 }
9938 endif;
9939 }
9940
9941
9942 }