PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
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 / OrderReviewTableSettings.php

OrderReviewTableSettings.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.6, at app/Elementor/Widgets/Controls/OrderReviewTableSettings.php

242 lines 7.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main OrderReviewTableSettings class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Controls;
9
10 // Do not allow directly accessing this file.
11 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
12 use RadiusTheme\SB\Helpers\Fns;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit( 'This script cannot be accessed directly.' );
16 }
17
18 /**
19 * OrderReviewTableSettings
20 */
21 class OrderReviewTableSettings {
22 /**
23 * @param object $widget widget object.
24 *
25 * @return array[]
26 */
27 public static function general_settings( $widget ) {
28 $fields = TitleSettings::general_settings();
29 if ( ! empty( $fields['show_title']['selectors'] ) ) {
30 $fields['show_title']['selectors'] = [
31 $widget->selectors['show_title'] => 'display:block;',
32 ];
33 }
34 $new_fields['table_horizontal_scroll_on_mobile'] = [
35 'label' => esc_html__( 'Show default Table View On Mobile?', 'shopbuilder' ),
36 'type' => 'switch',
37 'description' => esc_html__( 'Show default Table View On Mobile?', 'shopbuilder' ),
38 'default' => '',
39 'separator' => rtsb()->has_pro() ? 'default' : 'before-short',
40 ];
41 $new_fields['table_min_width'] = [
42 'mode' => 'responsive',
43 'label' => esc_html__( 'Table Minimum Width', 'shopbuilder' ),
44 'description' => esc_html__( 'Enter table min-width (in px),', 'shopbuilder' ),
45 'type' => 'slider',
46 'size_units' => [ 'px' ],
47 'range' => [
48 'px' => [
49 'min' => 0,
50 'max' => 1000,
51 'step' => 5,
52 ],
53 ],
54 'condition' => [
55 'table_horizontal_scroll_on_mobile' => 'yes',
56 ],
57 'selectors' => [
58 $widget->selectors['table_min_width'] => 'min-width: {{SIZE}}{{UNIT}};',
59 ],
60 ];
61
62 if ( 'rtsb-order-details-table' === $widget->rtsb_base ) {
63 $new_fields['table_horizontal_scroll_on_mobile']['condition']['layout'] = ['layout1'];
64 $new_fields['table_min_width']['condition']['layout'] = ['layout1'];
65 }
66
67 return Fns::insert_controls( 'show_title', $fields, $new_fields, true );
68 }
69 /**
70 * @param object $widget widget object.
71 *
72 * @return array
73 */
74 public static function table_settings( $widget ) {
75 $fields = [
76 'table_heading_section_start' => [
77 'mode' => 'section_start',
78 'tab' => 'style',
79 'label' => esc_html__( 'Table', 'shopbuilder' ),
80 ],
81
82 'table_cell' => [
83 'type' => 'html',
84 'raw' => sprintf(
85 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
86 esc_html__( 'Table Cell', 'shopbuilder' )
87 ),
88 'content_classes' => 'elementor-panel-heading-title',
89 ],
90 'table_heading_cell_border' => [
91 'mode' => 'group',
92 'type' => 'border',
93 'selector' => $widget->selectors['table_heading_cell_border'],
94 'separator' => 'before',
95 'fields_options' => [
96 'border' => [
97 'label' => esc_html__( 'Table Cell Border', 'shopbuilder' ),
98 'label_block' => true,
99 ],
100 'color' => [
101 'label' => esc_html__( 'Border Color', 'shopbuilder' ),
102 ],
103 ],
104 ],
105
106 'table_heading_cell_padding' => [
107 'label' => esc_html__( 'Padding', 'shopbuilder' ),
108 'type' => 'dimensions',
109 'mode' => 'responsive',
110 'size_units' => [ '%' ],
111 'selectors' => [
112 $widget->selectors['table_heading_cell_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
113 ],
114 ],
115
116 'total_heading_width' => [
117 'label' => __( 'Max Width (Product) ', 'shopbuilder' ),
118 'type' => 'slider',
119 'mode' => 'responsive',
120 'size_units' => [ '%' ],
121 'range' => [
122 '%' => [
123 'min' => 10,
124 'max' => 100,
125 ],
126 'px' => [
127 'min' => 50,
128 'max' => 500,
129 ],
130 ],
131 'selectors' => [
132 $widget->selectors['total_heading_width'] => 'width: {{SIZE}}{{UNIT}}',
133 ],
134 ],
135
136 'total_cell_heading_width' => [
137 'label' => __( 'Max Width (Total)', 'shopbuilder' ),
138 'mode' => 'responsive',
139 'type' => 'slider',
140 'size_units' => [ '%' ],
141 'range' => [
142 '%' => [
143 'min' => 10,
144 'max' => 100,
145 ],
146 'px' => [
147 'min' => 50,
148 'max' => 500,
149 ],
150 ],
151 'selectors' => [
152 $widget->selectors['total_cell_heading_width'] => 'width: {{SIZE}}{{UNIT}}',
153 ],
154 ],
155
156 'table_product_title' => [
157 'type' => 'html',
158 'raw' => sprintf(
159 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
160 esc_html__( 'Product Title', 'shopbuilder' )
161 ),
162
163 'content_classes' => 'elementor-panel-heading-title',
164 ],
165 'table_heading_typography' => [
166 'mode' => 'group',
167 'type' => 'typography',
168 'label' => esc_html__( 'Typography', 'shopbuilder' ),
169 'selector' => $widget->selectors['table_heading_typography'],
170 ],
171 'table_heading_color' => [
172 'label' => esc_html__( 'Color', 'shopbuilder' ),
173 'type' => 'color',
174 'selectors' => [
175 $widget->selectors['table_heading_color'] => 'color: {{VALUE}}',
176 ],
177 ],
178 'table_heading_background_color' => [
179 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
180 'type' => 'color',
181 'selectors' => [
182 $widget->selectors['table_heading_background_color'] => 'background-color: {{VALUE}}',
183 ],
184 ],
185 'table_heading_align' => [
186 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
187 'type' => 'choose',
188 'options' => ControlHelper::alignment(),
189 'selectors' => [
190 $widget->selectors['table_heading_align'] => 'text-align: {{VALUE}}!important',
191 ],
192 'classes' => 'elementor-control-align',
193 ],
194 'table_product_total' => [
195 'type' => 'html',
196 'raw' => sprintf(
197 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
198 esc_html__( 'Product Total', 'shopbuilder' )
199 ),
200
201 'content_classes' => 'elementor-panel-heading-title',
202 ],
203 'table_cell_typography' => [
204 'mode' => 'group',
205 'type' => 'typography',
206 'label' => esc_html__( 'Cell Typography', 'shopbuilder' ),
207 'selector' => $widget->selectors['table_cell_typography'],
208 ],
209 'table_cell_color' => [
210 'label' => esc_html__( 'Color', 'shopbuilder' ),
211 'type' => 'color',
212 'selectors' => [
213 $widget->selectors['table_cell_color'] => 'color: {{VALUE}}',
214 ],
215 ],
216 'table_cell_background_color' => [
217 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
218 'type' => 'color',
219 'selectors' => [
220 $widget->selectors['table_cell_background_color'] => 'background-color: {{VALUE}}',
221 ],
222 ],
223
224 'table_cell_align' => [
225 'label' => esc_html__( 'Alignment', 'shopbuilder' ),
226 'type' => 'choose',
227 'options' => ControlHelper::alignment(),
228 'selectors' => [
229 $widget->selectors['table_cell_align'] => 'text-align: {{VALUE}}!important; justify-content: {{VALUE}};',
230 ],
231 'classes' => 'elementor-control-align',
232 ],
233
234 'table_heading_end' => [
235 'mode' => 'section_end',
236 ],
237 ];
238
239 return $fields;
240 }
241 }
242