PluginProbe ʕ •ᴥ•ʔ
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution / 1.0.0
ShopEngine Elementor WooCommerce Builder Addon – All in One WooCommerce Solution v1.0.0
4.9.2 4.9.1 4.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 4.0.0 4.0.1 4.1.0 4.1.1 4.2.0 4.2.1 4.3.0 4.3.1 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.8.5 4.8.6 4.8.7 4.8.8 4.8.9 trunk 0.1.2-beta 0.1.3-beta 0.1.4-beta 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.8.0 1.8.1 1.9.0
shopengine / widgets / checkout-form-additional / checkout-form-additional.php
shopengine / widgets / checkout-form-additional Last commit date
screens 5 years ago checkout-form-additional-config.php 5 years ago checkout-form-additional.php 5 years ago
checkout-form-additional.php
380 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9
10 class ShopEngine_Checkout_Form_Additional extends \ShopEngine\Base\Widget
11 {
12
13
14 public function config() {
15 return new ShopEngine_Checkout_Form_Additional_Config();
16 }
17
18
19 protected function register_controls() {
20 /**
21 * Section: Heading
22 */
23 $this->start_controls_section(
24 'shopengine_section_style_heading',
25 [
26 'label' => esc_html__( 'Heading', 'shopengine' ),
27 'tab' => Controls_Manager::TAB_STYLE,
28 ]
29 );
30 $this->add_control(
31 'shopengine_checkout_form_additional_heading',
32 [
33 'label' => esc_html__( 'Show heading', 'shopengine' ),
34 'type' => Controls_Manager::SWITCHER,
35 'default' => 'yes',
36 'selectors' => [
37 '{{WRAPPER}} .shopengine-checkout-form-additional h3' => 'display: block;',
38 ],
39 ]
40 );
41
42 $this->add_control(
43 'shopengine_checkout_form_additional_heading_color',
44 [
45 'label' => esc_html__( 'Color', 'shopengine' ),
46 'type' => Controls_Manager::COLOR,
47 'alpha' => false,
48 'selectors' => [
49 '{{WRAPPER}} .shopengine-checkout-form-additional h3' => 'color: {{VALUE}};',
50 ],
51 ]
52 );
53
54 $this->add_control(
55 'shopengine_checkout_form_additional_heading_size',
56 [
57 'label' => esc_html__( 'Font Size (px)', 'shopengine' ),
58 'type' => Controls_Manager::SLIDER,
59 'size_units' => ['px'],
60 'selectors' => [
61 '{{WRAPPER}} .shopengine-checkout-form-additional h3' => 'font-size: {{SIZE}}{{UNIT}} !important;',
62 ],
63 ]
64 );
65
66 $this->add_control(
67 'shopengine_checkout_form_additional_heading_spacing',
68 [
69 'label' => esc_html__( 'Spacing Bottom (px)', 'shopengine' ),
70 'type' => Controls_Manager::SLIDER,
71 'size_units' => ['px'],
72 'selectors' => [
73 '{{WRAPPER}} .shopengine-checkout-form-additional h3' => 'padding-bottom: {{SIZE}}{{UNIT}} !important;',
74 ],
75 'separator' => 'before',
76 ]
77 );
78 $this->end_controls_section();
79
80
81 /*
82 ---------------------------------
83 Form label
84 ---------------------------------
85 */
86
87 $this->start_controls_section(
88 'shopengine_heading_checkout_form_additional_label',
89 [
90 'label' => esc_html__('Form Label', 'shopengine'),
91 'tab' => Controls_Manager::TAB_STYLE,
92 ]
93 );
94
95 $this->add_control(
96 'shopengine_checkout_form_additional_label_color',
97 [
98 'label' => esc_html__('Color', 'shopengine'),
99 'type' => Controls_Manager::COLOR,
100 'default' => '#3A3A3A',
101 'alpha' => false,
102 'selectors' => [
103 '{{WRAPPER}} .shopengine-checkout-form-additional .form-row label' => 'display: block; color: {{VALUE}};',
104 ],
105 ]
106 );
107
108 $this->add_group_control(
109 Group_Control_Typography::get_type(),
110 [
111 'name' => 'shopengine_orders_body_text_typography',
112 'label' => esc_html__('Typography', 'shopengine'),
113 'selector' => '{{WRAPPER}} .shopengine-checkout-form-additional .form-row label',
114 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'text_decoration', 'font_style', 'line_height'],
115 'fields_options' => [
116 'typography' => [
117 'default' => 'custom',
118 ],
119 'font_weight' => [
120 'default' => '400',
121 ],
122 'font_size' => [
123 'label' => esc_html__('Font Size (px)', 'shopengine'),
124 'default' => [
125 'size' => '15',
126 'unit' => 'px',
127 ],
128 'size_units' => ['px'],
129 'responsive' => false,
130 ],
131 ],
132 ]
133 );
134
135
136 $this->add_control(
137 'shopengine_checkout_form_additional_label_line_height',
138 [
139 'label' => esc_html__('Spacing Bottom (px)', 'shopengine'),
140 'type' => Controls_Manager::SLIDER,
141 'default' => [
142 'unit' => 'px',
143 'size' => '9',
144 ],
145 'size_units' => ['px'],
146 'range' => [
147 'px' => [
148 'min' => 1,
149 'max' => 200,
150 ],
151 ],
152 'selectors' => [
153 '{{WRAPPER}} .shopengine-checkout-form-additional .form-row label' => 'margin-bottom: {{SIZE}}{{UNIT}}',
154 ],
155 'separator' => 'before',
156 ]
157 );
158
159
160 $this->end_controls_section();
161
162 /*
163 ---------------------------------
164 textarea styles
165 ---------------------------------
166 */
167
168 $this->start_controls_section(
169 'shopengine_heading_checkout_form_additional_textarea',
170 [
171 'label' => esc_html__('Form Textarea', 'shopengine'),
172 'tab' => Controls_Manager::TAB_STYLE,
173 ]
174 );
175
176 $this->add_control(
177 'shopengine_checkout_form_additional_textarea_color',
178 [
179 'label' => esc_html__('Color', 'shopengine'),
180 'type' => Controls_Manager::COLOR,
181 'default' => '#3A3A3A',
182 'alpha' => false,
183 'selectors' => [
184 '{{WRAPPER}} .shopengine-checkout-form-additional .input-text' => 'color: {{VALUE}};',
185 ],
186 ]
187 );
188
189 $this->add_control(
190 'shopengine_checkout_form_additional_textarea_placeholder_color',
191 [
192 'label' => esc_html__('Placeholder color', 'shopengine'),
193 'type' => Controls_Manager::COLOR,
194 'default' => '#555555',
195 'alpha' => false,
196 'selectors' => [
197 '{{WRAPPER}} .shopengine-checkout-form-additional .input-text::placeholder' => 'color: {{VALUE}};',
198 ],
199 ]
200 );
201
202 $this->add_group_control(
203 Group_Control_Typography::get_type(),
204 [
205 'name' => 'shopengine_checkout_form_additional_textarea_typography',
206 'label' => esc_html__('Text Typography', 'shopengine'),
207 'selector' => '{{WRAPPER}} .shopengine-checkout-form-additional .input-text',
208 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'text_decoration', 'font_style'],
209 'fields_options' => [
210 'typography' => [
211 'default' => 'custom',
212 ],
213 'font_weight' => [
214 'default' => '400',
215 ],
216 'font_size' => [
217 'label' => esc_html__('Font Size (px)', 'shopengine'),
218 'default' => [
219 'size' => '14',
220 'unit' => 'px',
221 ],
222 'size_units' => ['px'],
223 ],
224 'line_height' => [
225 'label' => esc_html__('Line-height (px)', 'shopengine'),
226 'default' => [
227 'size' => '17',
228 'unit' => 'px',
229 ],
230 'size_units' => ['px'],
231 ],
232 ],
233 ]
234 );
235
236
237 $this->add_responsive_control(
238 'shopengine_checkout_form_additional_textarea_height',
239 [
240 'label' => esc_html__('Height (px)', 'shopengine'),
241 'type' => Controls_Manager::SLIDER,
242 'size_units' => ['px'],
243 'range' => [
244 'px' => [
245 'min' => 0,
246 'max' => 1000,
247 'step' => 5,
248 ],
249 ],
250 'default' => [
251 'unit' => 'px',
252 'size' => 90,
253 ],
254 'selectors' => [
255 '{{WRAPPER}} .shopengine-checkout-form-additional .input-text' => 'height: {{SIZE}}{{UNIT}}; width: 100%; background-image: none;',
256 ],
257 ]
258 );
259
260 $this->add_responsive_control(
261 'shopengine_checkout_form_additional_textarea_margin',
262 [
263 'label' => esc_html__('Padding', 'shopengine'),
264 'type' => Controls_Manager::DIMENSIONS,
265 'separator' => 'before',
266 'default' => [
267 'top' => '10',
268 'right' => '18',
269 'bottom' => '10',
270 'left' => '18',
271 'unit' => 'px',
272 'isLinked' => false,
273 ],
274 'size_units' => ['px'],
275 'selectors' => [
276 '{{WRAPPER}} .shopengine-checkout-form-additional .input-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
277 ],
278 ]
279 );
280
281 $this->add_group_control(
282 Group_Control_Border::get_type(),
283 [
284 'name' => 'shopengine_checkout_form_additional_border',
285 'selector' => '{{WRAPPER}} .shopengine-checkout-form-additional .form-row .input-text',
286 'separator' => 'before',
287 'fields_options' => [
288 'border' => [
289 'default' => 'solid',
290 ],
291 'width' => [
292 'default' => [
293 'top' => '1',
294 'right' => '1',
295 'bottom' => '1',
296 'left' => '1',
297 'isLinked' => true,
298 ],
299 ],
300 'color' => [
301 'default' => '#dee3ea',
302 ],
303 ],
304 ]
305 );
306
307 $this->add_control(
308 'shopengine_checkout_form_additional_textarea_focus_color',
309 [
310 'label' => esc_html__('Focus Border Color', 'shopengine'),
311 'type' => Controls_Manager::COLOR,
312 'default' => '#dee3ea',
313 'selectors' => [
314 '{{WRAPPER}} .shopengine-checkout-form-additional .form-row .input-text:focus' => 'border-color: {{VALUE}}',
315 ],
316 'condition' => [
317 'shopengine_checkout_form_additional_border_border!' => '',
318 ],
319 ]
320 );
321
322 $this->add_control(
323 'shopengine_checkout_form_additional_border_radius',
324 [
325 'label' => esc_html__('Border Radius', 'shopengine'),
326 'type' => Controls_Manager::DIMENSIONS,
327 'separator' => 'before',
328 'size_units' => ['px'],
329 'default' => [
330 'top' => '3',
331 'right' => '3',
332 'bottom' => '3',
333 'left' => '3',
334 'unit' => 'px',
335 'isLinked' => true,
336 ],
337 'selectors' => [
338 '{{WRAPPER}} .shopengine-checkout-form-additional .input-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
339 ],
340 ]
341 );
342
343 $this->end_controls_section();
344
345
346 /**
347 * Section: Global Font
348 */
349 $this->start_controls_section(
350 'shopengine_section_style_global',
351 [
352 'label' => esc_html__('Global Font', 'shopengine'),
353 'tab' => Controls_Manager::TAB_STYLE,
354 ]
355 );
356 $this->add_control(
357 'shopengine_checkout_form_additional_font_family',
358 [
359 'label' => esc_html__( 'Font Family', 'shopengine' ),
360 'description' => esc_html__( 'This font family is set for this specific widget.', 'shopengine' ),
361 'type' => Controls_Manager::FONT,
362 'selectors' => [
363 '{{WRAPPER}} .shopengine-checkout-form-additional h3,
364 {{WRAPPER}} .shopengine-checkout-form-additional .form-row label,
365 {{WRAPPER}} .shopengine-checkout-form-additional .input-text' => 'font-family: {{VALUE}};',
366 ],
367 ]
368 );
369 $this->end_controls_section();
370 }
371
372 protected function screen() {
373
374 $settings = $this->get_settings_for_display();
375 $tpl = Products::instance()->get_widget_template($this->get_name());
376
377 include $tpl;
378 }
379 }
380