| @@ -1,7 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Subscription product edit form view. | |
| 3 | + * Subscription product edit form view (classic-only panel). | |
| 4 | + * | |
| 5 | + * Used for the classic Subscription tab where no plan view is mounted. The | |
| 6 | + * simple-product plan view (Admin/Product/Plans) renders its own panel and | |
| 7 | + * reuses the shared classic fields partial for its hidden "classic settings". | |
| 8 | + * | |
| 9 | + * @package SpringDevs\Subscription\Admin | |
| 4 | 10 | */ |
| 5 | 11 | |
| 6 | 12 | // Exit if accessed directly. |
| 7 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -11,83 +17,7 @@ | ||
| 11 | 17 | ?> |
| 12 | 18 | <div id="sdevs_subscription_options" |
| 13 | 19 | class="panel woocommerce_options_panel option_group sdevs-form sdevs_panel show_if_simple" style="padding: 10px;"> |
| 14 | 20 | <div class="show_if_subscription"> |
| 15 | - <input name="_subscript_nonce" type="hidden" | |
| 16 | - value="<?php echo esc_attr( wp_create_nonce( '_subscript_edit_product_nonce' ) ); ?>"/> | |
| 17 | - <strong style="margin: 10px;"><?php esc_html_e( 'Subscription Settings', 'subscription' ); ?></strong> | |
| 18 | - <?php | |
| 19 | - | |
| 20 | - woocommerce_wp_select( | |
| 21 | - array( | |
| 22 | - 'id' => 'subscrpt_timing', | |
| 23 | - 'label' => __( 'Users will pay', 'subscription' ), | |
| 24 | - 'value' => $subscrpt_timing, | |
| 25 | - 'options' => $timing_types, | |
| 26 | - 'description' => __( 'Set the length of each recurring subscription period to daily, weekly, monthly or annually.', 'subscription' ), | |
| 27 | - 'desc_tip' => true, | |
| 28 | - ) | |
| 29 | - ); | |
| 30 | - ?> | |
| 31 | - <p class="form-field subscrpt_field"> | |
| 32 | - <label for="subscrpt_trial_time"><?php esc_html_e( ' Free Trial Duration', 'subscription' ); ?></label> | |
| 33 | - <input type="number" class="short" name="subscrpt_trial_time" id="subscrpt_trial_time" | |
| 34 | - value="<?php echo esc_attr( $subscrpt_trial_time ); ?>"/> | |
| 35 | - <select name="subscrpt_trial_timing" id="subscrpt_trial_timing"> | |
| 36 | - <?php foreach ( $trial_timing_types as $timing_type ) : ?> | |
| 37 | - <option value="<?php echo esc_attr( $timing_type['value'] ); ?>" | |
| 38 | - <?php | |
| 39 | - if ( $subscrpt_trial_timing === $timing_type['value'] ) { | |
| 40 | - echo 'selected'; | |
| 41 | - } | |
| 42 | - ?> | |
| 43 | - ><?php echo esc_html( $timing_type['label'] ); ?></option> | |
| 44 | - <?php endforeach; ?> | |
| 45 | - </select> | |
| 46 | - <small | |
| 47 | - class="description"><?php esc_html_e( 'Let users try the subscription for free before the first payment is collected.', 'subscription' ); ?></small> | |
| 48 | - </p> | |
| 49 | - | |
| 50 | - <?php | |
| 51 | - | |
| 52 | - woocommerce_wp_text_input( | |
| 53 | - array( | |
| 54 | - 'id' => 'subscrpt_cart_txt', | |
| 55 | - 'label' => __( 'Button Text (Custom)', 'subscription' ), | |
| 56 | - 'type' => 'text', | |
| 57 | - 'value' => $subscrpt_cart_txt, | |
| 58 | - 'description' => __( 'Customize the button label shown on the product or shop page. Default is "Subscribe"', 'subscription' ), | |
| 59 | - 'desc_tip' => true, | |
| 60 | - ) | |
| 61 | - ); | |
| 62 | - | |
| 63 | - woocommerce_wp_select( | |
| 64 | - array( | |
| 65 | - 'id' => 'subscrpt_user_cancel', | |
| 66 | - 'label' => __( 'Allow User Cancellation?', 'subscription' ), | |
| 67 | - 'value' => $subscrpt_user_cancell, | |
| 68 | - 'options' => array( | |
| 69 | - 'yes' => __( 'Yes', 'subscription' ), | |
| 70 | - 'no' => __( 'No', 'subscription' ), | |
| 71 | - ), | |
| 72 | - 'description' => __( 'Allow subscribers to cancel their subscription manually from their account dashboard.', 'subscription' ), | |
| 73 | - 'desc_tip' => true, | |
| 74 | - ) | |
| 75 | - ); | |
| 76 | - | |
| 77 | - woocommerce_wp_select( | |
| 78 | - array( | |
| 79 | - 'id' => 'subscrpt_limit', | |
| 80 | - 'label' => __( 'Limit subscription', 'subscription' ), | |
| 81 | - 'options' => array( | |
| 82 | - 'unlimited' => __( 'Do not limit', 'subscription' ), | |
| 83 | - 'one' => __( 'allow only one active subscription', 'subscription' ), | |
| 84 | - 'only_one' => __( 'allow only one subscription of any status', 'subscription' ), | |
| 85 | - ), | |
| 86 | - 'value' => $subscrpt_limit, | |
| 87 | - 'description' => __( 'Set optional limits for this product subscription.', 'subscription' ), | |
| 88 | - 'desc_tip' => true, | |
| 89 | - ) | |
| 90 | - ); | |
| 91 | - ?> | |
| 21 | + <?php require __DIR__ . '/product-classic-fields.php'; ?> | |
| 92 | 22 | </div> |
| 93 | 23 | </div> |