Set Frequency (duration) -> * Connect to a Product -> Finish. A persistent right-rail preview shows the * plan → durations → products flow and fills in live as each step is filled. * The plan (group), duration (term) and product relation are created through * the Plans REST API; only product creation uses admin-ajax. * * @package SpringDevs\Subscription\Admin */ if ( ! defined( 'ABSPATH' ) ) { exit; } $is_pro = subscrpt_pro_activated(); $currency_symbol = get_woocommerce_currency_symbol(); // Whether the store has any product at all — decides the connect step's shape. $has_products = (bool) wc_get_products( array( 'status' => array( 'publish', 'draft', 'pending', 'private' ), 'limit' => 1, 'return' => 'ids', ) ); // Plan types. Only "recurring" is available on the free plugin; the others are // shown Pro-locked so the choice is visible but not selectable without Pro. $plan_types = array( array( 'key' => 'recurring', 'label' => __( 'Recurring', 'subscription' ), 'desc' => __( 'Charge on a repeating schedule.', 'subscription' ), 'name' => __( 'Recurring Subscription', 'subscription' ), 'pro' => false, 'icon' => '', ), array( 'key' => 'subscribe_save', 'label' => __( 'Subscribe & Save', 'subscription' ), 'desc' => __( 'Recurring with a discount.', 'subscription' ), 'name' => __( 'Subscribe & Save', 'subscription' ), 'pro' => true, 'icon' => '', ), array( 'key' => 'installments', 'label' => __( 'Installments', 'subscription' ), 'desc' => __( 'Split a price into payments.', 'subscription' ), 'name' => __( 'Installment Plan', 'subscription' ), 'pro' => true, 'icon' => '', ), ); $interval_options = array( array( 'value' => 'day', 'label' => __( 'Day(s)', 'subscription' ), ), array( 'value' => 'week', 'label' => __( 'Week(s)', 'subscription' ), ), array( 'value' => 'month', 'label' => __( 'Month(s)', 'subscription' ), ), array( 'value' => 'year', 'label' => __( 'Year(s)', 'subscription' ), ), ); $avatar_palette = array( array( 'bg' => '#fde8d8', 'fg' => '#b85c20', ), array( 'bg' => '#dbeafe', 'fg' => '#1d4ed8', ), array( 'bg' => '#ede9fe', 'fg' => '#6d28d9', ), array( 'bg' => '#d1fae5', 'fg' => '#065f46', ), array( 'bg' => '#fce7f3', 'fg' => '#9d174d', ), ); // Small SVG icons reused inside the preview graph nodes. $subscrpt_icon_cal = ''; $subscrpt_icon_box = ''; $subscrpt_icon_plan = ''; ?>