PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.83
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.83
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.83, at includes/widgets/WooCommerce_Grid/WooCommerce_Grid.php

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