PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / trunk
Shortcodes and extra features for Phlox theme vtrunk
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / products-grid.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 6 months ago accordion.php 6 months ago audio.php 6 months ago before-after.php 6 months ago button.php 6 months ago carousel-navigation.php 6 months ago circle-chart.php 6 months ago contact-box.php 6 months ago contact-form.php 6 months ago custom-list.php 6 months ago divider.php 6 months ago gallery.php 6 months ago gmap.php 2 days ago heading-modern.php 5 months ago icon.php 6 months ago image.php 6 months ago mailchimp.php 6 months ago modern-button.php 6 months ago products-grid.php 6 months ago quote.php 6 months ago recent-comments.php 6 months ago recent-posts-grid-carousel.php 1 month ago recent-posts-land-style.php 6 months ago recent-posts-masonry.php 6 months ago recent-posts-tiles-carousel.php 6 months ago recent-posts-tiles.php 6 months ago recent-posts-timeline.php 6 months ago recent-products.php 6 months ago responsive-table.php 6 months ago search.php 6 months ago staff.php 6 months ago svg.php 6 months ago tabs.php 6 months ago testimonial.php 6 months ago text.php 6 months ago touch-slider.php 6 months ago video.php 6 months ago
products-grid.php
1174 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Widget_Base;
5 use Elementor\Controls_Manager;
6 use Elementor\Group_Control_Typography;
7 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Text_Shadow;
10 use Elementor\Group_Control_Background;
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly.
14 }
15
16 /**
17 * Elementor 'AdvancedRecentProducts' widget.
18 *
19 * Elementor widget that displays an 'AdvancedRecentProducts' with lightbox.
20 *
21 * @since 1.0.0
22 */
23 class ProductsGrid extends Widget_Base {
24
25 /**
26 * Get widget name.
27 *
28 * Retrieve 'AdvancedRecentProducts' widget name.
29 *
30 * @since 1.0.0
31 * @access public
32 *
33 * @return string Widget name.
34 */
35 public function get_name() {
36 return 'aux_product_grid';
37 }
38
39 /**
40 * Get widget title.
41 *
42 * Retrieve 'AdvancedRecentProducts' widget title.
43 *
44 * @since 1.0.0
45 * @access public
46 *
47 * @return string Widget title.
48 */
49 public function get_title() {
50 return __('Products Grid', 'auxin-elements' );
51 }
52
53 public function has_widget_inner_wrapper(): bool {
54 return ! \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
55 }
56
57
58 /**
59 * Get widget icon.
60 *
61 * Retrieve 'AdvancedRecentProducts' widget icon.
62 *
63 * @since 1.0.0
64 * @access public
65 *
66 * @return string Widget icon.
67 */
68 public function get_icon() {
69 return 'eicon-woocommerce auxin-badge-pro';
70 }
71
72 /**
73 * Get widget categories.
74 *
75 * Retrieve 'AdvancedRecentProducts' widget icon.
76 *
77 * @since 1.0.0
78 * @access public
79 *
80 * @return string Widget icon.
81 */
82 public function get_categories() {
83 return array( 'auxin-pro' );
84 }
85
86 /**
87 * Retrieve the terms in a given taxonomy or list of taxonomies.
88 *
89 * Retrieve 'AdvancedRecentProducts' widget icon.
90 *
91 * @since 1.0.0
92 * @access public
93 *
94 * @return string Widget icon.
95 */
96 public function get_terms() {
97 // Get terms
98 $terms = get_terms(
99 array(
100 'taxonomy' => 'product_cat',
101 'orderby' => 'count',
102 'hide_empty' => true
103 )
104 );
105
106 // Then create a list
107 $list = array();
108
109 if ( ! is_wp_error( $terms ) && is_array( $terms ) ){
110 foreach ( $terms as $key => $value ) {
111 $list[$value->term_id] = $value->name;
112 }
113 }
114
115 return $list;
116 }
117
118 /**
119 * Register 'AdvancedRecentProducts' widget controls.
120 *
121 * Adds different input fields to allow the user to change and customize the widget settings.
122 *
123 * @since 1.0.0
124 * @access protected
125 */
126 protected function register_controls() {
127 /*-------------------------------------------------------------------*/
128 /* Layout TAB
129 /*-------------------------------------------------------------------*/
130
131 /* Layout Section
132 /*-------------------------------------*/
133
134 $this->start_controls_section(
135 'layout_section',
136 array(
137 'label' => __('Layout', 'auxin-elements' ),
138 'tab' => Controls_Manager::TAB_LAYOUT
139 )
140 );
141
142 $this->add_control(
143 'columns',
144 array(
145 'label' => __( 'Columns', 'auxin-elements' ),
146 'type' => Controls_Manager::SELECT,
147 'default' => '4',
148 'options' => array(
149 '1' => '1',
150 '2' => '2',
151 '3' => '3',
152 '4' => '4',
153 '5' => '5',
154 ),
155 'frontend_available' => true,
156 )
157 );
158
159 $this->add_control(
160 'num',
161 array(
162 'label' => __('Number of posts to show', 'auxin-elements'),
163 'label_block' => true,
164 'type' => Controls_Manager::NUMBER,
165 'default' => '8',
166 'min' => 1,
167 'step' => 1
168 )
169 );
170
171 $this->end_controls_section();
172 /*-------------------------------------------------------------------*/
173 /* Content TAB
174 /*-------------------------------------------------------------------*/
175
176 /* Query Section
177 /*-------------------------------------*/
178
179 $this->start_controls_section(
180 'query_section',
181 array(
182 'label' => __('Query', 'auxin-elements' ),
183 )
184 );
185
186 $this->add_control(
187 'product_type',
188 array(
189 'label' => __('Products Type','auxin-elements' ),
190 'label_block' => true,
191 'type' => Controls_Manager::SELECT,
192 'options' => array(
193 'recent' => __('Recent Products' , 'auxin-elements'),
194 'featured' => __('Featured Products' , 'auxin-elements'),
195 'top_rated' => __('Top Rated Products', 'auxin-elements'),
196 'best_selling' => __('Best Selling Products' , 'auxin-elements'),
197 'sale' => __('On Sale Products' , 'auxin-elements'),
198 'deal' => __('Deal Products' , 'auxin-elements'),
199 ),
200 'default' => 'recent',
201 )
202 );
203
204 $this->add_control(
205 'cat',
206 array(
207 'label' => __('Categories', 'auxin-elements'),
208 'description' => __('Specifies a category that you want to show posts from it. In order to choose the all categories leave the field empty', 'auxin-elements' ),
209 'type' => Controls_Manager::SELECT2,
210 'multiple' => true,
211 'options' => $this->get_terms(),
212 'default' => array(),
213 )
214 );
215
216 $this->add_control(
217 'exclude_without_media',
218 array(
219 'label' => __('Exclude products without media','auxin-elements' ),
220 'type' => Controls_Manager::SWITCHER,
221 'label_on' => __( 'On', 'auxin-elements' ),
222 'label_off' => __( 'Off', 'auxin-elements' ),
223 'return_value' => 'yes',
224 'default' => 'yes'
225 )
226 );
227
228 $this->add_control(
229 'order_by',
230 array(
231 'label' => __('Order by', 'auxin-elements'),
232 'type' => Controls_Manager::SELECT,
233 'default' => 'date',
234 'options' => array(
235 'date' => __('Date', 'auxin-elements'),
236 'menu_order date' => __('Menu Order', 'auxin-elements'),
237 'title' => __('Title', 'auxin-elements'),
238 'ID' => __('ID', 'auxin-elements'),
239 'rand' => __('Random', 'auxin-elements'),
240 'comment_count' => __('Comments', 'auxin-elements'),
241 'modified' => __('Date Modified', 'auxin-elements'),
242 'author' => __('Author', 'auxin-elements'),
243 'post__in' => __('Inserted Post IDs', 'auxin-elements')
244 ),
245 )
246 );
247
248 $this->add_control(
249 'order',
250 array(
251 'label' => __('Order', 'auxin-elements'),
252 'type' => Controls_Manager::SELECT,
253 'default' => 'DESC',
254 'options' => array(
255 'DESC' => __('Descending', 'auxin-elements'),
256 'ASC' => __('Ascending', 'auxin-elements'),
257 ),
258 )
259 );
260
261 $this->add_control(
262 'only_products__in',
263 array(
264 'label' => __('Only products','auxin-elements' ),
265 'description' => __('If you intend to display ONLY specific products, you should specify the products here. You have to insert the Products IDs that are separated by comma (eg. 53,34,87,25).', 'auxin-elements' ),
266 'type' => Controls_Manager::TEXT
267 )
268 );
269
270 $this->add_control(
271 'include',
272 array(
273 'label' => __('Include products','auxin-elements' ),
274 'description' => __('If you intend to include additional products, you should specify the products here. You have to insert the Products IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
275 'type' => Controls_Manager::TEXT
276 )
277 );
278
279 $this->add_control(
280 'exclude',
281 array(
282 'label' => __('Exclude products','auxin-elements' ),
283 'description' => __('If you intend to exclude specific products from result, you should specify the products here. You have to insert the Products IDs that are separated by comma (eg. 53,34,87,25)', 'auxin-elements' ),
284 'type' => Controls_Manager::TEXT
285 )
286 );
287
288 $this->add_control(
289 'offset',
290 array(
291 'label' => __('Start offset','auxin-elements' ),
292 'description' => __('Number of products to displace or pass over.', 'auxin-elements' ),
293 'type' => Controls_Manager::NUMBER,
294 'default' => ''
295 )
296 );
297
298 $this->end_controls_section();
299
300 /*-------------------------------------------------------------------*/
301 /* Settings TAB
302 /*-------------------------------------------------------------------*/
303 /*-----------------------------------------------------------------------------------*/
304 /* Rating Style Section
305 /*-----------------------------------------------------------------------------------*/
306
307 $this->start_controls_section(
308 'wrappers_section',
309 array(
310 'label' => __( 'Wrappers', 'auxin-elements' ),
311 'tab' => Controls_Manager::TAB_STYLE,
312 )
313 );
314
315 $this->add_responsive_control(
316 'wrapper_margin_bottom',
317 array(
318 'label' => __( 'Product Bottom space', 'auxin-elements' ),
319 'type' => Controls_Manager::SLIDER,
320 'range' => array(
321 'px' => array(
322 'max' => 100,
323 ),
324 ),
325 'selectors' => array(
326 '{{WRAPPER}} .type-product' => 'padding-bottom: {{SIZE}}{{UNIT}};',
327 ),
328 )
329 );
330
331 $this->add_responsive_control(
332 'wrapper_info_padding',
333 array(
334 'label' => __( 'Info Wrapper Padding', 'auxin-elements' ),
335 'type' => Controls_Manager::DIMENSIONS,
336 'size_units' => array( 'px', '%' ),
337 'selectors' => array(
338 '{{WRAPPER}} .aux-shop-info-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
339 ),
340 )
341 );
342
343 $this->add_responsive_control(
344 'wrapper_meta_padding',
345 array(
346 'label' => __( 'Meta Wrapper Padding', 'auxin-elements' ),
347 'type' => Controls_Manager::DIMENSIONS,
348 'size_units' => array( 'px', '%' ),
349 'selectors' => array(
350 '{{WRAPPER}} .aux-shop-meta-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
351 ),
352 )
353 );
354
355 $this->add_responsive_control(
356 'wrapper_desc_padding',
357 array(
358 'label' => __( 'Description Wrapper Padding', 'auxin-elements' ),
359 'type' => Controls_Manager::DIMENSIONS,
360 'size_units' => array( 'px', '%' ),
361 'selectors' => array(
362 '{{WRAPPER}} .aux-shop-desc-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
363 ),
364 )
365 );
366
367 $this->add_responsive_control(
368 'wrapper_btn_padding',
369 array(
370 'label' => __( 'Buttons Wrapper Padding', 'auxin-elements' ),
371 'type' => Controls_Manager::DIMENSIONS,
372 'size_units' => array( 'px', '%' ),
373 'selectors' => array(
374 '{{WRAPPER}} .aux-shop-btns-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
375 ),
376 )
377 );
378
379 $this->end_controls_section();
380
381 /*-----------------------------------------------------------------------------------*/
382 /* title_style_section
383 /*-----------------------------------------------------------------------------------*/
384
385 $this->start_controls_section(
386 'title_style_section',
387 array(
388 'label' => __( 'Title', 'auxin-elements' ),
389 'tab' => Controls_Manager::TAB_STYLE,
390 )
391 );
392
393 $this->start_controls_tabs( 'title_colors' );
394
395 $this->start_controls_tab(
396 'title_color_normal',
397 array(
398 'label' => __( 'Normal' , 'auxin-elements' ),
399 )
400 );
401
402 $this->add_control(
403 'title_color',
404 array(
405 'label' => __( 'Color', 'auxin-elements' ),
406 'type' => Controls_Manager::COLOR,
407 'selectors' => array(
408 '{{WRAPPER}} .auxshp-loop-title, {{WRAPPER}} .woocommerce-loop-product__title' => 'color: {{VALUE}};',
409 ),
410 )
411 );
412
413 $this->end_controls_tab();
414
415 $this->start_controls_tab(
416 'title_color_hover',
417 array(
418 'label' => __( 'Hover' , 'auxin-elements' ),
419 )
420 );
421
422 $this->add_control(
423 'title_hover_color',
424 array(
425 'label' => __( 'Color', 'auxin-elements' ),
426 'type' => Controls_Manager::COLOR,
427 'selectors' => array(
428 '{{WRAPPER}} .auxshp-loop-title:hover, {{WRAPPER}} .woocommerce-loop-product__title:hover' => 'color: {{VALUE}};',
429 ),
430 )
431 );
432
433 $this->end_controls_tab();
434
435 $this->end_controls_tabs();
436
437 $this->add_group_control(
438 Group_Control_Typography::get_type(),
439 array(
440 'name' => 'title_typography',
441 'global' => [
442 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
443 ],
444 'selector' => '{{WRAPPER}} .auxshp-loop-title, {{WRAPPER}} .woocommerce-loop-product__title',
445 )
446 );
447
448 $this->end_controls_section();
449
450 /*-----------------------------------------------------------------------------------*/
451 /* price_style_section
452 /*-----------------------------------------------------------------------------------*/
453
454 $this->start_controls_section(
455 'price_style_section',
456 array(
457 'label' => __( 'Price', 'auxin-elements' ),
458 'tab' => Controls_Manager::TAB_STYLE,
459 )
460 );
461
462 $this->start_controls_tabs( 'price_colors' );
463
464 $this->start_controls_tab(
465 'price_color_normal',
466 array(
467 'label' => __( 'Normal' , 'auxin-elements' ),
468 )
469 );
470
471 $this->add_control(
472 'price_color',
473 array(
474 'label' => __( 'Color', 'auxin-elements' ),
475 'type' => Controls_Manager::COLOR,
476 'selectors' => array(
477 '{{WRAPPER}} .woocommerce-Price-amount' => 'color: {{VALUE}};',
478 ),
479 )
480 );
481
482 $this->end_controls_tab();
483
484 $this->start_controls_tab(
485 'price_color_hover',
486 array(
487 'label' => __( 'Hover' , 'auxin-elements' ),
488 )
489 );
490
491 $this->add_control(
492 'price_hover_color',
493 array(
494 'label' => __( 'Color', 'auxin-elements' ),
495 'type' => Controls_Manager::COLOR,
496 'selectors' => array(
497 '{{WRAPPER}} .woocommerce-Price-amount:hover' => 'color: {{VALUE}};',
498 ),
499 )
500 );
501
502 $this->end_controls_tab();
503
504 $this->end_controls_tabs();
505
506 $this->add_group_control(
507 Group_Control_Typography::get_type(),
508 array(
509 'name' => 'price_typography',
510 'global' => [
511 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
512 ],
513 'selector' => '{{WRAPPER}} .woocommerce-Price-amount',
514 )
515 );
516
517 $this->end_controls_section();
518
519 if ( class_exists( 'AUXSHP') ) {
520
521 /*-----------------------------------------------------------------------------------*/
522 /* info_style_section
523 /*-----------------------------------------------------------------------------------*/
524
525 $this->start_controls_section(
526 'info_style_section',
527 array(
528 'label' => __( 'Product Info', 'auxin-elements' ),
529 'tab' => Controls_Manager::TAB_STYLE,
530 )
531 );
532
533 $this->start_controls_tabs( 'info_colors' );
534
535 $this->start_controls_tab(
536 'info_color_normal',
537 array(
538 'label' => __( 'Normal' , 'auxin-elements' ),
539 )
540 );
541
542 $this->add_control(
543 'info_color',
544 array(
545 'label' => __( 'Color', 'auxin-elements' ),
546 'type' => Controls_Manager::COLOR,
547 'selectors' => array(
548 '{{WRAPPER}} .aux-shop-meta-terms > a' => 'color: {{VALUE}};',
549 ),
550 )
551 );
552
553 $this->end_controls_tab();
554
555 $this->start_controls_tab(
556 'info_color_hover',
557 array(
558 'label' => __( 'Hover' , 'auxin-elements' ),
559 )
560 );
561
562 $this->add_control(
563 'info_hover_color',
564 array(
565 'label' => __( 'Color', 'auxin-elements' ),
566 'type' => Controls_Manager::COLOR,
567 'selectors' => array(
568 '{{WRAPPER}} .aux-shop-meta-terms > a:hover' => 'color: {{VALUE}};',
569 ),
570 )
571 );
572
573 $this->end_controls_tab();
574
575 $this->end_controls_tabs();
576
577 $this->add_group_control(
578 Group_Control_Typography::get_type(),
579 array(
580 'name' => 'info_typography',
581 'global' => [
582 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
583 ],
584 'selector' => '{{WRAPPER}} .aux-shop-meta-terms, {{WRAPPER}} .aux-shop-meta-terms a',
585 )
586 );
587
588 $this->end_controls_section();
589
590 /*-----------------------------------------------------------------------------------*/
591 /* Description Style Section
592 /*-----------------------------------------------------------------------------------*/
593
594 $this->start_controls_section(
595 'desc_style_section',
596 array(
597 'label' => __( 'Description', 'auxin-elements' ),
598 'tab' => Controls_Manager::TAB_STYLE,
599 )
600 );
601
602 $this->start_controls_tabs( 'desc_colors' );
603
604 $this->start_controls_tab(
605 'desc_color_normal',
606 array(
607 'label' => __( 'Normal' , 'auxin-elements' ),
608 )
609 );
610
611 $this->add_control(
612 'desc_color',
613 array(
614 'label' => __( 'Color', 'auxin-elements' ),
615 'type' => Controls_Manager::COLOR,
616 'selectors' => array(
617 '{{WRAPPER}} .aux-shop-desc-wrapper' => 'color: {{VALUE}};',
618 ),
619 )
620 );
621
622 $this->end_controls_tab();
623
624 $this->start_controls_tab(
625 'desc_color_hover',
626 array(
627 'label' => __( 'Hover' , 'auxin-elements' ),
628 )
629 );
630
631 $this->add_control(
632 'desc_hover_color',
633 array(
634 'label' => __( 'Color', 'auxin-elements' ),
635 'type' => Controls_Manager::COLOR,
636 'selectors' => array(
637 '{{WRAPPER}} .aux-shop-desc-wrapper:hover' => 'color: {{VALUE}};',
638 ),
639 )
640 );
641
642 $this->end_controls_tab();
643
644 $this->end_controls_tabs();
645
646 $this->add_group_control(
647 Group_Control_Typography::get_type(),
648 array(
649 'name' => 'desc_typography',
650 'global' => [
651 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
652 ],
653 'selector' => '{{WRAPPER}} .aux-shop-desc-wrapper',
654 )
655 );
656
657 $this->end_controls_section();
658
659 /*-----------------------------------------------------------------------------------*/
660 /* meta_fields_style_section
661 /*-----------------------------------------------------------------------------------*/
662
663 $this->start_controls_section(
664 'meta_fields_section',
665 array(
666 'label' => __( 'Meta Fields', 'auxin-elements' ),
667 'tab' => Controls_Manager::TAB_STYLE,
668 )
669 );
670
671 $this->start_controls_tabs( 'meta_fields_colors' );
672
673 $this->start_controls_tab(
674 'meta_fields_color_normal',
675 array(
676 'label' => __( 'Normal' , 'auxin-elements' ),
677 )
678 );
679
680 $this->add_control(
681 'meta_fields_color',
682 array(
683 'label' => __( 'Color', 'auxin-elements' ),
684 'type' => Controls_Manager::COLOR,
685 'selectors' => array(
686 '{{WRAPPER}} .aux-shop-meta-field span' => 'color: {{VALUE}};',
687 ),
688 )
689 );
690
691 $this->end_controls_tab();
692
693 $this->start_controls_tab(
694 'meta_fields_color_hover',
695 array(
696 'label' => __( 'Hover' , 'auxin-elements' ),
697 )
698 );
699
700 $this->add_control(
701 'meta_fields_hover_color',
702 array(
703 'label' => __( 'Color', 'auxin-elements' ),
704 'type' => Controls_Manager::COLOR,
705 'selectors' => array(
706 '{{WRAPPER}} .aux-shop-meta-field span:hover' => 'color: {{VALUE}};',
707 ),
708 )
709 );
710
711 $this->end_controls_tab();
712
713 $this->end_controls_tabs();
714
715 $this->add_group_control(
716 Group_Control_Typography::get_type(),
717 array(
718 'name' => 'meta_fields_typography',
719 'global' => [
720 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
721 ],
722 'selector' => '{{WRAPPER}} .aux-shop-meta-field span',
723 )
724 );
725
726 $this->add_responsive_control(
727 'meta_fields_padding',
728 array(
729 'label' => __( 'Padding', 'auxin-elements' ),
730 'type' => Controls_Manager::DIMENSIONS,
731 'size_units' => array( 'px', '%' ),
732 'selectors' => array(
733 '{{WRAPPER}} .aux-shop-meta-field' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
734 ),
735 )
736 );
737
738 $this->end_controls_section();
739
740 /*-----------------------------------------------------------------------------------*/
741 /* Rating Style Section
742 /*-----------------------------------------------------------------------------------*/
743
744 $this->start_controls_section(
745 'rating_style_section',
746 array(
747 'label' => __( 'Rating', 'auxin-elements' ),
748 'tab' => Controls_Manager::TAB_STYLE,
749 )
750 );
751
752
753 $this->add_control(
754 'rating_empty_color',
755 array(
756 'label' => __( 'Empty Color', 'auxin-elements' ),
757 'type' => Controls_Manager::COLOR,
758 'selectors' => array(
759 '{{WRAPPER}} .aux-rating-box.aux-star-rating::before' => 'color: {{VALUE}} !important;'
760 )
761 )
762 );
763
764 $this->add_control(
765 'rating_fill_color',
766 array(
767 'label' => __( 'Fill Color', 'auxin-elements' ),
768 'type' => Controls_Manager::COLOR,
769 'selectors' => array(
770 '{{WRAPPER}} .aux-rating-box.aux-star-rating span::before' => 'color: {{VALUE}} !important;'
771 )
772 )
773 );
774
775 $this->add_responsive_control(
776 'rating_size',
777 array(
778 'label' => __( 'Size', 'auxin-elements' ),
779 'type' => Controls_Manager::SLIDER,
780 'size_units' => array( 'px', 'em', 'rem' ),
781 'range' => array(
782 'px' => array(
783 'min' => 1,
784 'max' => 200
785 )
786 ),
787 'selectors' => array(
788 '{{WRAPPER}} .aux-star-rating' => 'font-size: {{SIZE}}{{UNIT}};'
789 )
790 )
791 );
792
793
794 $this->end_controls_section();
795 }
796
797 /*-----------------------------------------------------------------------------------*/
798 /* Badge Style Section
799 /*-----------------------------------------------------------------------------------*/
800
801 $this->start_controls_section(
802 'badge_style_section',
803 array(
804 'label' => __( 'Sales Badge', 'auxin-elements' ),
805 'tab' => Controls_Manager::TAB_STYLE,
806 )
807 );
808
809
810 $this->start_controls_tabs( 'badge_colors' );
811
812 $this->start_controls_tab(
813 'badge_color_normal',
814 array(
815 'label' => __( 'Normal' , 'auxin-elements' ),
816 )
817 );
818
819 $this->add_control(
820 'badge_color',
821 array(
822 'label' => __( 'Color', 'auxin-elements' ),
823 'type' => Controls_Manager::COLOR,
824 'selectors' => array(
825 '{{WRAPPER}} .onsale, {{WRAPPER}} .auxin-onsale-badge' => 'color: {{VALUE}};',
826 ),
827 )
828 );
829
830 $this->end_controls_tab();
831
832 $this->start_controls_tab(
833 'badge_color_hover',
834 array(
835 'label' => __( 'Hover' , 'auxin-elements' ),
836 )
837 );
838
839 $this->add_control(
840 'badge_hover_color',
841 array(
842 'label' => __( 'Color', 'auxin-elements' ),
843 'type' => Controls_Manager::COLOR,
844 'selectors' => array(
845 '{{WRAPPER}} .onsale:hover, {{WRAPPER}} .auxin-onsale-badge:hover' => 'color: {{VALUE}};',
846 ),
847 )
848 );
849
850 $this->end_controls_tab();
851
852 $this->end_controls_tabs();
853
854 $this->add_group_control(
855 Group_Control_Typography::get_type(),
856 array(
857 'name' => 'badge_typography',
858 'global' => [
859 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
860 ],
861 'selector' => '{{WRAPPER}} .onsale, {{WRAPPER}} .auxin-onsale-badge',
862 )
863 );
864
865 $this->add_responsive_control(
866 'wrapper_badge_padding',
867 array(
868 'label' => __( 'Padding', 'auxin-elements' ),
869 'type' => Controls_Manager::DIMENSIONS,
870 'size_units' => array( 'px', '%' ),
871 'selectors' => array(
872 '{{WRAPPER}} .onsale, {{WRAPPER}} .auxin-onsale-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
873 ),
874 )
875 );
876
877 $this->add_group_control(
878 Group_Control_Background::get_type(),
879 array(
880 'name' => 'header_background',
881 'label' => __( 'Background', 'auxin-elements' ),
882 'types' => array( 'classic', 'gradient' ),
883 'selector' => '{{WRAPPER}} .onsale, {{WRAPPER}} .auxin-onsale-badge'
884 )
885 );
886
887 $this->end_controls_section();
888
889 if ( class_exists('AUXSHP') ) {
890 /*-----------------------------------------------------------------------------------*/
891 /* Badge Style Section
892 /*-----------------------------------------------------------------------------------*/
893
894 $this->start_controls_section(
895 'feat_badge_style_section',
896 array(
897 'label' => __( 'Featured Badge', 'auxin-elements' ),
898 'tab' => Controls_Manager::TAB_STYLE,
899 )
900 );
901
902
903 $this->start_controls_tabs( 'feat_badge_colors' );
904
905 $this->start_controls_tab(
906 'feat_badge_color_normal',
907 array(
908 'label' => __( 'Normal' , 'auxin-elements' ),
909 )
910 );
911
912 $this->add_control(
913 'feat_badge_color',
914 array(
915 'label' => __( 'Color', 'auxin-elements' ),
916 'type' => Controls_Manager::COLOR,
917 'selectors' => array(
918 '{{WRAPPER}} .aux-product-featured-badge' => 'color: {{VALUE}};',
919 ),
920 )
921 );
922
923 $this->end_controls_tab();
924
925 $this->start_controls_tab(
926 'feat_badge_color_hover',
927 array(
928 'label' => __( 'Hover' , 'auxin-elements' ),
929 )
930 );
931
932 $this->add_control(
933 'feat_badge_hover_color',
934 array(
935 'label' => __( 'Color', 'auxin-elements' ),
936 'type' => Controls_Manager::COLOR,
937 'selectors' => array(
938 '{{WRAPPER}} .aux-product-featured-badge:hover' => 'color: {{VALUE}};',
939 ),
940 )
941 );
942
943 $this->end_controls_tab();
944
945 $this->end_controls_tabs();
946
947 $this->add_group_control(
948 Group_Control_Typography::get_type(),
949 array(
950 'name' => 'feat_badge_typography',
951 'global' => [
952 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
953 ],
954 'selector' => '{{WRAPPER}} .aux-product-featured-badge',
955 )
956 );
957
958 $this->add_responsive_control(
959 'wrapper_feat_badge_padding',
960 array(
961 'label' => __( 'Padding', 'auxin-elements' ),
962 'type' => Controls_Manager::DIMENSIONS,
963 'size_units' => array( 'px', '%' ),
964 'selectors' => array(
965 '{{WRAPPER}} .aux-product-featured-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
966 ),
967 )
968 );
969
970 $this->add_group_control(
971 Group_Control_Background::get_type(),
972 array(
973 'name' => 'feat_badge_bg',
974 'label' => __( 'Background', 'auxin-elements' ),
975 'types' => array( 'classic', 'gradient' ),
976 'selector' => '{{WRAPPER}} .aux-product-featured-badge'
977 )
978 );
979
980 $this->end_controls_section();
981
982 }
983 /*-----------------------------------------------------------------------------------*/
984 /* Button
985 /*-----------------------------------------------------------------------------------*/
986
987 $this->start_controls_section(
988 'btn_section',
989 array(
990 'label' => __('Button', 'auxin-elements' ),
991 'tab' => Controls_Manager::TAB_STYLE,
992 )
993 );
994
995 $this->start_controls_tabs( 'btn_bg_tab' );
996
997 $this->start_controls_tab(
998 'btn_bg_normal',
999 array(
1000 'label' => __( 'Normal' , 'auxin-elements' )
1001 )
1002 );
1003
1004 $this->add_group_control(
1005 Group_Control_Background::get_type(),
1006 array(
1007 'name' => 'btn',
1008 'label' => __( 'Background', 'auxin-elements' ),
1009 'types' => array( 'classic', 'gradient' ),
1010 'selector' => '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button',
1011 )
1012 );
1013
1014 $this->add_group_control(
1015 Group_Control_Box_Shadow::get_type(),
1016 array(
1017 'name' => 'btn_shadow',
1018 'selector' => '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button'
1019 )
1020 );
1021
1022 $this->add_control(
1023 'btn_text_color',
1024 array(
1025 'label' => __( 'Color', 'auxin-elements' ),
1026 'type' => Controls_Manager::COLOR,
1027 'selectors' => array(
1028 '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button' => 'color: {{VALUE}};',
1029 )
1030 )
1031 );
1032
1033 $this->add_group_control(
1034 Group_Control_Text_Shadow::get_type(),
1035 array(
1036 'name' => 'btn_text_shadow',
1037 'label' => __( 'Text Shadow', 'auxin-elements' ),
1038 'selector' => '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button',
1039 )
1040 );
1041
1042 $this->add_group_control(
1043 Group_Control_Typography::get_type(),
1044 array(
1045 'name' => 'btn_text_typography',
1046 'global' => [
1047 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1048 ],
1049 'selector' => '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button'
1050 )
1051 );
1052
1053 $this->end_controls_tab();
1054
1055 $this->start_controls_tab(
1056 'btn_bg_hover',
1057 array(
1058 'label' => __( 'Hover' , 'auxin-elements' )
1059 )
1060 );
1061
1062 $this->add_group_control(
1063 Group_Control_Background::get_type(),
1064 array(
1065 'name' => 'btn_bg_hover',
1066 'label' => __( 'Background', 'auxin-elements' ),
1067 'types' => array( 'classic', 'gradient' ),
1068 'selector' => '{{WRAPPER}} .add_to_cart_button:hover, {{WRAPPER}} a.button:hover',
1069 )
1070 );
1071
1072 $this->add_group_control(
1073 Group_Control_Box_Shadow::get_type(),
1074 array(
1075 'name' => 'btn_shadow_hover',
1076 'selector' => '{{WRAPPER}} .add_to_cart_button:hover, {{WRAPPER}} a.button:hover'
1077 )
1078 );
1079
1080 $this->add_control(
1081 'btn_text_color_hover',
1082 array(
1083 'label' => __( 'Color', 'auxin-elements' ),
1084 'type' => Controls_Manager::COLOR,
1085 'selectors' => array(
1086 '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button' => 'color: {{VALUE}};',
1087 )
1088 )
1089 );
1090
1091 $this->add_group_control(
1092 Group_Control_Text_Shadow::get_type(),
1093 array(
1094 'name' => 'btn_text_shadow_hover',
1095 'label' => __( 'Text Shadow', 'auxin-elements' ),
1096 'selector' => '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button',
1097 )
1098 );
1099
1100 $this->add_group_control(
1101 Group_Control_Typography::get_type(),
1102 array(
1103 'name' => 'btn_text_typography_hover',
1104 'global' => [
1105 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1106 ],
1107 'selector' => '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button'
1108 )
1109 );
1110
1111 $this->end_controls_tab();
1112
1113 $this->end_controls_tabs();
1114
1115 $this->add_responsive_control(
1116 'btn_padding',
1117 array(
1118 'label' => __( 'Button Padding', 'auxin-elements' ),
1119 'type' => Controls_Manager::DIMENSIONS,
1120 'size_units' => array( 'px', '%' ),
1121 'selectors' => array(
1122 '{{WRAPPER}} .add_to_cart_button, {{WRAPPER}} a.button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1123 ),
1124 )
1125 );
1126
1127 $this->end_controls_section();
1128
1129
1130 }
1131
1132 /**
1133 * Render image box widget output on the frontend.
1134 *
1135 * Written in PHP and used to generate the final HTML.
1136 *
1137 * @since 1.0.0
1138 * @access protected
1139 */
1140 protected function render() {
1141
1142 // Check whether required resources are available
1143 if( ! auxin_is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
1144 auxin_elementor_plugin_missing_notice( array( 'plugin_name' => __( 'WooCommerce', 'auxin-elements' ) ) );
1145 return;
1146 }
1147
1148 $settings = $this->get_settings_for_display();
1149
1150 $args = array(
1151 'desktop_cnum' => $settings['columns'],
1152
1153 // Query section
1154 'product_type' => $settings['product_type'],
1155
1156 // Query section
1157 'cat' => $settings['cat'],
1158 'num' => $settings['num'],
1159 'exclude_without_media' => $settings['exclude_without_media'],
1160 'order_by' => $settings['order_by'],
1161 'order' => $settings['order'],
1162 'include' => $settings['include'],
1163 'exclude' => $settings['exclude'],
1164 'only_products__in' => $settings['only_products__in'],
1165
1166 );
1167
1168 // // get the shortcode base blog page
1169 echo auxin_widget_products_grid_callback( $args );
1170
1171 }
1172
1173 }
1174