PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 4.9.2
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v4.9.2
4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / recently-viewed-products / recently-viewed-products.php
shopengine / widgets / recently-viewed-products Last commit date
screens 1 year ago recently-viewed-products-config.php 4 years ago recently-viewed-products.php 1 year ago
recently-viewed-products.php
1726 lines
1 <?php
2
3 namespace Elementor;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 use ShopEngine\Widgets\Products;
8
9 class Shopengine_Recently_Viewed_Products extends \ShopEngine\Base\Widget {
10
11 public function config() {
12 return new Shopengine_Recently_Viewed_Products_Config();
13 }
14
15 protected function register_controls() {
16 $this->start_controls_section(
17 'general',
18 [
19 'label' => esc_html__('General', 'shopengine'),
20 'tab' => Controls_Manager::TAB_CONTENT,
21 ]
22 );
23
24 $this->add_control(
25 'products_per_page',
26 [
27 'label' => esc_html__('Products Per Page', 'shopengine' ),
28 'type' => Controls_Manager::NUMBER,
29 'default' => 4,
30 ]
31 );
32
33 $this->add_control(
34 'product_order',
35 [
36 'label' => esc_html__('Order', 'shopengine'),
37 'type' => Controls_Manager::SELECT,
38 'default' => 'DESC',
39 'options' => [
40 'ASC' => esc_html__('ASC', 'shopengine'),
41 'DESC' => esc_html__('DESC', 'shopengine'),
42 ],
43 ]
44 );
45
46 $this->add_responsive_control(
47 'column',
48 [
49 'label' => esc_html__('Column', 'shopengine'),
50 'type' => Controls_Manager::NUMBER,
51 'min' => 1,
52 'max' => 12,
53 'step' => 1,
54 'desktop_default' => 4,
55 'tablet_default' => 3,
56 'mobile_default' => 1,
57 'selectors' => [
58 '{{WRAPPER}} .shopengine-recently-viewed-products .recent-viewed-product-list' => 'grid-template-columns: repeat({{VALUE}}, 1fr)',
59 ]
60 ]
61 );
62
63
64 $this->add_control(
65 'shopengine_recently_viewed_product_show_products_heading',
66 [
67 'label' => esc_html__('Products Heading', 'shopengine'),
68 'type' => Controls_Manager::SWITCHER,
69 'label_on' => esc_html__('Show', 'shopengine'),
70 'label_off' => esc_html__('Hide', 'shopengine'),
71 'return_value' => 'yes',
72 'default' => 'no'
73 ]
74 );
75
76 $this->add_control(
77 'shopengine_recently_viewed_product_show_products_heading_title',
78 [
79 'label' => esc_html__('Heading Text', 'shopengine'),
80 'type' => Controls_Manager::TEXT,
81 'default' => 'Recently Viewed Products',
82 'placeholder' => esc_html__('Enter heading text', 'shopengine'),
83 'condition' => [
84 'shopengine_recently_viewed_product_show_products_heading' => 'yes',
85 ],
86 ]
87 );
88
89 $this->add_control(
90 'shopengine_recently_viewed_product_hide_if_products_not_found',
91 [
92 'label' => esc_html__('Hide if no products found', 'shopengine'),
93 'description' => esc_html__('If no products found, hide the widget.', 'shopengine'),
94 'type' => Controls_Manager::SWITCHER,
95 'label_on' => esc_html__('Yes', 'shopengine'),
96 'label_off' => esc_html__('No', 'shopengine'),
97 'return_value' => 'yes',
98 'default' => 'no'
99 ]
100 );
101
102 $this->end_controls_section();
103
104 $this->start_controls_section(
105 'settings',
106 [
107 'label' => esc_html__('Settings', 'shopengine'),
108 'tab' => Controls_Manager::TAB_CONTENT,
109 ]
110 );
111
112
113 $this->add_control(
114 'badge_settings',
115 [
116 'label' => esc_html__( 'Badge:', 'shopengine' ),
117 'type' => Controls_Manager::HEADING,
118 'separator' => 'before',
119 ]
120 );
121
122 $this->add_control(
123 'show_sale',
124 [
125 'label' => esc_html__('Show Sale Badge?', 'shopengine'),
126 'type' => Controls_Manager::SWITCHER,
127 'label_on' => esc_html__('Yes', 'shopengine'),
128 'label_off' => esc_html__('No', 'shopengine'),
129 'return_value' => 'yes',
130 'default' => 'yes',
131 'selectors' => [
132 '{{WRAPPER}} .shopengine-single-product-item .badge.sale' => 'display: inline-block !important;'
133 ],
134 ]
135 );
136
137 $this->add_control(
138 'show_tag',
139 [
140 'label' => esc_html__('Show Tag', 'shopengine'),
141 'type' => Controls_Manager::SWITCHER,
142 'label_on' => esc_html__('Yes', 'shopengine'),
143 'label_off' => esc_html__('No', 'shopengine'),
144 'return_value' => 'yes',
145 'default' => (isset( $default['show_tag']) ? esc_attr($default['show_tag']) : 'yes'),
146 'selectors' => [
147 '{{WRAPPER}} .shopengine-widget .shopengine-recently-viewed-products .shopengine-single-product-item .product-thumb .product-tag-sale-badge .badge.tag' => 'display: inline-block;'
148 ]
149 ]
150 );
151
152 $this->add_control(
153 'badge_position',
154 [
155 'label' => esc_html__( 'Badge Position', 'shopengine' ),
156 'type' => Controls_Manager::CHOOSE,
157 'options' => [
158 'top-left' => [
159 'title' => esc_html__( 'Top Left', 'shopengine' ),
160 'icon' => 'eicon-h-align-left',
161 ],
162 'top-right' => [
163 'title' => esc_html__( 'Top Right', 'shopengine' ),
164 'icon' => 'eicon-h-align-right',
165 ],
166 'custom' => [
167 'title' => esc_html__( 'Custom', 'shopengine' ),
168 'icon' => 'eicon-settings',
169 ],
170 ],
171 'selectors' => [
172 '{{WRAPPER}} .__' => 'position: {{VALUE}};',
173 ],
174 'default' => 'top-right',
175 'toggle' => false,
176 'conditions' => [
177 'relation' => 'or',
178 'terms' => [
179 [
180 'name' => 'show_sale',
181 'operator' => '===',
182 'value' => 'yes'
183 ],
184 [
185 'name' => 'show_tag',
186 'operator' => '===',
187 'value' => 'yes'
188 ]
189 ]
190 ]
191 ]
192 );
193
194 $this->add_control(
195 'badge_position_x_axis',
196 [
197 'label' => esc_html__('Badge Position (X axis)', 'shopengine'),
198 'type' => Controls_Manager::SLIDER,
199 'size_units' => [ 'px', '%' ],
200 'range' => [
201 'px' => [
202 'min' => 0,
203 'max' => 1000,
204 'step' => 1,
205 ],
206 '%' => [
207 'min' => 0,
208 'max' => 100,
209 ],
210 ],
211 'default' => [
212 'unit' => '%',
213 'size' => 4,
214 ],
215 'selectors' => [
216 '{{WRAPPER}} .product-tag-sale-badge' => 'left: {{SIZE}}{{UNIT}};',
217 ],
218 'condition' => [
219 'badge_position' => 'custom',
220 ]
221 ]
222 );
223
224 $this->add_control(
225 'badge_position_y_axis',
226 [
227 'label' => esc_html__('Badge Position (Y axis)', 'shopengine'),
228 'type' => Controls_Manager::SLIDER,
229 'size_units' => [ 'px', '%' ],
230 'range' => [
231 'px' => [
232 'min' => 0,
233 'max' => 1000,
234 'step' => 1,
235 ],
236 '%' => [
237 'min' => 0,
238 'max' => 100,
239 ],
240 ],
241 'default' => [
242 'unit' => '%',
243 'size' => 4,
244 ],
245 'selectors' => [
246 '{{WRAPPER}} .product-tag-sale-badge' => 'top: {{SIZE}}{{UNIT}};',
247 ],
248 'condition' => [
249 'badge_position' => 'custom',
250 ]
251 ]
252 );
253
254 $this->add_control(
255 'badge_align',
256 [
257 'label' => esc_html__( 'Badge Align', 'shopengine' ),
258 'type' => Controls_Manager::CHOOSE,
259 'options' => [
260 'vertical' => [
261 'title' => esc_html__( 'Vertical', 'shopengine' ),
262 'icon' => 'eicon-navigation-vertical',
263 ],
264 'horizontal' => [
265 'title' => esc_html__( 'Horizontal', 'shopengine' ),
266 'icon' => 'eicon-navigation-horizontal',
267 ],
268 ],
269 'default' => 'horizontal',
270 'toggle' => false,
271 'condition' => [
272 'show_sale' => 'yes',
273 ],
274 ]
275 );
276
277 $this->add_control(
278 'container_settings',
279 [
280 'label' => esc_html__( 'Title, Price and Buttons:', 'shopengine' ),
281 'type' => Controls_Manager::HEADING,
282 'separator' => 'before',
283 ]
284 );
285
286 $this->add_control(
287 'shopengine_show_title',
288 [
289 'label' => esc_html__('Show Title?', 'shopengine'),
290 'type' => Controls_Manager::SWITCHER,
291 'label_on' => esc_html__('Show', 'shopengine'),
292 'label_off' => esc_html__('Hide', 'shopengine'),
293 'return_value' => 'block',
294 'default' => 'none',
295 'selectors' => [
296 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item .product-title' => 'display: {{VALUE}};',
297 ],
298 ]
299 );
300
301 $this->add_control(
302 'shopengine_show_price',
303 [
304 'label' => esc_html__('Show Price?', 'shopengine'),
305 'type' => Controls_Manager::SWITCHER,
306 'label_on' => esc_html__('Show', 'shopengine'),
307 'label_off' => esc_html__('Hide', 'shopengine'),
308 'return_value' => 'block',
309 'default' => 'none',
310 'selectors' => [
311 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item .product-price' => 'display: {{VALUE}};',
312 ],
313 ]
314 );
315
316 $this->add_control(
317 'shopengine_group_btns',
318 [
319 'label' => esc_html__('Show Buttons?', 'shopengine'),
320 'type' => Controls_Manager::SWITCHER,
321 'label_on' => esc_html__('Show', 'shopengine'),
322 'label_off' => esc_html__('Hide', 'shopengine'),
323 'return_value' => 'yes',
324 'default' => '',
325 ]
326 );
327
328 $this->add_control(
329 'price_settings',
330 [
331 'label' => esc_html__( 'Button:', 'shopengine' ),
332 'type' => Controls_Manager::HEADING,
333 'separator' => 'before',
334 'condition' => [
335 'shopengine_group_btns' => 'yes',
336 ]
337 ]
338 );
339
340 $this->add_control(
341 'shopengine_cart_button',
342 [
343 'label' => esc_html__('Cart Button', 'shopengine'),
344 'type' => Controls_Manager::SWITCHER,
345 'label_on' => esc_html__('Show', 'shopengine'),
346 'label_off' => esc_html__('Hide', 'shopengine'),
347 'return_value' => 'yes',
348 'default' => 'yes',
349 'selectors' => [
350 '{{WRAPPER}} .shopengine-single-product-item .add-to-cart-bt .button' => 'display: inline-block;',
351 ],
352 'condition' => [
353 'shopengine_group_btns' => 'yes',
354 ]
355 ]
356 );
357
358 $this->add_control(
359 'out_of_stock_product_visibility',
360 [
361 'label' => esc_html__('Out of Stock Visibility', 'shopengine'),
362 'type' => Controls_Manager::SELECT,
363 'default' => 'default',
364 'options' => [
365 'default' => esc_html__('Default', 'shopengine'),
366 'show' => esc_html__('Show', 'shopengine'),
367 'hide' => esc_html__('Hide', 'shopengine')
368 ]
369 ]
370 );
371
372 $this->end_controls_section();
373
374 /**
375 * @params - These are common style sections: wrapper, badge, image, category, title, rating, price, description, cart
376 */
377
378 $this->start_controls_section(
379 'product_wrap_style_section',
380 [
381 'label' => esc_html__('Product Wrap', 'shopengine'),
382 'tab' => Controls_Manager::TAB_STYLE
383 ]
384 );
385
386 $this->add_responsive_control(
387 'shopengine_recent_product_text_align',
388 [
389 'label' => esc_html__('Text Align', 'shopengine'),
390 'type' => Controls_Manager::CHOOSE,
391 'options' => [
392 'left' => [
393 'title' => esc_html__('Left', 'shopengine'),
394 'icon' => 'eicon-text-align-left',
395 ],
396 'center' => [
397 'title' => esc_html__('Center', 'shopengine'),
398 'icon' => 'eicon-text-align-center',
399 ],
400 'right' => [
401 'title' => esc_html__('Right', 'shopengine'),
402 'icon' => 'eicon-text-align-right',
403 ],
404 ],
405 'default' => 'left',
406 'selectors_dictionary' => [
407 'left' => 'text-align: left; justify-content: flex-start;',
408 'center' => 'text-align: center; justify-content: center;',
409 'right' => 'text-align: right; justify-content: flex-end;',
410 ],
411 'selectors' => [
412 '{{WRAPPER}} .shopengine-recently-viewed-products .recent-viewed-product-list :is(.shopengine-single-product-item, .price)' => '{{VALUE}}',
413 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-single-product-item .product-title' => 'text-align:right;',
414 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-single-product-item .product-title' => 'text-align:left;',
415 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-single-product-item .add-to-cart-bt' => 'text-align:right;',
416 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-single-product-item .add-to-cart-bt' => 'text-align:left;',
417 ],
418 'prefix_class' => 'elementor%s-align-',
419 ]
420 );
421
422 $this->add_responsive_control(
423 'product_item_column_gap',
424 [
425 'label' => esc_html__('Column Gap (px)', 'shopengine'),
426 'type' => Controls_Manager::SLIDER,
427 'size_units' => [ 'px' ],
428 'range' => [
429 'px' => [
430 'min' => 0,
431 'max' => 200,
432 ],
433 ],
434 'default' => [
435 'unit' => 'px',
436 'size' => '20',
437 ],
438 'selectors' => [
439 '{{WRAPPER}} .shopengine-recently-viewed-products .recent-viewed-product-list' => 'grid-column-gap: {{SIZE}}{{UNIT}}',
440 ],
441 ]
442 );
443
444 $this->add_responsive_control(
445 'product_item_row_gap',
446 [
447 'label' => esc_html__('Row Gap (px)', 'shopengine'),
448 'type' => Controls_Manager::SLIDER,
449 'size_units' => [ 'px' ],
450 'range' => [
451 'px' => [
452 'min' => 0,
453 'max' => 200,
454 ],
455 ],
456 'default' => [
457 'unit' => 'px',
458 'size' => '20',
459 ],
460 'selectors' => [
461 '{{WRAPPER}} .shopengine-recently-viewed-products .recent-viewed-product-list' => 'grid-row-gap: {{SIZE}}{{UNIT}}',
462 ],
463 ]
464 );
465
466 $this->add_responsive_control(
467 'product_wrap_padding',
468 [
469 'label' => esc_html__( 'Padding (px)', 'shopengine' ),
470 'type' => Controls_Manager::DIMENSIONS,
471 'size_units' => [ 'px' ],
472 'default' => [
473 'top' => 0,
474 'right' => 0,
475 'bottom' => 0,
476 'left' => 0,
477 'unit' => 'px',
478 'isLinked' => true,
479 ],
480 'selectors' => [
481 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item .product-thumb' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
482 '.rtl {{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item .product-thumb' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
483 ],
484 'separator' => 'before',
485 ]
486 );
487
488 $this->add_control(
489 'product_image_bg',
490 [
491 'label' => esc_html__('Image Background', 'shopengine'),
492 'type' => Controls_Manager::COLOR,
493 'alpha' => false,
494 'selectors' => [
495 '{{WRAPPER}} .product-thumb' => 'background: {{VALUE}}',
496 ],
497 ]
498 );
499
500 $this->add_group_control(
501 Group_Control_Border::get_type(),
502 [
503 'name' => 'product_wrap_border',
504 'label' => esc_html__('Border', 'shopengine'),
505 'selector' => '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item',
506 'separator' => 'before',
507 'fields_options' => [
508 'width' => [
509 'selectors' => [
510 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
511 '.rtl {{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}',
512 ]
513 ]
514 ],
515 ]
516 );
517
518 $this->add_control(
519 'shopengine_product_wrap_hide_right_border',
520 [
521 'label' => esc_html__('Hide Right Boder?', 'shopengine'),
522 'description' => esc_html__('If the column gap is zero, you may hide the right border. So that right and left border will not double.', 'shopengine'),
523 'type' => Controls_Manager::SWITCHER,
524 'label_on' => esc_html__('Yes', 'shopengine'),
525 'label_off' => esc_html__('No', 'shopengine'),
526 'return_value' => 'yes',
527 'default' => '',
528 'selectors' => [
529 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-single-product-item:not(:last-child)' => 'border-right: none;',
530 ],
531 'condition' => [
532 'product_wrap_border_border!' => '',
533 ],
534 ]
535 );
536
537 $this->end_controls_section();
538
539 $this->start_controls_section(
540 'product_image_style_section',
541 [
542 'label' => esc_html__('Product Image', 'shopengine'),
543 'tab' => Controls_Manager::TAB_STYLE,
544 ]
545 );
546
547 $this->add_control(
548 'product_image_use_equal_height',
549 [
550 'label' => esc_html__('Use equal height for all image', 'shopengine'),
551 'type' => Controls_Manager::SWITCHER,
552 'label_on' => esc_html__('Yes', 'shopengine'),
553 'label_off' => esc_html__('No', 'shopengine'),
554 'return_value' => 'yes',
555 ]
556 );
557
558 $this->add_control(
559 'product_image_fit',
560 [
561 'label' => esc_html__('Image fit', 'shopengine'),
562 'type' => Controls_Manager::SELECT,
563 'default' => 'contain',
564 'options' => [
565 'contain' => esc_html__('Contain', 'shopengine'),
566 'cover' => esc_html__('Cover', 'shopengine'),
567 ],
568 'selectors' => [
569 '{{WRAPPER}} .shopengine-single-product-item .product-thumb img' => 'object-fit: {{VALUE}};'
570 ],
571 'condition' => [
572 'product_image_use_equal_height' => 'yes'
573 ]
574 ]
575 );
576
577 $this->add_responsive_control(
578 'product_image_height',
579 [
580 'label' => esc_html__( 'Image height', 'shopengine' ),
581 'type' => Controls_Manager::SLIDER,
582 'size_units' => ['px'],
583 'range' => [
584 'px' => [
585 'min' => 0,
586 'max' => 500,
587 ],
588 ],
589 'default' => [
590 'unit' => 'px',
591 'size' => 180,
592 ],
593 'selectors' => [
594 '{{WRAPPER}} .shopengine-single-product-item .product-thumb img' => 'height: {{SIZE}}{{UNIT}};'
595 ],
596 'condition' => [
597 'product_image_use_equal_height' => 'yes'
598 ]
599 ]
600 );
601
602 $this->end_controls_section();
603
604
605 $this->start_controls_section(
606 'product_badge_style_section',
607 [
608 'label' => esc_html__('Product Badge', 'shopengine'),
609 'tab' => Controls_Manager::TAB_STYLE,
610 'conditions' => [
611 'relation' => 'or',
612 'terms' => [
613 [
614 'name' => 'show_sale',
615 'operator' => '===',
616 'value' => 'yes'
617 ],
618 [
619 'name' => 'show_tag',
620 'operator' => '===',
621 'value' => 'yes'
622 ]
623 ]
624 ]
625 ]
626 );
627
628 $this->add_group_control(
629 Group_Control_Typography::get_type(),
630 array(
631 'name' => 'product_badge_typography',
632 'label' => esc_html__('Typography', 'shopengine'),
633 'selector' => '{{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link',
634 'exclude' => ['font_style', 'text_decoration'],
635 'fields_options' => [
636 'typography' => [
637 'default' => 'custom',
638 ],
639 'font_weight' => [
640 'default' => '700',
641 ],
642 'font_size' => [
643 'default' => [
644 'size' => '12',
645 'unit' => 'px'
646 ],
647 'label' => esc_html__('Font Size (px)', 'shopengine'),
648 'size_units' => ['px']
649 ],
650 'text_transform' => [
651 'default' => '',
652 ],
653 'line_height' => [
654 'default' => [
655 'size' => '24',
656 'unit' => 'px'
657 ],
658 'size_units' => ['px'] // enable only px
659 ]
660 ],
661 )
662 );
663
664 $this->add_control(
665 'product_badge_color',
666 [
667 'label' => esc_html__('Color', 'shopengine'),
668 'type' => Controls_Manager::COLOR,
669 'alpha' => false,
670 'default' => '#ffffff',
671 'selectors' => [
672 '{{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'color: {{VALUE}}',
673 ],
674 ]
675 );
676
677 $this->add_control(
678 'product_badge_bg',
679 [
680 'label' => esc_html__('Badge Background', 'shopengine'),
681 'type' => Controls_Manager::COLOR,
682 'default' => '#f03d3f',
683 'alpha' => false,
684 'selectors' => [
685 '{{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'background: {{VALUE}}',
686 ],
687 ]
688 );
689
690 $this->add_control(
691 'product_percentage_badge_bg',
692 [
693 'label' => esc_html__('Percentage Badge Background', 'shopengine'),
694 'type' => Controls_Manager::COLOR,
695 'alpha' => false,
696 'selectors' => [
697 '{{WRAPPER}} .product-tag-sale-badge .off' => 'background: {{VALUE}}',
698 ],
699 ]
700 );
701
702 $this->add_responsive_control(
703 'product_badgey_item_space_between',
704 [
705 'label' => esc_html__( 'Space In-between
706 Item (px)', 'shopengine' ),
707 'type' => Controls_Manager::SLIDER,
708 'size_units' => ['px'],
709 'range' => [
710 'px' => [
711 'min' => 0,
712 'max' => 200,
713 ],
714 ],
715 'default' => [
716 'unit' => 'px',
717 'size' => 2,
718 ],
719 'selectors' => [
720 '{{WRAPPER}} .product-tag-sale-badge ul li:not(:last-child)' => 'margin: 0 {{SIZE}}{{UNIT}} 0 0;',
721 '{{WRAPPER}} .product-tag-sale-badge.align-vertical ul li:not(:last-child)' => 'margin: 0 0 {{SIZE}}{{UNIT}} 0;',
722 ],
723 'separator' => 'before',
724 ]
725 );
726
727 $this->add_responsive_control(
728 'product_badge_padding',
729 [
730 'label' => esc_html__( 'Padding (px)', 'shopengine' ),
731 'type' => Controls_Manager::DIMENSIONS,
732 'size_units' => [ 'px' ],
733 'default' => [
734 'top' => '0',
735 'right' => '10',
736 'bottom' => '0',
737 'left' => '10',
738 'unit' => 'px',
739 'isLinked' => false,
740 ],
741 'selectors' => [
742 '{{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
743 '.rtl {{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
744 ],
745 'separator' => 'before',
746 ]
747 );
748
749 $this->add_responsive_control(
750 'product_badge_margin',
751 [
752 'label' => esc_html__( 'Margin (px)', 'shopengine' ),
753 'type' => Controls_Manager::DIMENSIONS,
754 'size_units' => [ 'px' ],
755 'selectors' => [
756 '{{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
757 '.rtl {{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
758 ],
759 'separator' => 'before',
760 ]
761 );
762
763 $this->add_group_control(
764 Group_Control_Border::get_type(),
765 [
766 'name' => 'badge_border',
767 'label' => esc_html__( 'Border', 'shopengine' ),
768 'selector' => '{{WRAPPER}} .product-tag-sale-badge :is(.tag, a, .no-link, li)',
769 'fields_options' => [
770 'width' => [
771 'selectors' => [
772 '{{WRAPPER}} .product-tag-sale-badge :is(.tag, a, .no-link, li)' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
773 '.rtl {{WRAPPER}} .product-tag-sale-badge :is(.tag, a, .no-link, li)' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}',
774 ]
775 ]
776 ],
777 ]
778 );
779 $this->add_responsive_control(
780 'badge_border_radius',
781 [
782 'label' =>esc_html__( 'Border Radius', 'shopengine' ),
783 'type' => Controls_Manager::DIMENSIONS,
784 'size_units' => [ 'px'],
785 'default' => [
786 'top' => '3',
787 'right' => '3',
788 'bottom' => '3' ,
789 'left' => '3',
790 ],
791 'selectors' => [
792 '{{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
793 '.rtl {{WRAPPER}} .product-tag-sale-badge .tag a, {{WRAPPER}} .product-tag-sale-badge .no-link' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
794 ],
795 ]
796 );
797
798 $this->end_controls_section();
799
800
801 // hover overlay style start
802 $this->start_controls_section(
803 'product_hover_overlay_style_section',
804 [
805 'label' => esc_html__('Product Hover', 'shopengine'),
806 'tab' => Controls_Manager::TAB_STYLE,
807 'condition' => [
808 'hide_product_hover_overlay!' => 'yes'
809 ]
810 ]
811 );
812
813 $this->start_controls_tabs(
814 'product_hover_overlay_color_tabs'
815 );
816
817 $this->start_controls_tab(
818 'product_hover_overlay_color_normal_tab',
819 [
820 'label' => esc_html__('Normal', 'shopengine'),
821 ]
822 );
823
824 $this->add_control(
825 'product_hover_overlay_color',
826 [
827 'label' => esc_html__('Color', 'shopengine'),
828 'type' => Controls_Manager::COLOR,
829 'default' => '#101010',
830 'alpha' => false,
831 'selectors' => [
832 '{{WRAPPER}} .overlay-add-to-cart a::before' => 'color: {{VALUE}};',
833 '{{WRAPPER}} .overlay-add-to-cart a::after' => 'color: {{VALUE}};',
834 ],
835 ]
836 );
837
838 $this->add_control(
839 'product_hover_overlay_bg_color',
840 [
841 'label' => esc_html__('Background Color', 'shopengine'),
842 'type' => Controls_Manager::COLOR,
843 'alpha' => false,
844 'default' => '#ffffff',
845 'selectors' => [
846 '{{WRAPPER}} .overlay-add-to-cart a' => 'background: {{VALUE}};',
847 ],
848 ]
849 );
850
851 $this->end_controls_tab();
852
853 $this->start_controls_tab(
854 'product_hover_overlay_color_hover_tab',
855 [
856 'label' => esc_html__('Hover', 'shopengine'),
857 ]
858 );
859
860 $this->add_control(
861 'product_hover_overlay_hover_color',
862 [
863 'label' => esc_html__('Color', 'shopengine'),
864 'type' => Controls_Manager::COLOR,
865 'default' => '#F03D3F',
866 'alpha' => false,
867 'selectors' => [
868 '{{WRAPPER}} .overlay-add-to-cart a.added::before' => 'color: {{VALUE}};',
869 '{{WRAPPER}} .overlay-add-to-cart a.loading::after' => 'color: {{VALUE}};',
870 '{{WRAPPER}} .overlay-add-to-cart a:hover::before' => 'color: {{VALUE}};',
871 '{{WRAPPER}} .overlay-add-to-cart a:hover::after' => 'color: {{VALUE}};',
872 ],
873 ]
874 );
875
876 $this->add_control(
877 'product_hover_overlay_hover_bg_color',
878 [
879 'label' => esc_html__('Background Color', 'shopengine'),
880 'type' => Controls_Manager::COLOR,
881 'default' => '#ffffff',
882 'alpha' => false,
883 'selectors' => [
884 '{{WRAPPER}} .overlay-add-to-cart a:hover' => 'background: {{VALUE}};',
885 '{{WRAPPER}} .overlay-add-to-cart a:hover' => 'background: {{VALUE}};',
886 ],
887 ]
888 );
889
890 $this->end_controls_tab();
891 $this->end_controls_tabs();
892
893 $this->add_responsive_control(
894 'product_hover_overlay_font_size',
895 [
896 'label' => esc_html__( 'Font Size (px)', 'shopengine' ),
897 'type' => Controls_Manager::SLIDER,
898 'size_units' => ['px'],
899 'range' => [
900 'px' => [
901 'min' => 0,
902 'max' => 200,
903 ],
904 ],
905 'default' => [
906 'unit' => 'px',
907 'size' => 18,
908 ],
909 'selectors' => [
910 '{{WRAPPER}} .overlay-add-to-cart a::before' => 'font-size: {{SIZE}}{{UNIT}};',
911 '{{WRAPPER}} .overlay-add-to-cart a::after' => 'font-size: {{SIZE}}{{UNIT}};',
912 ],
913 'separator' => 'before',
914 ]
915 );
916
917 $this->add_responsive_control(
918 'product_hover_overlay_padding',
919 [
920 'label' => esc_html__( 'Item Padding (px)', 'shopengine' ),
921 'type' => Controls_Manager::DIMENSIONS,
922 'size_units' => [ 'px' ],
923 'default' => [
924 'top' => '10',
925 'right' => '22',
926 'bottom' => '10',
927 'left' => '22',
928 'unit' => 'px',
929 'isLinked' => false,
930 ],
931 'selectors' => [
932 '{{WRAPPER}} .overlay-add-to-cart a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
933 ],
934 'separator' => 'before',
935 ]
936 );
937
938 $this->add_responsive_control(
939 'product_hover_overlay_item_space_between',
940 [
941 'label' => esc_html__( 'Space In-between
942 Items (px)', 'shopengine' ),
943 'type' => Controls_Manager::SLIDER,
944 'size_units' => ['px'],
945 'range' => [
946 'px' => [
947 'min' => 0,
948 'max' => 200,
949 ],
950 ],
951 'default' => [
952 'unit' => 'px',
953 'size' => 0,
954 ],
955 'selectors' => [
956 '{{WRAPPER}} .overlay-add-to-cart.position-bottom a:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
957 '{{WRAPPER}} .overlay-add-to-cart.position-left a:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}};',
958 '{{WRAPPER}} .overlay-add-to-cart.position-right a:not(:last-child)' => 'margin-bottom: {{SIZE}}{{UNIT}};',
959 '{{WRAPPER}} .overlay-add-to-cart.position-center a:not(:nth-child(2n))' => 'margin-right: {{SIZE}}{{UNIT}};',
960 '{{WRAPPER}} .overlay-add-to-cart.position-center a:not(:nth-child(1), :nth-child(2))' => 'margin-top: {{SIZE}}{{UNIT}};',
961 ],
962 'separator' => 'before',
963 ]
964 );
965
966 $this->add_group_control(
967 Group_Control_Border::get_type(),
968 [
969 'name' => 'product_hover_overlay_border',
970 'label' => esc_html__('Border', 'shopengine'),
971 'fields_options' => [
972 'border' => [
973 'default' => '',
974 'selectors' => [
975 '{{SELECTOR}} .overlay-add-to-cart' => 'border-style: {{VALUE}};',
976 '{{SELECTOR}} .overlay-add-to-cart:not(:last-child)' => 'border-style: {{VALUE}};',
977 ],
978 ],
979 'width' => [
980 'default' => [
981 'top' => '0',
982 'right' => '0',
983 'bottom' => '0',
984 'left' => '0',
985 'isLinked' => true,
986 ],
987 'selectors' => [
988 '{{SELECTOR}} .overlay-add-to-cart' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
989 '{{SELECTOR}} .overlay-add-to-cart a:not(:last-child)' => 'border-width: 0 {{RIGHT}}{{UNIT}} 0 0;',
990 '.rtl {{SELECTOR}} .overlay-add-to-cart' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
991 ],
992 ],
993 'color' => [
994 'default' => '#F2F2F2',
995 'alpha' => false,
996 'selectors' => [
997 '{{SELECTOR}} .overlay-add-to-cart' => 'border-color: {{VALUE}};',
998 '{{SELECTOR}} .overlay-add-to-cart a:not(:last-child)' => 'border-color: {{VALUE}};',
999 ],
1000 ]
1001 ],
1002 'separator' => 'before',
1003 ]
1004 );
1005
1006 $this->add_responsive_control(
1007 'product_hover_overlay_border_radius',
1008 [
1009 'label' => esc_html__( 'Border Radius (px)', 'shopengine' ),
1010 'type' => Controls_Manager::DIMENSIONS,
1011 'size_units' => [ 'px' ],
1012 'default' => [
1013 'top' => '5',
1014 'right' => '5',
1015 'bottom' => '0',
1016 'left' => '0',
1017 'unit' => 'px',
1018 'isLinked' => false,
1019 ],
1020 'selectors' => [
1021 '{{WRAPPER}} .overlay-add-to-cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1022 ],
1023 'separator' => 'before',
1024 ]
1025 );
1026
1027 $this->add_responsive_control(
1028 'product_hover_overlay_margin',
1029 [
1030 'label' => esc_html__( 'Wrap Margin (px)', 'shopengine' ),
1031 'type' => Controls_Manager::DIMENSIONS,
1032 'size_units' => [ 'px' ],
1033 'default' => [
1034 'top' => '0',
1035 'right' => '0',
1036 'bottom' => '0',
1037 'left' => '0',
1038 'unit' => 'px',
1039 'isLinked' => false,
1040 ],
1041 'selectors' => [
1042 '{{WRAPPER}} .overlay-add-to-cart' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1043 ],
1044 'separator' => 'before',
1045 ]
1046 );
1047
1048 $this->end_controls_section();
1049 // hover overlay style end
1050
1051 /*
1052 * Style Tab - Products Title
1053 */
1054 $this->start_controls_section(
1055 'shopengine_product_title_section',
1056 [
1057 'label' => esc_html__('Product Title', 'shopengine'),
1058 'tab' => Controls_Manager::TAB_STYLE,
1059 'condition' => [
1060 'shopengine_show_title' => 'block',
1061 ]
1062 ]
1063 );
1064
1065 $this->add_control(
1066 'shopengine_product_title_color',
1067 [
1068 'label' => esc_html__('Color', 'shopengine'),
1069 'type' => Controls_Manager::COLOR,
1070 'default' => '#101010',
1071 'alpha' => false,
1072 'selectors' => [
1073 '{{WRAPPER}} .shopengine-single-product-item .product-title a' => 'color: {{VALUE}};',
1074 ],
1075 ]
1076 );
1077
1078 $this->add_group_control(
1079 Group_Control_Typography::get_type(),
1080 [
1081 'name' => 'shopengine_product_title_typography',
1082 'label' => esc_html__('Typography', 'shopengine'),
1083 'selector' => '{{WRAPPER}} .shopengine-single-product-item .product-title a',
1084 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1085 'fields_options' => [
1086 'typography' => [
1087 'default' => 'custom',
1088 ],
1089 'font_weight' => [
1090 'default' => '500',
1091 ],
1092 'font_size' => [
1093 'label' => esc_html__('Font Size (px)', 'shopengine'),
1094 'default' => [
1095 'size' => '15',
1096 'unit' => 'px',
1097 ],
1098 'size_units' => ['px'],
1099 ],
1100 'text_transform' => [
1101 'default' => 'none',
1102 ],
1103 'line_height' => [
1104 'label' => esc_html__('Line Height (px)', 'shopengine'),
1105 'default' => [
1106 'size' => '20',
1107 'unit' => 'px',
1108 ],
1109 'size_units' => ['px'],
1110 'tablet_default' => [
1111 'unit' => 'px',
1112 ],
1113 'mobile_default' => [
1114 'unit' => 'px',
1115 ],
1116 ],
1117 ],
1118 ]
1119 );
1120
1121 $this->add_responsive_control(
1122 'shopengine_product_title_padding',
1123 [
1124 'label' => esc_html__('Padding (px)', 'shopengine'),
1125 'type' => Controls_Manager::DIMENSIONS,
1126 'size_units' => ['px'],
1127 'default' => [
1128 'top' => '0',
1129 'right' => '5',
1130 'bottom' => '0',
1131 'left' => '5',
1132 'isLinked' => false,
1133 ],
1134 'selectors' => [
1135 '{{WRAPPER}} .shopengine-single-product-item .product-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1136 '.rtl {{WRAPPER}} .shopengine-single-product-item .product-title' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1137 ],
1138 'separator' => 'before',
1139 ]
1140 );
1141
1142 $this->end_controls_section();
1143
1144 /*
1145 * Style Tab - Products Price
1146 */
1147 $this->start_controls_section(
1148 'shopengine_product_price_section',
1149 [
1150 'label' => esc_html__('Product Price', 'shopengine'),
1151 'tab' => Controls_Manager::TAB_STYLE,
1152 'condition' => [
1153 'shopengine_show_price' => 'block',
1154 ]
1155 ]
1156 );
1157
1158 $this->add_control(
1159 'shopengine_product_price_color',
1160 [
1161 'label' => esc_html__('Color', 'shopengine'),
1162 'type' => Controls_Manager::COLOR,
1163 'default' => '#101010',
1164 'alpha' => false,
1165 'selectors' => [
1166 '{{WRAPPER}} .shopengine-single-product-item .product-price :is(.price, .price span, .price .amount)' => 'color: {{VALUE}};',
1167 ],
1168 ]
1169 );
1170
1171 $this->add_control(
1172 'shopengine_product_sale_price_color',
1173 [
1174 'label' => esc_html__('Sale Price Color', 'shopengine'),
1175 'type' => Controls_Manager::COLOR,
1176 'default' => '#101010',
1177 'alpha' => false,
1178 'selectors' => [
1179 '{{WRAPPER}} .shopengine-single-product-item .product-price :is(del span, del .amount)' => 'color: {{VALUE}} !important;',
1180 ],
1181 ]
1182 );
1183
1184 $this->add_group_control(
1185 Group_Control_Typography::get_type(),
1186 [
1187 'name' => 'shopengine_product_price_typography',
1188 'selector' => '{{WRAPPER}} .shopengine-single-product-item .product-price :is(.price, .price .amount, .price ins, .price del)',
1189 'exclude' => ['text_transform', 'text_decoration', 'font_style', 'word_spacing'],
1190 'fields_options' => [
1191 'typography' => [
1192 'default' => 'custom',
1193 ],
1194 'font_weight' => [
1195 'default' => '700',
1196 ],
1197 'font_size' => [
1198 'label' => esc_html__('Font Size (px)', 'shopengine'),
1199 'size_units' => ['px'],
1200 'default' => [
1201 'size' => '18',
1202 'unit' => 'px'
1203 ]
1204 ],
1205 'line_height' => [
1206 'label' => esc_html__('Line Height (px)', 'shopengine'),
1207 'default' => [
1208 'size' => '24',
1209 'unit' => 'px',
1210 ],
1211 'size_units' => ['px'],
1212 'tablet_default' => [
1213 'unit' => 'px',
1214 ],
1215 'mobile_default' => [
1216 'unit' => 'px',
1217 ],
1218 ],
1219 ],
1220 ]
1221 );
1222
1223 $this->add_responsive_control(
1224 'shopengine_product_price_space_between',
1225 [
1226 'label' => esc_html__('Space In-between
1227 (px)', 'shopengine'),
1228 'type' => Controls_Manager::SLIDER,
1229 'size_units' => ['px'],
1230 'default' => [
1231 'size' => 8,
1232 'unit' => 'px'
1233 ],
1234 'range' => [
1235 'px' => [
1236 'min' => 0,
1237 'max' => 100,
1238 ]
1239 ],
1240 'selectors' => [
1241 '{{WRAPPER}} .shopengine-recently-viewed-products .product-price .price del' => 'margin-right: {{SIZE}}{{UNIT}};',
1242 '{{WRAPPER}} .shopengine-recently-viewed-products .product-price .price .shopengine-discount-badge' => 'margin-left: {{SIZE}}{{UNIT}};',
1243 ],
1244 'separator' => 'before',
1245 ]
1246 );
1247
1248 $this->add_responsive_control(
1249 'shopengine_product_price_padding',
1250 [
1251 'label' => esc_html__('Padding (px)', 'shopengine'),
1252 'type' => Controls_Manager::DIMENSIONS,
1253 'size_units' => ['px'],
1254 'default' => [
1255 'top' => '8',
1256 'right' => '5',
1257 'bottom' => '0',
1258 'left' => '5',
1259 'isLinked' => false,
1260 ],
1261 'selectors' => [
1262 '{{WRAPPER}} .shopengine-single-product-item .product-price .price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1263 '.rtl {{WRAPPER}} .shopengine-single-product-item .product-price .price' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1264 ],
1265 'separator' => 'before',
1266 ]
1267 );
1268
1269 /*
1270 * Style Tab - Price Discount Badge
1271 */
1272 $this->add_control(
1273 'shopengine_product_price_discount_badge_style',
1274 [
1275 'label' => esc_html__('Discount Badge', 'shopengine'),
1276 'type' => Controls_Manager::HEADING,
1277 'separator' => 'before',
1278 ]
1279 );
1280
1281 $this->add_control(
1282 'shopengine_product_price_discount_badge_note',
1283 [
1284 'type' => Controls_Manager::RAW_HTML,
1285 'raw' => esc_html__('Discount badge shows when Badges module is on', 'shopengine'),
1286 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1287 ]
1288 );
1289
1290 $this->add_group_control(
1291 Group_Control_Typography::get_type(),
1292 [
1293 'name' => 'shopengine_product_price_discount_badge_typography',
1294 'selector' => '{{WRAPPER}} .shopengine-single-product-item .product-price .price .shopengine-discount-badge',
1295 'exclude' => ['text_decoration', 'font_style', 'letter_spacing'],
1296 'fields_options' => [
1297 'typography' => [
1298 'default' => 'custom',
1299 ],
1300 'font_weight' => [
1301 'default' => '400',
1302 ],
1303 'font_size' => [
1304 'size_units' => ['px'],
1305 'default' => [
1306 'size' => '12',
1307 'unit' => 'px'
1308 ]
1309 ],
1310 'text_transform' => [
1311 'default' => 'uppercase',
1312 ],
1313 'line_height' => [
1314 'size_units' => ['px'],
1315 'default' => [
1316 'size' => '20',
1317 'unit' => 'px'
1318 ]
1319 ],
1320 'letter_spacing' => [
1321 'default' => [
1322 'size' => '',
1323 ]
1324 ],
1325 ],
1326 ]
1327 );
1328
1329 $this->add_control(
1330 'shopengine_product_price_discount_badge_color',
1331 [
1332 'label' => esc_html__('Color', 'shopengine'),
1333 'type' => Controls_Manager::COLOR,
1334 'alpha' => false,
1335 'default' => '#FFFFFF',
1336 'selectors' => [
1337 '{{WRAPPER}} .shopengine-single-product-item .product-price .price .shopengine-discount-badge' => 'color: {{VALUE}};',
1338 ],
1339 ]
1340 );
1341
1342 $this->add_control(
1343 'shopengine_product_price_discount_badge_bg_color',
1344 [
1345 'label' => esc_html__('Background Color', 'shopengine'),
1346 'type' => Controls_Manager::COLOR,
1347 'alpha' => false,
1348 'default' => '#EA4335',
1349 'selectors' => [
1350 '{{WRAPPER}} .shopengine-single-product-item .product-price .price .shopengine-discount-badge' => 'background: {{VALUE}};',
1351 ],
1352 ]
1353 );
1354
1355 $this->add_control(
1356 'shopengine_price_discount_badge_padding',
1357 [
1358 'label' => esc_html__( 'Badge Padding (px)', 'shopengine' ),
1359 'type' => Controls_Manager::DIMENSIONS,
1360 'size_units' => ['px'],
1361 'default' => [
1362 'top' => '0',
1363 'right' => '5',
1364 'bottom' => '0',
1365 'left' => '5',
1366 'isLinked' => false,
1367 ],
1368 'selectors' => [
1369 '{{WRAPPER}} .shopengine-single-product-item .product-price .price .shopengine-discount-badge' => 'padding: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
1370 '.rtl {{WRAPPER}} .shopengine-single-product-item .product-price .price .shopengine-discount-badge' => 'padding: {{TOP}}px {{LEFT}}px {{BOTTOM}}px {{RIGHT}}px;',
1371 ],
1372
1373 ]
1374 );
1375
1376 $this->end_controls_section();
1377
1378 $this->start_controls_section(
1379 'shopengine_recent_product_add_cart_btn_section',
1380 [
1381 'label' => esc_html__('Add To Cart', 'shopengine'),
1382 'tab' => Controls_Manager::TAB_STYLE,
1383 'condition' => [
1384 'shopengine_group_btns' => 'yes',
1385 ]
1386 ]
1387 );
1388
1389 $this->add_control(
1390 'shopengine_recent_product_btns_space_between',
1391 [
1392 'label' => esc_html__('Space In-between (px)', 'shopengine'),
1393 'type' => Controls_Manager::SLIDER,
1394 'size_units' => ['px'],
1395 'range' => [
1396 'px' => [
1397 'min' => 0,
1398 'max' => 50,
1399 'step' => 1,
1400 ],
1401 ],
1402 'default' => [
1403 'unit' => 'px',
1404 'size' => 4,
1405 ],
1406 'selectors' => [
1407 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item .add-to-cart-bt a:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
1408 '.rtl {{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item .add-to-cart-bt a:not(:last-child)' => 'margin-left: {{SIZE}}{{UNIT}};',
1409 ],
1410 ]
1411 );
1412
1413 $this->add_group_control(
1414 Group_Control_Typography::get_type(),
1415 [
1416 'name' => 'shopengine_recent_product_add_cart_typography',
1417 'label' => esc_html__('Typography', 'shopengine'),
1418 'selector' => '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)',
1419 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1420 'fields_options' => [
1421 'typography' => [
1422 'default' => 'custom',
1423 ],
1424 'font_weight' => [
1425 'default' => '500',
1426 ],
1427 'font_size' => [
1428 'default' => [
1429 'size' => '13',
1430 'unit' => 'px',
1431 ],
1432 'size_units' => ['px'],
1433 ],
1434 'text_transform' => [
1435 'default' => 'uppercase',
1436 ],
1437 'line_height' => [
1438 'label' => esc_html__('Line Height (px)', 'shopengine'),
1439 'default' => [
1440 'size' => '18',
1441 'unit' => 'px',
1442 ],
1443 'size_units' => ['px'],
1444 'tablet_default' => [
1445 'unit' => 'px',
1446 ],
1447 'mobile_default' => [
1448 'unit' => 'px',
1449 ],
1450 ],
1451 ],
1452 'separator' => 'before',
1453 ]
1454 );
1455
1456 $this->start_controls_tabs(
1457 'shopengine_recent_product_add_cart_btn_style_tabs',
1458 [
1459 'separator' => 'before',
1460 ]
1461 );
1462
1463 $this->start_controls_tab(
1464 'shopengine_recent_product_add_cart_btn_tab_normal',
1465 [
1466 'label' => esc_html__('Normal', 'shopengine'),
1467 ]
1468 );
1469
1470 $this->add_control(
1471 'shopengine_recent_product_add_cart_btn_color',
1472 [
1473 'label' => esc_html__('Text Color', 'shopengine'),
1474 'type' => Controls_Manager::COLOR,
1475 'default' => '#FFFFFF',
1476 'alpha' => false,
1477 'selectors' => [
1478 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'color: {{VALUE}};',
1479 ],
1480 ]
1481 );
1482
1483 $this->add_control(
1484 'shopengine_recent_product_add_cart_btn_bg_color',
1485 [
1486 'label' => esc_html__('Background Color', 'shopengine'),
1487 'type' => Controls_Manager::COLOR,
1488 'default' => '#3E3E3E',
1489 'alpha' => false,
1490 'selectors' => [
1491 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'background-color: {{VALUE}};',
1492 ],
1493 ]
1494 );
1495
1496 $this->end_controls_tab();
1497
1498 $this->start_controls_tab(
1499 'shopengine_recent_product_add_cart_btn_tab_hover',
1500 [
1501 'label' => esc_html__('Hover', 'shopengine'),
1502 ]
1503 );
1504
1505 $this->add_control(
1506 'shopengine_recent_product_add_cart_btn_hover_color',
1507 [
1508 'label' => esc_html__('Text Color', 'shopengine'),
1509 'type' => Controls_Manager::COLOR,
1510 'default' => '#FFFFFF',
1511 'alpha' => false,
1512 'selectors' => [
1513 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart):hover' => 'color: {{VALUE}};',
1514 ],
1515 ]
1516 );
1517
1518 $this->add_control(
1519 'shopengine_recent_product_add_cart_btn_hover_bg_color',
1520 [
1521 'label' => esc_html__('Background Color', 'shopengine'),
1522 'type' => Controls_Manager::COLOR,
1523 'default' => '#332d2d',
1524 'alpha' => false,
1525 'selectors' => [
1526 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart):hover' => 'background-color: {{VALUE}};',
1527 ],
1528 ]
1529 );
1530
1531 $this->add_control(
1532 'shopengine_recent_product_add_cart_btn_hover_border_color',
1533 [
1534 'label' => esc_html__('Border Color', 'shopengine'),
1535 'type' => Controls_Manager::COLOR,
1536 'selectors' => [
1537 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart):hover' => 'border-color: {{VALUE}};',
1538 ],
1539 ]
1540 );
1541
1542 $this->end_controls_tab();
1543 $this->end_controls_tabs();
1544
1545 $this->add_responsive_control(
1546 'shopengine_recent_product_add_cart_btn_padding',
1547 [
1548 'label' => esc_html__('Padding (px)', 'shopengine'),
1549 'type' => Controls_Manager::DIMENSIONS,
1550 'size_units' => ['px'],
1551 'default' => [
1552 'top' => '8',
1553 'right' => '15',
1554 'bottom' => '8',
1555 'left' => '15',
1556 'unit' => 'px',
1557 'isLinked' => false,
1558 ],
1559 'selectors' => [
1560 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1561 '.rtl {{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1562 ],
1563 'separator' => 'before',
1564 ]
1565 );
1566
1567 $this->add_group_control(
1568 Group_Control_Border::get_type(),
1569 [
1570 'name' => 'shopengine_recent_product_add_cart_border',
1571 'label' => esc_html__('Border', 'shopengine'),
1572 'selector' => '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)',
1573 'separator' => 'before',
1574 'fields_options' => [
1575 'width' => [
1576 'selectors' => [
1577 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1578 '.rtl {{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}',
1579 ]
1580 ]
1581 ],
1582 ]
1583 );
1584
1585 $this->add_control(
1586 'shopengine_recent_product_add_cart_border_radius',
1587 [
1588 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1589 'type' => Controls_Manager::DIMENSIONS,
1590 'size_units' => ['px'],
1591 'default' => [
1592 'top' => '0',
1593 'right' => '0',
1594 'bottom' => '0',
1595 'left' => '0',
1596 'unit' => 'px',
1597 'isLinked' => true,
1598 ],
1599 'selectors' => [
1600 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1601 '.rtl {{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1602 ],
1603 ]
1604 );
1605
1606 $this->add_responsive_control(
1607 'shopengine_recent_product_add_cart_btn_margin',
1608 [
1609 'label' => esc_html__('Margin (px)', 'shopengine'),
1610 'type' => Controls_Manager::DIMENSIONS,
1611 'size_units' => ['px'],
1612 'default' => [
1613 'top' => '0',
1614 'right' => '0',
1615 'bottom' => '0',
1616 'left' => '0',
1617 'isLinked' => false,
1618 ],
1619 'selectors' => [
1620 '{{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1621 '.rtl {{WRAPPER}} .recent-viewed-product-list .shopengine-single-product-item :is(.button, .added_to_cart)' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
1622 ],
1623 'separator' => 'before',
1624 ]
1625 );
1626
1627 $this->end_controls_section();
1628 /*
1629 * Style Tab - Heading text
1630 */
1631 $this->start_controls_section(
1632 'shopengine_recently_viewed_product_heading_text_style',
1633 [
1634 'label' => esc_html__('Heading Text', 'shopengine'),
1635 'tab' => Controls_Manager::TAB_STYLE,
1636 ]
1637 );
1638
1639 $this->add_control(
1640 'shopengine_recently_viewed_product_heading_text_color',
1641 [
1642 'label' => esc_html__('Color', 'shopengine'),
1643 'type' => Controls_Manager::COLOR,
1644 'default' => '#101010',
1645 'alpha' => false,
1646 'selectors' => [
1647 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-recently-viewed-products-heading-title' => 'color: {{VALUE}};',
1648 ],
1649 ]
1650 );
1651
1652 $this->add_group_control(
1653 Group_Control_Typography::get_type(),
1654 [
1655 'name' => 'shopengine_recently_viewed_product_heading_text_typography',
1656 'label' => esc_html__('Typography', 'shopengine'),
1657 'selector' => '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-recently-viewed-products-heading-title',
1658 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1659 'fields_options' => [
1660 'font_weight' => [
1661 'default' => '600',
1662 ],
1663 'font_size' => [
1664 'label' => esc_html__('Font Size (px)', 'shopengine'),
1665 'default' => [
1666 'size' => '28',
1667 'unit' => 'px',
1668 ],
1669 'size_units' => ['px'],
1670 ],
1671 'text_transform' => [
1672 'default' => 'none',
1673 ],
1674 'line_height' => [
1675 'label' => esc_html__('Line Height (px)', 'shopengine'),
1676 'default' => [
1677 'size' => '20',
1678 'unit' => 'px',
1679 ],
1680 'size_units' => ['px'],
1681 'tablet_default' => [
1682 'unit' => 'px',
1683 ],
1684 'mobile_default' => [
1685 'unit' => 'px',
1686 ],
1687 ],
1688 ],
1689 ]
1690 );
1691
1692 $this->add_responsive_control(
1693 'shopengine_recently_viewed_product_heading_text_padding',
1694 [
1695 'label' => esc_html__('Padding (px)', 'shopengine'),
1696 'type' => Controls_Manager::DIMENSIONS,
1697 'size_units' => ['px'],
1698 'default' => [
1699 'top' => '0',
1700 'right' => '0',
1701 'bottom' => '8',
1702 'left' => '0',
1703 'isLinked' => false,
1704 ],
1705 'selectors' => [
1706 '{{WRAPPER}} .shopengine-recently-viewed-products .shopengine-recently-viewed-products-heading-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1707 '.rtl {{WRAPPER}} .shopengine-recently-viewed-products .shopengine-recently-viewed-products-heading-title' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1708 ],
1709 'separator' => 'before',
1710 ]
1711 );
1712
1713 $this->end_controls_section();
1714 }
1715
1716 protected function screen() {
1717 $settings = $this->get_settings_for_display();
1718
1719 $post_type = get_post_type();
1720 $product = Products::instance()->get_product($post_type);
1721 $tpl = Products::instance()->get_widget_template($this->get_name());
1722
1723 include $tpl;
1724 }
1725 }
1726