PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.4
ShopBuilder – WooCommerce Builder For Elementor v1.1.4
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Controls / CartTableSettings.php

CartTableSettings.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.4, at app/Elementor/Widgets/Controls/CartTableSettings.php

831 lines 26.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductDescription class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Controls;
9
10 use Elementor\Controls_Manager;
11 use RadiusTheme\SB\Helpers\Fns;
12 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
13 use RadiusTheme\SB\Elementor\Widgets\Controls\ButtonSettings;
14
15 // Do not allow directly accessing this file.
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit( 'This script cannot be accessed directly.' );
18 }
19
20 /**
21 * Product Description class
22 */
23 class CartTableSettings {
24 /**
25 * Widget Control Selectors
26 *
27 * @var array
28 */
29 private static $selectors = [];
30 /**
31 * Widget Field
32 *
33 * @return array
34 */
35 public static function widget_fields( $widget ) {
36 self::$selectors = $widget->selectors;
37 return self::general_settings() +
38 self::cart_table() +
39 self::action_control() +
40 self::image_settings() +
41 ButtonSettings::style_settings( $widget ) +
42 self::input_style() +
43 self::cart_empty() +
44 self::return_shop_button_style() +
45 self::notice_style();
46 }
47
48 /**
49 * Widget Field
50 *
51 * @return array
52 */
53 public static function cart_table() {
54 $fields = [
55 'cart_table_settings' => [
56 'mode' => 'section_start',
57 'tab' => 'style',
58 'label' => esc_html__( 'Cart Table', 'shopbuilder' ),
59 ],
60 'cart_table_width' => [
61 'mode' => 'responsive',
62 'label' => esc_html__( 'Table Minimum Width', 'shopbuilder' ),
63 'type' => 'slider',
64 'separator' => 'default',
65 'size_units' => [ 'px', '%' ],
66 'range' => [
67 'px' => [
68 'min' => 320,
69 'max' => 3000,
70 'step' => 5,
71 ],
72 '%' => [
73 'min' => 0,
74 'max' => 100,
75 ],
76 ],
77 'selectors' => [
78 self::$selectors['cart_table_width'] => 'min-width: {{SIZE}}{{UNIT}};',
79 ],
80 ],
81 'cart_table_border' => [
82 'mode' => 'group',
83 'type' => 'border',
84 'label' => esc_html__( 'Table Border', 'shopbuilder' ),
85 'selector' => self::$selectors['cart_table_border'],
86 'size_units' => [ 'px' ],
87 ],
88 'table_column_header_padding' => [
89 'label' => esc_html__( 'Column Header Padding(px)', 'shopbuilder' ),
90 'type' => 'dimensions',
91 'size_units' => [ 'px' ],
92 'selectors' => [
93 self::$selectors['table_column_header_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
94 ],
95 ],
96
97 'table_content_column_padding' => [
98 'label' => esc_html__( 'Column Padding (px)', 'shopbuilder' ),
99 'type' => 'dimensions',
100 'size_units' => [ 'px' ],
101 'selectors' => [
102 self::$selectors['table_content_column_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
103 ],
104 ],
105 'cart_remove_icon_heading' => [
106 'type' => 'html',
107 'raw' => sprintf(
108 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
109 esc_html__( 'Remove Cart Item', 'shopbuilder' )
110 ),
111 'content_classes' => 'elementor-panel-heading-title',
112 ],
113 'cart_remove_button_size' => [
114 'label' => esc_html__( 'Remove Button Size', 'shopbuilder' ),
115 'type' => 'slider',
116 'range' => [
117 'px' => [
118 'min' => 10,
119 'max' => 100,
120 ],
121 ],
122 'selectors' => [
123 self::$selectors['cart_remove_button_size'] => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};',
124 ],
125 ],
126 'cart_remove_icon_size' => [
127 'label' => esc_html__( 'Remove Icon', 'shopbuilder' ),
128 'type' => 'slider',
129 'range' => [
130 'px' => [
131 'min' => 10,
132 'max' => 100,
133 ],
134 ],
135 'selectors' => [
136 self::$selectors['cart_remove_icon_size'] => 'font-size: {{SIZE}}{{UNIT}};',
137 ],
138 ],
139 'cart_icon_color' => [
140 'label' => esc_html__( 'Cart Icon Color', 'shopbuilder' ),
141 'type' => 'color',
142 'separator' => 'default',
143 'selectors' => [
144 self::$selectors['cart_icon_color'] => 'color: {{VALUE}};',
145 ],
146 ],
147 'action_button_padding' => [
148 'label' => esc_html__( 'Action Button Area padding(px)', 'shopbuilder' ),
149 'type' => 'dimensions',
150 'size_units' => [ 'px' ],
151 'selectors' => [
152 self::$selectors['action_button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
153 ],
154
155 ],
156 'table_wrapper_margin' => [
157 'label' => esc_html__( 'Table Wrapper Margin(px)', 'shopbuilder' ),
158 'type' => 'dimensions',
159 'size_units' => [ 'px' ],
160 'selectors' => [
161 self::$selectors['table_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
162 ],
163 ],
164 'cart_table_settings_end' => [
165 'mode' => 'section_end',
166 ],
167 ];
168 return $fields;
169 }
170
171 /**
172 * Widget Field
173 *
174 * @return array
175 */
176 public static function image_settings() {
177 $fields = [
178 'table_image_section' => [
179 'mode' => 'section_start',
180 'label' => esc_html__( 'Image ', 'shopbuilder' ),
181 'tab' => 'style',
182 ],
183 'table_thumbnail_width' => [
184 'mode' => 'responsive',
185 'label' => esc_html__( 'Thumbnail Image Width', 'shopbuilder' ),
186 'type' => 'slider',
187 'size_units' => [ '%', 'px' ],
188 'separator' => 'default',
189 'range' => [
190 '%' => [
191 'min' => 0,
192 'max' => 100,
193 'step' => 1,
194 ],
195 'px' => [
196 'min' => 0,
197 'max' => 2000,
198 'step' => 1,
199 ],
200 ],
201 'default' => [
202 'unit' => '%',
203 ],
204 'selectors' => [
205 self::$selectors['table_thumbnail_width'] => 'width: {{SIZE}}{{UNIT}} !important;',
206 ],
207 ],
208 'table_thumbnail_padding' => [
209 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ),
210 'type' => 'dimensions',
211 'size_units' => [ 'px' ],
212 'selectors' => [
213 self::$selectors['table_thumbnail_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
214 ],
215 'separator' => 'before',
216 ],
217 'table_image_section_end' => [
218 'mode' => 'section_end',
219 ],
220 ];
221 return $fields;
222 }
223 /**
224 * Widget Field
225 *
226 * @return array
227 */
228 public static function general_settings() {
229 $fields = [
230 'general_section' => [
231 'mode' => 'section_start',
232 'label' => esc_html__( 'General ', 'shopbuilder' ),
233 ],
234 'show_coupon_field' => [
235 'label' => esc_html__( 'Show Coupon field?', 'shopbuilder' ),
236 'type' => 'switch',
237 'description' => esc_html__( 'Switch on to show Coupon.', 'shopbuilder' ),
238 'separator' => 'default',
239 'default' => 'yes',
240 ],
241 'cart_empty_message' => [
242 'type' => 'text',
243 'label' => esc_html__( 'Cart Empty Text', 'shopbuilder' ),
244 'description' => esc_html__( 'Leave Empty For default.', 'shopbuilder' ),
245 ],
246 'return_to_shop_text' => [
247 'type' => 'text',
248 'label' => esc_html__( 'Return to shop', 'shopbuilder' ),
249 'description' => esc_html__( 'Return to shop button text. Leave Empty For default.', 'shopbuilder' ),
250 ],
251 'cart_table' => [
252 'type' => 'repeater',
253 'mode' => 'repeater',
254 'label' => esc_html__( 'Cart Table', 'shopbuilder' ),
255 'fields' => [
256 'cart_table_items' => [
257 'label' => esc_html__( 'Table Item', 'shopbuilder' ),
258 'type' => 'select',
259 'separator' => 'default',
260 'default' => 'remove',
261 'options' => [
262 'remove' => esc_html__( 'Remove', 'shopbuilder' ),
263 'thumbnail' => esc_html__( 'Thumbnail', 'shopbuilder' ),
264 'name' => esc_html__( 'Product Title', 'shopbuilder' ),
265 'price' => esc_html__( 'Price', 'shopbuilder' ),
266 'quantity' => esc_html__( 'Quantity', 'shopbuilder' ),
267 'subtotal' => esc_html__( 'Total', 'shopbuilder' ),
268 'custom_field' => esc_html__( 'Custom Field', 'shopbuilder' ),
269 ],
270 ],
271 'cart_table_heading_title' => [
272 'label' => esc_html__( 'Heading', 'shopbuilder' ),
273 'type' => 'text',
274 'separator' => 'default',
275 ],
276 'cart_table_thumbnail_size' => [
277 'type' => 'select',
278 'label' => esc_html__( 'Thumbnail Size', 'shopbuilder' ),
279 'default' => 'woocommerce_thumbnail',
280 'options' => Fns::get_image_sizes(),
281 'condition' => [
282 'cart_table_items' => 'thumbnail',
283 ],
284 ],
285 'cart_table_remove_icon' => [
286 'label' => esc_html__( 'Icon', 'shopbuilder' ),
287 'type' => 'icons',
288 'fa4compatibility' => 'breadcrumbsicon',
289 'default' => [
290 'value' => 'fas fa-times-circle',
291 'library' => 'fa-solid',
292 ],
293 'condition' => [
294 'cart_table_items' => 'remove',
295 ],
296 ],
297 'cart_table_custom_field' => [
298 'label' => esc_html__( 'Meta Field Key', 'shopbuilder' ),
299 'type' => 'text',
300 'condition' => [
301 'cart_table_items' => 'custom_field',
302 ],
303 ],
304 'cart_table_custom_field_fallback' => [
305 'label' => esc_html__( 'Fallback', 'shopbuilder' ),
306 'type' => 'text',
307 'default' => '',
308 'description' => esc_html__( 'Show this if field value is empty', 'shopbuilder' ),
309 'condition' => [
310 'cart_table_items' => 'custom_field',
311 ],
312 ],
313 'cart_table_cell_width' => [
314 'mode' => 'responsive',
315 'label' => esc_html__( 'Column Width', 'shopbuilder' ),
316 'type' => 'slider',
317 'size_units' => [ 'px', '%' ],
318 'range' => [
319 'px' => [
320 'min' => 0,
321 'max' => 1000,
322 'step' => 5,
323 ],
324 '%' => [
325 'min' => 0,
326 'max' => 100,
327 ],
328 ],
329 'selectors' => [
330 self::$selectors['cart_table_cell_width']['th'] . '{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};',
331 self::$selectors['cart_table_cell_width']['td'] . '{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};',
332 ],
333 ],
334 ],
335 'default' => [
336 [
337 'cart_table_items' => 'remove',
338 'cart_table_heading_title' => esc_html__( 'Remove', 'shopbuilder' ),
339 ],
340 [
341 'cart_table_items' => 'thumbnail',
342 'cart_table_heading_title' => esc_html__( 'Thumbnail', 'shopbuilder' ),
343 ],
344 [
345 'cart_table_items' => 'name',
346 'cart_table_heading_title' => esc_html__( 'Product Title', 'shopbuilder' ),
347 ],
348 [
349 'cart_table_items' => 'price',
350 'cart_table_heading_title' => esc_html__( 'Price', 'shopbuilder' ),
351 ],
352 [
353 'cart_table_items' => 'quantity',
354 'cart_table_heading_title' => esc_html__( 'Quantity', 'shopbuilder' ),
355 ],
356 [
357 'cart_table_items' => 'subtotal',
358 'cart_table_heading_title' => esc_html__( 'Total', 'shopbuilder' ),
359 ],
360 ],
361 'title_field' => '{{{ cart_table_heading_title }}}',
362 ],
363
364 'general_section_end' => [
365 'mode' => 'section_end',
366 ],
367 ];
368 return $fields;
369 }
370
371 /**
372 * Widget Field
373 *
374 * @return array
375 */
376 public static function action_control() {
377 $fields = [
378 'action_control_section' => [
379 'mode' => 'section_start',
380 'label' => esc_html__( 'Action ', 'shopbuilder' ),
381 ],
382 'cart_table_update_button_heading' => [
383 'type' => 'html',
384 'raw' => sprintf(
385 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
386 esc_html__( 'Update Button', 'shopbuilder' )
387 ),
388 'content_classes' => 'elementor-panel-heading-title',
389 'separator' => 'default',
390 ],
391 'cart_table_update_button_text' => [
392 'label' => esc_html__( 'Label', 'shopbuilder' ),
393 'type' => 'text',
394 'separator' => 'default',
395 'default' => esc_html__( 'Update Cart', 'shopbuilder' ),
396 'placeholder' => esc_html__( 'Update Cart', 'shopbuilder' ),
397 ],
398 'cart_table_coupon_form_heading' => [
399 'type' => 'html',
400 'raw' => sprintf(
401 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
402 esc_html__( 'Coupon Form', 'shopbuilder' )
403 ),
404 'content_classes' => 'elementor-panel-heading-title',
405 'separator' => 'before',
406 'condition' => [
407 'show_coupon_field' => 'yes',
408 ],
409 ],
410 'cart_table_coupon_button_text' => [
411 'label' => esc_html__( 'Button Label', 'shopbuilder' ),
412 'type' => 'text',
413 'separator' => 'default',
414 'default' => esc_html__( 'Apply Coupon', 'shopbuilder' ),
415 'placeholder' => esc_html__( 'Apply Coupon', 'shopbuilder' ),
416 'condition' => [
417 'show_coupon_field' => 'yes',
418 ],
419 ],
420 'cart_table_coupon_placeholder_text' => [
421 'label' => esc_html__( 'Placeholder Text', 'shopbuilder' ),
422 'type' => 'text',
423 'default' => esc_html__( 'Coupon Code', 'shopbuilder' ),
424 'placeholder' => esc_html__( 'Coupon Code', 'shopbuilder' ),
425 'condition' => [
426 'show_coupon_field' => 'yes',
427 ],
428 ],
429 'action_control_section_end' => [
430 'mode' => 'section_end',
431 ],
432 ];
433 return $fields;
434 }
435
436 /**
437 * Widget Field
438 *
439 * @return array
440 */
441 public static function notice_style() {
442 $fields = [
443 'notice_section' => [
444 'mode' => 'section_start',
445 'tab' => 'style',
446 'label' => esc_html__( 'Notice ', 'shopbuilder' ),
447 ],
448 'notice_typography' => [
449 'mode' => 'group',
450 'type' => 'typography',
451 'label' => esc_html__( 'Typography', 'shopbuilder' ),
452 'selector' => self::$selectors['notice_typography'],
453 ],
454 'notice_padding' => [
455 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ),
456 'type' => 'dimensions',
457 'size_units' => [ 'px' ],
458 'selectors' => [
459 self::$selectors['notice_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
460 ],
461 'separator' => 'before',
462 ],
463
464 'notice_tabs_start' => [
465 'mode' => 'tabs_start',
466 ],
467 // Tab For normal view.
468 'notice_normal' => [
469 'mode' => 'tab_start',
470 'label' => esc_html__( 'Success Message', 'shopbuilder' ),
471 ],
472 'notice_bg_color' => [
473 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
474 'type' => 'color',
475
476 'separator' => 'default',
477 'selectors' => [
478 self::$selectors['notice_bg_color'] => 'background-color: {{VALUE}};',
479 ],
480 ],
481 'notice_text_color' => [
482 'label' => esc_html__( 'Color', 'shopbuilder' ),
483 'type' => 'color',
484
485 'selectors' => [
486 self::$selectors['notice_text_color'] => 'color: {{VALUE}};',
487 ],
488 ],
489 'notice_border_color' => [
490 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
491 'type' => 'color',
492
493 'selectors' => [
494 self::$selectors['notice_border_color'] => 'border-color: {{VALUE}};',
495 ],
496 ],
497 'notice_normal_end' => [
498 'mode' => 'tab_end',
499 ],
500 'notice_hover' => [
501 'mode' => 'tab_start',
502 'label' => esc_html__( 'Error Messsage', 'shopbuilder' ),
503 ],
504 'error_notice_bg_color' => [
505 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
506 'type' => 'color',
507 'separator' => 'default',
508
509 'selectors' => [
510 self::$selectors['error_notice_bg_color'] => 'background-color: {{VALUE}};',
511 ],
512 ],
513 'error_notice_text_color' => [
514 'label' => esc_html__( 'Color', 'shopbuilder' ),
515 'type' => 'color',
516
517 'selectors' => [
518 self::$selectors['error_notice_text_color'] => 'color: {{VALUE}};',
519 ],
520 ],
521 'error_notice_border_color' => [
522 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
523 'type' => 'color',
524
525 'selectors' => [
526 self::$selectors['error_notice_border_color'] => 'border-color: {{VALUE}};',
527 ],
528 ],
529 'notice_hover_end' => [
530 'mode' => 'tab_end',
531 ],
532 'notice_tabs_end' => [
533 'mode' => 'tabs_end',
534 ],
535
536 'notice_section_end' => [
537 'mode' => 'section_end',
538 ],
539 ];
540 return $fields;
541 }
542
543
544 /**
545 * Widget Field
546 *
547 * @return array
548 */
549 public static function input_style() {
550 $fields = [
551 'input_section_start' => [
552 'mode' => 'section_start',
553 'label' => esc_html__( 'Input Field', 'shopbuilder' ),
554 'tab' => 'style',
555 ],
556 'quantity_input_width' => [
557 'label' => esc_html__( 'Quantity Width', 'shopbuilder' ),
558 'type' => 'slider',
559 'separator' => 'default',
560 'range' => [
561 'px' => [
562 'min' => 50,
563 'max' => 100,
564 ],
565 ],
566 'selectors' => [
567 self::$selectors['quantity_input_width'] => 'width: {{SIZE}}{{UNIT}};',
568 ],
569 ],
570 'quantity_input_height' => [
571 'label' => esc_html__( 'Quantity Height', 'shopbuilder' ),
572 'type' => 'slider',
573 'separator' => 'default',
574 'range' => [
575 'px' => [
576 'min' => 10,
577 'max' => 200,
578 ],
579 ],
580 'selectors' => [
581 self::$selectors['quantity_input_height'] => 'height: {{SIZE}}{{UNIT}};',
582 ],
583 ],
584 'coupon_input_width' => [
585 'label' => esc_html__( 'Coupon Width', 'shopbuilder' ),
586 'type' => 'slider',
587 'range' => [
588 'px' => [
589 'min' => 80,
590 'max' => 500,
591 ],
592 ],
593 'selectors' => [
594 self::$selectors['coupon_input_width'] => 'width: {{SIZE}}{{UNIT}} !important;',
595 ],
596 ],
597 'coupon_input_height' => [
598 'label' => esc_html__( 'Coupon Height', 'shopbuilder' ),
599 'type' => 'slider',
600 'range' => [
601 'px' => [
602 'min' => 10,
603 'max' => 100,
604 ],
605 ],
606 'selectors' => [
607 self::$selectors['coupon_input_height'] => 'height: {{SIZE}}{{UNIT}} !important;',
608 ],
609 ],
610 'input_border' => [
611 'mode' => 'group',
612 'type' => 'border',
613 'selector' => self::$selectors['input_border'],
614 'size_units' => [ 'px' ],
615 ],
616 'input_text_color' => [
617 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
618 'type' => 'color',
619
620 'selectors' => [
621 self::$selectors['input_text_color'] => 'color: {{VALUE}};',
622 ],
623 ],
624 'input_bg_color' => [
625 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
626 'type' => 'color',
627 'alpha' => true,
628 'selectors' => [
629 self::$selectors['input_bg_color'] => 'background-color: {{VALUE}};',
630 ],
631 ],
632 'coupon_style_section_end' => [
633 'mode' => 'section_end',
634 ],
635 ];
636 return $fields;
637 }
638
639 /**
640 * Widget Field
641 *
642 * @return array
643 */
644 public static function cart_empty() {
645 $fields = [
646 'empty_notice_section' => [
647 'mode' => 'section_start',
648 'tab' => 'style',
649 'label' => esc_html__( 'Cart Empty', 'shopbuilder' ),
650 ],
651
652 'empty_notice_typography' => [
653 'mode' => 'group',
654 'type' => 'typography',
655 'label' => esc_html__( 'Typography', 'shopbuilder' ),
656 'selector' => self::$selectors['empty_notice_typography'],
657 ],
658 'empty_notice_bg_color' => [
659 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
660 'type' => 'color',
661 'selectors' => [
662 self::$selectors['empty_notice_bg_color'] => 'background-color: {{VALUE}};',
663 ],
664 ],
665 'empty_notice_text_color' => [
666 'label' => esc_html__( 'Color', 'shopbuilder' ),
667 'type' => 'color',
668
669 'selectors' => [
670 self::$selectors['empty_notice_text_color'] => 'color: {{VALUE}};',
671 ],
672 ],
673 'empty_notice_border_color' => [
674 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
675 'type' => 'color',
676
677 'selectors' => [
678 self::$selectors['empty_notice_border_color'] => 'border-color: {{VALUE}};',
679 ],
680 ],
681 'empty_notice_padding' => [
682 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ),
683 'type' => 'dimensions',
684 'size_units' => [ 'px' ],
685 'selectors' => [
686 self::$selectors['empty_notice_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
687 ],
688 'separator' => 'before',
689 ],
690 'empty_notice_section_end' => [
691 'mode' => 'section_end',
692 ],
693 ];
694 return $fields;
695 }
696
697 /**
698 * Widget Field
699 *
700 * @return array
701 */
702 public static function return_shop_button_style() {
703 $alignment = ControlHelper::alignment();
704 unset( $alignment['justify'] );
705 $fields = [
706 'return_shop_button_section_start' => [
707 'mode' => 'section_start',
708 'label' => esc_html__( 'Return Shop Button', 'shopbuilder' ),
709 'tab' => 'style',
710 ],
711 'return_shop_button_typography' => [
712 'mode' => 'group',
713 'type' => 'typography',
714 'label' => esc_html__( 'Typography', 'shopbuilder' ),
715 'selector' => self::$selectors['return_shop_button_typography'],
716 ],
717 'return_shop_button_height' => [
718 'label' => esc_html__( 'Button Height', 'shopbuilder' ),
719 'type' => 'slider',
720 'range' => [
721 'px' => [
722 'min' => 10,
723 'max' => 100,
724 ],
725 ],
726 'selectors' => [
727 self::$selectors['return_shop_button_height'] => 'height: {{SIZE}}{{UNIT}};',
728 ],
729 ],
730 'return_shop_button_tabs_start' => [
731 'mode' => 'tabs_start',
732 ],
733 // Tab For normal view.
734 'return_shop_button_normal' => [
735 'mode' => 'tab_start',
736 'label' => esc_html__( 'Normal', 'shopbuilder' ),
737 ],
738 'return_shop_button_text_color_normal' => [
739 'label' => esc_html__( 'Color', 'shopbuilder' ),
740 'type' => 'color',
741
742 'separator' => 'default',
743 'selectors' => [
744 self::$selectors['return_shop_button_text_color_normal'] => 'color: {{VALUE}};',
745 ],
746 ],
747 'return_shop_button_bg_color_normal' => [
748 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
749 'type' => 'color',
750 'selectors' => [
751 self::$selectors['return_shop_button_bg_color_normal'] => 'background-color: {{VALUE}};',
752 ],
753 ],
754
755 'return_shop_button_border' => [
756 'mode' => 'group',
757 'type' => 'border',
758 'selector' => self::$selectors['return_shop_button_border'],
759 'size_units' => [ 'px' ],
760 ],
761 'return_shop_button_normal_end' => [
762 'mode' => 'tab_end',
763 ],
764 'return_shop_button_hover' => [
765 'mode' => 'tab_start',
766 'label' => esc_html__( 'Hover', 'shopbuilder' ),
767 ],
768 'return_shop_button_text_color_hover' => [
769 'label' => esc_html__( 'Color', 'shopbuilder' ),
770 'type' => 'color',
771
772 'separator' => 'default',
773 'selectors' => [
774 self::$selectors['return_shop_button_text_color_hover'] => 'color: {{VALUE}};',
775 ],
776 ],
777 'return_shop_button_bg_color_hover' => [
778 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
779 'type' => 'color',
780 'selectors' => [
781 self::$selectors['return_shop_button_bg_color_hover'] => 'background-color: {{VALUE}};',
782 ],
783 ],
784 'return_shop_button_border_hover_color' => [
785 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
786 'type' => 'color',
787
788 'selectors' => [
789 self::$selectors['return_shop_button_border_hover_color'] => 'border-color: {{VALUE}};',
790 ],
791 ],
792 'return_shop_button_hover_end' => [
793 'mode' => 'tab_end',
794 ],
795 'return_shop_button_tabs_end' => [
796 'mode' => 'tabs_end',
797 ],
798 'return_shop_button_border_radius' => [
799 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ),
800 'type' => 'dimensions',
801 'size_units' => [ 'px' ],
802 'separator' => 'before',
803 'selectors' => [
804 self::$selectors['return_shop_button_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
805 ],
806 ],
807 'return_shop_button_padding' => [
808 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ),
809 'type' => 'dimensions',
810 'size_units' => [ 'px' ],
811 'selectors' => [
812 self::$selectors['return_shop_button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
813 ],
814 'separator' => 'before',
815 ],
816 'return_shop_button_margin' => [
817 'label' => esc_html__( 'Margin (px)', 'shopbuilder' ),
818 'type' => 'dimensions',
819 'size_units' => [ 'px' ],
820 'selectors' => [
821 self::$selectors['return_shop_button_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
822 ],
823 ],
824 'return_shop_button_section_end' => [
825 'mode' => 'section_end',
826 ],
827 ];
828 return $fields;
829 }
830 }
831