class-evf-field-address.php
1 week 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
5 months ago
class-evf-field-hidden.php
1 year ago
class-evf-field-html.php
10 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
2 years 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
5 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
5 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-subscription-plan.php
106 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Payment subscription plan field |
| 4 | * |
| 5 | * @since 3.0.9 |
| 6 | * |
| 7 | * @package EverestForms\Fields |
| 8 | */ |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | // Currency-aware amount helper so the choices preview matches the real Pro field. |
| 13 | require_once __DIR__ . '/payment-amount-helpers.php'; |
| 14 | |
| 15 | /** |
| 16 | * EVF_Field_Payment_Subscription_Plan 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 | * processing) 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 | * @since 3.0.9 |
| 26 | */ |
| 27 | class EVF_Field_Payment_Subscription_Plan extends EVF_Form_Fields { |
| 28 | |
| 29 | /** |
| 30 | * Constructor. |
| 31 | * |
| 32 | * @since 3.0.9 |
| 33 | */ |
| 34 | public function __construct() { |
| 35 | $this->name = esc_html__( 'Subscription Plan', 'everest-forms' ); |
| 36 | $this->type = 'payment-subscription-plan'; |
| 37 | $this->icon = 'evf-icon evf-icon-subscription-plan'; |
| 38 | $this->order = 12; |
| 39 | $this->group = 'payment'; |
| 40 | $this->is_pro = true; |
| 41 | $this->links = array( |
| 42 | 'image_id' => '', |
| 43 | 'vedio_id' => '', |
| 44 | ); |
| 45 | $this->defaults = array( |
| 46 | 1 => array( |
| 47 | 'label' => esc_html__( 'First Choice', 'everest-forms' ), |
| 48 | 'value' => '10.00', |
| 49 | 'image' => '', |
| 50 | 'default' => '', |
| 51 | ), |
| 52 | 2 => array( |
| 53 | 'label' => esc_html__( 'Second Choice', 'everest-forms' ), |
| 54 | 'value' => '20.00', |
| 55 | 'image' => '', |
| 56 | 'default' => '', |
| 57 | ), |
| 58 | 3 => array( |
| 59 | 'label' => esc_html__( 'Third Choice', 'everest-forms' ), |
| 60 | 'value' => '30.00', |
| 61 | 'image' => '', |
| 62 | 'default' => '', |
| 63 | ), |
| 64 | ); |
| 65 | $this->settings = array( |
| 66 | 'basic-options' => array( |
| 67 | 'field_options' => array( |
| 68 | 'label', |
| 69 | 'plan_choices', |
| 70 | 'choices_images', |
| 71 | 'description', |
| 72 | 'required', |
| 73 | 'required_field_message_setting', |
| 74 | 'required_field_message', |
| 75 | ), |
| 76 | ), |
| 77 | 'advanced-options' => array( |
| 78 | 'field_options' => array( |
| 79 | 'meta', |
| 80 | 'input_columns', |
| 81 | 'label_hide', |
| 82 | 'css', |
| 83 | ), |
| 84 | ), |
| 85 | ); |
| 86 | |
| 87 | parent::__construct(); |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Field preview inside the builder (matches the Pro Subscription Plan field). |
| 92 | * |
| 93 | * @param array $field Field data and settings. |
| 94 | */ |
| 95 | public function field_preview( $field ) { |
| 96 | // Label. |
| 97 | $this->field_preview_option( 'label', $field ); |
| 98 | |
| 99 | // Choices. |
| 100 | $this->field_preview_option( 'choices', $field ); |
| 101 | |
| 102 | // Description. |
| 103 | $this->field_preview_option( 'description', $field ); |
| 104 | } |
| 105 | } |
| 106 |