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 / up-sells / up-sells.php
shopengine / widgets / up-sells Last commit date
screens 5 days ago up-sells-config.php 4 years ago up-sells.php 1 year ago
up-sells.php
1774 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9 class ShopEngine_Up_Sells extends \ShopEngine\Base\Widget
10 {
11
12 public function config() {
13 return new ShopEngine_Up_Sells_Config();
14 }
15
16 protected function register_controls() {
17
18 /*
19 * Content Tab
20 */
21 $this->start_controls_section(
22 'shopengine_up_sells_product_content_section',
23 [
24 'label' => esc_html__('Content', 'shopengine'),
25 'tab' => Controls_Manager::TAB_CONTENT,
26 ]
27 );
28
29 $this->add_control(
30 'shopengine_up_sells_product_enable_slider',
31 [
32 'label' => esc_html__('Enable Slider', 'shopengine'),
33 'type' => Controls_Manager::SWITCHER,
34 'label_on' => esc_html__('Yes', 'shopengine'),
35 'label_off' => esc_html__('No', 'shopengine'),
36 'return_value' => 'yes',
37 'default' => 'yes',
38 'separator' => 'before',
39 'description' => esc_html__('Slider dosen\'t work if up-sells products and products to show is smaller than or equal to slides per view.', 'shopengine'),
40 ]
41 );
42
43 $this->add_control(
44 'shopengine_up_sells_product_show_flash_sale',
45 [
46 'label' => esc_html__('Flash Sale', 'shopengine'),
47 'type' => Controls_Manager::SWITCHER,
48 'label_on' => esc_html__('Show', 'shopengine'),
49 'label_off' => esc_html__('Hide', 'shopengine'),
50 'return_value' => 'yes',
51 'default' => 'yes',
52 'selectors' => [
53 '{{WRAPPER}} .shopengine-up-sells .up-sells .onsale' => 'display: block;',
54 ],
55 ]
56 );
57
58 $this->add_control(
59 'shopengine_up_sells_product_show_sale_price',
60 [
61 'label' => esc_html__('Sale Price', 'shopengine'),
62 'type' => Controls_Manager::SWITCHER,
63 'label_on' => esc_html__('Show', 'shopengine'),
64 'label_off' => esc_html__('Hide', 'shopengine'),
65 'return_value' => 'yes',
66 'default' => 'yes',
67 'selectors' => [
68 '{{WRAPPER}} .shopengine-up-sells .up-sells .price del' => 'display: inline-block;',
69 ],
70 ]
71 );
72
73 $this->add_control(
74 'shopengine_up_sells_product_show_cart_btn',
75 [
76 'label' => esc_html__('Cart Button', 'shopengine'),
77 'type' => Controls_Manager::SWITCHER,
78 'label_on' => esc_html__('Show', 'shopengine'),
79 'label_off' => esc_html__('Hide', 'shopengine'),
80 'return_value' => 'yes',
81 'default' => 'yes',
82 'selectors' => [
83 '{{WRAPPER}} .shopengine-up-sells .up-sells .button' => 'display: block;',
84 ],
85 ]
86 );
87
88 $this->add_control(
89 'shopengine_up_sells_product_to_show',
90 [
91 'label' => esc_html__('Products to Show', 'shopengine'),
92 'description' => esc_html__('How many products want show in total.', 'shopengine'),
93 'type' => Controls_Manager::NUMBER,
94 'default' => 4,
95 'min' => 1,
96 'max' => 50,
97 'separator' => 'before',
98 ]
99 );
100
101 $this->add_responsive_control(
102 'shopengine_up_sells_product_columns',
103 [
104 'label' => esc_html__('Columns', 'shopengine'),
105 'description' => esc_html__('How many products want show per row.', 'shopengine'),
106 'type' => Controls_Manager::NUMBER,
107 'default' => 4,
108 'tablet_default' => 2,
109 'mobile_default' => 1,
110 'min' => 1,
111 'max' => 12,
112 'selectors' => [
113 '{{WRAPPER}} .shopengine-up-sells ul.products' => 'display: grid; grid-template-columns: repeat({{SIZE}}, 1fr) !important;',
114 ],
115 'condition' => [
116 'shopengine_up_sells_product_enable_slider!' => 'yes',
117 ],
118 ]
119 );
120
121 $this->add_control(
122 'shopengine_up_sells_product_show_products_heading',
123 [
124 'label' => esc_html__('Products Heading', 'shopengine'),
125 'type' => Controls_Manager::SWITCHER,
126 'label_on' => esc_html__('Show', 'shopengine'),
127 'label_off' => esc_html__('Hide', 'shopengine'),
128 'return_value' => 'yes',
129 'default' => 'no'
130 ]
131 );
132
133 $this->add_control(
134 'shopengine_up_sells_product_show_products_heading_title',
135 [
136 'label' => esc_html__('Heading Text', 'shopengine'),
137 'type' => Controls_Manager::TEXT,
138 'default' => 'Upsell Products',
139 'placeholder' => esc_html__('Enter heading text', 'shopengine'),
140 'condition' => [
141 'shopengine_up_sells_product_show_products_heading' => 'yes',
142 ],
143 ]
144 );
145
146 $this->end_controls_section();
147
148 /*
149 * Content Tab - Slider Controls
150 */
151 $this->start_controls_section(
152 'shopengine_up_sells_product_slider_controls_section',
153 [
154 'label' => esc_html__('Slider Controls', 'shopengine'),
155 'tab' => Controls_Manager::TAB_CONTENT,
156 'condition' => [
157 'shopengine_up_sells_product_enable_slider' => 'yes',
158 ],
159 ]
160 );
161
162 $this->add_control(
163 'shopengine_up_sells_product_slider_perview',
164 [
165 'label' => esc_html__('Slides Per View', 'shopengine'),
166 'type' => Controls_Manager::NUMBER,
167 'default' => 4,
168 'min' => 1,
169 'max' => 12,
170 'description' => esc_html__('This value will be the number of slides to show in viewport.', 'shopengine'),
171 ]
172 );
173
174 $this->add_control(
175 'shopengine_up_sells_product_slider_loop',
176 [
177 'label' => esc_html__('Loop', 'shopengine'),
178 'type' => Controls_Manager::SWITCHER,
179 'label_on' => esc_html__('Yes', 'shopengine'),
180 'label_off' => esc_html__('No', 'shopengine'),
181 'default' => 'yes',
182 'return_value' => 'yes',
183 ]
184 );
185
186 $this->add_control(
187 'shopengine_up_sells_product_slider_autoplay',
188 [
189 'label' => esc_html__('Autoplay', 'shopengine'),
190 'type' => Controls_Manager::SWITCHER,
191 'label_on' => esc_html__('Yes', 'shopengine'),
192 'label_off' => esc_html__('No', 'shopengine'),
193 'default' => 'yes',
194 'return_value' => 'yes',
195 ]
196 );
197
198 $this->add_control(
199 'shopengine_up_sells_product_slider_autoplay_delay',
200 [
201 'label' => esc_html__('Slide Speed', 'shopengine'),
202 'type' => Controls_Manager::NUMBER,
203 'default' => 3000,
204 'min' => 0,
205 'max' => 10000,
206 'condition' => [
207 'shopengine_up_sells_product_slider_autoplay' => 'yes',
208 ],
209 ]
210 );
211
212 $this->add_control(
213 'shopengine_up_sells_product_slider_show_arrows',
214 [
215 'label' => esc_html__('Show Arrows', 'shopengine'),
216 'type' => Controls_Manager::SWITCHER,
217 'label_off' => esc_html__('Hide', 'shopengine'),
218 'label_on' => esc_html__('Show', 'shopengine'),
219 'default' => 'yes',
220 'return_value' => 'yes',
221 ]
222 );
223
224 $this->add_control(
225 'shopengine_up_sells_product_slider_show_dots',
226 [
227 'label' => esc_html__('Show Dots', 'shopengine'),
228 'type' => Controls_Manager::SWITCHER,
229 'label_off' => esc_html__('Hide', 'shopengine'),
230 'label_on' => esc_html__('Show', 'shopengine'),
231 'default' => 'yes',
232 'return_value' => 'yes',
233 ]
234 );
235
236
237 $this->add_control(
238 'shopengine_up_sells_product_slider_left_arrow_icon',
239 [
240 'label' => esc_html__('Left Arrow', 'shopengine'),
241 'type' => Controls_Manager::ICONS,
242 'fa4compatibility' => 'icon',
243 'default' => [
244 'value' => 'fas fa-chevron-left',
245 'library' => 'fa-solid',
246 ],
247 'condition' => [
248 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
249 ],
250 ]
251 );
252
253 $this->add_control(
254 'shopengine_up_sells_product_slider_right_arrow_icon',
255 [
256 'label' => esc_html__('Right Arrow', 'shopengine'),
257 'type' => Controls_Manager::ICONS,
258 'fa4compatibility' => 'icon',
259 'default' => [
260 'value' => 'fas fa-chevron-right',
261 'library' => 'fa-solid',
262 ],
263 'condition' => [
264 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
265 ],
266 ]
267 );
268
269 $this->add_control(
270 'shopengine_up_sells_product_slider_dots_size',
271 [
272 'label' => esc_html__('Dots Size (px)', 'shopengine'),
273 'type' => Controls_Manager::SLIDER,
274 'size_units' => ['px'],
275 'range' => [
276 'px' => [
277 'min' => 0,
278 'max' => 50,
279 'step' => 1,
280 ],
281 ],
282 'default' => [
283 'unit' => 'px',
284 'size' => 6,
285 ],
286 'selectors' => [
287 '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};',
288 ],
289 'condition' => [
290 'shopengine_up_sells_product_slider_show_dots' => 'yes',
291 ],
292 'separator' => 'before',
293 ]
294 );
295
296 $this->add_control(
297 'shopengine_up_sells_product_slider_dots_size_active',
298 [
299 'label' => esc_html__('Active Dots Size (px)', 'shopengine'),
300 'type' => Controls_Manager::SLIDER,
301 'size_units' => ['px'],
302 'range' => [
303 'px' => [
304 'min' => 0,
305 'max' => 50,
306 'step' => 1,
307 ],
308 ],
309 'default' => [
310 'unit' => 'px',
311 'size' => 15,
312 ],
313 'selectors' => [
314 '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet.swiper-pagination-bullet-active' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};',
315 ],
316 'condition' => [
317 'shopengine_up_sells_product_slider_show_dots' => 'yes',
318 ],
319 ]
320 );
321
322 $this->end_controls_section();
323
324 /*
325 * Content Tab - Advanced Slider Controls
326 */
327 $this->start_controls_section(
328 'shopengine_up_sells_product_advance_controls',
329 [
330 'label' => esc_html__('Advanced', 'shopengine'),
331 'tab' => Controls_Manager::TAB_CONTENT,
332 ]
333 );
334
335 $this->add_control(
336 'shopengine_up_sells_product_orderby',
337 [
338 'label' => esc_html__('Order By', 'shopengine'),
339 'type' => Controls_Manager::SELECT,
340 'default' => 'rand',
341 'options' => [
342 'date' => esc_html__('Date', 'shopengine'),
343 'title' => esc_html__('Title', 'shopengine'),
344 'price' => esc_html__('Price', 'shopengine'),
345 'popularity' => esc_html__('Popularity', 'shopengine'),
346 'rating' => esc_html__('Rating', 'shopengine'),
347 'rand' => esc_html__('Random', 'shopengine'),
348 'menu_order' => esc_html__('Menu Order', 'shopengine'),
349 'modified' => esc_html__('Modified Date', 'shopengine'),
350 ],
351 ]
352 );
353
354 $this->add_control(
355 'shopengine_up_sells_product_order',
356 [
357 'label' => esc_html__('Order', 'shopengine'),
358 'type' => Controls_Manager::SELECT,
359 'default' => 'desc',
360 'options' => [
361 'desc' => esc_html__('DESC', 'shopengine'),
362 'asc' => esc_html__('ASC', 'shopengine'),
363 ],
364 ]
365 );
366
367 $this->end_controls_section();
368
369 /*
370 * Style Tab - Products Wrap
371 */
372 $this->start_controls_section(
373 'shopengine_up_sells_product_items_section',
374 [
375 'label' => esc_html__('Items', 'shopengine'),
376 'tab' => Controls_Manager::TAB_STYLE,
377 ]
378 );
379
380 $this->add_responsive_control(
381 'shopengine_up_sells_product_text_align',
382 [
383 'label' => esc_html__('Text Align', 'shopengine'),
384 'type' => Controls_Manager::CHOOSE,
385 'options' => [
386 'left' => [
387 'title' => esc_html__('Left', 'shopengine'),
388 'icon' => 'eicon-text-align-left',
389 ],
390 'center' => [
391 'title' => esc_html__('Center', 'shopengine'),
392 'icon' => 'eicon-text-align-center',
393 ],
394 'right' => [
395 'title' => esc_html__('Right', 'shopengine'),
396 'icon' => 'eicon-text-align-right',
397 ],
398 ],
399 'default' => 'left',
400 'selectors_dictionary' => [
401 'left' => 'text-align: left; justify-content: flex-start;',
402 'center' => 'text-align: center; justify-content: center;',
403 'right' => 'text-align: right; justify-content: flex-end;',
404 ],
405 'selectors' => [
406 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.product, .price)' => '{{VALUE}}',
407 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-up-sells .up-sells :is(.product, .price)' => 'text-align:right;',
408 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-up-sells .up-sells :is(.product, .price)' => 'text-align:left;'
409 ],
410 'prefix_class' => 'elementor%s-align-',
411 ]
412 );
413
414 $this->add_responsive_control(
415 'shopengine_up_sells_product_column_gap',
416 [
417 'label' => esc_html__('Column Gap (px)', 'shopengine'),
418 'type' => Controls_Manager::SLIDER,
419 'size_units' => ['px'],
420 'range' => [
421 'px' => [
422 'min' => 0,
423 'max' => 100,
424 'step' => 1,
425 ],
426 ],
427 'default' => [
428 'unit' => 'px',
429 'size' => 30,
430 ],
431 'selectors' => [
432 '{{WRAPPER}} .shopengine-up-sells.slider-disabled ul.products' => 'grid-gap: {{SIZE}}{{UNIT}};',
433 '.elementor-editor-active {{WRAPPER}} .shopengine-up-sells.slider-enabled ul.products > li' => 'margin-right: {{SIZE}}{{UNIT}} !important;',
434 ]
435 ]
436 );
437
438 $this->add_control(
439 'shopengine_up_sells_product_buttons',
440 [
441 'label' => esc_html__( 'Buttons', 'shopengine' ),
442 'type' => Controls_Manager::HEADING,
443 'separator' => 'before',
444 ]
445 );
446
447 $this->add_control(
448 'shopengine_up_sells_product_btns_space_between',
449 [
450 'label' => esc_html__('Space In-between (px)', 'shopengine'),
451 'type' => Controls_Manager::SLIDER,
452 'size_units' => ['px'],
453 'range' => [
454 'px' => [
455 'min' => 0,
456 'max' => 50,
457 'step' => 1,
458 ],
459 ],
460 'default' => [
461 'unit' => 'px',
462 'size' => 10,
463 ],
464 'selectors' => [
465 '{{WRAPPER}} .shopengine-up-sells .up-sells .products li a:not(.woocommerce-LoopProduct-link, :last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
466 ],
467 ]
468 );
469
470
471 $this->end_controls_section();
472
473 /*
474 * Style Tab - Flash Sale
475 */
476 $this->start_controls_section(
477 'shopengine_up_sells_product_flash_sale',
478 [
479 'label' => esc_html__('Flash Sale', 'shopengine'),
480 'tab' => Controls_Manager::TAB_STYLE,
481 'condition' => [
482 'shopengine_up_sells_product_show_flash_sale' => 'yes',
483 ],
484 ]
485 );
486
487 $this->add_control(
488 'shopengine_up_sells_product_flash_sale_color',
489 [
490 'label' => esc_html__('Color', 'shopengine'),
491 'type' => Controls_Manager::COLOR,
492 'default' => '#FFFFFF',
493 'alpha' => false,
494 'selectors' => [
495 '{{WRAPPER}} .shopengine-up-sells .onsale' => 'color: {{VALUE}};',
496 ],
497 ]
498 );
499
500 $this->add_control(
501 'shopengine_up_sells_product_flash_sale_bg_color',
502 [
503 'label' => esc_html__('Background Color', 'shopengine'),
504 'type' => Controls_Manager::COLOR,
505 'default' => '#4285f4',
506 'alpha' => false,
507 'selectors' => [
508 '{{WRAPPER}} .shopengine-up-sells .onsale' => 'background-color: {{VALUE}};',
509 ],
510 ]
511 );
512
513 $this->add_group_control(
514 Group_Control_Typography::get_type(),
515 [
516 'name' => 'shopengine_up_sells_product_flash_sale_badge_typography',
517 'label' => esc_html__('Typography', 'shopengine'),
518 'selector' => '{{WRAPPER}} .shopengine-up-sells .onsale',
519 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
520 'fields_options' => [
521 'typography' => [
522 'default' => 'custom',
523 ],
524 'font_weight' => [
525 'default' => '400',
526 ],
527 'font_size' => [
528 'label' => esc_html__('Font Size (px)', 'shopengine'),
529 'default' => [
530 'size' => '12',
531 'unit' => 'px',
532 ],
533 'size_units' => ['px'],
534 ],
535 'text_transform' => [
536 'default' => '',
537 ],
538 'line_height' => [
539 'label' => esc_html__('Line Height (px)', 'shopengine'),
540 'default' => [
541 'size' => '44',
542 'unit' => 'px',
543 ],
544 'size_units' => ['px'],
545 'tablet_default' => [
546 'unit' => 'px',
547 ],
548 'mobile_default' => [
549 'unit' => 'px',
550 ],
551 ],
552 ],
553 ]
554 );
555
556 $this->add_responsive_control(
557 'shopengine_up_sells_product_flash_sale_badge_size',
558 [
559 'label' => esc_html__('Badge Size (px)', 'shopengine'),
560 'type' => Controls_Manager::SLIDER,
561 'size_units' => ['px'],
562 'range' => [
563 'px' => [
564 'min' => 0,
565 'max' => 100,
566 'step' => 1,
567 ],
568 ],
569 'default' => [
570 'unit' => 'px',
571 'size' => 44,
572 ],
573 'selectors' => [
574 '{{WRAPPER}} .shopengine-up-sells .onsale' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
575 ],
576 'separator' => 'before',
577 ]
578 );
579
580 $this->add_responsive_control(
581 'shopengine_up_sells_product_flash_sale_badge_border_radius',
582 [
583 'label' => esc_html__('Badge Border Radius (px)', 'shopengine'),
584 'type' => Controls_Manager::SLIDER,
585 'size_units' => ['px'],
586 'range' => [
587 'px' => [
588 'min' => 0,
589 'max' => 100,
590 'step' => 1,
591 ],
592 ],
593 'default' => [
594 'unit' => 'px',
595 'size' => 100,
596 ],
597 'selectors' => [
598 '{{WRAPPER}} .shopengine-up-sells .onsale' => 'border-radius: {{SIZE}}{{UNIT}};',
599 ],
600 ]
601 );
602
603 $this->add_responsive_control(
604 'shopengine_up_sells_product_flash_sale_padding',
605 [
606 'label' => esc_html__('Padding (px)', 'shopengine'),
607 'type' => Controls_Manager::DIMENSIONS,
608 'size_units' => ['px'],
609 'default' => [
610 'top' => '0',
611 'right' => '0',
612 'bottom' => '0',
613 'left' => '0',
614 'unit' => 'px',
615 'isLinked' => true,
616 ],
617 'selectors' => [
618 '{{WRAPPER}} .shopengine-up-sells .onsale' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
619 '.rtl {{WRAPPER}} .shopengine-up-sells .onsale' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
620 ],
621 'separator' => 'before',
622 ]
623 );
624
625 $this->add_responsive_control(
626 'shopengine_up_sells_product_flash_sale_position',
627 [
628 'label' => esc_html__('Position', 'shopengine'),
629 'type' => Controls_Manager::CHOOSE,
630 'options' => [
631 'left' => [
632 'title' => esc_html__('Left', 'shopengine'),
633 'icon' => 'eicon-h-align-left',
634 ],
635 'right' => [
636 'title' => esc_html__('Right', 'shopengine'),
637 'icon' => 'eicon-h-align-right',
638 ],
639 ],
640 'default' => 'left',
641 'separator' => 'before'
642 ]
643 );
644
645 $this->add_responsive_control(
646 'shopengine_up_sells_product_flash_sale_position_horizontal',
647 [
648 'label' => esc_html__('Horizontal', 'shopengine'),
649 'type' => Controls_Manager::SLIDER,
650 'size_units' => ['px', '%'],
651 'range' => [
652 'px' => [
653 'min' => -100,
654 'max' => 100,
655 'step' => 5,
656 ],
657 '%' => [
658 'min' => 0,
659 'max' => 100,
660 ],
661 ],
662 'default' => [
663 'unit' => 'px',
664 'size' => 20,
665 ],
666 'selectors' => [
667 '{{WRAPPER}} .shopengine-up-sells .up-sells .onsale' => '{{shopengine_up_sells_product_flash_sale_position.VALUE}}: {{SIZE}}{{UNIT}};',
668 ],
669 ]
670 );
671
672 $this->add_responsive_control(
673 'shopengine_up_sells_product_flash_sale_position_vertical',
674 [
675 'label' => esc_html__('Vertical', 'shopengine'),
676 'type' => Controls_Manager::SLIDER,
677 'size_units' => ['px', '%'],
678 'range' => [
679 'px' => [
680 'min' => -100,
681 'max' => 100,
682 'step' => 5,
683 ],
684 '%' => [
685 'min' => 0,
686 'max' => 100,
687 ],
688 ],
689 'default' => [
690 'unit' => 'px',
691 'size' => 20,
692 ],
693 'selectors' => [
694 '{{WRAPPER}} .shopengine-up-sells .up-sells .onsale' => 'top: {{SIZE}}{{UNIT}};',
695 ],
696 ]
697 );
698
699 $this->end_controls_section();
700
701 /*
702 * Style Tab - Products Image
703 */
704 $this->start_controls_section(
705 'shopengine_up_sells_product_image_section',
706 [
707 'label' => esc_html__('Image', 'shopengine'),
708 'tab' => Controls_Manager::TAB_STYLE,
709 ]
710 );
711
712 $this->add_control(
713 'shopengine_up_sells_product_image_bg_color',
714 [
715 'label' => esc_html__('Background Color', 'shopengine'),
716 'type' => Controls_Manager::COLOR,
717 'alpha' => false,
718 'selectors' => [
719 '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'background-color: {{VALUE}};',
720 ],
721 ]
722 );
723
724 $this->add_responsive_control(
725 'shopengine_up_sells_product_image_height',
726 [
727 'label' => esc_html__('Height (px)', 'shopengine'),
728 'description' => esc_html__('Leave empty for auto height', 'shopengine'),
729 'type' => Controls_Manager::SLIDER,
730 'size_units' => ['px'],
731 'range' => [
732 'px' => [
733 'min' => 0,
734 'max' => 500,
735 'step' => 5,
736 ],
737 ],
738 'default' => [
739 'size' => '',
740 ],
741 'selectors' => [
742 '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'height: {{SIZE}}{{UNIT}} !important;',
743 ],
744 ]
745 );
746
747 $this->add_control(
748 'shopengine_related_image_auto_fit',
749 [
750 'label' => esc_html__('Auto Image Fit', 'shopengine'),
751 'type' => Controls_Manager::SWITCHER,
752 'default' => false,
753 'return_value' => true,
754 'selectors' => [
755 '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'object-fit: cover; object-position:center center',
756 ],
757 ]
758 );
759
760
761 $this->add_responsive_control(
762 'shopengine_up_sells_product_image_padding',
763 [
764 'label' => esc_html__('Padding (px)', 'shopengine'),
765 'type' => Controls_Manager::DIMENSIONS,
766 'size_units' => ['px'],
767 'default' => [
768 'top' => '0',
769 'right' => '0',
770 'bottom' => '8',
771 'left' => '0',
772 'isLinked' => false,
773 ],
774 'selectors' => [
775 '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
776 '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
777 ],
778 'separator' => 'before',
779 ]
780 );
781
782 $this->end_controls_section();
783
784 /*
785 * Style Tab - Products Title
786 */
787 $this->start_controls_section(
788 'shopengine_up_sells_product_title_section',
789 [
790 'label' => esc_html__('Title', 'shopengine'),
791 'tab' => Controls_Manager::TAB_STYLE,
792 ]
793 );
794
795 $this->add_control(
796 'shopengine_up_sells_product_title_color',
797 [
798 'label' => esc_html__('Color', 'shopengine'),
799 'type' => Controls_Manager::COLOR,
800 'default' => '#101010',
801 'alpha' => false,
802 'selectors' => [
803 '{{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title' => 'color: {{VALUE}};',
804 ],
805 ]
806 );
807
808 $this->add_group_control(
809 Group_Control_Typography::get_type(),
810 [
811 'name' => 'shopengine_up_sells_product_title_typography',
812 'label' => esc_html__('Typography', 'shopengine'),
813 'selector' => '{{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title',
814 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
815 'fields_options' => [
816 'typography' => [
817 'default' => 'custom',
818 ],
819 'font_weight' => [
820 'default' => '500',
821 ],
822 'font_size' => [
823 'label' => esc_html__('Font Size (px)', 'shopengine'),
824 'default' => [
825 'size' => '15',
826 'unit' => 'px',
827 ],
828 'size_units' => ['px'],
829 ],
830 'text_transform' => [
831 'default' => 'none',
832 ],
833 'line_height' => [
834 'label' => esc_html__('Line Height (px)', 'shopengine'),
835 'default' => [
836 'size' => '20',
837 'unit' => 'px',
838 ],
839 'size_units' => ['px'],
840 'tablet_default' => [
841 'unit' => 'px',
842 ],
843 'mobile_default' => [
844 'unit' => 'px',
845 ],
846 ],
847 ],
848 ]
849 );
850
851 $this->add_responsive_control(
852 'shopengine_up_sells_product_title_padding',
853 [
854 'label' => esc_html__('Padding (px)', 'shopengine'),
855 'type' => Controls_Manager::DIMENSIONS,
856 'size_units' => ['px'],
857 'default' => [
858 'top' => '0',
859 'right' => '0',
860 'bottom' => '8',
861 'left' => '0',
862 'isLinked' => false,
863 ],
864 'selectors' => [
865 '{{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
866 '.rtl {{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
867 ],
868 'separator' => 'before',
869 ]
870 );
871
872 $this->end_controls_section();
873
874 /*
875 * Style Tab - Products Rating
876 */
877 $this->start_controls_section(
878 'shopengine_up_sells_product_rating_section',
879 [
880 'label' => esc_html__('Rating', 'shopengine'),
881 'tab' => Controls_Manager::TAB_STYLE,
882 ]
883 );
884
885 $this->add_control(
886 'shopengine_up_sells_product_rating_start_color',
887 [
888 'label' => esc_html__('Color', 'shopengine'),
889 'type' => Controls_Manager::COLOR,
890 'default' => '#fec42d',
891 'alpha' => false,
892 'selectors' => [
893 '{{WRAPPER}} .shopengine-up-sells .products .star-rating' => 'color: {{VALUE}};',
894 '{{WRAPPER}} .shopengine-up-sells .products .star-rating::before' => 'color: {{VALUE}};',
895 ],
896 ]
897 );
898
899 $this->add_responsive_control(
900 'shopengine_up_sells_product_rating_start_size',
901 [
902 'label' => esc_html__('Star Size (px)', 'shopengine'),
903 'type' => Controls_Manager::SLIDER,
904 'size_units' => ['px'],
905 'range' => [
906 'px' => [
907 'min' => 0,
908 'max' => 50,
909 'step' => 1,
910 ],
911 ],
912 'default' => [
913 'unit' => 'px',
914 'size' => 12,
915 ],
916 'selectors' => [
917 '{{WRAPPER}} .shopengine-up-sells .products .product .star-rating' => 'font-size: {{SIZE}}{{UNIT}} !important;',
918 ],
919 ]
920 );
921
922 $this->add_responsive_control(
923 'shopengine_up_sells_product_rating_start_margin_bottom',
924 [
925 'label' => esc_html__('Margin Bottom (px)', 'shopengine'),
926 'type' => Controls_Manager::SLIDER,
927 'size_units' => ['px'],
928 'range' => [
929 'px' => [
930 'min' => 0,
931 'max' => 50,
932 'step' => 1,
933 ],
934 ],
935 'default' => [
936 'unit' => 'px',
937 'size' => 8,
938 ],
939 'selectors' => [
940 '{{WRAPPER}} .shopengine-up-sells .products .product .star-rating' => 'margin-bottom: {{SIZE}}{{UNIT}};',
941 ],
942 ]
943 );
944
945 $this->end_controls_section();
946
947 /*
948 * Style Tab - Products Price
949 */
950 $this->start_controls_section(
951 'shopengine_up_sells_product_price_section',
952 [
953 'label' => esc_html__('Price', 'shopengine'),
954 'tab' => Controls_Manager::TAB_STYLE,
955 ]
956 );
957
958 $this->add_control(
959 'shopengine_up_sells_product_price_color',
960 [
961 'label' => esc_html__('Color', 'shopengine'),
962 'type' => Controls_Manager::COLOR,
963 'default' => '#101010',
964 'alpha' => false,
965 'selectors' => [
966 '{{WRAPPER}} .shopengine-up-sells :is(.price, .price span, .price .amount)' => 'color: {{VALUE}};',
967 ],
968 ]
969 );
970
971 $this->add_control(
972 'shopengine_up_sells_product_sale_price_color',
973 [
974 'label' => esc_html__('Sale Price Color', 'shopengine'),
975 'type' => Controls_Manager::COLOR,
976 'default' => '#101010',
977 'alpha' => false,
978 'selectors' => [
979 '{{WRAPPER}} .shopengine-up-sells .price :is(del span, del .amount)' => 'color: {{VALUE}};',
980 ],
981 'condition' => [
982 'shopengine_up_sells_product_show_sale_price' => 'yes',
983 ],
984 ]
985 );
986
987 $this->add_group_control(
988 Group_Control_Typography::get_type(),
989 [
990 'name' => 'shopengine_up_sells_product_price_typography',
991 'selector' => '{{WRAPPER}} .shopengine-up-sells :is(.price, .price .amount, .price ins, .price del)',
992 'exclude' => ['text_transform', 'text_decoration', 'font_style', 'letter_spacing'],
993 'fields_options' => [
994 'typography' => [
995 'default' => 'custom',
996 ],
997 'font_weight' => [
998 'default' => '700',
999 ],
1000 'font_size' => [
1001 'label' => esc_html__('Font Size (px)', 'shopengine'),
1002 'size_units' => ['px'],
1003 'default' => [
1004 'size' => '18',
1005 'unit' => 'px'
1006 ]
1007 ],
1008 'line_height' => [
1009 'label' => esc_html__('Line Height (px)', 'shopengine'),
1010 'default' => [
1011 'size' => '24',
1012 'unit' => 'px',
1013 ],
1014 'size_units' => ['px'],
1015 'tablet_default' => [
1016 'unit' => 'px',
1017 ],
1018 'mobile_default' => [
1019 'unit' => 'px',
1020 ],
1021 ],
1022 ],
1023 ]
1024 );
1025
1026 $this->add_responsive_control(
1027 'shopengine_up_sells_product_price_padding',
1028 [
1029 'label' => esc_html__('Padding (px)', 'shopengine'),
1030 'type' => Controls_Manager::DIMENSIONS,
1031 'size_units' => ['px'],
1032 'default' => [
1033 'top' => '0',
1034 'right' => '0',
1035 'bottom' => '8',
1036 'left' => '0',
1037 'isLinked' => false,
1038 ],
1039 'selectors' => [
1040 '{{WRAPPER}} .shopengine-up-sells .price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1041 '.rtl {{WRAPPER}} .shopengine-up-sells .price' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1042 ],
1043 'separator' => 'before',
1044 ]
1045 );
1046
1047 $this->end_controls_section();
1048
1049 /*
1050 * Style Tab - Products Rating
1051 */
1052 $this->start_controls_section(
1053 'shopengine_up_sells_product_add_cart_btn_section',
1054 [
1055 'label' => esc_html__('Add To Cart', 'shopengine'),
1056 'tab' => Controls_Manager::TAB_STYLE,
1057 'condition' => [
1058 'shopengine_up_sells_product_show_cart_btn' => 'yes',
1059 ],
1060 ]
1061 );
1062
1063 $this->add_control(
1064 'shopengine_upsell_button_move_end',
1065 [
1066 'label' => esc_html__('Position End', 'shopengine'),
1067 'type' => Controls_Manager::SWITCHER,
1068 'default' => false,
1069 'return_value' => true,
1070 'selectors' => [
1071 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'order: 1',
1072 ],
1073 ]
1074 );
1075
1076 $this->add_group_control(
1077 Group_Control_Typography::get_type(),
1078 [
1079 'name' => 'shopengine_up_sells_product_add_cart_typography',
1080 'label' => esc_html__('Typography', 'shopengine'),
1081 'selector' => '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)',
1082 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1083 'fields_options' => [
1084 'typography' => [
1085 'default' => 'custom',
1086 ],
1087 'font_weight' => [
1088 'default' => '500',
1089 ],
1090 'font_size' => [
1091 'default' => [
1092 'size' => '13',
1093 'unit' => 'px',
1094 ],
1095 'size_units' => ['px'],
1096 ],
1097 'text_transform' => [
1098 'default' => 'uppercase',
1099 ],
1100 'line_height' => [
1101 'label' => esc_html__('Line Height (px)', 'shopengine'),
1102 'default' => [
1103 'size' => '18',
1104 'unit' => 'px',
1105 ],
1106 'size_units' => ['px'],
1107 'tablet_default' => [
1108 'unit' => 'px',
1109 ],
1110 'mobile_default' => [
1111 'unit' => 'px',
1112 ],
1113 ],
1114 ],
1115 'separator' => 'before',
1116 ]
1117 );
1118
1119 $this->start_controls_tabs(
1120 'shopengine_up_sells_product_add_cart_btn_style_tabs',
1121 [
1122 'separator' => 'before',
1123 ]
1124 );
1125
1126 $this->start_controls_tab(
1127 'shopengine_up_sells_product_add_cart_btn_tab_normal',
1128 [
1129 'label' => esc_html__('Normal', 'shopengine'),
1130 ]
1131 );
1132
1133 $this->add_control(
1134 'shopengine_up_sells_product_add_cart_btn_color',
1135 [
1136 'label' => esc_html__('Text Color', 'shopengine'),
1137 'type' => Controls_Manager::COLOR,
1138 'default' => '#FFFFFF',
1139 'alpha' => false,
1140 'selectors' => [
1141 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'color: {{VALUE}};',
1142 ],
1143 ]
1144 );
1145
1146 $this->add_control(
1147 'shopengine_up_sells_product_add_cart_btn_bg_color',
1148 [
1149 'label' => esc_html__('Background Color', 'shopengine'),
1150 'type' => Controls_Manager::COLOR,
1151 'default' => '#3E3E3E',
1152 'alpha' => false,
1153 'selectors' => [
1154 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'background-color: {{VALUE}};',
1155 ],
1156 ]
1157 );
1158
1159 $this->end_controls_tab();
1160
1161 $this->start_controls_tab(
1162 'shopengine_up_sells_product_add_cart_btn_tab_hover',
1163 [
1164 'label' => esc_html__('Hover', 'shopengine'),
1165 ]
1166 );
1167
1168 $this->add_control(
1169 'shopengine_up_sells_product_add_cart_btn_hover_color',
1170 [
1171 'label' => esc_html__('Text Color', 'shopengine'),
1172 'type' => Controls_Manager::COLOR,
1173 'default' => '#FFFFFF',
1174 'alpha' => false,
1175 'selectors' => [
1176 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart):hover' => 'color: {{VALUE}};',
1177 ],
1178 ]
1179 );
1180
1181 $this->add_control(
1182 'shopengine_up_sells_product_add_cart_btn_hover_bg_color',
1183 [
1184 'label' => esc_html__('Background Color', 'shopengine'),
1185 'type' => Controls_Manager::COLOR,
1186 'default' => '#332d2d',
1187 'alpha' => false,
1188 'selectors' => [
1189 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart):hover' => 'background-color: {{VALUE}};',
1190 ],
1191 ]
1192 );
1193
1194 $this->add_control(
1195 'shopengine_up_sells_product_add_cart_btn_hover_border_color',
1196 [
1197 'label' => esc_html__('Border Color', 'shopengine'),
1198 'type' => Controls_Manager::COLOR,
1199 'selectors' => [
1200 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart):hover' => 'border-color: {{VALUE}};',
1201 ],
1202 ]
1203 );
1204
1205 $this->end_controls_tab();
1206 $this->end_controls_tabs();
1207
1208 $this->add_responsive_control(
1209 'shopengine_up_sells_product_add_cart_btn_padding',
1210 [
1211 'label' => esc_html__('Padding (px)', 'shopengine'),
1212 'type' => Controls_Manager::DIMENSIONS,
1213 'size_units' => ['px'],
1214 'default' => [
1215 'top' => '8',
1216 'right' => '15',
1217 'bottom' => '8',
1218 'left' => '15',
1219 'unit' => 'px',
1220 'isLinked' => false,
1221 ],
1222 'selectors' => [
1223 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1224 '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1225 ],
1226 'separator' => 'before',
1227 ]
1228 );
1229
1230 $this->add_group_control(
1231 Group_Control_Border::get_type(),
1232 [
1233 'name' => 'shopengine_up_sells_product_add_cart_border',
1234 'label' => esc_html__('Border', 'shopengine'),
1235 'selector' => '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)',
1236 'separator' => 'before',
1237 ]
1238 );
1239
1240 $this->add_control(
1241 'shopengine_up_sells_product_add_cart_border_radius',
1242 [
1243 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1244 'type' => Controls_Manager::DIMENSIONS,
1245 'size_units' => ['px'],
1246 'default' => [
1247 'top' => '0',
1248 'right' => '0',
1249 'bottom' => '0',
1250 'left' => '0',
1251 'unit' => 'px',
1252 'isLinked' => true,
1253 ],
1254 'selectors' => [
1255 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1256 '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1257 ],
1258 ]
1259 );
1260
1261 $this->add_responsive_control(
1262 'shopengine_up_sells_product_add_cart_btn_margin',
1263 [
1264 'label' => esc_html__('Margin (px)', 'shopengine'),
1265 'type' => Controls_Manager::DIMENSIONS,
1266 'size_units' => ['px'],
1267 'default' => [
1268 'top' => '0',
1269 'right' => '0',
1270 'bottom' => '0',
1271 'left' => '0',
1272 'isLinked' => false,
1273 ],
1274 'selectors' => [
1275 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
1276 '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
1277 ],
1278 'separator' => 'before',
1279 ]
1280 );
1281
1282 $this->end_controls_section();
1283
1284 /*
1285 * Style Tab - Slider
1286 */
1287 $this->start_controls_section(
1288 'shopengine_up_sells_product_slider_style_section',
1289 [
1290 'label' => esc_html__('Slider Style', 'shopengine'),
1291 'tab' => Controls_Manager::TAB_STYLE,
1292 'conditions' => [
1293 'relation' => 'and',
1294 'terms' => [
1295 [
1296 'name' => 'shopengine_up_sells_product_enable_slider',
1297 'operator' => '===',
1298 'value' => 'yes'
1299 ],
1300 [
1301 'relation' => 'or',
1302 'terms' => [
1303 [
1304 'name' => 'shopengine_up_sells_product_slider_show_arrows',
1305 'operator' => '===',
1306 'value' => 'yes'
1307 ],
1308 [
1309 'name' => 'shopengine_up_sells_product_slider_show_dots',
1310 'operator' => '===',
1311 'value' => 'yes'
1312 ]
1313 ]
1314 ]
1315 ]
1316 ]
1317 ]
1318 );
1319
1320 $this->add_control(
1321 'shopengine_up_sells_product_slider_arrows_style',
1322 [
1323 'label' => esc_html__( 'Arrows', 'shopengine' ),
1324 'type' => Controls_Manager::HEADING,
1325 'condition' => [
1326 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1327 ],
1328 ]
1329 );
1330
1331 $this->add_control(
1332 'shopengine_up_sells_product_slider_arrow_size',
1333 [
1334 'label' => esc_html__('Arrow Size (px)', 'shopengine'),
1335 'type' => Controls_Manager::SLIDER,
1336 'size_units' => ['px'],
1337 'range' => [
1338 'px' => [
1339 'min' => 0,
1340 'max' => 100,
1341 'step' => 5,
1342 ],
1343 ],
1344 'default' => [
1345 'unit' => 'px',
1346 'size' => 40,
1347 ],
1348 'selectors' => [
1349 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-next, .swiper-button-prev)' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
1350 ],
1351 'condition' => [
1352 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1353 ],
1354 'separator' => 'before',
1355 ]
1356 );
1357
1358 $this->add_control(
1359 'shopengine_up_sells_product_slider_arrow_icon_size',
1360 [
1361 'label' => esc_html__('Icon Size (px)', 'shopengine'),
1362 'type' => Controls_Manager::SLIDER,
1363 'size_units' => ['px'],
1364 'range' => [
1365 'px' => [
1366 'min' => 0,
1367 'max' => 100,
1368 'step' => 5,
1369 ],
1370 ],
1371 'default' => [
1372 'unit' => 'px',
1373 'size' => 25,
1374 ],
1375 'selectors' => [
1376 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'font-size: {{SIZE}}{{UNIT}};',
1377 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev svg, .swiper-button-next svg)' => 'width: {{SIZE}}{{UNIT}};',
1378 ],
1379 'condition' => [
1380 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1381 ],
1382 ]
1383 );
1384
1385 $this->add_control(
1386 'shopengine_up_sells_product_slider_arrow_position',
1387 [
1388 'label' => esc_html__('Arrow Position (y-axis)', 'shopengine'),
1389 'type' => Controls_Manager::SLIDER,
1390 'size_units' => ['%'],
1391 'range' => [
1392 '%' => [
1393 'min' => 0,
1394 'max' => 100,
1395 'step' => 1,
1396 ],
1397 ],
1398 'default' => [
1399 'unit' => '%',
1400 'size' => 30,
1401 ],
1402 'selectors' => [
1403 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'top: {{SIZE}}{{UNIT}};',
1404 ],
1405 'condition' => [
1406 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1407 ],
1408 'separator' => 'before',
1409 ]
1410 );
1411
1412 $this->start_controls_tabs(
1413 'shopengine_up_sells_product_slider_arrows_tabs',
1414 [
1415 'condition' => [
1416 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1417 ],
1418 ]
1419 );
1420
1421 $this->start_controls_tab(
1422 'shopengine_up_sells_product_slider_arrows_tab_normal',
1423 [
1424 'label' => esc_html__('Normal', 'shopengine'),
1425 ]
1426 );
1427
1428 $this->add_control(
1429 'shopengine_up_sells_product_slider_arrows_color',
1430 [
1431 'label' => esc_html__('Color', 'shopengine'),
1432 'type' => Controls_Manager::COLOR,
1433 'default' => '#FFFFFF',
1434 'alpha' => false,
1435 'selectors' => [
1436 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'color: {{VALUE}};',
1437 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev svg, .swiper-button-next svg)' => 'fill: {{VALUE}};',
1438 ],
1439 ]
1440 );
1441
1442 $this->add_control(
1443 'shopengine_up_sells_product_slider_arrows_bg_color',
1444 [
1445 'label' => esc_html__('Background Color', 'shopengine'),
1446 'type' => Controls_Manager::COLOR,
1447 'default' => '#3E3E3E',
1448 'selectors' => [
1449 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'background-color: {{VALUE}};',
1450 ],
1451 ]
1452 );
1453
1454 $this->end_controls_tab();
1455
1456 $this->start_controls_tab(
1457 'shopengine_up_sells_product_slider_arrows_tab_hover',
1458 [
1459 'label' => esc_html__('Hover', 'shopengine'),
1460 ]
1461 );
1462
1463 $this->add_control(
1464 'shopengine_up_sells_product_slider_arrows_hover_color',
1465 [
1466 'label' => esc_html__('Color', 'shopengine'),
1467 'type' => Controls_Manager::COLOR,
1468 'default' => '#FFFFFF',
1469 'alpha' => false,
1470 'selectors' => [
1471 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next):hover' => 'color: {{VALUE}};',
1472 ],
1473 ]
1474 );
1475
1476 $this->add_control(
1477 'shopengine_up_sells_product_slider_arrows_hover_bg_color',
1478 [
1479 'label' => esc_html__('Background Color', 'shopengine'),
1480 'type' => Controls_Manager::COLOR,
1481 'default' => '#332d2d',
1482 'selectors' => [
1483 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next):hover' => 'background-color: {{VALUE}};',
1484 ],
1485 ]
1486 );
1487
1488 $this->add_control(
1489 'shopengine_up_sells_product_slider_arrows_hover_border_color',
1490 [
1491 'label' => esc_html__('Border Color', 'shopengine'),
1492 'type' => Controls_Manager::COLOR,
1493 'selectors' => [
1494 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next):hover' => 'border-color: {{VALUE}};',
1495 ],
1496 ]
1497 );
1498
1499 $this->end_controls_tab();
1500 $this->end_controls_tabs();
1501
1502 $this->add_group_control(
1503 Group_Control_Border::get_type(),
1504 [
1505 'name' => 'shopengine_up_sells_product_slider_arrows_border',
1506 'label' => esc_html__('Border', 'shopengine'),
1507 'selector' => '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)',
1508 'condition' => [
1509 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1510 ],
1511 'separator' => 'before',
1512 ]
1513 );
1514
1515 $this->add_control(
1516 'shopengine_up_sells_product_slider_arrows_border_radius',
1517 [
1518 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1519 'type' => Controls_Manager::DIMENSIONS,
1520 'size_units' => ['px'],
1521 'default' => [
1522 'top' => '0',
1523 'right' => '0',
1524 'bottom' => '0',
1525 'left' => '0',
1526 'unit' => 'px',
1527 'isLinked' => true,
1528 ],
1529 'selectors' => [
1530 '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1531 '.rtl {{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1532 ],
1533 'condition' => [
1534 'shopengine_up_sells_product_slider_show_arrows' => 'yes',
1535 ],
1536 ]
1537 );
1538
1539 $this->add_control(
1540 'shopengine_up_sells_product_slider_style_divider',
1541 [
1542 'type' => Controls_Manager::DIVIDER,
1543 'conditions' => [
1544 'relation' => 'and',
1545 'terms' => [
1546 [
1547 'name' => 'shopengine_up_sells_product_slider_show_arrows',
1548 'operator' => '===',
1549 'value' => 'yes'
1550 ],
1551 [
1552 'name' => 'shopengine_up_sells_product_slider_show_dots',
1553 'operator' => '===',
1554 'value' => 'yes'
1555 ]
1556 ]
1557 ]
1558 ]
1559 );
1560
1561 $this->add_control(
1562 'shopengine_up_sells_product_slider_dots_style',
1563 [
1564 'label' => esc_html__( 'Dots', 'shopengine' ),
1565 'type' => Controls_Manager::HEADING,
1566 'condition' => [
1567 'shopengine_up_sells_product_slider_show_dots' => 'yes',
1568 ],
1569 ]
1570 );
1571
1572 $this->add_control(
1573 'shopengine_up_sells_product_slider_dots_color',
1574 [
1575 'label' => esc_html__('Color', 'shopengine'),
1576 'type' => Controls_Manager::COLOR,
1577 'default' => '#c9c9c9',
1578 'alpha' => false,
1579 'selectors' => [
1580 '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet' => 'background: {{VALUE}};',
1581 ],
1582 'condition' => [
1583 'shopengine_up_sells_product_slider_show_dots' => 'yes',
1584 ],
1585 ]
1586 );
1587
1588 $this->add_control(
1589 'shopengine_up_sells_product_slider_active_dots_color',
1590 [
1591 'label' => esc_html__('Active Color', 'shopengine'),
1592 'type' => Controls_Manager::COLOR,
1593 'default' => '#f03d3f',
1594 'alpha' => false,
1595 'selectors' => [
1596 '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet-active' => 'border-color: {{VALUE}};',
1597 ],
1598 'condition' => [
1599 '$shopengine_up_sells_product_slider_show_dots' => 'yes',
1600 ],
1601 ]
1602 );
1603
1604 $this->add_responsive_control(
1605 'shopengine_up_sells_product_slider_dot_wrap_margin',
1606 [
1607 'label' => esc_html__('Wrap Margin (px)', 'shopengine'),
1608 'type' => Controls_Manager::DIMENSIONS,
1609 'size_units' => ['px'],
1610 'default' => [
1611 'top' => '20',
1612 'right' => '0',
1613 'bottom' => '0',
1614 'left' => '0',
1615 'isLinked' => false,
1616 ],
1617 'selectors' => [
1618 '{{WRAPPER}} .shopengine-up-sells .swiper-pagination' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1619 '.rtl {{WRAPPER}} .shopengine-up-sells .swiper-pagination' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1620 ],
1621 'condition' => [
1622 '$shopengine_up_sells_product_slider_show_dots' => 'yes',
1623 ],
1624 'separator' => 'before',
1625 ]
1626 );
1627 $this->end_controls_section();
1628 /*
1629 * Style Tab - Heading text
1630 */
1631 $this->start_controls_section(
1632 'shopengine_up_sells_product_heading_text_style',
1633 [
1634 'label' => esc_html__('Heading Text', 'shopengine'),
1635 'tab' => Controls_Manager::TAB_STYLE,
1636 ]
1637 );
1638 $this->add_control(
1639 'shopengine_up_sells_product_heading_text_color',
1640 [
1641 'label' => esc_html__('Color', 'shopengine'),
1642 'type' => Controls_Manager::COLOR,
1643 'default' => '#101010',
1644 'alpha' => false,
1645 'selectors' => [
1646 '{{WRAPPER}} .shopengine-up-sells .shopengine-up-sells-products-heading' => 'color: {{VALUE}};',
1647 ],
1648 ]
1649 );
1650 $this->add_group_control(
1651 Group_Control_Typography::get_type(),
1652 [
1653 'name' => 'shopengine_up_sells_product_heading_text_typography',
1654 'label' => esc_html__('Typography', 'shopengine'),
1655 'selector' => '{{WRAPPER}} .shopengine-up-sells .shopengine-up-sells-products-heading',
1656 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'],
1657 'fields_options' => [
1658 'font_weight' => [
1659 'default' => '600',
1660 ],
1661 'font_size' => [
1662 'label' => esc_html__('Font Size (px)', 'shopengine'),
1663 'default' => [
1664 'size' => '28',
1665 'unit' => 'px',
1666 ],
1667 'size_units' => ['px'],
1668 ],
1669 'text_transform' => [
1670 'default' => 'none',
1671 ],
1672 'line_height' => [
1673 'label' => esc_html__('Line Height (px)', 'shopengine'),
1674 'default' => [
1675 'size' => '20',
1676 'unit' => 'px',
1677 ],
1678 'size_units' => ['px'],
1679 'tablet_default' => [
1680 'unit' => 'px',
1681 ],
1682 'mobile_default' => [
1683 'unit' => 'px',
1684 ],
1685 ],
1686 ],
1687 ]
1688 );
1689 $this->add_responsive_control(
1690 'shopengine_up_sells_product_heading_text_padding',
1691 [
1692 'label' => esc_html__('Padding (px)', 'shopengine'),
1693 'type' => Controls_Manager::DIMENSIONS,
1694 'size_units' => ['px'],
1695 'default' => [
1696 'top' => '0',
1697 'right' => '0',
1698 'bottom' => '8',
1699 'left' => '0',
1700 'isLinked' => false,
1701 ],
1702 'selectors' => [
1703 '{{WRAPPER}} .shopengine-up-sells .shopengine-up-sells-products-heading' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1704 '.rtl {{WRAPPER}} .shopengine-up-sells .shopengine-up-sells-products-heading' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1705 ],
1706 'separator' => 'before',
1707 ]
1708 );
1709
1710 $this->end_controls_section();
1711
1712 /*
1713 * Style Tab - Global Font
1714 */
1715 $this->start_controls_section(
1716 'shopengine_up_sells_product_global_font_section',
1717 [
1718 'label' => esc_html__('Global Font', 'shopengine'),
1719 'tab' => Controls_Manager::TAB_STYLE,
1720 ]
1721 );
1722
1723 $this->add_control(
1724 'shopengine_up_sells_product_global_font_family',
1725 [
1726 'label' => esc_html__('Font Family', 'shopengine'),
1727 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'),
1728 'type' => Controls_Manager::FONT,
1729 'selectors' => [
1730 '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.onsale, .woocommerce-loop-product__title, .price, del, ins, .button)' => 'font-family: {{VALUE}};',
1731 ],
1732 ]
1733 );
1734
1735 $this->end_controls_section();
1736 }
1737
1738 public function get_icon_html($icon) {
1739
1740 if($icon) {
1741 ob_start();
1742 \Elementor\Icons_Manager::render_icon($icon, ['aria-hidden' => 'true']);
1743 $icon = ob_get_clean();
1744 } else {
1745 $icon = '';
1746 }
1747
1748 return $icon;
1749 }
1750
1751 protected function screen() {
1752 $settings = $this->get_settings_for_display();
1753 shopengine_content_render(\ShopEngine\Utils\Helper::render($this->view_render($settings)));
1754 }
1755
1756 protected function view_render($settings = []) {
1757
1758 extract($settings);
1759
1760 $post_type = get_post_type();
1761
1762 $product = \ShopEngine\Widgets\Products::instance()->get_product($post_type);
1763
1764 if(empty($product)) {
1765 return;
1766 }
1767
1768
1769 $tpl = Products::instance()->get_widget_template($this->get_name());
1770
1771 include $tpl;
1772 }
1773 }
1774