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.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-payment / checkout-payment.php
shopengine / widgets / checkout-payment Last commit date
screens 5 years ago checkout-payment-config.php 5 years ago checkout-payment.php 5 years ago
checkout-payment.php
568 lines
1 <?php
2
3 namespace Elementor;
4
5 use ShopEngine\Widgets\Products;
6
7 defined('ABSPATH') || exit;
8
9 class ShopEngine_Checkout_Payment extends \ShopEngine\Base\Widget
10 {
11
12 public function config() {
13 return new ShopEngine_Checkout_Payment_Config();
14 }
15
16 protected function register_controls() {
17 /*
18 ---------------------------------
19 Content Section
20 ------------------------------------
21 */
22
23 $this->start_controls_section(
24 'shopengine_content_section',
25 [
26 'label' => esc_html__('Content Style', 'shopengine'),
27 'tab' => Controls_Manager::TAB_STYLE,
28 ]
29 );
30
31 $this->add_control(
32 'shopengine_payment_label_text_color',
33 [
34 'label' => esc_html__('Label Text Color', 'shopengine'),
35 'type' => Controls_Manager::COLOR,
36 'alpha' => false,
37 'default' => '#3A3A3A',
38 'selectors' => [
39 '{{WRAPPER}} .shopengine-checkout-payment .wc_payment_method label' => 'color: {{VALUE}};',
40 ],
41 ]
42 );
43
44 $this->add_control(
45 'shopengine_payment_url_clr',
46 [
47 'label' => esc_html__('Url Color', 'shopengine'),
48 'type' => Controls_Manager::COLOR,
49 'alpha' => false,
50 'default' => '#4169E1',
51 'selectors' => [
52 '{{WRAPPER}} .shopengine-checkout-payment a' => 'color: {{VALUE}};',
53 ],
54 ]
55 );
56
57 $this->add_control(
58 'shopengine_payment_url_hover_clr',
59 [
60 'label' => esc_html__('Url hover Color', 'shopengine'),
61 'type' => Controls_Manager::COLOR,
62 'alpha' => false,
63 'default' => '#3A3A3A',
64 'selectors' => [
65 '{{WRAPPER}} .shopengine-checkout-payment a:hover' => 'color: {{VALUE}};',
66 ],
67 ]
68 );
69
70 $this->add_control(
71 'shopengine_payment_description_text_color',
72 [
73 'label' => esc_html__('Description Text Color', 'shopengine'),
74 'type' => Controls_Manager::COLOR,
75 'alpha' => false,
76 'default' => '#979797',
77 'selectors' => [
78 '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_methods .payment_box' => 'color: {{VALUE}};',
79 '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_methods .payment_box p' => 'color: {{VALUE}};',
80 '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_methods .payment_box a' => 'color: {{VALUE}};',
81 '{{WRAPPER}} .shopengine-checkout-payment #payment .woocommerce-privacy-policy-text p' => 'color: {{VALUE}};',
82 ],
83 ]
84 );
85
86 $this->add_group_control(
87 Group_Control_Typography::get_type(),
88 [
89 'name' => 'shopengine_payment_label_typography',
90 'label' => esc_html__('Label typography', 'shopengine'),
91 'selector' => '{{WRAPPER}} .shopengine-checkout-payment .wc_payment_method label',
92 'exclude' => ['letter_spacing', 'text_decoration', 'text_transform', 'font_style', 'letter_spacing'],
93
94 'fields_options' => [
95 'typography' => [
96 'default' => 'custom',
97 ],
98 'font_weight' => [
99 'default' => '600',
100 ],
101 'font_size' => [
102 'label' => esc_html__('Font Size (px)', 'shopengine'),
103 'default' => [
104 'size' => '14',
105 'unit' => 'px',
106 ],
107 'size_units' => ['px'],
108 'responsive' => false,
109 ],
110 'line_height' => [
111 'label' => esc_html__('Line Height (px)', 'shopengine'),
112 'default' => [
113 'size' => '17',
114 'unit' => 'px',
115 ],
116 'size_units' => ['px'],
117 ],
118 ],
119 ]
120 );
121
122 $this->add_group_control(
123 Group_Control_Typography::get_type(),
124 [
125 'name' => 'shopengine_payment_content_typography',
126 'label' => esc_html__('Body typography', 'shopengine'),
127 'selector' => '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_box p, {{WRAPPER}} .shopengine-checkout-payment #payment .woocommerce-terms-and-conditions-wrapper p ,{{WRAPPER}} #payment .payment_method_paypal a',
128 'exclude' => ['letter_spacing', 'text_decoration', 'text_transform', 'font_style', 'letter_spacing'],
129 'fields_options' => [
130 'typography' => [
131 'default' => 'custom',
132 ],
133 'font_weight' => [
134 'default' => '400',
135 ],
136 'font_size' => [
137 'label' => esc_html__('Font Size (px)', 'shopengine'),
138 'default' => [
139 'size' => '13',
140 'unit' => 'px',
141 ],
142 'size_units' => ['px'],
143 'responsive' => false,
144 ],
145 'line_height' => [
146 'label' => esc_html__('Line-Height (px)', 'shopengine'),
147 'default' => [
148 'size' => '16',
149 'unit' => 'px',
150 ],
151 'size_units' => ['px'],
152 ],
153 ],
154 ]
155 );
156
157 $this->end_controls_section(); // end ./ content section
158
159 /*
160 ---------------------------------
161 checkbox Section
162 ------------------------------------
163 */
164
165 $this->start_controls_section(
166 'shopengine_payment_methods',
167 [
168 'label' => esc_html__('Payment Methods', 'shopengine'),
169 'tab' => Controls_Manager::TAB_STYLE,
170 ]
171 );
172
173 $this->add_control(
174 'shopengine_payment_methods_checkboxes',
175 [
176 'label' => esc_html__('Checkboxes', 'shopengine'),
177 'type' => Controls_Manager::HEADING,
178 ]
179 );
180
181 $this->add_control(
182 'shopengine_payment_methods_checkbox_normal_color',
183 [
184 'label' => esc_html__('Checkbox color', 'shopengine'),
185 'type' => Controls_Manager::COLOR,
186 'alpha' => false,
187 'default' => '#C7C7C7',
188 'selectors' => [
189 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]:not(:checked)::before' => 'border-color: {{VALUE}};',
190 ],
191 ]
192 );
193
194 $this->add_control(
195 'shopengine_payment_methods_checkbox_checked_color',
196 [
197 'label' => esc_html__('Checkbox checked color', 'shopengine'),
198 'type' => Controls_Manager::COLOR,
199 'alpha' => false,
200 'default' => '#3A3A3A',
201 'selectors' => [
202 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]:checked::before' => 'border-color: {{VALUE}};',
203 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]:checked::after' => 'background-color: {{VALUE}};',
204 ],
205 ]
206 );
207
208 $this->add_responsive_control(
209 'shopengine_payment_methods_checkbox_size',
210 [
211 'label' => esc_html__('Checkbox Size (px)', 'shopengine'),
212 'type' => Controls_Manager::SLIDER,
213 'size_units' => ['px'],
214 'range' => [
215 'px' => [
216 'min' => 0,
217 'max' => 200,
218 'step' => 5,
219 ],
220 ],
221 'default' => [
222 'unit' => 'px',
223 'size' => 16,
224 ],
225 'selectors' => [
226 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]::before' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
227 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]::after' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
228 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]:checked::after' => 'width: calc({{SIZE}}{{UNIT}} / 2); height: calc({{SIZE}}{{UNIT}} / 2); left: calc(({{SIZE}}{{UNIT}} / 2) / 2 ); top: calc(({{SIZE}}{{UNIT}} / 2) / 2 );',
229 ],
230 ]
231 );
232
233 $this->add_responsive_control(
234 'shopengine_payment_methods_checkbox_margin',
235 [
236 'label' => esc_html__('Margin (px)', 'shopengine'),
237 'type' => Controls_Manager::DIMENSIONS,
238 'size_units' => ['px'],
239 'default' => [
240 'top' => '0',
241 'right' => '8',
242 'bottom' => '0',
243 'left' => '0',
244 'unit' => 'px',
245 'isLinked' => false,
246 ],
247 'selectors' => [
248 '{{WRAPPER}} .shopengine-checkout-payment #payment .wc_payment_method input[type="radio"]' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
249 ],
250 'separator' => 'before',
251 ]
252 );
253
254 $this->add_control(
255 'shopengine_payment_methods_list',
256 [
257 'label' => esc_html__('Payment Methods List', 'shopengine'),
258 'type' => Controls_Manager::HEADING,
259 'separator' => 'before',
260 ]
261 );
262
263 $this->add_responsive_control(
264 'shopengine_payment_methods_list_padding',
265 [
266 'label' => esc_html__('Padding (px)', 'shopengine'),
267 'type' => Controls_Manager::DIMENSIONS,
268 'size_units' => ['px'],
269 'default' => [
270 'top' => '10',
271 'right' => '0',
272 'bottom' => '10',
273 'left' => '0',
274 'unit' => 'px',
275 'isLinked' => false,
276 ],
277 'selectors' => [
278 '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_methods li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
279 ],
280 ]
281 );
282
283 $this->add_group_control(
284 Group_Control_Border::get_type(),
285 [
286 'name' => 'shopengine_payment_methods_list_border_between',
287 'label' => esc_html__('Border', 'shopengine'),
288 'selector' => '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_methods li',
289 'separator' => 'before',
290 ]
291 );
292
293 $this->add_control(
294 'shopengine_payment_methods_description',
295 [
296 'label' => esc_html__('Payment Methods Description', 'shopengine'),
297 'type' => Controls_Manager::HEADING,
298 'separator' => 'before',
299 ]
300 );
301
302 $this->add_responsive_control(
303 'shopengine_payment_methods_description_padding',
304 [
305 'label' => esc_html__('Padding (px)', 'shopengine'),
306 'type' => Controls_Manager::DIMENSIONS,
307 'size_units' => ['px'],
308 'default' => [
309 'top' => '15',
310 'right' => '0',
311 'bottom' => '0',
312 'left' => '0',
313 'unit' => 'px',
314 'isLinked' => false,
315 ],
316 'selectors' => [
317 '{{WRAPPER}} .shopengine-checkout-payment #payment .payment_methods .payment_box p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
318 ],
319 ]
320 );
321
322 $this->end_controls_section(); // end ./ checkbox Section
323
324 /*
325 ---------------------------------
326 button
327 ------------------------------------
328 */
329
330 $this->start_controls_section(
331 'shopengine_payment_order_button',
332 [
333 'label' => esc_html__('Button', 'shopengine'),
334 'tab' => Controls_Manager::TAB_STYLE,
335 ]
336 );
337
338 $this->add_control(
339 'shopengine_full_width_order_btn',
340 [
341 'label' => esc_html__('Full width button', 'shopengine'),
342 'type' => Controls_Manager::SWITCHER,
343 'label_on' => esc_html__('Show', 'shopengine'),
344 'label_off' => esc_html__('Hide', 'shopengine'),
345 'return_value' => 'yes',
346 'default' => 'yes',
347 ]
348 );
349
350 $this->add_responsive_control(
351 'shopengine_payment_order_button_space_between',
352 [
353 'label' => esc_html__('Space between', 'shopengine'),
354 'type' => Controls_Manager::SLIDER,
355 'size_units' => ['px'],
356 'range' => [
357 'px' => [
358 'min' => 0,
359 'max' => 100,
360 'step' => 5,
361 ],
362 ],
363 'default' => [
364 'unit' => 'px',
365 'size' => 20,
366 ],
367 'condition' => [
368 'shopengine_full_width_order_btn' => 'yes',
369 ],
370 'selectors' => [
371 '{{WRAPPER}} .shopengine-checkout-payment .form-row.place-order' => 'grid-template-columns: 100%; grid-gap: {{SIZE}}{{UNIT}} 0;',
372 ],
373 ]
374 );
375
376 $this->add_responsive_control(
377 'shopengine_payment_order_button_padding',
378 [
379 'label' => esc_html__('Padding', 'shopengine'),
380 'type' => Controls_Manager::DIMENSIONS,
381 'size_units' => ['px'],
382 'default' => [
383 'top' => '13',
384 'right' => '21',
385 'bottom' => '13',
386 'left' => '21',
387 'unit' => 'px',
388 'isLinked' => false,
389 ],
390 'selectors' => [
391 '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
392 ],
393 ]
394 );
395
396 $this->add_control(
397 'shopengine_payment_order_button_radius',
398 [
399 'label' => esc_html__('Border Radius', 'shopengine'),
400 'type' => Controls_Manager::DIMENSIONS,
401 'size_units' => ['px'],
402 'default' => [
403 'top' => '3',
404 'right' => '3',
405 'bottom' => '3',
406 'left' => '3',
407 'unit' => 'px',
408 'isLinked' => true,
409 ],
410 'selectors' => [
411 '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
412 ],
413 ]
414 );
415
416 $this->add_group_control(
417 Group_Control_Typography::get_type(),
418 [
419 'name' => 'shopengine_payment_order_button_typography',
420 'label' => esc_html__('Button Typography', 'shopengine'),
421 'selector' => '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order',
422 'exclude' => ['letter_spacing', 'font_style'],
423 'fields_options' => [
424 'typography' => [
425 'default' => 'custom',
426 ],
427 'font_weight' => [
428 'default' => '500',
429 ],
430 'font_size' => [
431 'label' => esc_html__('Font Size (px)', 'shopengine'),
432 'default' => [
433 'size' => '15',
434 'unit' => 'px',
435 ],
436 'responsive' => false,
437 'size_units' => ['px'],
438 ],
439 'text_decoration' => [
440 'default' => 'none',
441 ],
442 ],
443 ]
444 );
445
446 $this->add_group_control(
447 Group_Control_Box_Shadow::get_type(),
448 [
449 'name' => 'shopengine_payment_order_button_shadow',
450 'label' => esc_html__('Box Shadow', 'shopengine'),
451 'selector' => '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order',
452 ]
453 );
454
455 $this->start_controls_tabs('shopengine_payment_order_button_tabs');
456
457 $this->start_controls_tab(
458 'shopengine_payment_order_button_tabs_normal',
459 [
460 'label' => esc_html__('Normal', 'shopengine'),
461 ]
462 );
463
464 $this->add_control(
465 'shopengine_payment_order_button_tabs_normal_clr',
466 [
467 'label' => esc_html__('Color', 'shopengine'),
468 'type' => Controls_Manager::COLOR,
469 'default' => '#ffffff',
470 'alpha' => false,
471 'selectors' => [
472 '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order' => 'color: {{VALUE}}',
473 ],
474 ]
475 );
476
477 $this->add_control(
478 'shopengine_payment_order_button_tabs_normal_bg',
479 [
480 'label' => esc_html__('Background', 'shopengine'),
481 'type' => Controls_Manager::COLOR,
482 'default' => '#3A3A3A',
483 'alpha' => false,
484 'selectors' => [
485 '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order' => 'background: {{VALUE}}',
486 ],
487 ]
488 );
489
490 $this->end_controls_tab();
491
492 $this->start_controls_tab(
493 'shopengine_payment_order_button_tabs_hover',
494 [
495 'label' => esc_html__('Hover', 'shopengine'),
496 ]
497 );
498
499 $this->add_control(
500 'shopengine_payment_order_button_tabs_hover_clr',
501 [
502 'label' => esc_html__('Color', 'shopengine'),
503 'type' => Controls_Manager::COLOR,
504 'alpha' => false,
505 'default' => '#ffffff',
506 'selectors' => [
507 '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order:hover' => 'color: {{VALUE}}',
508 ],
509 ]
510 );
511
512 $this->add_control(
513 'shopengine_payment_order_button_tabs_hover_bg',
514 [
515 'label' => esc_html__('Background', 'shopengine'),
516 'type' => Controls_Manager::COLOR,
517 'default' => '#101010',
518 'alpha' => false,
519 'selectors' => [
520 '{{WRAPPER}} .shopengine-checkout-payment #payment #place_order:hover' => 'background: {{VALUE}}',
521 ],
522 ]
523 );
524
525
526 $this->end_controls_tab();
527 $this->end_controls_tabs();
528
529 $this->add_responsive_control(
530 'shopengine_payment_order_button_wrap_margin',
531 [
532 'label' => esc_html__('Wrap Margin (px)', 'shopengine'),
533 'type' => Controls_Manager::DIMENSIONS,
534 'size_units' => ['px'],
535 'default' => [
536 'top' => '10',
537 'right' => '0',
538 'bottom' => '0',
539 'left' => '0',
540 'unit' => 'px',
541 'isLinked' => false,
542 ],
543 'selectors' => [
544 '{{WRAPPER}} .shopengine-checkout-payment #payment .form-row.place-order' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
545 ],
546 'separator' => 'before',
547 ]
548 );
549
550 $this->end_controls_section(); // end ./ button
551 }
552
553 /**
554 * Render widget output on the frontend.
555 *
556 * Written in PHP and used to generate the final HTML.
557 *
558 * @since 1.0.0
559 * @access protected
560 */
561 protected function screen() {
562
563 $tpl = Products::instance()->get_widget_template($this->get_name());
564
565 include $tpl;
566 }
567 }
568