{% extends "commerce/_layouts/cp" %} {% set selectedSubnavItem = "promotions" %} {% set crumbs = [ { label: "Promotions"|t('commerce'), url: url('commerce/promotions') }, { label: "Sales"|t('commerce'), url: url('commerce/promotions/sales') }, ] %} {% set fullPageForm = true %} {% import "_includes/forms" as forms %} {% import "commerce/_includes/forms/commerceForms" as commerceForms %} {% set actionClasses = "" %} {% if (sale.getErrors('applyAmount') or sale.getErrors('apply')) %} {% set actionClasses = "error" %} {% endif %} {% set matchingItemsClasses = "" %} {% if false %} {% set matchingItemsClasses = "error" %} {% endif %} {% set saleClasses = "" %} {% if(sale.getErrors('name')) %} {% set saleClasses = "error" %} {% endif %} {% set tabs = { 0: {'label':'Sale'|t('commerce'),'url':'#sale','class': saleClasses}, 1: {'label':'Matching Items'|t('commerce'),'url':'#matching-items'}, 2: {'label':'Conditions'|t('commerce'),'url':'#conditions'}, 3: {'label':'Actions'|t('commerce'),'url':'#actions','class': actionClasses} } %} {% block content %} {{ redirectInput('commerce/promotions/sales') }} {% if sale.id %} {% endif %}
| {{ forms.select({ id: 'apply', name: 'apply', options: [ {optgroup: "Reduce price"|t('commerce')}, {label: "Reduce the price by a percentage of the original price"|t('commerce'), value: 'byPercent' }, {label: "Reduce the price by a fixed amount"|t('commerce',{'currency': craft.commerce.paymentCurrencies.primaryPaymentCurrencyIso}), value: 'byFlat' }, {optgroup: "Set price"|t('commerce')}, {label: "Set the sale price to a percentage of the original price"|t('commerce'), value: 'toPercent' }, {label: "Set the sale price to a flat amount"|t('commerce',{'currency': craft.commerce.paymentCurrencies.primaryPaymentCurrencyIso}), value: 'toFlat' }, ], value: sale.apply }) }} | {{ currencySymbol }} {{ forms.text({ id: 'applyAmount', name: 'applyAmount', size: 10, value: sale.applyAmount, }) }} {{ percentSymbol }} |