PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.1
ShopBuilder – WooCommerce Builder For Elementor v3.2.1
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 / CheckoutFromSettings.php

CheckoutFromSettings.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.1, at app/Elementor/Widgets/Controls/CheckoutFromSettings.php

348 lines 10.1 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 CheckoutFromSettings {
22
23 /**
24 * Widget Control Selectors
25 *
26 * @var object
27 */
28 private static $widget = [];
29 /**
30 * Widget Control Selectors
31 *
32 * @var array
33 */
34 private static $selectors = [];
35
36 /**
37 * Controls Settings
38 *
39 * @param object $widget widget object.
40 * @return array
41 */
42 public static function widget_fields( $widget ) {
43 self::$widget = $widget;
44 self::$selectors = self::$widget->selectors;
45 $fields = [];
46 if ( 'rtsb-shipping-form' !== $widget->rtsb_base ) {
47 $fields = self::general_settings() + TitleSettings::title_settings( self::$widget );
48 }
49 $fields = $fields + self::fields_settings();
50
51 return $fields;
52 }
53
54 /**
55 * Widget Field
56 *
57 * @return array
58 */
59 public static function general_settings() {
60 // The function will Overwrite.
61 $fields = TitleSettings::general_settings();
62 $fields['show_title']['selectors'] = [
63 self::$selectors['show_title'] => 'display:block;',
64 ];
65 return $fields;
66 }
67
68 /**
69 * Widget Field
70 *
71 * @return array
72 */
73 public static function fields_settings() {
74 $fields = [
75 'fields_label_style_start' => [
76 'mode' => 'section_start',
77 'tab' => 'style',
78 'label' => esc_html__( 'Form Label', 'shopbuilder' ),
79 ],
80 'fields_label_typo' => [
81 'mode' => 'group',
82 'type' => 'typography',
83 'label' => esc_html__( 'Label Typography', 'shopbuilder' ),
84 'selector' => self::$selectors['fields_label_typo'],
85 ],
86 'fields_label_color' => [
87 'label' => esc_html__( 'Label Color', 'shopbuilder' ),
88 'type' => 'color',
89 'selectors' => [
90 self::$selectors['fields_label_color'] => 'color: {{VALUE}} !important;',
91 ],
92 ],
93 'fields_label_reguired_color' => [
94 'label' => esc_html__( 'Label Required Color', 'shopbuilder' ),
95 'type' => 'color',
96 'selectors' => [
97 self::$selectors['fields_label_reguired_color'] => 'color: {{VALUE}} !important;',
98 ],
99 ],
100 'fields_label_margin' => [
101 'label' => esc_html__( 'Label Margin', 'shopbuilder' ),
102 'type' => 'dimensions',
103 'size_units' => [ 'px' ],
104 'selectors' => [
105 self::$selectors['fields_label_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
106 ],
107 ],
108 'fields_label_style_end' => [
109 'mode' => 'section_end',
110 ],
111 'fields_style_start' => [
112 'mode' => 'section_start',
113 'tab' => 'style',
114 'label' => esc_html__( 'Form Fields', 'shopbuilder' ),
115 ],
116 'primary_color' => [
117 'type' => 'html',
118 'raw' => sprintf(
119 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
120 esc_html__( 'Primary Settings', 'shopbuilder' )
121 ),
122 'content_classes' => 'elementor-panel-heading-title',
123 ],
124 'fields_primary_color' => [
125 'label' => esc_html__( 'Fields Primary Color', 'shopbuilder' ),
126 'type' => 'color',
127 'selectors' => [
128 '{{WRAPPER}} .rtsb-input-field, {{WRAPPER}} #ship-to-different-address' => '--rtsb-fields-primary-color: {{VALUE}}',
129 ],
130 ],
131
132 'from_fields_settings' => [
133 'type' => 'html',
134 'raw' => sprintf(
135 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
136 esc_html__( 'From Fields Settings', 'shopbuilder' )
137 ),
138 'content_classes' => 'elementor-panel-heading-title',
139 ],
140
141 'fields_height' => [
142 'label' => esc_html__( 'Fields Height', 'shopbuilder' ),
143 'type' => 'slider',
144 'separator' => 'default',
145 'range' => [
146 'px' => [
147 'min' => 10,
148 'max' => 200,
149 ],
150 ],
151 'selectors' => [
152 self::$selectors['fields_height'] => 'height: {{SIZE}}{{UNIT}};',
153 ],
154 ],
155 'textarea_fields_height' => [
156 'label' => esc_html__( 'Textarea Fields Height', 'shopbuilder' ),
157 'type' => 'slider',
158 'separator' => 'default',
159 'range' => [
160 'px' => [
161 'min' => 10,
162 'max' => 200,
163 ],
164 ],
165 'selectors' => [
166 self::$selectors['textarea_fields_height'] => 'height: {{SIZE}}{{UNIT}};',
167 ],
168 ],
169 'fields_width_100' => [
170 'label' => esc_html__( 'Full Width Fields?', 'shopbuilder' ),
171 'type' => 'switch',
172 'description' => esc_html__( 'Switch on to set all fields to a 100% width..', 'shopbuilder' ),
173 'default' => '',
174 ],
175
176 'fields_tabs_start' => [
177 'mode' => 'tabs_start',
178 ],
179 // Tab For normal view.
180 'fields_normal' => [
181 'mode' => 'tab_start',
182 'label' => esc_html__( 'Normal', 'shopbuilder' ),
183 ],
184 'fields_border' => [
185 'mode' => 'group',
186 'type' => 'border',
187 'selector' => self::$selectors['fields_border'],
188 'size_units' => [ 'px' ],
189 ],
190 'fields_border_radius' => [
191 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ),
192 'type' => 'dimensions',
193 'size_units' => [ 'px' ],
194 'selectors' => [
195 self::$selectors['fields_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
196 ],
197 ],
198 'fields_text_color' => [
199 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
200 'type' => 'color',
201
202 'selectors' => [
203 self::$selectors['fields_text_color'] => 'color: {{VALUE}};',
204 ],
205 ],
206 'fields_bg_color' => [
207 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
208 'type' => 'color',
209 'alpha' => true,
210 'selectors' => [
211 self::$selectors['fields_bg_color'] => 'background-color: {{VALUE}};',
212 ],
213 ],
214 'fields_normal_end' => [
215 'mode' => 'tab_end',
216 ],
217 'fields_hover' => [
218 'mode' => 'tab_start',
219 'label' => esc_html__( 'Hover & Focus', 'shopbuilder' ),
220 ],
221
222 'fields_hover_border' => [
223 'mode' => 'group',
224 'type' => 'border',
225 'selector' => self::$selectors['fields_hover_border'],
226 'size_units' => [ 'px' ],
227 ],
228 'fields_border_radius_hover' => [
229 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ),
230 'type' => 'dimensions',
231 'size_units' => [ 'px' ],
232 'selectors' => [
233 self::$selectors['fields_border_radius_hover'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
234 ],
235 ],
236 'fields_hover_text_color' => [
237 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
238 'type' => 'color',
239 'selectors' => [
240 self::$selectors['fields_hover_text_color'] => 'color: {{VALUE}};',
241 ],
242 ],
243 'fields_hover_bg_color' => [
244 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
245 'type' => 'color',
246 'alpha' => true,
247 'selectors' => [
248 self::$selectors['fields_hover_bg_color'] => 'background-color: {{VALUE}};',
249 ],
250 ],
251
252 'fields_hover_end' => [
253 'mode' => 'tab_end',
254 ],
255 'fields_tabs_end' => [
256 'mode' => 'tabs_end',
257 ],
258
259 'fields_padding' => [
260 'label' => esc_html__( 'Fields Padding (px)', 'shopbuilder' ),
261 'type' => 'dimensions',
262 'mode' => 'responsive',
263 'size_units' => [ 'px' ],
264 'selectors' => [
265 self::$selectors['fields_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
266 ],
267 ],
268
269 'form_row_margin' => [
270 'label' => esc_html__( 'Form Row Margin (px)', 'shopbuilder' ),
271 'mode' => 'responsive',
272 'type' => 'dimensions',
273 'size_units' => [ 'px' ],
274 'selectors' => [
275 self::$selectors['form_row_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
276 ],
277 ],
278
279 'form_wrapper_margin' => [
280 'label' => esc_html__( 'Form Wrapper Margin (px)', 'shopbuilder' ),
281 'mode' => 'responsive',
282 'type' => 'dimensions',
283 'size_units' => [ 'px' ],
284 'selectors' => [
285 self::$selectors['form_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
286 ],
287 ],
288
289 'fields_style_end' => [
290 'mode' => 'section_end',
291 ],
292 ];
293
294 if ( 'rtsb-shipping-form' === self::$widget->rtsb_base ) {
295
296 $insert_array = [
297 'form_heading_label' => [
298 'type' => 'html',
299 'raw' => sprintf(
300 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
301 esc_html__( 'Form Heading', 'shopbuilder' )
302 ),
303 'content_classes' => 'elementor-panel-heading-title',
304 'separator' => 'default',
305 ],
306 'form_heading_typo' => [
307 'mode' => 'group',
308 'type' => 'typography',
309 'label' => esc_html__( 'Form Heading Typography', 'shopbuilder' ),
310 'selector' => self::$selectors['form_heading_typo'],
311 ],
312 'form_heading_color' => [
313 'label' => esc_html__( 'Form Heading Color', 'shopbuilder' ),
314 'type' => 'color',
315 'selectors' => [
316 self::$selectors['form_heading_color'] => 'color: {{VALUE}} !important;',
317 ],
318 ],
319 'form_heading_gap' => [
320 'label' => esc_html__( 'Form Heading Gap', 'shopbuilder' ),
321 'type' => 'slider',
322 'range' => [
323 'px' => [
324 'min' => 10,
325 'max' => 100,
326 ],
327 ],
328 'selectors' => [
329 self::$selectors['form_heading_gap'] => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
330 ],
331 ],
332 'form_field_label' => [
333 'type' => 'html',
334 'raw' => sprintf(
335 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
336 esc_html__( 'Form Label', 'shopbuilder' )
337 ),
338 'content_classes' => 'elementor-panel-heading-title',
339 'separator' => 'default',
340 ],
341 ];
342 $fields = Fns::insert_controls( 'fields_label_style_start', $fields, $insert_array, true );
343 }
344
345 return $fields;
346 }
347 }
348