PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.2
ShopBuilder – WooCommerce Builder For Elementor v3.4.2
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 / OrderReviewSettings.php

OrderReviewSettings.php in ShopBuilder – WooCommerce Builder For Elementor 3.4.2, at app/Elementor/Widgets/Controls/OrderReviewSettings.php

591 lines 17.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
13 // Do not allow directly accessing this file.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * Product Description class
20 */
21 class OrderReviewSettings {
22 /**
23 * Widget Control Selectors
24 *
25 * @var object
26 */
27 private static $widget = [];
28 /**
29 * Widget Control Selectors
30 *
31 * @var array
32 */
33 private static $selectors = [];
34
35 /**
36 * Controls Settings
37 *
38 * @param object $widget widget object.
39 *
40 * @return array
41 */
42 public static function widget_fields( $widget ) {
43 self::$widget = $widget;
44 self::$selectors = self::$widget->selectors;
45
46 return self::general_settings() + TitleSettings::title_settings( self::$widget ) + self::review_tables() + self::quantity_style();
47 }
48
49 /**
50 * Widget Field
51 *
52 * @return array
53 */
54 public static function general_settings() {
55 // The function will Overwrite.
56 $fields = TitleSettings::general_settings();
57
58 $new_fields['show_quantity'] = [
59 'label' => esc_html__( 'Show Quantity Selector?', 'shopbuilder' ),
60 'type' => 'switch',
61 'description' => esc_html__( 'Switch on to let customers change the item quantity from the order review table.', 'shopbuilder' ),
62 'default' => '',
63 'separator' => 'default',
64 ];
65 $new_fields['table_horizontal_scroll_on_mobile'] = [
66 'label' => esc_html__( 'Show default Table View On Mobile?', 'shopbuilder' ),
67 'type' => 'switch',
68 'description' => esc_html__( 'Show default Table View On Mobile?', 'shopbuilder' ),
69 'default' => '',
70 'separator' => rtsb()->has_pro() ? 'default' : 'before-short',
71 ];
72 $new_fields['table_min_width'] = [
73 'mode' => 'responsive',
74 'label' => esc_html__( 'Table Minimum Width', 'shopbuilder' ),
75 'description' => esc_html__( 'Enter table min-width (in px),', 'shopbuilder' ),
76 'type' => 'slider',
77 'size_units' => [ 'px' ],
78 'range' => [
79 'px' => [
80 'min' => 0,
81 'max' => 1000,
82 'step' => 5,
83 ],
84 ],
85 'condition' => [
86 'table_horizontal_scroll_on_mobile' => 'yes',
87 ],
88 'selectors' => [
89 self::$selectors['table_min_width'] => 'min-width: {{SIZE}}{{UNIT}};',
90 ],
91 ];
92
93 return Fns::insert_controls( 'show_title', $fields, $new_fields, true );
94 }
95
96 /**
97 * Widget Field
98 *
99 * @return array
100 */
101 public static function review_tables(): array {
102 // The function will Overwrite.
103 return [
104 'review_table_start' => [
105 'mode' => 'section_start',
106 'tab' => 'style',
107 'label' => esc_html__( 'Order Review Table', 'shopbuilder' ),
108 ],
109
110 'table_wrapper_border' => [
111 'mode' => 'group',
112 'type' => 'border',
113 'selector' => self::$selectors['table_wrapper_border'],
114 'size_units' => [ 'px' ],
115 'separator' => 'default',
116 'fields_options' => [
117 'border' => [
118 'label' => esc_html__( 'Table Wrapper Border', 'shopbuilder' ),
119 'label_block' => true,
120 'default' => 'solid',
121 ],
122 'width' => [
123 'default' => [
124 'top' => '0',
125 'right' => '0',
126 'bottom' => '0',
127 'left' => '0',
128 'isLinked' => true,
129 ],
130 ],
131 'color' => [
132 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
133 ],
134 ],
135 ],
136
137 'table_border' => [
138 'mode' => 'group',
139 'type' => 'border',
140 'selector' => self::$selectors['table_border'],
141 'size_units' => [ 'px' ],
142 'separator' => 'default',
143 'fields_options' => [
144 'border' => [
145 'label' => esc_html__( 'Table Cell Border', 'shopbuilder' ),
146 'label_block' => true,
147 ],
148 'color' => [
149 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
150 ],
151 ],
152 ],
153
154 'table_wrapper_padding' => [
155 'label' => esc_html__( 'Wrapper Padding (px)', 'shopbuilder' ),
156 'type' => 'dimensions',
157 'mode' => 'responsive',
158 'size_units' => [ 'px' ],
159 'default' => [
160 'top' => '0',
161 'right' => '0',
162 'bottom' => '0',
163 'left' => '0',
164 'unit' => 'px',
165 'isLinked' => true,
166 ],
167 'selectors' => [
168 self::$selectors['table_wrapper_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
169 ],
170 ],
171 'table_wrapper_margin' => [
172 'label' => esc_html__( 'Wrapper Margin (px)', 'shopbuilder' ),
173 'type' => 'dimensions',
174 'mode' => 'responsive',
175 'size_units' => [ 'px' ],
176 'selectors' => [
177 self::$selectors['table_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
178 ],
179 ],
180
181 'table_label' => [
182 'type' => 'html',
183 'raw' => sprintf(
184 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
185 esc_html__( 'Label', 'shopbuilder' )
186 ),
187 'content_classes' => 'elementor-panel-heading-title',
188 'separator' => 'default',
189 ],
190 'label_typo' => [
191 'mode' => 'group',
192 'type' => 'typography',
193 'label' => esc_html__( 'Label Typography', 'shopbuilder' ),
194 'selector' => self::$selectors['label_typo'],
195 ],
196 'label_color' => [
197 'label' => esc_html__( 'Label Color', 'shopbuilder' ),
198 'type' => 'color',
199 'selectors' => [
200 self::$selectors['label_color'] => 'color: {{VALUE}} !important;',
201 ],
202 ],
203 'label_item_padding' => [
204 'label' => esc_html__( 'Item Padding (px)', 'shopbuilder' ),
205 'type' => 'dimensions',
206 'mode' => 'responsive',
207 'size_units' => [ 'px' ],
208 'selectors' => [
209 self::$selectors['label_item_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
210 ],
211 ],
212
213 'label_bg_color' => [
214 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
215 'type' => 'color',
216 'alpha' => true,
217 'selectors' => [
218 self::$selectors['label_bg_color'] => 'background-color: {{VALUE}};',
219 ],
220 ],
221 'table_body' => [
222 'type' => 'html',
223 'raw' => sprintf(
224 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
225 esc_html__( 'Table Body', 'shopbuilder' )
226 ),
227 'content_classes' => 'elementor-panel-heading-title',
228 'separator' => 'default',
229 ],
230 'body_text_typo' => [
231 'mode' => 'group',
232 'type' => 'typography',
233 'label' => esc_html__( 'Typography', 'shopbuilder' ),
234 'selector' => self::$selectors['body_text_typo'],
235 ],
236 'table_text_color' => [
237 'label' => esc_html__( 'Body Text Color', 'shopbuilder' ),
238 'type' => 'color',
239 'selectors' => [
240 self::$selectors['body_text_color'] => 'color: {{VALUE}} !important;',
241 ],
242 ],
243 'table_body_bg_color' => [
244 'label' => esc_html__( 'Table Body Background Color', 'shopbuilder' ),
245 'type' => 'color',
246 'alpha' => true,
247 'selectors' => [
248 self::$selectors['table_body_bg_color'] => 'background-color: {{VALUE}};',
249 ],
250 ],
251 'body_item_padding' => [
252 'label' => esc_html__( 'Item Padding (px)', 'shopbuilder' ),
253 'type' => 'dimensions',
254 'mode' => 'responsive',
255 'size_units' => [ 'px' ],
256 'selectors' => [
257 self::$selectors['body_item_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
258 ],
259 ],
260 'counter_text_color' => [
261 'label' => esc_html__( 'Counter Text Color', 'shopbuilder' ),
262 'type' => 'color',
263 'selectors' => [
264 self::$selectors['counter_text_color'] => 'color: {{VALUE}} !important;',
265 ],
266 ],
267 'counter_style' => [
268 'label' => esc_html__( 'Counter Style', 'shopbuilder' ),
269 'type' => 'choose',
270 'default' => 'column',
271 'options' => [
272 'auto' => [
273 'title' => esc_html__( 'Inline', 'shopbuilder' ),
274 'icon' => 'eicon-ellipsis-h',
275 ],
276 '100%' => [
277 'title' => esc_html__( 'New Line', 'shopbuilder' ),
278 'icon' => 'eicon-editor-list-ul',
279 ],
280 ],
281 'selectors' => [
282 self::$selectors['counter_style'] => 'width:{{VALUE}};',
283 ],
284 ],
285 'table_footer' => [
286 'type' => 'html',
287 'raw' => sprintf(
288 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
289 esc_html__( 'Table Footer', 'shopbuilder' )
290 ),
291 'content_classes' => 'elementor-panel-heading-title',
292 'separator' => 'default',
293 ],
294 'table_footer_label_typo' => [
295 'mode' => 'group',
296 'type' => 'typography',
297 'label' => esc_html__( 'Footer Typography', 'shopbuilder' ),
298 'selector' => self::$selectors['table_footer_label_typo'],
299 ],
300 'table_footer_label_color' => [
301 'label' => esc_html__( 'Label Color', 'shopbuilder' ),
302 'type' => 'color',
303 'selectors' => [
304 self::$selectors['table_footer_label_color'] => 'color: {{VALUE}} !important;',
305 ],
306 ],
307
308 'table_footer_text_color' => [
309 'label' => esc_html__( 'Value Color', 'shopbuilder' ),
310 'type' => 'color',
311 'selectors' => [
312 self::$selectors['table_footer_text_color'] => 'color: {{VALUE}} !important;',
313 ],
314 ],
315 'table_footer_label_bg_color' => [
316 'label' => esc_html__( 'Footer Background Color', 'shopbuilder' ),
317 'type' => 'color',
318 'alpha' => true,
319 'selectors' => [
320 self::$selectors['table_footer_label_bg_color'] => 'background-color: {{VALUE}};',
321 ],
322 ],
323 'table_footer_item_padding' => [
324 'label' => esc_html__( 'Item Padding (px)', 'shopbuilder' ),
325 'type' => 'dimensions',
326 'mode' => 'responsive',
327 'size_units' => [ 'px' ],
328 'selectors' => [
329 self::$selectors['table_footer_item_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
330 ],
331 ],
332 'review_table_end' => [
333 'mode' => 'section_end',
334 ],
335 ];
336 }
337
338 /**
339 * Quantity selector style fields.
340 *
341 * @return array
342 */
343 public static function quantity_style(): array {
344 return [
345 'qty_section_start' => [
346 'mode' => 'section_start',
347 'tab' => 'style',
348 'label' => esc_html__( 'Quantity Selector', 'shopbuilder' ),
349 'condition' => [
350 'show_quantity' => 'yes',
351 ],
352 ],
353
354 'qty_align' => [
355 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
356 'type' => 'choose',
357 'mode' => 'responsive',
358 'options' => [
359 'flex-start' => [
360 'title' => esc_html__( 'Left', 'shopbuilder' ),
361 'icon' => 'eicon-text-align-left',
362 ],
363 'center' => [
364 'title' => esc_html__( 'Center', 'shopbuilder' ),
365 'icon' => 'eicon-text-align-center',
366 ],
367 'flex-end' => [
368 'title' => esc_html__( 'Right', 'shopbuilder' ),
369 'icon' => 'eicon-text-align-right',
370 ],
371 ],
372 'selectors' => [
373 self::$selectors['qty_align'] => 'justify-content: {{VALUE}};',
374 ],
375 ],
376 'qty_wrapper_margin' => [
377 'label' => esc_html__( 'Margin (px)', 'shopbuilder' ),
378 'type' => 'dimensions',
379 'mode' => 'responsive',
380 'size_units' => [ 'px' ],
381 'selectors' => [
382 self::$selectors['qty_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
383 ],
384 ],
385
386 'qty_box_label' => [
387 'type' => 'html',
388 'raw' => sprintf(
389 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
390 esc_html__( 'Box', 'shopbuilder' )
391 ),
392 'content_classes' => 'elementor-panel-heading-title',
393 'separator' => 'default',
394 ],
395 'qty_box_height' => [
396 'label' => esc_html__( 'Height', 'shopbuilder' ),
397 'type' => 'slider',
398 'mode' => 'responsive',
399 'size_units' => [ 'px' ],
400 'range' => [
401 'px' => [
402 'min' => 20,
403 'max' => 80,
404 ],
405 ],
406 'selectors' => [
407 self::$selectors['qty_box_height'] => 'height: {{SIZE}}{{UNIT}};',
408 ],
409 ],
410 'qty_box_border' => [
411 'mode' => 'group',
412 'type' => 'border',
413 'selector' => self::$selectors['qty_box_border'],
414 'size_units' => [ 'px' ],
415 'fields_options' => [
416 'border' => [
417 'label' => esc_html__( 'Border', 'shopbuilder' ),
418 'label_block' => true,
419 ],
420 'color' => [
421 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
422 ],
423 ],
424 ],
425 'qty_box_radius' => [
426 'label' => esc_html__( 'Border Radius', 'shopbuilder' ),
427 'type' => 'dimensions',
428 'mode' => 'responsive',
429 'size_units' => [ 'px', '%' ],
430 'selectors' => [
431 self::$selectors['qty_box_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
432 ],
433 ],
434 'qty_box_bg_color' => [
435 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
436 'type' => 'color',
437 'alpha' => true,
438 'selectors' => [
439 self::$selectors['qty_box_bg_color'] => 'background-color: {{VALUE}};',
440 ],
441 ],
442
443 'qty_input_label' => [
444 'type' => 'html',
445 'raw' => sprintf(
446 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
447 esc_html__( 'Quantity Field', 'shopbuilder' )
448 ),
449 'content_classes' => 'elementor-panel-heading-title',
450 'separator' => 'default',
451 ],
452 'qty_input_width' => [
453 'label' => esc_html__( 'Width', 'shopbuilder' ),
454 'type' => 'slider',
455 'mode' => 'responsive',
456 'size_units' => [ 'px' ],
457 'range' => [
458 'px' => [
459 'min' => 20,
460 'max' => 120,
461 ],
462 ],
463 'selectors' => [
464 self::$selectors['qty_input_width'] => 'width: {{SIZE}}{{UNIT}};',
465 ],
466 ],
467 'qty_input_typo' => [
468 'mode' => 'group',
469 'type' => 'typography',
470 'label' => esc_html__( 'Typography', 'shopbuilder' ),
471 'selector' => self::$selectors['qty_input_typo'],
472 ],
473 'qty_input_color' => [
474 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
475 'type' => 'color',
476 'selectors' => [
477 self::$selectors['qty_input_color'] => 'color: {{VALUE}};',
478 ],
479 ],
480 'qty_input_bg_color' => [
481 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
482 'type' => 'color',
483 'alpha' => true,
484 'selectors' => [
485 self::$selectors['qty_input_bg_color'] => 'background-color: {{VALUE}};',
486 ],
487 ],
488 'qty_input_border_color' => [
489 'label' => esc_html__( 'Separator Color', 'shopbuilder' ),
490 'type' => 'color',
491 'selectors' => [
492 self::$selectors['qty_input_border_color'] => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};',
493 ],
494 ],
495
496 'qty_btn_label' => [
497 'type' => 'html',
498 'raw' => sprintf(
499 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
500 esc_html__( 'Buttons', 'shopbuilder' )
501 ),
502 'content_classes' => 'elementor-panel-heading-title',
503 'separator' => 'default',
504 ],
505 'qty_btn_width' => [
506 'label' => esc_html__( 'Width', 'shopbuilder' ),
507 'type' => 'slider',
508 'mode' => 'responsive',
509 'size_units' => [ 'px' ],
510 'range' => [
511 'px' => [
512 'min' => 20,
513 'max' => 80,
514 ],
515 ],
516 'selectors' => [
517 self::$selectors['qty_btn_width'] => 'width: {{SIZE}}{{UNIT}};',
518 ],
519 ],
520 'qty_icon_size' => [
521 'label' => esc_html__( 'Icon Size', 'shopbuilder' ),
522 'type' => 'slider',
523 'size_units' => [ 'px' ],
524 'range' => [
525 'px' => [
526 'min' => 5,
527 'max' => 30,
528 ],
529 ],
530 'selectors' => [
531 self::$selectors['qty_icon_size'] => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
532 ],
533 ],
534 'qty_btn_tabs_start' => [
535 'mode' => 'tabs_start',
536 ],
537 'qty_btn_normal_tab' => [
538 'mode' => 'tab_start',
539 'label' => esc_html__( 'Normal', 'shopbuilder' ),
540 ],
541 'qty_btn_color' => [
542 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
543 'type' => 'color',
544 'selectors' => [
545 self::$selectors['qty_btn_color'] => 'color: {{VALUE}};',
546 ],
547 ],
548 'qty_btn_bg_color' => [
549 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
550 'type' => 'color',
551 'alpha' => true,
552 'selectors' => [
553 self::$selectors['qty_btn_bg_color'] => 'background-color: {{VALUE}};',
554 ],
555 ],
556 'qty_btn_normal_tab_end' => [
557 'mode' => 'tab_end',
558 ],
559 'qty_btn_hover_tab' => [
560 'mode' => 'tab_start',
561 'label' => esc_html__( 'Hover', 'shopbuilder' ),
562 ],
563 'qty_btn_hover_color' => [
564 'label' => esc_html__( 'Icon Color', 'shopbuilder' ),
565 'type' => 'color',
566 'selectors' => [
567 self::$selectors['qty_btn_hover_color'] => 'color: {{VALUE}};',
568 ],
569 ],
570 'qty_btn_hover_bg_color' => [
571 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
572 'type' => 'color',
573 'alpha' => true,
574 'selectors' => [
575 self::$selectors['qty_btn_hover_bg_color'] => 'background-color: {{VALUE}};',
576 ],
577 ],
578 'qty_btn_hover_tab_end' => [
579 'mode' => 'tab_end',
580 ],
581 'qty_btn_tabs_end' => [
582 'mode' => 'tabs_end',
583 ],
584
585 'qty_section_end' => [
586 'mode' => 'section_end',
587 ],
588 ];
589 }
590 }
591