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