PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.2.0
ShopBuilder – WooCommerce Builder For Elementor v2.2.0
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 2.2.0, at app/Elementor/Widgets/Controls/CheckoutFromSettings.php

310 lines 8.9 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 'fields_height' => [
117 'label' => esc_html__( 'Fields Height', 'shopbuilder' ),
118 'type' => 'slider',
119 'separator' => 'default',
120 'range' => [
121 'px' => [
122 'min' => 10,
123 'max' => 200,
124 ],
125 ],
126 'selectors' => [
127 self::$selectors['fields_height'] => 'height: {{SIZE}}{{UNIT}};',
128 ],
129 ],
130
131 'fields_width_100' => [
132 'label' => esc_html__( 'Full Width Fields?', 'shopbuilder' ),
133 'type' => 'switch',
134 'description' => esc_html__( 'Switch on to set all fields to a 100% width..', 'shopbuilder' ),
135 'default' => '',
136 ],
137
138 'fields_tabs_start' => [
139 'mode' => 'tabs_start',
140 ],
141 // Tab For normal view.
142 'fields_normal' => [
143 'mode' => 'tab_start',
144 'label' => esc_html__( 'Normal', 'shopbuilder' ),
145 ],
146 'fields_border' => [
147 'mode' => 'group',
148 'type' => 'border',
149 'selector' => self::$selectors['fields_border'],
150 'size_units' => [ 'px' ],
151 ],
152 'fields_border_radius' => [
153 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ),
154 'type' => 'dimensions',
155 'size_units' => [ 'px' ],
156 'selectors' => [
157 self::$selectors['fields_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
158 ],
159 ],
160 'fields_text_color' => [
161 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
162 'type' => 'color',
163
164 'selectors' => [
165 self::$selectors['fields_text_color'] => 'color: {{VALUE}};',
166 ],
167 ],
168 'fields_bg_color' => [
169 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
170 'type' => 'color',
171 'alpha' => true,
172 'selectors' => [
173 self::$selectors['fields_bg_color'] => 'background-color: {{VALUE}};',
174 ],
175 ],
176 'fields_normal_end' => [
177 'mode' => 'tab_end',
178 ],
179 'fields_hover' => [
180 'mode' => 'tab_start',
181 'label' => esc_html__( 'Hover & Focus', 'shopbuilder' ),
182 ],
183
184 'fields_hover_border' => [
185 'mode' => 'group',
186 'type' => 'border',
187 'selector' => self::$selectors['fields_hover_border'],
188 'size_units' => [ 'px' ],
189 ],
190 'fields_border_radius_hover' => [
191 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ),
192 'type' => 'dimensions',
193 'size_units' => [ 'px' ],
194 'selectors' => [
195 self::$selectors['fields_border_radius_hover'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
196 ],
197 ],
198 'fields_hover_text_color' => [
199 'label' => esc_html__( 'Text Color', 'shopbuilder' ),
200 'type' => 'color',
201 'selectors' => [
202 self::$selectors['fields_hover_text_color'] => 'color: {{VALUE}};',
203 ],
204 ],
205 'fields_hover_bg_color' => [
206 'label' => esc_html__( 'Background Color', 'shopbuilder' ),
207 'type' => 'color',
208 'alpha' => true,
209 'selectors' => [
210 self::$selectors['fields_hover_bg_color'] => 'background-color: {{VALUE}};',
211 ],
212 ],
213
214 'fields_hover_end' => [
215 'mode' => 'tab_end',
216 ],
217 'fields_tabs_end' => [
218 'mode' => 'tabs_end',
219 ],
220
221 'fields_padding' => [
222 'label' => esc_html__( 'Fields Padding (px)', 'shopbuilder' ),
223 'type' => 'dimensions',
224 'mode' => 'responsive',
225 'size_units' => [ 'px' ],
226 'selectors' => [
227 self::$selectors['fields_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
228 ],
229 ],
230
231 'form_row_margin' => [
232 'label' => esc_html__( 'Form Row Margin (px)', 'shopbuilder' ),
233 'mode' => 'responsive',
234 'type' => 'dimensions',
235 'size_units' => [ 'px' ],
236 'selectors' => [
237 self::$selectors['form_row_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
238 ],
239 ],
240
241 'form_wrapper_margin' => [
242 'label' => esc_html__( 'Form Wrapper Margin (px)', 'shopbuilder' ),
243 'mode' => 'responsive',
244 'type' => 'dimensions',
245 'size_units' => [ 'px' ],
246 'selectors' => [
247 self::$selectors['form_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
248 ],
249 ],
250
251 'fields_style_end' => [
252 'mode' => 'section_end',
253 ],
254 ];
255
256 if ( 'rtsb-shipping-form' === self::$widget->rtsb_base ) {
257
258 $insert_array = [
259 'form_heading_label' => [
260 'type' => 'html',
261 'raw' => sprintf(
262 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
263 esc_html__( 'Form Heading', 'shopbuilder' )
264 ),
265 'content_classes' => 'elementor-panel-heading-title',
266 'separator' => 'default',
267 ],
268 'form_heading_typo' => [
269 'mode' => 'group',
270 'type' => 'typography',
271 'label' => esc_html__( 'Form Heading Typography', 'shopbuilder' ),
272 'selector' => self::$selectors['form_heading_typo'],
273 ],
274 'form_heading_color' => [
275 'label' => esc_html__( 'Form Heading Color', 'shopbuilder' ),
276 'type' => 'color',
277 'selectors' => [
278 self::$selectors['form_heading_color'] => 'color: {{VALUE}} !important;',
279 ],
280 ],
281 'form_heading_gap' => [
282 'label' => esc_html__( 'Form Heading Gap', 'shopbuilder' ),
283 'type' => 'slider',
284 'range' => [
285 'px' => [
286 'min' => 10,
287 'max' => 100,
288 ],
289 ],
290 'selectors' => [
291 self::$selectors['form_heading_gap'] => 'margin-bottom: {{SIZE}}{{UNIT}} !important;',
292 ],
293 ],
294 'form_field_label' => [
295 'type' => 'html',
296 'raw' => sprintf(
297 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
298 esc_html__( 'Form Label', 'shopbuilder' )
299 ),
300 'content_classes' => 'elementor-panel-heading-title',
301 'separator' => 'default',
302 ],
303 ];
304 $fields = Fns::insert_controls( 'fields_label_style_start', $fields, $insert_array, true );
305 }
306
307 return $fields;
308 }
309 }
310