{% extends "commerce/_layouts/cp" %} {% set crumbs = [ { label: "Store Settings"|t('commerce'), url: url('commerce/store-settings') }, { label: "States"|t('commerce'), url: url('commerce/store-settings/states') }, ] %} {% set selectedSubnavItem = 'store-settings' %} {% set fullPageForm = true %} {% import "_includes/forms" as forms %} {% block content %} {% if state.id %}{% endif %} {{ forms.textField({ first: true, label: "Name"|t('commerce'), instructions: "What this state will be called in the control panel."|t('commerce'), id: 'name', name: 'name', value: state.name, errors: state.getErrors('name'), autofocus: true, required: true }) }} {{ forms.textField({ label: "Abbreviation"|t('commerce'), id: 'abbreviation', name: 'abbreviation', value: state.abbreviation, errors: state.getErrors('abbreviation'), required: true, }) }} {% if not state.countryId and craft.app.request.getQueryParam('countryId') %} {% set countryId = craft.app.request.getQueryParam('countryId') %} {% set hideSelect = true %} {% else %} {% set countryId = null %} {% set hideSelect = false %} {% endif %}
{{ forms.lightswitchField({ label: "Enabled?"|t('commerce'), id: 'enabled', name: 'enabled', value: 1, on: state.enabled, errors: state.getErrors('enabled'), warning: showDisableWarning ? 'You will not be able to update addresses, shipping zones or tax zones related to this state if it is disabled.'|t('commerce') : null, }) }} {% endblock %} {% js %} $(function() { $('#countryId').selectize({ dropdownParent: 'body' }); }); {% endjs %}