PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.6.2
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.6.2
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 / optin / fields / acceptance.php

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

65 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || die();
4
5 class Sellkit_Elementor_Optin_Field_Acceptance extends Sellkit_Elementor_Optin_Field_Base {
6
7 public static function get_field_type() {
8 return 'acceptance';
9 }
10
11 public function get_input_type() {
12 return 'checkbox';
13 }
14
15 public function add_field_render_attribute() {
16 parent::add_field_render_attribute();
17
18 if ( 'true' === $this->field['checked_by_default'] ) {
19 $this->widget->add_render_attribute( 'field-' . $this->get_id(), 'checked' );
20 }
21 }
22
23 public function render_content() {
24 $attrs = $this->widget->get_render_attribute_string( 'field-' . $this->get_id() );
25
26 ?>
27 <div class="sellkit-field-subgroup">
28 <span class="sellkit-field-option sellkit-field-option-checkbox">
29 <input <?php echo $attrs; ?>>
30 <label
31 for="optin-field-<?php echo $this->get_id(); ?>"
32 class="sellkit-field-label">
33 <?php echo $this->field['acceptance_text']; ?>
34 <?php if ( isset( $this->field['required'] ) && 'true' === $this->field['required'] ) : ?>
35 <span class="required-mark-label"></span>
36 <?php endif ?>
37 </label>
38 </span>
39 </div>
40 <?php
41 }
42
43 public static function get_additional_controls() {
44 $commons = parent::get_common_controls();
45
46 return [
47 'label' => $commons['label'],
48 'acceptance_text' => [
49 'label' => esc_html__( 'Acceptance Text', 'sellkit' ),
50 'default' => esc_html__( 'I agree to terms.', 'sellkit' ),
51 'type' => 'textarea',
52 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
53 ],
54 'checked_by_default' => [
55 'label' => esc_html__( 'Checked by Default', 'sellkit' ),
56 'type' => 'switcher',
57 'return_value' => 'true',
58 'conditions' => [ 'terms' => [ parent::get_type_condition() ] ],
59 ],
60 'required' => $commons['required'],
61 'width_responsive' => $commons['width_responsive'],
62 ];
63 }
64 }
65