class-evf-field-address.php
1 year ago
class-evf-field-ai.php
1 year ago
class-evf-field-captcha.php
1 month ago
class-evf-field-checkbox.php
3 months ago
class-evf-field-color.php
1 month ago
class-evf-field-country.php
3 months ago
class-evf-field-credit-card.php
1 month ago
class-evf-field-date-time.php
1 month ago
class-evf-field-divider.php
2 years ago
class-evf-field-email.php
1 year ago
class-evf-field-file-upload.php
1 year ago
class-evf-field-first-name.php
1 year ago
class-evf-field-hcaptcha.php
4 months ago
class-evf-field-hidden.php
1 year ago
class-evf-field-html.php
9 months ago
class-evf-field-image-upload.php
1 year ago
class-evf-field-last-name.php
1 year ago
class-evf-field-likert.php
1 year ago
class-evf-field-lookup.php
1 month ago
class-evf-field-number.php
1 year ago
class-evf-field-password.php
1 month ago
class-evf-field-payment-authorize-net.php
1 month ago
class-evf-field-payment-checkbox.php
1 month ago
class-evf-field-payment-coupon.php
1 month ago
class-evf-field-payment-gateway-selector.php
1 month ago
class-evf-field-payment-quantity.php
1 month ago
class-evf-field-payment-radio.php
1 month ago
class-evf-field-payment-single.php
1 month ago
class-evf-field-payment-square.php
1 year ago
class-evf-field-payment-subscription-plan.php
1 month ago
class-evf-field-payment-subtotal.php
1 month ago
class-evf-field-payment-total.php
1 month ago
class-evf-field-phone.php
1 year ago
class-evf-field-privacy-policy.php
3 months ago
class-evf-field-private-note.php
1 year ago
class-evf-field-progress.php
1 month ago
class-evf-field-radio.php
3 months ago
class-evf-field-range-slider.php
1 month ago
class-evf-field-rating.php
3 months ago
class-evf-field-recaptcha.php
4 months ago
class-evf-field-repeater.php
1 month ago
class-evf-field-reset.php
1 month ago
class-evf-field-scale-rating.php
1 year ago
class-evf-field-select.php
1 year ago
class-evf-field-signature.php
1 month ago
class-evf-field-text.php
1 year ago
class-evf-field-textarea.php
1 year ago
class-evf-field-title.php
2 years ago
class-evf-field-turnstile.php
4 months ago
class-evf-field-url.php
1 year ago
class-evf-field-wysiwyg.php
3 months ago
class-evf-field-yes-no.php
1 year ago
payment-amount-helpers.php
1 month ago
class-evf-field-payment-checkbox.php
104 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Payment checkbox field |
| 4 | * |
| 5 | * @package EverestForms\Fields |
| 6 | * @since 1.2.0 |
| 7 | */ |
| 8 | |
| 9 | defined( 'ABSPATH' ) || exit; |
| 10 | |
| 11 | // Currency-aware amount helpers (mirror the Pro evf_format_amount/evf_sanitize_amount |
| 12 | // so the locked preview matches the real Pro field exactly, incl. the currency symbol). |
| 13 | require_once __DIR__ . '/payment-amount-helpers.php'; |
| 14 | |
| 15 | /** |
| 16 | * EVF_Field_Payment_Checkbox Class. |
| 17 | * |
| 18 | * Builder-scope (read-only) version shipped in the free plugin so the field can |
| 19 | * be shown LOCKED — with its real preview and readable settings — for the AI |
| 20 | * upsell. The full functional implementation (front-end display, validation, |
| 21 | * exporters) lives in Everest Forms Pro, whose class loads in place of this one |
| 22 | * when the plugin is active (this file is only autoloaded when that class is not |
| 23 | * already defined). Keep `is_pro = true` so the field stays locked. |
| 24 | */ |
| 25 | class EVF_Field_Payment_Checkbox extends EVF_Form_Fields { |
| 26 | |
| 27 | /** |
| 28 | * Constructor. |
| 29 | */ |
| 30 | public function __construct() { |
| 31 | $this->name = esc_html__( 'Checkboxes', 'everest-forms' ); |
| 32 | $this->type = 'payment-checkbox'; |
| 33 | $this->icon = 'evf-icon evf-icon-checkbox'; |
| 34 | $this->order = 30; |
| 35 | $this->group = 'payment'; |
| 36 | $this->is_pro = true; |
| 37 | $this->links = array( |
| 38 | 'image_id' => '', |
| 39 | 'vedio_id' => 'madNj3wtoak', |
| 40 | ); |
| 41 | $this->defaults = array( |
| 42 | 1 => array( |
| 43 | 'label' => esc_html__( 'First Choice', 'everest-forms' ), |
| 44 | 'value' => '10.00', |
| 45 | 'image' => '', |
| 46 | 'default' => '', |
| 47 | ), |
| 48 | 2 => array( |
| 49 | 'label' => esc_html__( 'Second Choice', 'everest-forms' ), |
| 50 | 'value' => '20.00', |
| 51 | 'image' => '', |
| 52 | 'default' => '', |
| 53 | ), |
| 54 | 3 => array( |
| 55 | 'label' => esc_html__( 'Third Choice', 'everest-forms' ), |
| 56 | 'value' => '30.00', |
| 57 | 'image' => '', |
| 58 | 'default' => '', |
| 59 | ), |
| 60 | ); |
| 61 | $this->settings = array( |
| 62 | 'basic-options' => array( |
| 63 | 'field_options' => array( |
| 64 | 'label', |
| 65 | 'choices', |
| 66 | 'choices_images', |
| 67 | 'description', |
| 68 | 'required', |
| 69 | 'required_field_message_setting', |
| 70 | 'required_field_message', |
| 71 | ), |
| 72 | ), |
| 73 | 'advanced-options' => array( |
| 74 | 'field_options' => array( |
| 75 | 'meta', |
| 76 | 'input_columns', |
| 77 | 'label_hide', |
| 78 | 'css', |
| 79 | ), |
| 80 | ), |
| 81 | ); |
| 82 | |
| 83 | parent::__construct(); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Field preview inside the builder. |
| 88 | * |
| 89 | * @since 1.0.0 |
| 90 | * |
| 91 | * @param array $field Field data and settings. |
| 92 | */ |
| 93 | public function field_preview( $field ) { |
| 94 | // Label. |
| 95 | $this->field_preview_option( 'label', $field ); |
| 96 | |
| 97 | // Choices. |
| 98 | $this->field_preview_option( 'choices', $field ); |
| 99 | |
| 100 | // Description. |
| 101 | $this->field_preview_option( 'description', $field ); |
| 102 | } |
| 103 | } |
| 104 |