PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets / 4.9.3
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution with eCommerce Templates & Woo Widgets v4.9.3
4.9.5 4.9.4 4.9.3 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 / add-to-cart / add-to-cart.php
shopengine / widgets / add-to-cart Last commit date
screens 3 weeks ago add-to-cart-config.php 4 years ago add-to-cart.php 3 weeks ago
add-to-cart.php
2793 lines
1 <?php
2
3 namespace Elementor;
4
5
6 use ShopEngine\Core\Register\Model;
7 use ShopEngine\Widgets\Products;
8
9 defined('ABSPATH') || exit;
10
11
12 class ShopEngine_Add_To_Cart extends \ShopEngine\Base\Widget
13 {
14
15 public function config() {
16 return new ShopEngine_Add_To_Cart_Config();
17 }
18
19
20 protected function register_controls() {
21
22 $m_settings = Model::source('settings')->get_option('modules', []);
23
24 /*
25 --------------------------
26 settings content tab
27 --------------------------
28 */
29
30 $this->start_controls_section(
31 'shopengine_add_to_cart_settings',
32 [
33 'label' => esc_html__('Settings', 'shopengine'),
34 'tab' => Controls_Manager::TAB_CONTENT,
35 ]
36 );
37
38 /*
39 ------------------------------
40 Quantity Section start
41 ------------------------------
42 */
43
44 $this->add_control(
45 'shopengine_add_to_cart_quantity_section',
46 [
47 'label' => esc_html__('Quantity Settings', 'shopengine'),
48 'type' => Controls_Manager::HEADING,
49 ]
50 );
51
52 $this->add_control(
53 'shopengine_quantity_btn_position',
54 [
55 'label' => esc_html__('Button Style', 'shopengine'),
56 'type' => Controls_Manager::SELECT,
57 'default' => 'default',
58 'options' => [
59 'default' => esc_html__('Default', 'shopengine'),
60 'both' => esc_html__('Both Side', 'shopengine'),
61 'before' => esc_html__('Both Left', 'shopengine'),
62 'after' => esc_html__('Both Right', 'shopengine'),
63 ],
64 ]
65 );
66
67 $this->add_control(
68 'shopengine_quantity_plus_icon',
69 [
70 'label' => esc_html__('Plus Icon', 'shopengine'),
71 'type' => Controls_Manager::ICONS,
72 'default' => [
73 'value' => 'fas fa-plus',
74 'library' => 'fa-solid',
75 ],
76 'condition' => [
77 'shopengine_quantity_btn_position!' => 'default',
78 ]
79 ]
80 );
81
82 $this->add_control(
83 'shopengine_quantity_minus_icon',
84 [
85 'label' => esc_html__('Minus Icon', 'shopengine'),
86 'type' => Controls_Manager::ICONS,
87 'default' => [
88 'value' => 'fas fa-minus',
89 'library' => 'fa-solid',
90 ],
91 'condition' => [
92 'shopengine_quantity_btn_position!' => 'default',
93 ]
94 ]
95 );
96
97 /*
98 ------------------------------
99 Contents Section start
100 ------------------------------
101 */
102
103 $this->add_control(
104 'shopengine_add_to_cart_stock_section',
105 [
106 'label' => esc_html__('Stock', 'shopengine'),
107 'type' => Controls_Manager::HEADING,
108 'separator' => 'before',
109 ]
110 );
111
112 $this->add_control(
113 'shopengine_add_to_cart_show_stock',
114 [
115 'label' => esc_html__('Show Stock Status', 'shopengine'),
116 'description' => esc_html__('Show stock status, If product have stock enable.', 'shopengine'),
117 'type' => Controls_Manager::SWITCHER,
118 'label_on' => esc_html__('Yes', 'shopengine'),
119 'label_off' => esc_html__('No', 'shopengine'),
120 'default' => "yes",
121 'return_value' => "yes",
122 'selectors' => [
123 '{{WRAPPER}} .shopengine-swatches .stock' => 'display: block;',
124 ],
125 ]
126 );
127
128 /*
129 ------------------------------
130 Variations Section start
131 ------------------------------
132 */
133
134 $this->add_control(
135 'shopengine_add_to_cart_variation_section',
136 [
137 'label' => esc_html__('Variations', 'shopengine'),
138 'type' => Controls_Manager::HEADING,
139 'separator' => 'before',
140 ]
141 );
142
143 $this->add_control(
144 'shopengine_add_to_cart_show_variation_description',
145 [
146 'label' => esc_html__('Variation Description', 'shopengine'),
147 'description' => esc_html__('Show product variation description.', 'shopengine'),
148 'type' => Controls_Manager::SWITCHER,
149 'label_on' => esc_html__('Yes', 'shopengine'),
150 'label_off' => esc_html__('No', 'shopengine'),
151 'default' => "yes",
152 'return_value' => "yes",
153 'selectors' => [
154 '{{WRAPPER}} .shopengine-swatches .woocommerce-variation-description' => 'display: block;',
155 ],
156 ]
157 );
158
159 /*
160 ------------------------------
161 Data ordering Section start
162 ------------------------------
163 */
164 $this->add_control(
165 'shopengine_add_to_cart_data_ordering_section',
166 [
167 'label' => esc_html__('Data Ordering', 'shopengine'),
168 'type' => Controls_Manager::HEADING,
169 'separator' => 'before',
170 ]
171 );
172
173 $this->add_control(
174 'shopengine_hide_buy_button',
175 [
176 'label' => esc_html__( 'Hide Buy Button', 'shopengine' ),
177 'type' => Controls_Manager::SWITCHER,
178 'label_on' => esc_html__( 'Hide', 'shopengine' ),
179 'label_off' => esc_html__( 'Show', 'shopengine' ),
180 'return_value' => 'yes',
181 'default' => '',
182 'selectors' => [
183 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'display: none;',
184 ],
185 ]
186 );
187
188 $this->add_control(
189 'shopengine_hide_wishlist_button',
190 [
191 'label' => esc_html__( 'Hide Wishlist Button', 'shopengine' ),
192 'type' => Controls_Manager::SWITCHER,
193 'label_on' => esc_html__( 'Hide', 'shopengine' ),
194 'label_off' => esc_html__( 'Show', 'shopengine' ),
195 'return_value' => 'yes',
196 'default' => '',
197 'selectors' => [
198 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'display: none;',
199 ],
200 ]
201 );
202
203 $this->add_control(
204 'shopengine_hide_addtocart_button',
205 [
206 'label' => esc_html__( 'Hide Add to Cart', 'shopengine' ),
207 'type' => Controls_Manager::SWITCHER,
208 'label_on' => esc_html__( 'Hide', 'shopengine' ),
209 'label_off' => esc_html__( 'Show', 'shopengine' ),
210 'return_value' => 'yes',
211 'default' => '',
212 'selectors' => [
213 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'display: none;',
214 ],
215 ]
216 );
217
218 $this->add_control(
219 'shopengine_hide_compare_button',
220 [
221 'label' => esc_html__( 'Hide Compare Button', 'shopengine' ),
222 'type' => Controls_Manager::SWITCHER,
223 'label_on' => esc_html__( 'Hide', 'shopengine' ),
224 'label_off' => esc_html__( 'Show', 'shopengine' ),
225 'return_value' => 'yes',
226 'default' => '',
227 'selectors' => [
228 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'display: none;',
229 ],
230 ]
231 );
232
233 $this->add_control(
234 'shopengine_hide_quntity_button',
235 [
236 'label' => esc_html__( 'Hide Quantity Button', 'shopengine' ),
237 'type' => Controls_Manager::SWITCHER,
238 'label_on' => esc_html__( 'Hide', 'shopengine' ),
239 'label_off' => esc_html__( 'Show', 'shopengine' ),
240 'return_value' => 'yes',
241 'default' => '',
242 'selectors' => [
243 '{{WRAPPER}} .shopengine-swatches .quantity-wrap' => 'display: none;',
244 ],
245 ]
246 );
247
248 $this->add_control(
249 'shopengine_add_to_cart_data_ordering_enable',
250 [
251 'label' => esc_html__('Enable Ordering?', 'shopengine'),
252 'type' => Controls_Manager::SWITCHER,
253 'label_on' => esc_html__('Yes', 'shopengine'),
254 'label_off' => esc_html__('No', 'shopengine'),
255 'default' => "yes",
256 'return_value' => "yes",
257 'prefix_class' => 'shopengine-add-to-cart-ordering-',
258 ]
259 );
260
261 $default = [
262 [
263 'list_title' => esc_html__( 'Quantitly', 'shopengine' ),
264 'list_key' => 'quantity',
265 ],
266 [
267 'list_title' => esc_html__( 'Add to Cart', 'shopengine' ),
268 'list_key' => 'add_to_cart',
269 ],
270 [
271 'list_title' => esc_html__( 'Buy Now/Quick Checkout', 'shopengine' ),
272 'list_key' => 'quick_checkout',
273 ],
274 [
275 'list_title' => esc_html__( 'Wishlist', 'shopengine' ),
276 'list_key' => 'wishlist',
277 ],
278 [
279 'list_title' => esc_html__( 'Comparison', 'shopengine' ),
280 'list_key' => 'comparison',
281 ],
282 [
283 'list_title' => esc_html__( 'Partial Payment', 'shopengine' ),
284 'list_key' => 'partial_payment',
285 ],
286 ];
287
288 $repeater = new Repeater();
289 $this->add_control(
290 'shopengine_add_to_cart_data_ordering_list',
291 [
292 'label' => esc_html__( 'Data Ordering List', 'shopengine' ),
293 'type' => Controls_Manager::REPEATER,
294 'fields' => $repeater->get_controls(),
295 'default' => $default,
296 'title_field' => '{{{ list_title }}}',
297 'item_actions' => [
298 'add' => false,
299 'duplicate' => false,
300 'remove' => false,
301 'sort' => true,
302 ],
303 'condition' => [
304 'shopengine_add_to_cart_data_ordering_enable' => 'yes',
305 ]
306 ]
307 );
308
309 /*
310 ------------------------------
311 WooCommerce Gift Card Support
312 ------------------------------
313 */
314
315 // Only show gift card support control if the plugin is active
316 if (function_exists('is_plugin_active') && is_plugin_active('wt-woocommerce-gift-cards/wt-woocommerce-gift-cards.php')) {
317 $this->add_control(
318 'shopengine_woocommerce_gift_card_support',
319 [
320 'label' => esc_html__('Enable Gift Card Support', 'shopengine'),
321 'description' => esc_html__('Enable this to use gift card template design for WebToffee WooCommerce Gift Cards Plugin.', 'shopengine'),
322 'type' => Controls_Manager::SWITCHER,
323 'label_on' => esc_html__('Yes', 'shopengine'),
324 'label_off' => esc_html__('No', 'shopengine'),
325 'return_value' => 'yes',
326 'default' => '',
327 'separator' => 'before',
328 ]
329 );
330 }
331
332 $this->end_controls_section();
333 // contents section end
334
335 /*
336 * Style Tab - Stock Style
337 */
338 $this->start_controls_section(
339 'shopengine_section_add_to_cart_stock_status_styles',
340 [
341 'label' => esc_html__('Stock Status', 'shopengine'),
342 'tab' => Controls_Manager::TAB_STYLE,
343 'condition' => [
344 'shopengine_add_to_cart_show_stock' => 'yes'
345 ]
346 ]
347 );
348
349 $this->add_group_control(
350 Group_Control_Typography::get_type(),
351 array(
352 'name' => 'shopengine_add_to_cart_stock_status_typography',
353 'label' => esc_html__('Typography', 'shopengine'),
354 'selector' => '{{WRAPPER}} .shopengine-swatches .stock',
355 'exclude' => ['font_style', 'text_decoration', 'letter_spacing'],
356 'fields_options' => [
357 'typography' => [
358 'default' => 'custom',
359 ],
360 'font_size' => [
361 'label' => esc_html__('Font Size (px)', 'shopengine'),
362 'default' => [
363 'size' => '14',
364 'unit' => 'px'
365 ],
366 'size_units' => ['px']
367 ],
368 'text_transform' => [
369 'default' => 'uppercase',
370 ],
371 'font_weight' => [
372 'default' => '500',
373 ],
374 'line_height' => [
375 'label' => esc_html__('Line Height (px)', 'shopengine'),
376 'default' => [
377 'size' => '17',
378 'unit' => 'px'
379 ],
380 'size_units' => ['px']
381 ],
382 ],
383 )
384 );
385
386 $this->add_responsive_control(
387 'shopengine_add_to_cart_stock_status_alignment',
388 [
389 'label' => esc_html__('Alignment', 'shopengine'),
390 'type' => Controls_Manager::CHOOSE,
391 'options' => [
392 'left' => [
393 'title' => esc_html__('Left', 'shopengine'),
394 'icon' => 'eicon-text-align-left',
395 ],
396 'center' => [
397 'title' => esc_html__('Center', 'shopengine'),
398 'icon' => 'eicon-text-align-center',
399 ],
400 'right' => [
401 'title' => esc_html__('Right', 'shopengine'),
402 'icon' => 'eicon-text-align-right',
403 ],
404 ],
405 'default' => 'left',
406 'prefix_class' => 'elementor-align-',
407 'selectors' => [
408 '{{WRAPPER}} .shopengine-swatches .stock' => 'text-align: {{VALUE}}',
409 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-swatches .stock' => 'text-align: right',
410 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-swatches .stock' => 'text-align: left',
411 ],
412 ]
413 );
414
415 $this->add_control(
416 'shopengine_add_to_cart_in_stock_color',
417 [
418 'label' => esc_html__('In Stock Color', 'shopengine'),
419 'type' => Controls_Manager::COLOR,
420 'alpha' => false,
421 'default' => '#169543',
422 'description' => esc_html__('This will apply to product in stock', 'shopengine'),
423 'selectors' => [
424 '{{WRAPPER}} .shopengine-swatches .stock' => 'color: {{VALUE}};',
425 ],
426 ]
427 );
428
429 $this->add_control(
430 'shopengine_add_to_cart_out_of_stock_color',
431 [
432 'label' => esc_html__('Out Of Stock Color', 'shopengine'),
433 'type' => Controls_Manager::COLOR,
434 'alpha' => false,
435 'default' => '#EA4335',
436 'description' => esc_html__('This will apply to product out of stock', 'shopengine'),
437 'selectors' => [
438 '{{WRAPPER}} .shopengine-swatches .stock.out-of-stock' => 'color: {{VALUE}};',
439 ],
440 ]
441 );
442
443 $this->end_controls_section();
444
445 /*
446 * Style Tab - Add to Cart Button
447 */
448 $this->start_controls_section(
449 'shopengine_section_add_cart__button_style',
450 array(
451 'label' => esc_html__('Add To Cart Button', 'shopengine'),
452 'tab' => Controls_Manager::TAB_STYLE,
453 )
454 );
455
456 $this->add_group_control(
457 Group_Control_Typography::get_type(),
458 array(
459 'name' => 'shopengine_add_cart_button_typography',
460 'label' => esc_html__('Typography', 'shopengine'),
461 'selector' => '{{WRAPPER}} .shopengine-swatches .cart .button',
462 'exclude' => ['text_decoration'],
463 'fields_options' => [
464 'typography' => [
465 'default' => 'custom',
466 ],
467 'font_weight' => [
468 'default' => '600',
469 ],
470 'font_size' => [
471 'label' => esc_html__('Font Size (px)', 'shopengine'),
472 'default' => [
473 'size' => '15',
474 'unit' => 'px'
475 ],
476 'size_units' => ['px']
477 ],
478 'text_transform' => [
479 'default' => 'uppercase',
480 ],
481 'line_height' => [
482 'label' => esc_html__('Line Height (px)', 'shopengine'),
483 'default' => [
484 'size' => '18',
485 'unit' => 'px'
486 ],
487 'size_units' => ['px'],
488 'tablet_default' => [
489 'unit' => 'px',
490 ],
491 'mobile_default' => [
492 'unit' => 'px',
493 ],
494 'selectors' => [
495 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'line-height: {{SIZE}}{{UNIT}};',
496 ],
497 ],
498 ],
499 )
500 );
501
502 $this->start_controls_tabs('shopengine_add_cart_button_style_tabs');
503
504 $this->start_controls_tab('shopengine_add_cart_button_style_normal',
505 [
506 'label' => esc_html__('Normal', 'shopengine'),
507 ]
508 );
509
510 $this->add_control(
511 'shopengine_add_cart_button_text_color_normal',
512 [
513 'label' => esc_html__('Color', 'shopengine'),
514 'type' => Controls_Manager::COLOR,
515 'alpha' => false,
516 'default' => '#FFFFFF',
517 'selectors' => [
518 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'color: {{VALUE}};',
519 ],
520 ]
521 );
522
523 $this->add_control(
524 'shopengine_add_cart_button_bg_color_normal',
525 [
526 'label' => esc_html__('Background Color', 'shopengine'),
527 'type' => Controls_Manager::COLOR,
528 'alpha' => false,
529 'default' => '#101010',
530 'selectors' => [
531 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'background-color: {{VALUE}};',
532 ],
533 ]
534 );
535
536 $this->end_controls_tab();
537
538 $this->start_controls_tab('shopengine_add_cart_button_style_hover',
539 [
540 'label' => esc_html__('Hover', 'shopengine'),
541 ]
542 );
543
544 $this->add_control(
545 'shopengine_add_cart_button_text_color_hover',
546 [
547 'label' => esc_html__('Color', 'shopengine'),
548 'type' => Controls_Manager::COLOR,
549 'alpha' => false,
550 'default' => '#FFFFFF',
551 'selectors' => [
552 '{{WRAPPER}} .shopengine-swatches .cart .button:hover' => 'color: {{VALUE}};',
553 ],
554 ]
555 );
556
557 $this->add_control(
558 'shopengine_add_cart_button_bg_color_hover',
559 [
560 'label' => esc_html__('Background Color', 'shopengine'),
561 'type' => Controls_Manager::COLOR,
562 'alpha' => false,
563 'default' => '#312b2b',
564 'selectors' => [
565 '{{WRAPPER}} .shopengine-swatches .cart .button:hover' => 'background-color: {{VALUE}};',
566 ],
567 ]
568 );
569
570 $this->add_control(
571 'shopengine_add_cart_button_border_color_hover',
572 [
573 'label' => esc_html__('Border Color', 'shopengine'),
574 'type' => Controls_Manager::COLOR,
575 'alpha' => false,
576 'default' => '#312b2b',
577 'selectors' => [
578 '{{WRAPPER}} .shopengine-swatches .cart .button:hover' => 'border-color: {{VALUE}};',
579 ],
580 ]
581 );
582
583 $this->end_controls_tab();
584 $this->end_controls_tabs();
585
586 $this->add_group_control(
587 Group_Control_Border::get_type(),
588 [
589 'name' => 'shopengine_add_cart_button_border',
590 'selector' => '{{WRAPPER}} .shopengine-swatches .cart .button',
591 'size_units' => ['px'],
592 'fields_options' => [
593 'border' => [
594 'default' => 'solid',
595 ],
596 'width' => [
597 'default' => [
598 'top' => '1',
599 'right' => '1',
600 'bottom' => '1',
601 'left' => '1',
602 'isLinked' => true,
603 ],
604 'selectors' => [
605 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
606 '.rtl {{WRAPPER}} .shopengine-swatches .cart .button' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
607 ]
608 ],
609 'color' => [
610 'default' => '#101010',
611 'alpha' => false,
612 ]
613 ],
614 'separator' => 'before',
615 ]
616 );
617
618 $this->add_control(
619 'shopengine_add_cart_button_border_radius',
620 [
621 'label' => esc_html__('Border Radius (px)', 'shopengine'),
622 'type' => Controls_Manager::DIMENSIONS,
623 'default' => [
624 'top' => '5',
625 'right' => '5',
626 'bottom' => '5',
627 'left' => '5',
628 'unit' => 'px',
629 'isLinked' => true,
630 ],
631 'size_units' => ['px'],
632 'selectors' => [
633 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
634 '.rtl {{WRAPPER}} .shopengine-swatches .cart .button' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
635 ],
636 ]
637 );
638
639 $this->add_responsive_control(
640 'shopengine_add_cart_button_padding',
641 [
642 'label' => esc_html__('Padding (px)', 'shopengine'),
643 'type' => Controls_Manager::DIMENSIONS,
644 'size_units' => ['px'],
645 'default' => [
646 'top' => '12',
647 'right' => '25',
648 'bottom' => '12',
649 'left' => '25',
650 'unit' => 'px',
651 'isLinked' => false,
652 ],
653 'selectors' => [
654 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
655 '.rtl {{WRAPPER}} .shopengine-swatches .cart .button' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
656 ],
657 'separator' => 'before',
658 ]
659 );
660
661 $this->add_responsive_control(
662 'shopengine_add_cart_button_margin',
663 [
664 'label' => esc_html__('Margin (px)', 'shopengine'),
665 'type' => Controls_Manager::DIMENSIONS,
666 'size_units' => ['px'],
667 'default' => [
668 'top' => '0',
669 'right' => '10',
670 'bottom' => '0',
671 'left' => '0',
672 'unit' => 'px',
673 'isLinked' => false,
674 ],
675 'selectors' => [
676 '{{WRAPPER}} .shopengine-swatches .cart .button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
677 '.rtl {{WRAPPER}} .shopengine-swatches .cart .button' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
678 ],
679 'separator' => 'before',
680 ]
681 );
682
683 $this->end_controls_section();
684
685 if(empty($m_settings['quick-checkout']['status']) || !empty($m_settings['quick-checkout']['status']) && $m_settings['quick-checkout']['status'] === 'active') {
686
687 /*
688 * Style Tab - Quick Checkout Button
689 */
690 $this->start_controls_section(
691 'shopengine_section_quick_checkout_button_style',
692 array(
693 'label' => esc_html__('Quick Checkout', 'shopengine'),
694 'tab' => Controls_Manager::TAB_STYLE,
695 )
696 );
697
698 $this->add_group_control(
699 Group_Control_Typography::get_type(),
700 array(
701 'name' => 'shopengine_quick_checkout_button_typography',
702 'label' => esc_html__('Typography', 'shopengine'),
703 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button',
704 'exclude' => ['text_decoration'],
705 'fields_options' => [
706 'typography' => [
707 'default' => 'custom',
708 ],
709 'font_weight' => [
710 'default' => '600',
711 ],
712 'font_size' => [
713 'label' => esc_html__('Font Size (px)', 'shopengine'),
714 'default' => [
715 'size' => '15',
716 'unit' => 'px'
717 ],
718 'size_units' => ['px']
719 ],
720 'text_transform' => [
721 'default' => 'uppercase',
722 ],
723 'line_height' => [
724 'label' => esc_html__('Line Height (px)', 'shopengine'),
725 'default' => [
726 'size' => '18',
727 'unit' => 'px'
728 ],
729 'size_units' => ['px'],
730 'tablet_default' => [
731 'unit' => 'px',
732 ],
733 'mobile_default' => [
734 'unit' => 'px',
735 ],
736 'selectors' => [
737 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'line-height: {{SIZE}}{{UNIT}} !important;',
738 ],
739 ],
740 ],
741 )
742 );
743
744 $this->start_controls_tabs('shopengine_quick_checkout_button_style_tabs');
745
746 $this->start_controls_tab('shopengine_quick_checkout_button_style_normal',
747 [
748 'label' => esc_html__('Normal', 'shopengine'),
749 ]
750 );
751
752 $this->add_control(
753 'shopengine_quick_checkout_button_text_color_normal',
754 [
755 'label' => esc_html__('Color', 'shopengine'),
756 'type' => Controls_Manager::COLOR,
757 'alpha' => false,
758 'default' => '#FFFFFF',
759 'selectors' => [
760 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'color: {{VALUE}};',
761 ],
762 ]
763 );
764
765 $this->add_control(
766 'shopengine_quick_checkout_button_bg_color_normal',
767 [
768 'label' => esc_html__('Background Color', 'shopengine'),
769 'type' => Controls_Manager::COLOR,
770 'alpha' => false,
771 'default' => '#101010',
772 'selectors' => [
773 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'background-color: {{VALUE}} !important;',
774 ],
775 ]
776 );
777
778 $this->end_controls_tab();
779
780 $this->start_controls_tab('shopengine_quick_checkout_button_style_hover',
781 [
782 'label' => esc_html__('Hover', 'shopengine'),
783 ]
784 );
785
786 $this->add_control(
787 'shopengine_quick_checkout_button_text_color_hover',
788 [
789 'label' => esc_html__('Color', 'shopengine'),
790 'type' => Controls_Manager::COLOR,
791 'alpha' => false,
792 'default' => '#FFFFFF',
793 'selectors' => [
794 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button:hover' => 'color: {{VALUE}};',
795 ],
796 ]
797 );
798
799 $this->add_control(
800 'shopengine_quick_checkout_button_bg_color_hover',
801 [
802 'label' => esc_html__('Background Color', 'shopengine'),
803 'type' => Controls_Manager::COLOR,
804 'alpha' => false,
805 'default' => '#312b2b',
806 'selectors' => [
807 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button:hover' => 'background-color: {{VALUE}} !important;',
808 ],
809 ]
810 );
811
812 $this->add_control(
813 'shopengine_quick_checkout_button_border_color_hover',
814 [
815 'label' => esc_html__('Border Color', 'shopengine'),
816 'type' => Controls_Manager::COLOR,
817 'alpha' => false,
818 'default' => '#312b2b',
819 'selectors' => [
820 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button:hover' => 'border-color: {{VALUE}};',
821 ],
822 ]
823 );
824
825 $this->end_controls_tab();
826 $this->end_controls_tabs();
827
828 $this->add_group_control(
829 Group_Control_Border::get_type(),
830 [
831 'name' => 'shopengine_quick_checkout_button_border',
832 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button',
833 'size_units' => ['px'],
834 'fields_options' => [
835 'border' => [
836 'default' => 'solid',
837 ],
838 'width' => [
839 'default' => [
840 'top' => '1',
841 'right' => '1',
842 'bottom' => '1',
843 'left' => '1',
844 'isLinked' => true,
845 ],
846 'selectors' => [
847 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
848 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
849 ]
850 ],
851 'color' => [
852 'default' => '#101010',
853 'alpha' => false,
854 ]
855 ],
856 'separator' => 'before',
857 ]
858 );
859
860 $this->add_control(
861 'shopengine_quick_checkout_button_border_radius',
862 [
863 'label' => esc_html__('Border Radius (px)', 'shopengine'),
864 'type' => Controls_Manager::DIMENSIONS,
865 'default' => [
866 'top' => '5',
867 'right' => '5',
868 'bottom' => '5',
869 'left' => '5',
870 'unit' => 'px',
871 'isLinked' => true,
872 ],
873 'size_units' => ['px'],
874 'selectors' => [
875 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
876 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
877 ],
878 ]
879 );
880
881 $this->add_control(
882 'shopengine_quick_checkout_button_padding',
883 [
884 'label' => esc_html__('Padding (px)', 'shopengine'),
885 'type' => Controls_Manager::DIMENSIONS,
886 'size_units' => ['px'],
887 'default' => [
888 'top' => '12',
889 'right' => '25',
890 'bottom' => '12',
891 'left' => '25',
892 'unit' => 'px',
893 'isLinked' => false,
894 ],
895 'selectors' => [
896 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
897 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
898 ],
899 'separator' => 'before',
900 ]
901 );
902
903 $this->add_responsive_control(
904 'shopengine_quick_checkout_button_margin',
905 [
906 'label' => esc_html__('Margin (px)', 'shopengine'),
907 'type' => Controls_Manager::DIMENSIONS,
908 'size_units' => ['px'],
909 'default' => [
910 'top' => '0',
911 'right' => '10',
912 'bottom' => '0',
913 'left' => '0',
914 'unit' => 'px',
915 'isLinked' => false,
916 ],
917 'selectors' => [
918 '{{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
919 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-quick-checkout-button' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;',
920 ],
921 'separator' => 'before',
922 ]
923 );
924
925 $this->end_controls_section();
926 }
927
928 /*
929 * Style Tab - Quantity
930 */
931 $this->start_controls_section(
932 'shopengine_section_add_cart_quantity_style',
933 array(
934 'label' => esc_html__('Quantity Input', 'shopengine'),
935 'tab' => Controls_Manager::TAB_STYLE,
936 )
937 );
938
939 $this->add_group_control(
940 Group_Control_Typography::get_type(),
941 array(
942 'name' => 'shopengine_add_cart_quantity_typography',
943 'label' => esc_html__('Typography', 'shopengine'),
944 'selector' => '{{WRAPPER}} .shopengine-swatches .quantity .qty',
945 'exclude' => ['text_transform', 'line_height', 'text_decoration'],
946 'fields_options' => [
947 'typography' => [
948 'default' => 'custom',
949 ],
950 'font_weight' => [
951 'default' => '500',
952 ],
953 'font_size' => [
954 'default' => [
955 'size' => '16',
956 'unit' => 'px'
957 ],
958 'label' => esc_html__('Font Size (px)', 'shopengine'),
959 'size_units' => ['px']
960 ],
961 'line_height' => [
962 'default' => [
963 'size' => '19',
964 'unit' => 'px'
965 ],
966 'label' => esc_html__('Line Height (px)', 'shopengine'),
967 'size_units' => ['px']
968 ],
969 'letter_spacing' => [
970 'default' => [
971 'size' => '0.5',
972 ]
973 ],
974 ],
975 )
976 );
977
978 $this->add_control(
979 'shopengine_add_cart_quantity_color',
980 [
981 'label' => esc_html__('Color', 'shopengine'),
982 'type' => Controls_Manager::COLOR,
983 'alpha' => false,
984 'default' => '#101010',
985 'selectors' => [
986 '{{WRAPPER}} .shopengine-swatches .quantity .qty' => 'color: {{VALUE}}',
987 ],
988 ]
989 );
990
991 $this->add_control(
992 'shopengine_add_cart_quantity_bg_color',
993 [
994 'label' => esc_html__('Background Color', 'shopengine'),
995 'type' => Controls_Manager::COLOR,
996 'alpha' => false,
997 'default' => '#FFFFFF',
998 'selectors' => [
999 '{{WRAPPER}} .shopengine-swatches .quantity .qty' => 'background: {{VALUE}}',
1000 ],
1001 ]
1002 );
1003
1004 $this->add_control(
1005 'shopengine_quantity_plus_minus_section_heading',
1006 [
1007 'label' => esc_html__('Plus Minus Button', 'shopengine'),
1008 'type' => Controls_Manager::HEADING,
1009 'condition' => [
1010 'shopengine_quantity_btn_position!' => 'default'
1011 ],
1012 'separator' => 'before',
1013 ]
1014 );
1015
1016 $this->add_control(
1017 'shopengine_quantity_btn_icon_size',
1018 [
1019 'label' => esc_html__('Icon Size', 'shopengine'),
1020 'type' => Controls_Manager::SLIDER,
1021 'size_units' => ['px'],
1022 'range' => [
1023 'px' => [
1024 'min' => 0,
1025 'max' => 100
1026 ],
1027 ],
1028 'default' => [
1029 'unit' => 'px',
1030 'size' => 10,
1031 ],
1032 'selectors' => [
1033 '{{WRAPPER}} .shopengine-swatches :is(.plus, .minus) :is(i, svg)' => 'width: {{SIZE}}{{UNIT}}; font-size: {{SIZE}}{{UNIT}};'
1034 ],
1035 'condition' => [
1036 'shopengine_quantity_btn_position!' => 'default'
1037 ],
1038 ]
1039 );
1040
1041 $this->start_controls_tabs(
1042 'shopengine_quantity_btn_tabs',
1043 [
1044 'condition' => [
1045 'shopengine_quantity_btn_position!' => 'default'
1046 ],
1047 ]
1048 );
1049
1050 $this->start_controls_tab('shopengine_quantity_btn_tabs_normal',
1051 [
1052 'label' => esc_html__('Normal', 'shopengine'),
1053 ]
1054 );
1055
1056 $this->add_control(
1057 'shopengine_quantity_btn_tabs_normal_clr',
1058 [
1059 'label' => esc_html__('Color', 'shopengine'),
1060 'type' => Controls_Manager::COLOR,
1061 'alpha' => false,
1062 'default' => '#101010',
1063 'selectors' => [
1064 '{{WRAPPER}} .shopengine-swatches :is(.plus, .minus) :is(i, svg, path)' => 'color: {{VALUE}}; fill: {{VALUE}};'
1065 ],
1066 ]
1067 );
1068
1069 $this->add_control(
1070 'shopengine_quantity_btn_tabs_normal_bg_clr',
1071 [
1072 'label' => esc_html__('Background Color', 'shopengine'),
1073 'type' => Controls_Manager::COLOR,
1074 'default' => '#FFFFFF',
1075 'selectors' => [
1076 '{{WRAPPER}} .shopengine-swatches :is(.plus, .minus)' => 'background-color: {{VALUE}};',
1077 ],
1078 ]
1079 );
1080
1081 $this->end_controls_tab();
1082
1083 $this->start_controls_tab('shopengine_quantity_btn_tabs_hover',
1084 [
1085 'label' => esc_html__('Hover', 'shopengine'),
1086 ]
1087 );
1088
1089 $this->add_control(
1090 'shopengine_quantity_btn_tabs_Hover_clr',
1091 [
1092 'label' => esc_html__('Color', 'shopengine'),
1093 'type' => Controls_Manager::COLOR,
1094 'alpha' => false,
1095 'default' => '#FFFFFF',
1096 'selectors' => [
1097 '{{WRAPPER}} .shopengine-swatches :is(.plus, .minus):hover :is(i, svg, path)' => 'color: {{VALUE}}; fill: {{VALUE}};'
1098 ],
1099 ]
1100 );
1101
1102 $this->add_control(
1103 'shopengine_quantity_btn_tabs_hover_bg_clr',
1104 [
1105 'label' => esc_html__('Background Color', 'shopengine'),
1106 'type' => Controls_Manager::COLOR,
1107 'default' => '#101010',
1108 'selectors' => [
1109 '{{WRAPPER}} .shopengine-swatches :is(.plus, .minus):hover' => 'background-color: {{VALUE}}; border-color: {{VALUE}};',
1110 ],
1111 ]
1112 );
1113
1114 $this->end_controls_tab();
1115 $this->end_controls_tabs();
1116
1117 $this->add_control(
1118 'shopengine_quantity_button_padding',
1119 [
1120 'label' => esc_html__('Buttons Padding (px)', 'shopengine'),
1121 'type' => Controls_Manager::DIMENSIONS,
1122 'size_units' => ['px'],
1123 'default' => [
1124 'top' => '4',
1125 'right' => '18',
1126 'bottom' => '4',
1127 'left' => '18',
1128 'unit' => 'px',
1129 'isLinked' => false,
1130 ],
1131 'selectors' => [
1132 '{{WRAPPER}} .shopengine-swatches :is(.plus, .minus)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1133 '.rtl {{WRAPPER}} .shopengine-swatches :is(.plus, .minus)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1134 ],
1135 'condition' => [
1136 'shopengine_quantity_btn_position!' => 'default'
1137 ],
1138 'separator' => 'before',
1139 ]
1140 );
1141
1142 $this->add_control(
1143 'shopengine_add_cart_quantity_padding',
1144 [
1145 'label' => esc_html__('Input Padding (px)', 'shopengine'),
1146 'type' => Controls_Manager::DIMENSIONS,
1147 'size_units' => ['px'],
1148 'default' => [
1149 'top' => '10',
1150 'right' => '0',
1151 'bottom' => '10',
1152 'left' => '0',
1153 'unit' => 'px',
1154 'isLinked' => false,
1155 ],
1156 'selectors' => [
1157 '{{WRAPPER}} .shopengine-swatches .quantity .qty' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1158 '.rtl {{WRAPPER}} .shopengine-swatches .quantity .qty' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1159 ],
1160 'separator' => 'before',
1161 ]
1162 );
1163
1164 $this->add_group_control(
1165 Group_Control_Border::get_type(),
1166 [
1167 'name' => 'shopengine_add_cart_quantity_border',
1168 'label' => esc_html__('Border (px)', 'shopengine'),
1169 'size_units' => ['px'],
1170 'fields_options' => [
1171 'border' => [
1172 'default' => 'solid',
1173 'selectors' => [
1174 '{{WRAPPER}} .shopengine-swatches .quantity .qty' => 'border-style: {{VALUE}};',
1175 '{{WRAPPER}} .shopengine-swatches .quantity-wrap button' => 'border-style: {{VALUE}};',
1176 ],
1177 ],
1178 'width' => [
1179 'default' => [
1180 'top' => '2',
1181 'right' => '2',
1182 'bottom' => '2',
1183 'left' => '2',
1184 'isLinked' => true,
1185 ],
1186 'selectors' => [
1187 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.default .quantity .qty' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1188 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.default .quantity .qty'=> 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1189
1190 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.both .quantity .qty' => 'border-width: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0;',
1191
1192 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.both .minus' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1193 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.both .minus' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1194
1195 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.both .plus' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1196 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.both .plus' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1197
1198 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.before .quantity .qty' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} 0;',
1199 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.before .quantity .qty'=> 'border-width: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1200
1201 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.before .plus' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}};',
1202 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.before .plus' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} 0 {{RIGHT}}{{UNIT}};',
1203
1204 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.before .minus' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1205 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.before .minus' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1206
1207 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.after .quantity .qty' => 'border-width: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1208 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.after .quantity .qty' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} 0;',
1209
1210 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.after .plus' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}};',
1211 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.after .plus' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} 0 {{RIGHT}}{{UNIT}};',
1212
1213 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.after .minus' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1214 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.after .minus' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1215 ],
1216 ],
1217 'color' => [
1218 'default' => '#F2F2F2',
1219 'alpha' => false,
1220 'selectors' => [
1221 '{{WRAPPER}} .shopengine-swatches .quantity .qty' => 'border-color: {{VALUE}};',
1222 '{{WRAPPER}} .shopengine-swatches .quantity-wrap button' => 'border-color: {{VALUE}};',
1223 ],
1224 ]
1225 ],
1226 'separator' => 'before',
1227 ]
1228 );
1229
1230 $this->add_control(
1231 'shopengine_add_cart_quantity_border_radius',
1232 [
1233 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1234 'type' => Controls_Manager::DIMENSIONS,
1235 'default' => [
1236 'top' => '5',
1237 'right' => '5',
1238 'bottom' => '5',
1239 'left' => '5',
1240 'unit' => 'px',
1241 'isLinked' => true,
1242 ],
1243 'size_units' => ['px'],
1244 'selectors' => [
1245 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.default .quantity .qty' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1246 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.default .quantity .qty' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1247 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.both .quantity .qty' => 'border-radius: 0;',
1248 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.both .minus' => 'border-radius: {{TOP}}{{UNIT}} 0 0 {{LEFT}}{{UNIT}};',
1249 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.both .minus' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} 0 0;',
1250 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.both .plus' => 'border-radius: 0 {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} 0;',
1251 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.both .plus' => 'border-radius: 0 0 {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1252 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.before .quantity .qty' => 'border-radius: 0 {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} 0;',
1253 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.before .quantity .qty'=> 'border-radius: 0 0 {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1254 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.before .plus' => 'border-radius: {{TOP}}{{UNIT}} 0 0 0;',
1255 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.before .minus' => 'border-radius: 0 0 0 {{LEFT}}{{UNIT}};',
1256 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.before .minus' => 'border-radius: 0 {{LEFT}}{{UNIT}} 0 0;',
1257 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.after .quantity .qty' => 'border-radius: {{TOP}}{{UNIT}} 0 0 {{LEFT}}{{UNIT}};',
1258 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.after .quantity .qty' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} 0 0;',
1259 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.after .plus' => 'border-radius: 0 {{RIGHT}}{{UNIT}} 0 0;',
1260 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap.after .plus' => 'border-radius: 0 0 0 {{RIGHT}}{{UNIT}};',
1261 '{{WRAPPER}} .shopengine-swatches .quantity-wrap.after .minus' => 'border-radius: 0 0 {{BOTTOM}}{{UNIT}} 0;',
1262 ],
1263 'separator' => 'before',
1264 ]
1265 );
1266
1267 $this->add_responsive_control(
1268 'shopengine_add_cart_quantity_wrap_margin',
1269 [
1270 'label' => esc_html__('Wrap Margin (px)', 'shopengine'),
1271 'type' => Controls_Manager::DIMENSIONS,
1272 'size_units' => ['px'],
1273 'default' => [
1274 'top' => '0',
1275 'right' => '10',
1276 'bottom' => '0',
1277 'left' => '0',
1278 'unit' => 'px',
1279 'isLinked' => false,
1280 ],
1281 'selectors' => [
1282 '{{WRAPPER}} .shopengine-swatches .quantity-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1283 '.rtl {{WRAPPER}} .shopengine-swatches .quantity-wrap' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1284 ],
1285 'separator' => 'before',
1286 ]
1287 );
1288
1289 $this->end_controls_section();
1290
1291
1292 /*
1293 * Style Tab - Variations
1294 */
1295 $this->start_controls_section(
1296 'shopengine_section_add_to_cart_variations_styles',
1297 array(
1298 'label' => esc_html__('Variations', 'shopengine'),
1299 'tab' => Controls_Manager::TAB_STYLE,
1300 )
1301 );
1302
1303 $this->add_responsive_control(
1304 'shopengine_add_to_cart_variation_swatches_alignment',
1305 [
1306 'label' => esc_html__('Alignment', 'shopengine'),
1307 'type' => Controls_Manager::CHOOSE,
1308 'options' => [
1309 'left' => [
1310 'title' => esc_html__('Left', 'shopengine'),
1311 'icon' => 'eicon-text-align-left',
1312 ],
1313 'center' => [
1314 'title' => esc_html__('Center', 'shopengine'),
1315 'icon' => 'eicon-text-align-center',
1316 ],
1317 'right' => [
1318 'title' => esc_html__('Right', 'shopengine'),
1319 'icon' => 'eicon-text-align-right',
1320 ],
1321 ],
1322 'default' => 'left',
1323 'prefix_class' => 'elementor-align-',
1324 'selectors' => [
1325 '{{WRAPPER}} .shopengine-swatches table.variations' => 'text-align: {{VALUE}}',
1326 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-swatches table.variations' => 'text-align: left',
1327 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-swatches table.variations' => 'text-align: right',
1328 '{{WRAPPER}} .shopengine-swatches .single_variation_wrap' => 'text-align: {{VALUE}}',
1329 '.rtl {{WRAPPER}}.elementor-align-right .shopengine-swatches .single_variation_wrap' => 'text-align: left',
1330 '.rtl {{WRAPPER}}.elementor-align-left .shopengine-swatches .single_variation_wrap' => 'text-align: right',
1331 ],
1332 ]
1333 );
1334
1335 $this->start_controls_tabs('shopengine_add_to_cart_variation_tabs',
1336 [
1337 'separator' => 'before'
1338 ]
1339 );
1340
1341 $this->start_controls_tab(
1342 'shopengine_add_to_cart_variation_label_tab',
1343 [
1344 'label' => esc_html__('Label', 'shopengine'),
1345 ]
1346 );
1347
1348 $this->add_group_control(
1349 Group_Control_Typography::get_type(),
1350 array(
1351 'name' => 'shopengine_add_to_cart_variation_label_typography',
1352 'label' => esc_html__('Typography', 'shopengine'),
1353 'selector' => '{{WRAPPER}} .shopengine-swatches .variations label, {{WRAPPER}} .shopengine-swatches .variations select',
1354 'fields_options' => [
1355 'typography' => [
1356 'default' => 'custom',
1357 ],
1358 'font_weight' => [
1359 'default' => '500',
1360 ],
1361 'font_size' => [
1362 'label' => esc_html__('Font Size (px)', 'shopengine'),
1363 'default' => [
1364 'size' => '14',
1365 'unit' => 'px'
1366 ],
1367 'size_units' => ['px']
1368 ],
1369 'line_height' => [
1370 'label' => esc_html__('Line Height (px)', 'shopengine'),
1371 'default' => [
1372 'size' => '18',
1373 'unit' => 'px'
1374 ],
1375 'size_units' => ['px']
1376 ],
1377 ],
1378 )
1379 );
1380
1381 $this->add_control(
1382 'shopengine_add_to_cart_variation_label_color',
1383 [
1384 'label' => esc_html__('Color', 'shopengine'),
1385 'type' => Controls_Manager::COLOR,
1386 'alpha' => false,
1387 'default' => '#101010',
1388 'selectors' => [
1389 '{{WRAPPER}} .shopengine-swatches .variations td.label, {{WRAPPER}} .shopengine-swatches .variations th.label' => 'color: {{VALUE}};',
1390 '{{WRAPPER}} .shopengine-swatches .variations td.select, {{WRAPPER}} .shopengine-swatches .variations th.select' => 'color: {{VALUE}};',
1391 ],
1392 ]
1393 );
1394
1395 $this->add_control(
1396 'shopengine_add_to_cart_variation_label_display_style',
1397 [
1398 'label' => esc_html__('Display Style', 'shopengine'),
1399 'type' => Controls_Manager::SELECT,
1400 'default' => 'row',
1401 'options' => [
1402 'row' => esc_html__('Inline', 'shopengine'),
1403 'column' => esc_html__('Block', 'shopengine'),
1404 ],
1405 'selectors' => [
1406 '{{WRAPPER}} .shopengine-swatches .variations tr' => 'flex-direction: {{VALUE}};',
1407 ],
1408 ]
1409 );
1410
1411 $this->add_control(
1412 'shopengine_add_to_cart_variation_inline_label_width',
1413 [
1414 'label' => esc_html__('Label Width (px)', 'shopengine'),
1415 'type' => Controls_Manager::SLIDER,
1416 'size_units' => ['px'],
1417 'range' => [
1418 'px' => [
1419 'min' => 0,
1420 'max' => 200
1421 ],
1422 ],
1423 'default' => [
1424 'unit' => 'px',
1425 'size' => 60,
1426 ],
1427 'selectors' => [
1428 '{{WRAPPER}} .shopengine-swatches .variations td.label' => 'width: {{SIZE}}{{UNIT}};',
1429 '{{WRAPPER}} .shopengine-swatches .variations td.value' => 'width: 100%;',
1430 ],
1431 'condition' => [
1432 'shopengine_add_to_cart_variation_label_display_style' => 'row'
1433 ]
1434 ]
1435 );
1436
1437 $this->end_controls_tab();
1438
1439 $this->start_controls_tab(
1440 'shopengine_add_to_cart_variation_description_tab',
1441 [
1442 'label' => esc_html__('Description', 'shopengine'),
1443 'condition' => [
1444 'shopengine_add_to_cart_show_variation_description' => 'yes',
1445 ]
1446 ]
1447 );
1448
1449 $this->add_group_control(
1450 Group_Control_Typography::get_type(),
1451 array(
1452 'name' => 'shopengine_add_to_cart_variation_description_typography',
1453 'label' => esc_html__('Typography', 'shopengine'),
1454 'selector' => '{{WRAPPER}} .shopengine-swatches .woocommerce-variation-description',
1455 'exclude' => ['font_family', 'font_style', 'text_decoration'],
1456 'fields_options' => [
1457 'typography' => [
1458 'default' => 'custom',
1459 ],
1460 'font_weight' => [
1461 'default' => '400',
1462 ],
1463 'font_size' => [
1464 'label' => esc_html__('Font Size (px)', 'shopengine'),
1465 'default' => [
1466 'size' => '14',
1467 'unit' => 'px'
1468 ],
1469 'size_units' => ['px']
1470 ],
1471 'line_height' => [
1472 'label' => esc_html__('Line Height (px)', 'shopengine'),
1473 'default' => [
1474 'size' => '18',
1475 'unit' => 'px'
1476 ],
1477 'size_units' => ['px']
1478 ],
1479 ],
1480 )
1481 );
1482
1483 $this->add_control(
1484 'shopengine_add_to_cart_variation_description_color',
1485 [
1486 'label' => esc_html__('Color', 'shopengine'),
1487 'type' => Controls_Manager::COLOR,
1488 'alpha' => false,
1489 'default' => '#666666',
1490 'selectors' => [
1491 '{{WRAPPER}} .shopengine-swatches .woocommerce-variation-description p' => 'color: {{VALUE}};',
1492 ],
1493 ]
1494 );
1495
1496 $this->add_responsive_control(
1497 'shopengine_add_to_cart_variation_description_margin',
1498 [
1499 'label' => esc_html__('Description Wrap Margin (px)', 'shopengine'),
1500 'type' => Controls_Manager::DIMENSIONS,
1501 'size_units' => ['px'],
1502 'default' => [
1503 'top' => '0',
1504 'right' => '0',
1505 'bottom' => '15',
1506 'left' => '0',
1507 'unit' => 'px',
1508 'isLinked' => false,
1509 ],
1510 'selectors' => [
1511 '{{WRAPPER}} .shopengine-swatches .woocommerce-variation-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1512 '.rtl {{WRAPPER}} .shopengine-swatches .woocommerce-variation-description' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1513 ],
1514 'separator' => 'before'
1515 ]
1516 );
1517
1518 $this->end_controls_tab();
1519
1520 $this->start_controls_tab(
1521 'shopengine_add_to_cart_variation_price_tab',
1522 [
1523 'label' => esc_html__('Price', 'shopengine'),
1524 ]
1525 );
1526
1527 $this->add_group_control(
1528 Group_Control_Typography::get_type(),
1529 array(
1530 'name' => 'shopengine_add_to_cart_variation_price_typography',
1531 'label' => esc_html__('Typography', 'shopengine'),
1532 'selector' => '{{WRAPPER}} .shopengine-swatches :is(.price, .price del, .price ins )',
1533 'exclude' => ['text_transform'],
1534 'fields_options' => [
1535 'typography' => [
1536 'default' => 'custom',
1537 ],
1538 'font_weight' => [
1539 'default' => '700',
1540 ],
1541 'font_size' => [
1542 'label' => esc_html__('Font Size (px)', 'shopengine'),
1543 'default' => [
1544 'size' => '18',
1545 'unit' => 'px'
1546 ],
1547 'size_units' => ['px']
1548 ],
1549 'line_height' => [
1550 'label' => esc_html__('Line Height (px)', 'shopengine'),
1551 'default' => [
1552 'size' => '24',
1553 'unit' => 'px'
1554 ],
1555 'size_units' => ['px']
1556 ],
1557 ],
1558 )
1559 );
1560
1561 $this->add_control(
1562 'shopengine_add_to_cart_variation_price_color',
1563 [
1564 'label' => esc_html__('Price Color', 'shopengine'),
1565 'type' => Controls_Manager::COLOR,
1566 'alpha' => false,
1567 'default' => '#101010',
1568 'alpha' => false,
1569 'selectors' => [
1570 '{{WRAPPER}} .shopengine-swatches :is(.price, .price del, .price ins )' => 'color: {{VALUE}};',
1571 ],
1572 ]
1573 );
1574
1575 $this->add_control(
1576 'shopengine_add_to_cart_variation_sale_price_color',
1577 [
1578 'label' => esc_html__('Sale Price Color', 'shopengine'),
1579 'type' => Controls_Manager::COLOR,
1580 'alpha' => false,
1581 'default' => '#101010',
1582 'selectors' => [
1583 '{{WRAPPER}} .shopengine-swatches .price ins .amount' => 'background: transparent; color: {{VALUE}};',
1584 ],
1585 ]
1586 );
1587
1588 $this->add_control(
1589 'shopengine_add_to_cart_variation_price_discount_badge_note',
1590 [
1591 'type' => Controls_Manager::RAW_HTML,
1592 'raw' => esc_html__(' Discount badge shows up when a product has a sale price.', 'shopengine'),
1593 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1594 'separator' => 'before',
1595 ]
1596 );
1597
1598 $this->add_control(
1599 'shopengine_add_to_cart_variation_price_discount_badge_color',
1600 [
1601 'label' => esc_html__('Discount Badge Color', 'shopengine'),
1602 'type' => Controls_Manager::COLOR,
1603 'alpha' => false,
1604 'default' => '#FFFFFF',
1605 'selectors' => [
1606 '{{WRAPPER}} .shopengine-swatches .shopengine-badge' => 'color: {{VALUE}};',
1607 ],
1608 ]
1609 );
1610
1611 $this->add_control(
1612 'shopengine_add_to_cart_variation_price_discount_badge_bg_color',
1613 [
1614 'label' => esc_html__('Discount Badge Background Color', 'shopengine'),
1615 'type' => Controls_Manager::COLOR,
1616 'alpha' => false,
1617 'default' => '#EA4335',
1618 'selectors' => [
1619 '{{WRAPPER}} .shopengine-swatches .shopengine-badge' => 'background: {{VALUE}};',
1620 ],
1621 ]
1622 );
1623
1624 $this->add_control(
1625 'shopengine_add_to_cart_variation_price_discount_badge_font_size',
1626 [
1627 'label' => esc_html__('Badge Font Size (px)', 'shopengine'),
1628 'type' => Controls_Manager::SLIDER,
1629 'size_units' => ['px'],
1630 'range' => [
1631 'px' => [
1632 'min' => 0,
1633 'max' => 100,
1634 'step' => 1,
1635 ],
1636 ],
1637 'default' => [
1638 'unit' => 'px',
1639 'size' => 12,
1640 ],
1641 'selectors' => [
1642 '{{WRAPPER}} .shopengine-swatches .shopengine-badge' => 'font-size: {{SIZE}}{{UNIT}};',
1643 ],
1644 ]
1645 );
1646
1647 $this->add_control(
1648 'shopengine_add_to_cart_variation_price_discount_badge_line_height',
1649 [
1650 'label' => esc_html__('Badge Line Height (px)', 'shopengine'),
1651 'type' => Controls_Manager::SLIDER,
1652 'size_units' => ['px'],
1653 'range' => [
1654 'px' => [
1655 'min' => 0,
1656 'max' => 100,
1657 'step' => 1,
1658 ],
1659 ],
1660 'default' => [
1661 'unit' => 'px',
1662 'size' => 20,
1663 ],
1664 'selectors' => [
1665 '{{WRAPPER}} .shopengine-swatches .shopengine-badge' => 'line-height: {{SIZE}}{{UNIT}};',
1666 ],
1667 ]
1668 );
1669
1670 $this->add_responsive_control(
1671 'shopengine_add_to_cart_variation_price_margin',
1672 [
1673 'label' => esc_html__('Price Wrap Margin (px)', 'shopengine'),
1674 'type' => Controls_Manager::DIMENSIONS,
1675 'size_units' => ['px'],
1676 'default' => [
1677 'top' => '0',
1678 'right' => '0',
1679 'bottom' => '15',
1680 'left' => '0',
1681 'unit' => 'px',
1682 'isLinked' => false,
1683 ],
1684 'selectors' => [
1685 '{{WRAPPER}} .shopengine-swatches .woocommerce-variation-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; display: block;',
1686 '.rtl {{WRAPPER}} .shopengine-swatches .woocommerce-variation-price' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}; display: block;',
1687 ],
1688 'separator' => 'before'
1689 ]
1690 );
1691
1692 $this->end_controls_tab();
1693 $this->end_controls_tabs();
1694
1695 $this->add_responsive_control(
1696 'shopengine_add_to_cart_variation_item_margin',
1697 [
1698 'label' => esc_html__('Variation Item Margin (px)', 'shopengine'),
1699 'type' => Controls_Manager::DIMENSIONS,
1700 'size_units' => ['px'],
1701 'default' => [
1702 'top' => '0',
1703 'right' => '0',
1704 'bottom' => '15',
1705 'left' => '0',
1706 'unit' => 'px',
1707 'isLinked' => false,
1708 ],
1709 'selectors' => [
1710 '{{WRAPPER}} .shopengine-swatches .variations tr' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1711 '.rtl {{WRAPPER}} .shopengine-swatches .variations tr' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1712 ],
1713 'separator' => 'before'
1714 ]
1715 );
1716
1717 $this->add_responsive_control(
1718 'shopengine_add_to_cart_variation_wrap_margin',
1719 [
1720 'label' => esc_html__('Variation Wrap Margin (px)', 'shopengine'),
1721 'type' => Controls_Manager::DIMENSIONS,
1722 'size_units' => ['px'],
1723 'default' => [
1724 'top' => '0',
1725 'right' => '0',
1726 'bottom' => '15',
1727 'left' => '0',
1728 'unit' => 'px',
1729 'isLinked' => false,
1730 ],
1731 'selectors' => [
1732 '{{WRAPPER}} .shopengine-swatches .variations' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1733 '.rtl {{WRAPPER}} .shopengine-swatches .variations' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1734 ],
1735 'separator' => 'before'
1736 ]
1737 );
1738
1739 $this->add_responsive_control(
1740 'shopengine_add_to_cart_variation_space_label_swatch',
1741 [
1742 'label' => esc_html__('Space Between Label & Swatch (px)', 'shopengine'),
1743 'type' => Controls_Manager::SLIDER,
1744 'size_units' => ['px'],
1745 'range' => [
1746 'px' => [
1747 'min' => 0,
1748 'max' => 100,
1749 'step' => 1,
1750 ],
1751 ],
1752 'default' => [
1753 'unit' => 'px',
1754 'size' => 15,
1755 ],
1756 'selectors' => [
1757 '{{WRAPPER}} .shopengine-swatches .variations tr' => 'gap: {{SIZE}}{{UNIT}};',
1758 ],
1759 ]
1760 );
1761
1762 $this->add_control(
1763 'shopengine_add_to_cart_variation_dropdown',
1764 [
1765 'label' => esc_html__('Variation Dropdown', 'shopengine'),
1766 'type' => Controls_Manager::HEADING,
1767 'separator' => 'before'
1768 ]
1769 );
1770
1771 $this->add_control(
1772 'shopengine_add_to_cart_variation_dropdown_color',
1773 [
1774 'label' => esc_html__('Dropdown Color', 'shopengine'),
1775 'type' => Controls_Manager::COLOR,
1776 'alpha' => false,
1777 'default' => '#101010',
1778 'selectors' => [
1779 '{{WRAPPER}} .shopengine-swatches .variations select' => 'color: {{VALUE}};',
1780 ],
1781 ]
1782 );
1783
1784 $this->add_group_control(
1785 Group_Control_Border::get_type(),
1786 [
1787 'name' => 'shopengine_add_to_cart_variation_dropdown_border',
1788 'label' => esc_html__('Border (px)', 'shopengine'),
1789 'size_units' => ['px'],
1790 'fields_options' => [
1791 'border' => [
1792 'default' => 'solid',
1793 ],
1794 'width' => [
1795 'label' => esc_html__('Width (px)', 'shopengine'),
1796 'default' => [
1797 'top' => '2',
1798 'right' => '2',
1799 'bottom' => '2',
1800 'left' => '2',
1801 'isLinked' => true,
1802 ],
1803 'responsive' => false,
1804 'selectors' => [
1805 '{{WRAPPER}} .shopengine-swatches .variations select' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1806 '.rtl {{WRAPPER}} .shopengine-swatches .variations select' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1807 ]
1808 ],
1809 'color' => [
1810 'default' => '#F2F2F2',
1811 'alpha' => false,
1812 ]
1813 ],
1814 'selector' => '{{WRAPPER}} .shopengine-swatches .variations select',
1815 'separator' => 'before'
1816 ]
1817 );
1818
1819 $this->add_control(
1820 'shopengine_add_to_cart_variation_dropdown_border_radius',
1821 [
1822 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1823 'type' => Controls_Manager::DIMENSIONS,
1824 'default' => [
1825 'top' => '0',
1826 'right' => '0',
1827 'bottom' => '0',
1828 'left' => '0',
1829 'unit' => 'px',
1830 'isLinked' => true,
1831 ],
1832 'size_units' => ['px'],
1833 'selectors' => [
1834 '{{WRAPPER}} .shopengine-swatches .variations select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1835 '.rtl {{WRAPPER}} .shopengine-swatches .variations select' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1836 ],
1837 'condition' => [
1838 'shopengine_add_to_cart_variation_dropdown_border_border!' => ''
1839 ]
1840 ]
1841 );
1842
1843 $this->end_controls_section();
1844
1845
1846 /*
1847 * Style Tab - Variation Swatches
1848 */
1849 $this->start_controls_section(
1850 'shopengine_section_add_to_cart_variation_swatches_styles',
1851 array(
1852 'label' => esc_html__('Variation Swatches', 'shopengine'),
1853 'tab' => Controls_Manager::TAB_STYLE,
1854 )
1855 );
1856
1857 $this->start_controls_tabs('shopengine_add_to_cart_variation_swatch_tabs',
1858 [
1859 'separator' => 'before'
1860 ]
1861 );
1862
1863 $this->start_controls_tab(
1864 'shopengine_add_to_cart_variation_swatch_color_tab',
1865 [
1866 'label' => esc_html__('Color', 'shopengine'),
1867 ]
1868 );
1869
1870 $this->add_control(
1871 'shopengine_add_to_cart_variation_swatch_color_width',
1872 [
1873 'label' => esc_html__('Swatch Width (px)', 'shopengine'),
1874 'type' => Controls_Manager::SLIDER,
1875 'size_units' => ['px'],
1876 'range' => [
1877 'px' => [
1878 'min' => 0,
1879 'max' => 150,
1880 'step' => 5,
1881 ],
1882 ],
1883 'default' => [
1884 'unit' => 'px',
1885 'size' => 30,
1886 ],
1887 'selectors' => [
1888 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch.swatch_color' => 'width: {{SIZE}}{{UNIT}};',
1889 ],
1890 ]
1891 );
1892
1893 $this->add_control(
1894 'shopengine_add_to_cart_variation_swatch_color_height',
1895 [
1896 'label' => esc_html__('Swatch Height (px)', 'shopengine'),
1897 'type' => Controls_Manager::SLIDER,
1898 'size_units' => ['px'],
1899 'range' => [
1900 'px' => [
1901 'min' => 0,
1902 'max' => 150,
1903 'step' => 5,
1904 ],
1905 ],
1906 'default' => [
1907 'unit' => 'px',
1908 'size' => 30,
1909 ],
1910 'selectors' => [
1911 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch.swatch_color' => 'height: {{SIZE}}{{UNIT}};',
1912 ],
1913 ]
1914 );
1915
1916 $this->add_control(
1917 'shopengine_add_to_cart_variation_swatch_color_border_radius',
1918 [
1919 'label' => esc_html__('Border Radius (px)', 'shopengine'),
1920 'type' => Controls_Manager::SLIDER,
1921 'size_units' => ['px'],
1922 'range' => [
1923 'px' => [
1924 'min' => 0,
1925 'max' => 100,
1926 'step' => 5,
1927 ]
1928 ],
1929 'default' => [
1930 'unit' => 'px',
1931 'size' => 100,
1932 ],
1933 'selectors' => [
1934 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_color' => 'border-radius: {{SIZE}}{{UNIT}};',
1935 ],
1936 ]
1937 );
1938 $this->add_group_control(
1939 Group_Control_Border::get_type(),
1940 [
1941 'name' => 'shopengine_add_to_cart_variation_swatch_color_label_border',
1942 'label' => esc_html__('Border', 'shopengine'),
1943 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_color',
1944 'fields_options' => [
1945 'border' => [
1946 'default' => 'solid',
1947 'devices' => ['desktop'],
1948 'responsive' => true,
1949 ],
1950 'width' => [
1951 'devices' => ['desktop'],
1952 'default' => [
1953 'top' => '2',
1954 'right' => '2',
1955 'bottom' => '2',
1956 'left' => '2',
1957 'isLinked' => true,
1958 ],
1959 'selectors' => [
1960 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_color' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1961 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_color' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
1962 ]
1963 ],
1964 'color' => [
1965 'label' => esc_html__('Border Color', 'shopengine'),
1966 'alpha' => false,
1967 'default' => '#F2F2F2',
1968 ],
1969 ],
1970 'separator' => 'before',
1971 ]
1972 );
1973
1974 $this->add_control(
1975 'shopengine_add_to_cart_variation_swatch_color_selected_label_border',
1976 [
1977 'label' => esc_html__('Selected Border Color', 'shopengine'),
1978 'type' => Controls_Manager::COLOR,
1979 'alpha' => false,
1980 'default' => '#101010',
1981 'selectors' => [
1982 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_color.selected' => 'border-color: {{VALUE}};',
1983 ],
1984 ]
1985 );
1986
1987 $this->end_controls_tab();
1988
1989 $this->start_controls_tab(
1990 'shopengine_add_to_cart_variation_swatch_image_tab',
1991 [
1992 'label' => esc_html__('Image', 'shopengine'),
1993 ]
1994 );
1995
1996 $this->add_control(
1997 'shopengine_add_to_cart_variation_swatch_image_width',
1998 [
1999 'label' => esc_html__('Swatch Width (px)', 'shopengine'),
2000 'type' => Controls_Manager::SLIDER,
2001 'size_units' => ['px'],
2002 'range' => [
2003 'px' => [
2004 'min' => 0,
2005 'max' => 150,
2006 'step' => 5,
2007 ],
2008 ],
2009 'default' => [
2010 'unit' => 'px',
2011 'size' => 30,
2012 ],
2013 'selectors' => [
2014 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch.swatch_image' => 'width: {{SIZE}}{{UNIT}};',
2015 ],
2016 ]
2017 );
2018
2019 $this->add_control(
2020 'shopengine_add_to_cart_variation_swatch_image_height',
2021 [
2022 'label' => esc_html__('Swatch Height (px)', 'shopengine'),
2023 'type' => Controls_Manager::SLIDER,
2024 'size_units' => ['px'],
2025 'range' => [
2026 'px' => [
2027 'min' => 0,
2028 'max' => 150,
2029 'step' => 5,
2030 ],
2031 ],
2032 'default' => [
2033 'unit' => 'px',
2034 'size' => 30,
2035 ],
2036 'selectors' => [
2037 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch.swatch_image' => 'height: {{SIZE}}{{UNIT}};',
2038 ],
2039 ]
2040 );
2041
2042 $this->add_control(
2043 'shopengine_add_to_cart_variation_swatch_image_border_radius',
2044 [
2045 'label' => esc_html__('Border Radius (px)', 'shopengine'),
2046 'type' => Controls_Manager::SLIDER,
2047 'size_units' => ['px'],
2048 'range' => [
2049 'px' => [
2050 'min' => 0,
2051 'max' => 100,
2052 'step' => 5,
2053 ]
2054 ],
2055 'default' => [
2056 'unit' => 'px',
2057 'size' => 100,
2058 ],
2059 'selectors' => [
2060 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_image' => 'border-radius: {{SIZE}}{{UNIT}};',
2061 ],
2062 ]
2063 );
2064 $this->add_group_control(
2065 Group_Control_Border::get_type(),
2066 [
2067 'name' => 'shopengine_add_to_cart_variation_swatch_image_label_border',
2068 'label' => esc_html__('Border', 'shopengine'),
2069 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_image',
2070 'fields_options' => [
2071 'border' => [
2072 'default' => 'solid',
2073 'devices' => ['desktop'],
2074 'responsive' => true,
2075 ],
2076 'width' => [
2077 'devices' => ['desktop'],
2078 'default' => [
2079 'top' => '2',
2080 'right' => '2',
2081 'bottom' => '2',
2082 'left' => '2',
2083 'isLinked' => true,
2084 ],
2085 'selectors' => [
2086 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_image' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2087 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_image' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2088 ]
2089 ],
2090 'color' => [
2091 'label' => esc_html__('Border Color', 'shopengine'),
2092 'alpha' => false,
2093 'default' => '#F2F2F2',
2094 ],
2095 ],
2096 'separator' => 'before',
2097 ]
2098 );
2099
2100 $this->add_control(
2101 'shopengine_add_to_cart_variation_swatch_image_selected_label_border',
2102 [
2103 'label' => esc_html__('Selected Border Color', 'shopengine'),
2104 'type' => Controls_Manager::COLOR,
2105 'alpha' => false,
2106 'default' => '#101010',
2107 'selectors' => [
2108 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_image.selected' => 'border-color: {{VALUE}};',
2109 ],
2110 ]
2111 );
2112
2113 $this->end_controls_tab();
2114
2115 $this->start_controls_tab(
2116 'shopengine_add_to_cart_variation_swatch_label_tab',
2117 [
2118 'label' => esc_html__('Label', 'shopengine'),
2119 ]
2120 );
2121
2122 $this->add_control(
2123 'shopengine_add_to_cart_variation_swatch_label_width',
2124 [
2125 'label' => esc_html__('Swatch Width (px)', 'shopengine'),
2126 'type' => Controls_Manager::SLIDER,
2127 'size_units' => ['px'],
2128 'range' => [
2129 'px' => [
2130 'min' => 0,
2131 'max' => 150,
2132 'step' => 5,
2133 ],
2134 ],
2135 'default' => [
2136 'unit' => 'px',
2137 'size' => 30,
2138 ],
2139 'selectors' => [
2140 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch.swatch_label' => 'min-width: {{SIZE}}{{UNIT}};',
2141 ],
2142 ]
2143 );
2144
2145 $this->add_control(
2146 'shopengine_add_to_cart_variation_swatch_label_height',
2147 [
2148 'label' => esc_html__('Swatch Height (px)', 'shopengine'),
2149 'type' => Controls_Manager::SLIDER,
2150 'size_units' => ['px'],
2151 'range' => [
2152 'px' => [
2153 'min' => 0,
2154 'max' => 150,
2155 'step' => 5,
2156 ],
2157 ],
2158 'default' => [
2159 'unit' => 'px',
2160 'size' => 30,
2161 ],
2162 'selectors' => [
2163 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch.swatch_label' => 'min-height: {{SIZE}}{{UNIT}};',
2164 ],
2165 ]
2166 );
2167
2168 $this->add_control(
2169 'shopengine_add_to_cart_variation_swatch_label_border_radius',
2170 [
2171 'label' => esc_html__('Border Radius', 'shopengine'),
2172 'type' => Controls_Manager::SLIDER,
2173 'size_units' => ['px'],
2174 'range' => [
2175 'px' => [
2176 'min' => 0,
2177 'max' => 100,
2178 'step' => 5,
2179 ]
2180 ],
2181 'default' => [
2182 'unit' => 'px',
2183 'size' => 5,
2184 ],
2185 'selectors' => [
2186 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'border-radius: {{SIZE}}{{UNIT}};',
2187 ],
2188 ]
2189 );
2190
2191 $this->add_control(
2192 'shopengine_add_to_cart_variation_swatch_label_padding',
2193 [
2194 'label' => esc_html__( 'Padding', 'shopengine' ),
2195 'type' => \Elementor\Controls_Manager::DIMENSIONS,
2196 'size_units' => [ 'px' ],
2197 'selectors' => [
2198 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2199 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2200 ],
2201 ]
2202 );
2203
2204 $this->add_group_control(
2205 Group_Control_Border::get_type(),
2206 [
2207 'name' => 'shopengine_add_to_cart_variation_swatch_label_label_border',
2208 'label' => esc_html__('Border', 'shopengine'),
2209 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label',
2210 'fields_options' => [
2211 'border' => [
2212 'default' => 'solid',
2213 'devices' => ['desktop'],
2214 'responsive' => true,
2215 ],
2216 'width' => [
2217 'devices' => ['desktop'],
2218 'default' => [
2219 'top' => '2',
2220 'right' => '2',
2221 'bottom' => '2',
2222 'left' => '2',
2223 'isLinked' => true,
2224 ],
2225 'selectors' => [
2226 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2227 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2228 ]
2229 ],
2230 'color' => [
2231 'label' => esc_html__('Border Color', 'shopengine'),
2232 'alpha' => false,
2233 'default' => '#F2F2F2',
2234 ],
2235 ],
2236 'separator' => 'before',
2237 ]
2238 );
2239
2240 $this->add_control(
2241 'shopengine_add_to_cart_variation_swatch_label_selected_label_border',
2242 [
2243 'label' => esc_html__('Selected Border Color', 'shopengine'),
2244 'type' => Controls_Manager::COLOR,
2245 'alpha' => false,
2246 'default' => '#101010',
2247 'selectors' => [
2248 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label.selected' => 'border-color: {{VALUE}};',
2249 ],
2250 ]
2251 );
2252 $this->add_control(
2253 'shopengine_add_to_cart_variation_swatch_label_text_color',
2254 [
2255 'label' => esc_html__('Text Color', 'shopengine'),
2256 'type' => Controls_Manager::COLOR,
2257 'alpha' => false,
2258 'default' => '#272626',
2259 'selectors' => [
2260 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'color: {{VALUE}} !important;',
2261 ],
2262 ]
2263 );
2264 $this->add_control(
2265 'shopengine_add_to_cart_variation_swatch_label_background_color',
2266 [
2267 'label' => esc_html__('Background Color', 'shopengine'),
2268 'type' => Controls_Manager::COLOR,
2269 'alpha' => false,
2270 'default' => '#f1f1f1',
2271 'selectors' => [
2272 '{{WRAPPER}} .shopengine-swatches .shopengine_swatches .swatch_label' => 'background-color: {{VALUE}} !important;',
2273 ],
2274 ]
2275 );
2276
2277 $this->end_controls_tab();
2278 $this->end_controls_tabs();
2279
2280
2281
2282 $this->end_controls_section();
2283
2284 if(!empty($m_settings['wishlist']['status']) && $m_settings['wishlist']['status'] === 'active') {
2285
2286 /*
2287 * Style Tab - Wishlist
2288 */
2289 $this->start_controls_section(
2290 'shopengine_section_add_cart_wishlist_style',
2291 array(
2292 'label' => esc_html__('Wishlist', 'shopengine'),
2293 'tab' => Controls_Manager::TAB_STYLE,
2294 )
2295 );
2296
2297 $this->add_control(
2298 'shopengine_add_cart_wishlist_size',
2299 [
2300 'label' => esc_html__('Icon Size', 'shopengine'),
2301 'type' => Controls_Manager::SLIDER,
2302 'size_units' => ['px'],
2303 'range' => [
2304 'px' => [
2305 'min' => 0,
2306 'max' => 100
2307 ],
2308 ],
2309 'default' => [
2310 'unit' => 'px',
2311 'size' => 15,
2312 ],
2313 'selectors' => [
2314 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'font-size: {{SIZE}}{{UNIT}};',
2315 ],
2316 ]
2317 );
2318
2319 $this->start_controls_tabs('shopengine_add_cart_wishlist_style_tabs');
2320
2321 $this->start_controls_tab(
2322 'shopengine_add_cart_wishlist_style_normal',
2323 [
2324 'label' => esc_html__('Normal', 'shopengine'),
2325 ]
2326 );
2327
2328 $this->add_control(
2329 'shopengine_add_cart_wishlist_button_color',
2330 [
2331 'label' => esc_html__('Color', 'shopengine'),
2332 'type' => Controls_Manager::COLOR,
2333 'alpha' => false,
2334 'default' => '#101010',
2335 'selectors' => [
2336 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'color: {{VALUE}};',
2337 ],
2338 ]
2339 );
2340
2341 $this->add_control(
2342 'shopengine_add_cart_wishlist_button_bg_color',
2343 [
2344 'label' => esc_html__('Background Color', 'shopengine'),
2345 'type' => Controls_Manager::COLOR,
2346 'alpha' => false,
2347 'default' => '#FFFFFF',
2348 'selectors' => [
2349 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'background: {{VALUE}}',
2350 ],
2351 ]
2352 );
2353
2354 $this->end_controls_tab();
2355
2356 $this->start_controls_tab(
2357 'shopengine_add_cart_wishlist_style_hover',
2358 [
2359 'label' => esc_html__('Hover', 'shopengine'),
2360 ]
2361 );
2362
2363 $this->add_control(
2364 'shopengine_add_cart_wishlist_button_hover_color',
2365 [
2366 'label' => esc_html__('Color', 'shopengine'),
2367 'type' => Controls_Manager::COLOR,
2368 'alpha' => false,
2369 'default' => '#FFFFFF',
2370 'selectors' => [
2371 '{{WRAPPER}} .shopengine-swatches :is(.shopengine-wishlist.badge.active,.shopengine-wishlist.badge:hover)' => 'color: {{VALUE}};',
2372 ],
2373 ]
2374 );
2375
2376 $this->add_control(
2377 'shopengine_add_cart_wishlist_button_bg_hover_color',
2378 [
2379 'label' => esc_html__('Background Color', 'shopengine'),
2380 'type' => Controls_Manager::COLOR,
2381 'default' => '#101010',
2382 'selectors' => [
2383 '{{WRAPPER}} .shopengine-swatches :is(.shopengine-wishlist.badge.active,.shopengine-wishlist.badge:hover)' => 'background: {{VALUE}}',
2384 ],
2385 ]
2386 );
2387
2388 $this->add_control(
2389 'shopengine_add_cart_wishlist_button_border_color_hover',
2390 [
2391 'label' => esc_html__('Border Color', 'shopengine'),
2392 'type' => Controls_Manager::COLOR,
2393 'alpha' => false,
2394 'default' => '#101010',
2395 'selectors' => [
2396 '{{WRAPPER}} .shopengine-swatches :is(.shopengine-wishlist.badge.active,.shopengine-wishlist.badge:hover)' => 'border-color: {{VALUE}}',
2397 ],
2398 ]
2399 );
2400
2401 $this->end_controls_tab();
2402 $this->end_controls_tabs();
2403
2404 $this->add_control(
2405 'shopengine_add_cart_wishlist_colors_separator',
2406 [
2407 'type' => Controls_Manager::DIVIDER,
2408 ]
2409 );
2410
2411 $this->add_group_control(
2412 Group_Control_Border::get_type(),
2413 [
2414 'name' => 'shopengine_add_cart_wishlist_border',
2415 'label' => esc_html__('Border (px)', 'shopengine'),
2416 'size_units' => ['px'],
2417 'fields_options' => [
2418 'border' => [
2419 'default' => 'solid',
2420 ],
2421 'width' => [
2422 'default' => [
2423 'top' => '2',
2424 'right' => '2',
2425 'bottom' => '2',
2426 'left' => '2',
2427 'isLinked' => true,
2428 ],
2429 'selectors' => [
2430 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2431 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2432 ]
2433 ],
2434 'color' => [
2435 'default' => '#F2F2F2',
2436 'alpha' => false,
2437 ]
2438 ],
2439 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge',
2440 ]
2441 );
2442
2443 $this->add_control(
2444 'shopengine_add_cart_wishlist_border_radius',
2445 [
2446 'label' => esc_html__('Border Radius (px)', 'shopengine'),
2447 'type' => Controls_Manager::DIMENSIONS,
2448 'default' => [
2449 'top' => '5',
2450 'right' => '5',
2451 'bottom' => '5',
2452 'left' => '5',
2453 'unit' => 'px',
2454 'isLinked' => true,
2455 ],
2456 'size_units' => ['px'],
2457 'selectors' => [
2458 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2459 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2460 ],
2461 'separator' => 'before',
2462 ]
2463 );
2464
2465 $this->add_control(
2466 'shopengine_add_cart_wishlist_padding',
2467 [
2468 'label' => esc_html__('Padding (px)', 'shopengine'),
2469 'type' => Controls_Manager::DIMENSIONS,
2470 'size_units' => ['px'],
2471 'default' => [
2472 'top' => '12',
2473 'right' => '25',
2474 'bottom' => '12',
2475 'left' => '25',
2476 'unit' => 'px',
2477 'isLinked' => false,
2478 ],
2479 'selectors' => [
2480 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2481 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2482 ],
2483 'separator' => 'before',
2484 ]
2485 );
2486
2487 $this->add_control(
2488 'shopengine_add_cart_wishlist_margin',
2489 [
2490 'label' => esc_html__('Margin (px)', 'shopengine'),
2491 'type' => Controls_Manager::DIMENSIONS,
2492 'size_units' => ['px'],
2493 'default' => [
2494 'top' => '0',
2495 'right' => '10',
2496 'bottom' => '0',
2497 'left' => '0',
2498 'unit' => 'px',
2499 'isLinked' => false,
2500 ],
2501 'selectors' => [
2502 '{{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2503 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-wishlist.badge' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2504 ],
2505 'separator' => 'before',
2506 ]
2507 );
2508
2509 $this->end_controls_section();
2510 }
2511
2512 if(!empty($m_settings['comparison']['status']) && $m_settings['comparison']['status'] === 'active') {
2513
2514
2515 /*
2516 * Style Tab - Compare
2517 */
2518 $this->start_controls_section(
2519 'shopengine_section_add_cart_compare_style',
2520 array(
2521 'label' => esc_html__('Compare', 'shopengine'),
2522 'tab' => Controls_Manager::TAB_STYLE,
2523 )
2524 );
2525
2526 $this->add_control(
2527 'shopengine_add_cart_compare_size',
2528 [
2529 'label' => esc_html__('Icon Size', 'shopengine'),
2530 'type' => Controls_Manager::SLIDER,
2531 'size_units' => ['px'],
2532 'range' => [
2533 'px' => [
2534 'min' => 0,
2535 'max' => 100
2536 ],
2537 ],
2538 'default' => [
2539 'unit' => 'px',
2540 'size' => 15,
2541 ],
2542 'selectors' => [
2543 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'font-size: {{SIZE}}{{UNIT}};',
2544 ],
2545 ]
2546 );
2547
2548 $this->start_controls_tabs('shopengine_add_cart_compare_style_tabs');
2549
2550 $this->start_controls_tab(
2551 'shopengine_add_cart_compare_style_normal',
2552 [
2553 'label' => esc_html__('Normal', 'shopengine'),
2554 ]
2555 );
2556
2557 $this->add_control(
2558 'shopengine_add_cart_compare_button_color',
2559 [
2560 'label' => esc_html__('Color', 'shopengine'),
2561 'type' => Controls_Manager::COLOR,
2562 'alpha' => false,
2563 'default' => '#101010',
2564 'selectors' => [
2565 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'color: {{VALUE}};',
2566 ],
2567 ]
2568 );
2569
2570 $this->add_control(
2571 'shopengine_add_cart_compare_button_bg_color',
2572 [
2573 'label' => esc_html__('Background Color', 'shopengine'),
2574 'type' => Controls_Manager::COLOR,
2575 'alpha' => false,
2576 'default' => '#FFFFFF',
2577 'selectors' => [
2578 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'background: {{VALUE}};',
2579 ],
2580 ]
2581 );
2582
2583 $this->end_controls_tab();
2584
2585 $this->start_controls_tab(
2586 'shopengine_add_cart_compare_style_hover',
2587 [
2588 'label' => esc_html__('Hover', 'shopengine'),
2589 ]
2590 );
2591
2592 $this->add_control(
2593 'shopengine_add_cart_compare_button_hover_color',
2594 [
2595 'label' => esc_html__('Color', 'shopengine'),
2596 'type' => Controls_Manager::COLOR,
2597 'alpha' => false,
2598 'default' => '#FFFFFF',
2599 'selectors' => [
2600 '{{WRAPPER}} .shopengine-swatches :is(.shopengine-comparison.badge.active, .shopengine-comparison.badge:hover)' => 'color: {{VALUE}};',
2601 ],
2602 ]
2603 );
2604
2605 $this->add_control(
2606 'shopengine_add_cart_compare_button_bg_hover_color',
2607 [
2608 'label' => esc_html__('Background Color', 'shopengine'),
2609 'type' => Controls_Manager::COLOR,
2610 'default' => '#101010',
2611 'selectors' => [
2612 '{{WRAPPER}} .shopengine-swatches :is(.shopengine-comparison.badge.active, .shopengine-comparison.badge:hover)' => 'background: {{VALUE}}',
2613 ],
2614 ]
2615 );
2616
2617 $this->add_control(
2618 'shopengine_add_cart_compare_button_border_color_hover',
2619 [
2620 'label' => esc_html__('Border Color', 'shopengine'),
2621 'type' => Controls_Manager::COLOR,
2622 'alpha' => false,
2623 'default' => '#101010',
2624 'selectors' => [
2625 '{{WRAPPER}} .shopengine-swatches :is(.shopengine-comparison.badge.active, .shopengine-comparison.badge:hover)' => 'border-color: {{VALUE}}',
2626 ],
2627 ]
2628 );
2629
2630 $this->end_controls_tab();
2631 $this->end_controls_tabs();
2632
2633 $this->add_control(
2634 'shopengine_add_cart_compare_colors_separator',
2635 [
2636 'type' => Controls_Manager::DIVIDER,
2637 ]
2638 );
2639
2640 $this->add_group_control(
2641 Group_Control_Border::get_type(),
2642 [
2643 'name' => 'shopengine_add_cart_compare_border',
2644 'label' => esc_html__('Border (px)', 'shopengine'),
2645 'size_units' => ['px'],
2646 'fields_options' => [
2647 'border' => [
2648 'default' => 'solid',
2649 ],
2650 'width' => [
2651 'default' => [
2652 'top' => '2',
2653 'right' => '2',
2654 'bottom' => '2',
2655 'left' => '2',
2656 'isLinked' => true,
2657 ],
2658 'selectors' => [
2659 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2660 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2661 ]
2662 ],
2663 'color' => [
2664 'default' => '#F2F2F2',
2665 'alpha' => false,
2666 ]
2667 ],
2668 'selector' => '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge',
2669 ]
2670 );
2671
2672 $this->add_control(
2673 'shopengine_add_cart_compare_border_radius',
2674 [
2675 'label' => esc_html__('Border Radius (px)', 'shopengine'),
2676 'type' => Controls_Manager::DIMENSIONS,
2677 'default' => [
2678 'top' => '5',
2679 'right' => '5',
2680 'bottom' => '5',
2681 'left' => '5',
2682 'unit' => 'px',
2683 'isLinked' => true,
2684 ],
2685 'size_units' => ['px'],
2686 'selectors' => [
2687 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2688 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2689 ],
2690 'separator' => 'before',
2691 ]
2692 );
2693
2694 $this->add_control(
2695 'shopengine_add_cart_compare_padding',
2696 [
2697 'label' => esc_html__('Padding (px)', 'shopengine'),
2698 'type' => Controls_Manager::DIMENSIONS,
2699 'size_units' => ['px'],
2700 'default' => [
2701 'top' => '12',
2702 'right' => '25',
2703 'bottom' => '12',
2704 'left' => '25',
2705 'unit' => 'px',
2706 'isLinked' => false,
2707 ],
2708 'selectors' => [
2709 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2710 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2711 ],
2712 'separator' => 'before',
2713 ]
2714 );
2715
2716 $this->add_control(
2717 'shopengine_add_cart_compare_margin',
2718 [
2719 'label' => esc_html__('Margin (px)', 'shopengine'),
2720 'type' => Controls_Manager::DIMENSIONS,
2721 'size_units' => ['px'],
2722 'default' => [
2723 'top' => '0',
2724 'right' => '10',
2725 'bottom' => '0',
2726 'left' => '0',
2727 'unit' => 'px',
2728 'isLinked' => false,
2729 ],
2730 'selectors' => [
2731 '{{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2732 '.rtl {{WRAPPER}} .shopengine-swatches .shopengine-comparison.badge' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};',
2733 ],
2734 'separator' => 'before',
2735 ]
2736 );
2737
2738 $this->end_controls_section();
2739 }
2740 }
2741
2742 private function order_item_css($order_items) {
2743 $styles = '';
2744 $parent_class = '.elementor-element-' . $this->get_id();
2745
2746 foreach($order_items as $key => $item) {
2747 $order_number = $key + 1;
2748 if($item['list_key'] == 'quantity') {
2749 $styles .= $parent_class . ' .shopengine-swatches .quantity-wrap {order: '. $order_number .';}';
2750 }
2751 if($item['list_key'] == 'add_to_cart') {
2752 $styles .= $parent_class . ' .shopengine-swatches .cart .button {order: '. $order_number .';}';
2753 }
2754 if($item['list_key'] == 'quick_checkout') {
2755 $styles .= $parent_class . ' .shopengine-swatches .shopengine-quick-checkout-button {order: '. $order_number .';}';
2756 }
2757 if($item['list_key'] == 'wishlist') {
2758 $styles .= $parent_class . ' .shopengine-swatches .shopengine-wishlist {order: '. $order_number .';}';
2759 }
2760 if($item['list_key'] == 'comparison') {
2761 $styles .= $parent_class . ' .shopengine-swatches .shopengine-comparison {order: '. $order_number .';}';
2762 }
2763 if($item['list_key'] == 'partial_payment') {
2764 $styles .= $parent_class . ' .shopengine-swatches .shopengine-partial-payment-container {order: '. $order_number .';}';
2765 }
2766 }
2767
2768 echo '<style>';
2769 shopengine_content_render($styles);
2770 echo '</style>';
2771 }
2772
2773
2774 protected function screen() {
2775 ?>
2776 <?php
2777 $settings = $this->get_settings_for_display();
2778 extract($settings);
2779
2780 if(!empty($shopengine_add_to_cart_data_ordering_list)) {
2781 $this->order_item_css($shopengine_add_to_cart_data_ordering_list);
2782 }
2783
2784 $post_type = get_post_type();
2785
2786 $product = Products::instance()->get_product($post_type);
2787
2788 $tpl = Products::instance()->get_widget_template($this->get_name());
2789
2790 include $tpl;
2791 }
2792 }
2793