PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 2.0.2
ShopBuilder – WooCommerce Builder For Elementor v2.0.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 / CheckoutFromSettings.php

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

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