Initial Commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div id="condition-add-operators-values" class="form-group">
|
||||
<label for="operator">{$label}</label>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
<div class="input-group col-lg-6">
|
||||
<input type="text" class="form-control" id="{$inputKey}-value" name="{$inputKey}[value]" value="{$currentValue}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div class="form-group">
|
||||
<label for="operator">{intl l="Products are :"}</label>
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{$categories_field_name}-value">{intl l="The selected categories :"}</label>
|
||||
<select required multiple size="5" class="form-control" id="{$categories_field_name}-value" name="{$categories_field_name}[value][]">
|
||||
{loop type="category-tree" category=0 name="list-of-categories" backend_context=1}
|
||||
<option style="padding-left: {$LEVEL * 20}px" value="{$ID}" {if in_array($ID, $values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div class="form-group">
|
||||
<label for="operator">{intl l="Products are :"}</label>
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{$products_field_name}-value">{intl l="The selected products :"}</label>
|
||||
<select required multiple size="5" class="form-control" id="{$products_field_name}-value" name="{$products_field_name}[value][]">
|
||||
{loop type="product" name="list-of-products" order="alpha" backend_context=1 return_url=false}
|
||||
<option value="{$ID}" {if in_array($ID, $values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one product'}</span>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div id="condition-add-operators-values" class="form-group">
|
||||
<label for="operator">{$label}</label>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
<div class="input-group col-lg-6">
|
||||
{$quantitySelectHtml nofilter}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div class="form-group">
|
||||
|
||||
<label for="operator">{$label}</label>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<input type="text" class="form-control" id="{$field_1_name}-value" name="{$field_1_name}[value]" value="{$value}" placeholder="{intl l='Amount'}">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-2">
|
||||
<input type="hidden" id="{$field_2_name}-operator" name="{$field_2_name}[operator]" value="=="/>
|
||||
{$currencySelectHtml nofilter}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<select class="form-control" id="{$inputKey}-operator" name="{$inputKey}[operator]">
|
||||
{foreach $operators as $key => $operator}
|
||||
<option value="{$key}"{if $key == $value}selected="selected"{/if}>{$operator}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
@@ -0,0 +1,15 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div class="form-group">
|
||||
<label for="operator">{$countryLabel}</label>
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{$countries_field_name}-value">{intl l="The selected countries :"}</label>
|
||||
<select required multiple size="5" class="form-control" id="{$countries_field_name}-value" name="{$countries_field_name}[value][]">
|
||||
{loop type="country" name="list-of-countries" order="alpha" backend_context=1 visible="*"}
|
||||
<option style="padding-left: {$LEVEL * 20}px" value="{$ID}" {if in_array($ID, $values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one country'}</span>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<select class="form-control" id="{$inputKey}-value" name="{$inputKey}[value]">
|
||||
{foreach $currencies as $key => $currency}
|
||||
<option value="{$key}"{if $key == $value}selected="selected"{/if}>{$currency}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
@@ -0,0 +1,15 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
<div class="form-group">
|
||||
<label for="operator">{intl l="Customer is"}</label>
|
||||
{$operatorSelectHtml nofilter}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="{$customers_field_name}-value">{intl l="The selected customer :"}</label>
|
||||
<select required multiple size="5" class="form-control" id="{$customers_field_name}-value" name="{$customers_field_name}[value][]">
|
||||
{loop type="customer" name="list-of-customers" order="lastname,firstname" current="0" backend_context=1}
|
||||
<option value="{$ID}" {if in_array($ID, $values)}selected="selected"{/if}>{$LASTNAME} {$FIRSTNAME} {$REF}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one country'}</span>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
<input type="number" value="{$value}" class="form-control" id="{$inputKey}-value" name="{$inputKey}[value]" placeholder="{intl l='Enter quantity'}" />
|
||||
{* Use a text field instead
|
||||
<select class="form-control" id="{$inputKey}-value" name="{$inputKey}[value]">
|
||||
{for $index=$min to $max}
|
||||
<option value="{$index}" {if $index == $value}selected="selected"{/if}>{$index}</option>
|
||||
{/for}
|
||||
</select>
|
||||
*}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
|
||||
<input type="hidden" name="{$fieldName}[operator]" value="{$criteria}" />
|
||||
|
||||
<div id="condition-add-operators-values" class="form-group">
|
||||
<label for="operator">{intl l="Validity start date"} :</label>
|
||||
<input type="text" class="form-control" id="{$fieldName}-value" name="{$fieldName}[value]" value="{$currentValue}" placeholder="{intl l="Format: %fmt" fmt={$dateFormat}}">
|
||||
<span class="label-help-block">{intl l='Please enter the date using the %fmt format' fmt={$dateFormat}}</span>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
{$inputsDrawn nofilter}
|
||||
|
||||
<input name="conditionIndex" type="hidden" value="{$conditionIndex}" />
|
||||
|
||||
<script>
|
||||
$.couponManager.conditionToUpdateServiceId = '{$conditionServiceId}';
|
||||
</script>
|
||||
24
templates/backOffice/default/coupon/conditions.html
Normal file
24
templates/backOffice/default/coupon/conditions.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
{* List all condition with their summary *}
|
||||
{foreach from=$conditions item=condition name=conditionsForeach}
|
||||
<tr>
|
||||
<td>
|
||||
{if !$smarty.foreach.conditionsForeach.first}
|
||||
<span class="label label-info">{intl l='And'}</span>
|
||||
{/if}
|
||||
{$condition.summary nofilter}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<a title="{intl l='Change this condition'}" data-service-id="{$condition.serviceId}" data-condition-index="{$condition.index}" class="condition-update-btn" href="{$urlEdit nofilter}">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
|
||||
{if $conditions|count != 1}
|
||||
<a title="{intl l='Delete this condition'}" data-condition-index="{$condition.index}" data-target="#delete" data-toggle="confirm" class="condition-delete-btn" href="{$urlDelete nofilter}">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
296
templates/backOffice/default/coupon/form.html
Normal file
296
templates/backOffice/default/coupon/form.html
Normal file
@@ -0,0 +1,296 @@
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
{include file='includes/notifications.html' message=$general_error}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 general-block-decorator">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{$title}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-container">
|
||||
|
||||
<form action="{$formAction}" {form_enctype} method="POST" >
|
||||
|
||||
{form_hidden_fields}
|
||||
|
||||
{form_field field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{if $value}{$value}{else}{$edit_language_locale}{/if}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/coupon/update/{id}'}" />
|
||||
{/form_field}
|
||||
|
||||
{if !$noConditions}
|
||||
{include
|
||||
file = "includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons = false
|
||||
|
||||
page_url = {url path=$formAction}
|
||||
close_url = {url path='/admin/coupon'}
|
||||
}
|
||||
{else}
|
||||
{include
|
||||
file = "includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons = false
|
||||
hide_save_and_close_button = true
|
||||
hide_flags = true
|
||||
|
||||
page_url = {url path=$formAction}
|
||||
close_url = {url path='/admin/coupon'}
|
||||
}
|
||||
{/if}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{form_field field='code'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label class="control-label" for="code">{intl l='Coupon code * :'}</label>
|
||||
<input required id="code" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='code'}">
|
||||
<span class="help-block">{intl l='This is the code entered by your customers to use this coupon'}</span>
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<div id="coupon-type">
|
||||
{form_field field='type'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="type" class="control-label">{intl l='Coupon type * :'}</label>
|
||||
<select required name="{$name}" id="type" class="col-md-12 form-control">
|
||||
<option value="" data-description="" data-inputName="">{intl l='Please select a coupon type'}</option>
|
||||
{foreach from=$availableCoupons item=availableCoupon}
|
||||
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}" data-inputName="{$availableCoupon.inputName}" {if $value == $availableCoupon.serviceId}selected{/if}>
|
||||
{$availableCoupon.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{if $error}{$message}{/if}
|
||||
<span class="help-block typeToolTip">{$availableCoupons.0.toolTip}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{form_field field='isEnabled'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="is-enabled" class="checkbox control-label">
|
||||
<input id="is-enabled" type="checkbox" name="{$name}" {if $value}value="1" checked{/if} />
|
||||
{if $error}{$message}{/if}
|
||||
{intl l='Enabled'}
|
||||
</label>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='isAvailableOnSpecialOffers'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="is-available-on-special-offers" class="checkbox control-label">
|
||||
<input id="is-available-on-special-offers" type="checkbox" name="{$name}" {if $value}value="1" checked{/if} />
|
||||
{if $error}{$message}{/if}
|
||||
{intl l='Valid on special offers'}
|
||||
</label>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='isCumulative'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="is-cumulative" class="checkbox control-label">
|
||||
<input id="is-cumulative" type="checkbox" name="{$name}" {if $value}value="1" checked{/if} />
|
||||
{if $error}{$message}{/if}
|
||||
{intl l='Combinable with other promotions'}
|
||||
</label>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='startDate'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="expiration-date" class="control-label">{intl l='Start Date'} :</label>
|
||||
<input type="text" id="expiration-date" name="{$name}" class="form-control" value="{if $nowDate}{$nowDate}{else}{$value}{/if}" placeholder="{intl l='Format: %fmt, e.g. %date' fmt=$dateFormat date={$smarty.now|date_format:$dateFormat}}">
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='expirationDate'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="expiration-date" class="control-label">{intl l='Expiration date * :'}</label>
|
||||
{* Do not use 'date' input type, as some browsers enforce RFC339 date formats, which is not what we want *}
|
||||
<input required type="text" id="expiration-date" name="{$name}" class="form-control" value="{if $defaultDate}{$defaultDate}{else}{$value}{/if}" placeholder="{intl l='Format: %fmt, e.g. %date' fmt=$dateFormat date={$smarty.now|date_format:$dateFormat}}">
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='maxUsage'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
|
||||
<label for="is-unlimited" class="checkbox control-label">
|
||||
<input id="is-unlimited" type="checkbox" name="is-unlimited" {if $value == '' || $value == -1}checked="checked"{/if}>
|
||||
{intl l='Unlimited number of uses'}
|
||||
</label>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div class="well well-sm" id="max-usage-data">
|
||||
{form_field field='maxUsage'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label id="max-usage-label" for="max-usage" class="control-label">{intl l='Maximum usage count :'}</label>
|
||||
<input id="max-usage" type="text" class="form-control" name="{$name}" value="{if $value == ''}-1{else}{$value}{/if}" placeholder="{intl l='Usage count'}">
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='perCustomerUsageCount'}
|
||||
<div class="form-group {if $error}has-error{/if}" style="margin-bottom: 0;">
|
||||
{foreach $choices as $choice}
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="{$name}" value="{$choice->value}" {if $value == $choice->data}checked="checked"{/if}>
|
||||
{$choice->label}
|
||||
</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
{form_field field='isRemovingPostage'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="is-removing-postage" class="checkbox control-label">
|
||||
<input id="is-removing-postage" type="checkbox" name="{$name}" {if $value}value="1" checked{/if} />
|
||||
{if $error}{$message}{/if}
|
||||
{intl l='Provides free shipping'}
|
||||
</label>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div class="free-postage-conditions well well-sm" " style="display: none">
|
||||
{form_field field='freeShippingForCountries'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="for-countries-only">{intl l="Free shipping to countries :"}</label>
|
||||
<select multiple size="5" class="form-control" id="for-countries-only" name="{$name}">
|
||||
{foreach $choices as $choice}
|
||||
<option value="{$choice->value}" {if in_array($choice->value, $value)}selected="selected"{/if}>{$choice->label}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one country'}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='freeShippingForModules'}
|
||||
<div class="form-group {if $error}has-error{/if}" style="margin-bottom: 0;">
|
||||
<label for="for-modules-only">{intl l="Free shipping for methods :"}</label>
|
||||
<select multiple size="5" class="form-control" id="for-modules-only" name="{$name}">
|
||||
{foreach $choices as $choice}
|
||||
<option value="{$choice->value}" {if in_array($choice->value, $value)}selected="selected"{/if}>{$choice->label}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one shipping method'}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div id="coupon-inputs">
|
||||
<div class="inputs">
|
||||
{$couponInputsHtml nofilter}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
{loop type="lang" name="get-flag" id=$edit_language_id}
|
||||
{form_field field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="title" class="control-label" >{intl l='Title * :'}</label>
|
||||
<div class="input-group">
|
||||
<input required id="title" class="form-control" type="text" name="{$name}" value="{$value}" placeholder="{intl l='title'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.png"}" alt="{$TITLE}" /></span>
|
||||
</div>
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='shortDescription'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="short-description" class="control-label">{intl l='Short description :'} <img src="{image file="assets/img/flags/{$CODE}.png"}" alt="{$TITLE}" /></label>
|
||||
<textarea id="short-description" name="{$name}" class="form-control" placeholder="{intl l='short description'}" rows="3">{$value nofilter}</textarea>
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field field='description'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="description" class="control-label">{intl l='Long description :'} <img src="{image file="assets/img/flags/{$CODE}.png"}" alt="{$TITLE}" /></label>
|
||||
<textarea id="description" name="{$name}" placeholder="{intl l='long description'}" class="form-control wysiwyg" rows="3">{$value nofilter}</textarea>
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{if $noConditions}
|
||||
<div class="col-md-12">
|
||||
<p class="title title-without-tabs">{intl l="Coupon conditions"}</p>
|
||||
<br />
|
||||
{include file='includes/notifications.html' alert_type='info' dismissable=false message={intl l='Please save this coupon first to define coupon conditions'}}
|
||||
</div>
|
||||
{else}
|
||||
<div class="col-md-6">
|
||||
<p class="title title-without-tabs">{intl l="Coupon conditions"}</p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed" id="folder_list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='Condition description'}</th>
|
||||
<th class="text-center">{intl l='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="condition-list">
|
||||
{include file='coupon/conditions.html' conditions=$conditions}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
<p class="title title-without-tabs">{intl l="Add a condition"}</p>
|
||||
|
||||
<form id="condition-form" action="{$urlAjaxSaveConditions nofilter}" {form_enctype} method="POST" >
|
||||
|
||||
<div id="condition-add-type" class="form-group">
|
||||
<label for="categoryCondition">{intl l='Condition category :'}</label>
|
||||
<select name="categoryCondition" id="category-condition" class="form-control">
|
||||
<option value="" data-description="">{intl l='Please select a condition'}</option>
|
||||
{foreach from=$availableConditions item=availableCondition}
|
||||
<option value="{$availableCondition.serviceId}" data-description="{$availableCondition.toolTip}">{$availableCondition.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<span class="help-block typeToolTip"></span>
|
||||
</div>
|
||||
|
||||
<div id="condition-add-operators-values" class="form-group">
|
||||
|
||||
</div>
|
||||
|
||||
<a id="condition-save-btn" title="{intl l='Save this condition'}" class="btn btn-primary pull-right" data-toggle="confirm" data-script="">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span> {intl l='Save this condition'}
|
||||
</a>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
{loop type="attribute_availability" attribute={$smarty.post.attribute_id} name="list-of-attribute_avs" backend_context="1"}
|
||||
<option value="{$ID}">{$TITLE}</option>
|
||||
{/loop}
|
||||
@@ -0,0 +1,3 @@
|
||||
{loop type="product" category={$smarty.post.category_id} name="list-of-products" backend_context="1" return_url=false}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}">{$TITLE}</option>
|
||||
{/loop}
|
||||
@@ -0,0 +1,67 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
|
||||
{block name="discount-field"}{/block}
|
||||
|
||||
<div class="form-group input-coupon-attribute-id">
|
||||
|
||||
<label for="coupon-category-id">{intl l="Select attribute :"}</label>
|
||||
|
||||
<select required class="form-control" id="coupon-attribute-id" name="{$attribute_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="attribute" name="list-of-attributes" order="alpha" backend_context="1"}
|
||||
<option value="{$ID}" {if $ID == $attribute_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-coupon-attributeAvs-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-coupon-attributeAvs-id" {if $attribute_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="coupon-products-id">{intl l="Applies to attribute values :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-attributeAvs-id" name="{$attribute_av_field_name}[]">
|
||||
{loop type="attribute_availability" attribute=$attribute_value|default:0 name="list-of-attribute_avs" backend_context="1"}
|
||||
<option value="{$ID}" {if in_array($ID, $attribute_av_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one attribute value'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
|
||||
var $catSelect = $('#coupon-attribute-id');
|
||||
|
||||
$catSelect.change(function(ev) {
|
||||
|
||||
var $attribute_id = $(this).val();
|
||||
|
||||
$('#input-coupon-attributeAvs-id').hide();
|
||||
$('#coupon-attributeAvs-id').html('');
|
||||
|
||||
if ($attribute_id != 0) {
|
||||
|
||||
$('#input-coupon-attributeAvs-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-attribute-avs-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
attribute_id: $attribute_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('#coupon-attributeAvs-id').html(options);
|
||||
$('#input-coupon-attributeAvs-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-coupon-attributeAvs-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
{block name="javascript-init"}{/block}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,22 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
|
||||
{block name="discount-field"}{/block}
|
||||
|
||||
<div class="form-group input-coupon-categories-id">
|
||||
|
||||
<label for="coupon-categories-id">{intl l="Applies to products in categories :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-categories-id" name="{$categories_field_name}[]">
|
||||
{loop type="category-tree" category=0 name="list-of-categories" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if in_array($ID, $categories_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
{block name="javascript-init"}{/block}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,67 @@
|
||||
{default_translation_domain domain='bo.default'}
|
||||
|
||||
{block name="discount-field"}{/block}
|
||||
|
||||
<div class="form-group input-coupon-category-id">
|
||||
|
||||
<label for="coupon-category-id">{intl l="Select product category :"}</label>
|
||||
|
||||
<select required class="form-control" id="coupon-category-id" name="{$category_id_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="category-tree" category=0 name="list-of-category" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if $ID == $category_id_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-coupon-products-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-coupon-products-id" {if $category_id_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="coupon-products-id">{intl l="Applies to products :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-products-id" name="{$products_field_name}[]">
|
||||
{loop type="product" category=$category_id_value|default:0 name="list-of-products" backend_context="1" return_url=false}
|
||||
<option value="{$ID}" {if in_array($ID, $products_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one product'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
|
||||
var $catSelect = $('#coupon-category-id');
|
||||
|
||||
$catSelect.change(function(ev) {
|
||||
|
||||
var $category_id = $(this).val();
|
||||
|
||||
$('#input-coupon-products-id').hide();
|
||||
$('#coupon-products-id').html('');
|
||||
|
||||
if ($category_id != 0) {
|
||||
|
||||
$('#input-coupon-products-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_id: $category_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('#coupon-products-id').html(options);
|
||||
$('#input-coupon-products-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-coupon-products-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
{block name="javascript-init"}{/block}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,69 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-products.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-free-product-category-id">
|
||||
|
||||
<label for="free-product-category-id">{intl l="Select offrered product category :"}</label>
|
||||
|
||||
<select required class="form-control" id="free-product-category-id" name="{$offered_category_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="category-tree" category=0 name="list-of-category" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if $ID == $offered_category_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-free-products-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-free-products-id" {if $offered_category_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="free-products-id">{intl l="Select offered product :"}</label>
|
||||
|
||||
<select required class="form-control" id="free-products-id" name="{$offered_product_field_name}">
|
||||
{loop type="product" category=$offered_category_value|default:0 name="list-of-products" backend_context="1" return_url=false}
|
||||
<option value="{$ID}" {if $ID == $offered_product_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="javascript-init"}
|
||||
|
||||
// Hide selected products category selection if the
|
||||
// offered product is not yet selected.
|
||||
if ({$offered_category_value|default:0} == 0) {
|
||||
$('.input-coupon-category-id').hide();
|
||||
}
|
||||
|
||||
var $freeCatSelect = $('#free-product-category-id');
|
||||
|
||||
$freeCatSelect.change(function(ev) {
|
||||
|
||||
var $category_id = $(this).val();
|
||||
|
||||
$('.input-coupon-category-id').hide();
|
||||
$('#input-free-products-id').hide();
|
||||
$('#free-products-id').html('');
|
||||
|
||||
if ($category_id != 0) {
|
||||
|
||||
$('#input-free-products-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_id: $category_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('.input-coupon-category-id').show();
|
||||
$('#free-products-id').html(options);
|
||||
$('#input-free-products-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-free-products-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
{/block}
|
||||
@@ -0,0 +1,16 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-attributes.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-amount">
|
||||
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,16 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-categories.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-amount">
|
||||
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,16 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-products.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-amount">
|
||||
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,14 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-attributes.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-percentage">
|
||||
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,14 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-categories.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-percentage">
|
||||
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,14 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-products.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-percentage">
|
||||
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -0,0 +1,11 @@
|
||||
<div class="form-group input-coupon-amount">
|
||||
<label for="coupon-amount" class="control-label">{intl l='Discount amount'}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="{intl l="Amount, e.g. 12.50"}">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="form-group input-coupon-percent">
|
||||
|
||||
<label for="coupon-percent" class="control-label">{intl l='Percent Discount'}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percent" class="form-control" name="{$percentage_field_name}" type="text" value="{$percentage_value}"/>
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,4 @@
|
||||
<div class="form-group input-{$fieldId}">
|
||||
<label for="{$fieldId}" class="control-label">{$label}</label>
|
||||
<input id="{$fieldId}" type="money" class="form-control" name="{$fieldName}" value="{$value}">
|
||||
</div>
|
||||
Reference in New Issue
Block a user