{% extends "commerce/_layouts/cp" %} {% set title = brandNewPlan ? 'Create a new subscription plan'|t('commerce') : plan.name %} {% set crumbs = [ { label: "Commerce Settings"|t('commerce'), url: url('commerce/settings') }, { label: "Subscription plans"|t('commerce'), url: url('commerce/settings/subscriptions/plans') }, ] %} {% set selectedSubnavItem = 'settings' %} {% set fullPageForm = gatewayOptions|length > 0 %} {% import "_includes/forms" as forms %} {% block content %} {% if gatewayOptions|length > 0 or plan is not null %} {{ redirectInput('commerce/settings/subscriptions/plans') }} {% if plan is not null and plan.id %} {% endif %}
{{ 'You must set up at least one gateway that supports subscriptions first.'|t('commerce', {'link': url('commerce/settings/gateways')})|raw }}
{% endif %} {% endblock %} {% js %} {% if plan is null or not plan.handle %}new Craft.HandleGenerator('#name', '#handle');{% endif %} $('#gatewayId').on('change', function (ev) { $('.gateway-settings').addClass('hidden'); $('#gateway-settings-' + ev.currentTarget.value).removeClass('hidden'); }); {% endjs %}