PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / elementor / modules / checkout / fields / checkbox.php

checkbox.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/elementor/modules/checkout/fields/checkbox.php

73 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Elementor\Modules\Checkout\Fields;
4
5 defined( 'ABSPATH' ) || die();
6
7 use Sellkit\Elementor\Modules\Checkout\Fields\Base;
8
9 /**
10 * Class checkbox.
11 *
12 * @since 1.1.0
13 */
14 class Checkbox extends Base {
15 /**
16 * Type of field.
17 *
18 * @return string
19 * @since 1.1.0
20 */
21 public function type() {
22 return 'checkbox';
23 }
24
25 /**
26 * Print out field label.
27 *
28 * @param array $args checkout fields options.
29 * @return void
30 * @since 1.1.0
31 */
32 protected function label( $args ) {
33
34 }
35
36 /**
37 * Adds additional class for fields if required
38 *
39 * @param array $args checkout fields options.
40 * @param string $key field key.
41 * @return array
42 * @since 1.1.0
43 */
44 protected function additional_class( $args, $key ) {
45 $args['class'][] = 'sellkit-checkout-checkbox-wrapper';
46
47 return $args;
48 }
49
50 /**
51 * Customized html per field.
52 *
53 * @param string $field field html string.
54 * @param array $args checkout fields options.
55 * @param string $key key of field.
56 * @return void
57 * @since 1.1.0
58 */
59 public function field( $field, $args, $key ) {
60 ?>
61 <p>
62 <span class="woocommerce-input-wrapper checkbox_wrapper">
63 <?php
64 $checked = ( 'true' === $args['checked'] ) ? 'checked="checked"' : '';
65 ?>
66 <input id="<?php echo esc_attr( $key ); ?>" style="width:fit-content" name="<?php esc_attr( $key ); ?>" class="checkbox_margin" type="checkbox" <?php echo esc_attr( $checked ); ?> >
67 <label for="<?php echo esc_attr( $key ); ?>" class="checkbox_label"><?php echo esc_html( $args['label'] ); ?></label>
68 </span>
69 </p>
70 <?php
71 }
72 }
73