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

282 lines 8.2 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-billing-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 'fields_style_end' => [
224 'mode' => 'section_end',
225 ],
226 ];
227
228 if ( 'rtsb-shipping-form' === self::$widget->rtsb_base ) {
229
230 $insert_array = [
231 'form_heading_label' => [
232 'type' => 'html',
233 'raw' => sprintf(
234 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
235 esc_html__( 'Form Heading', 'shopbuilder' )
236 ),
237 'content_classes' => 'elementor-panel-heading-title',
238 'separator' => 'default',
239 ],
240 'form_heading_typo' => [
241 'mode' => 'group',
242 'type' => 'typography',
243 'label' => esc_html__( 'Form Heading Typography', 'shopbuilder' ),
244 'selector' => self::$selectors['form_heading_typo'],
245 ],
246 'form_heading_color' => [
247 'label' => esc_html__( 'Form Heading Color', 'shopbuilder' ),
248 'type' => 'color',
249 'selectors' => [
250 self::$selectors['form_heading_color'] => 'color: {{VALUE}} !important;',
251 ],
252 ],
253 'form_heading_gap' => [
254 'label' => esc_html__( 'Form Heading Gap', 'shopbuilder' ),
255 'type' => 'slider',
256 'range' => [
257 'px' => [
258 'min' => 10,
259 'max' => 100,
260 ],
261 ],
262 'selectors' => [
263 self::$selectors['form_heading_gap'] => 'margin-bottom: {{SIZE}}{{UNIT}};',
264 ],
265 ],
266 'form_field_label' => [
267 'type' => 'html',
268 'raw' => sprintf(
269 '<h3 class="rtsb-elementor-group-heading">%s</h3>',
270 esc_html__( 'Form Label', 'shopbuilder' )
271 ),
272 'content_classes' => 'elementor-panel-heading-title',
273 'separator' => 'default',
274 ],
275 ];
276 $fields = Fns::insert_controls( 'fields_label_style_start', $fields, $insert_array, true );
277 }
278
279 return $fields;
280 }
281 }
282