// Refactor helper list + fixs

This commit is contained in:
Kevin Granger
2013-07-02 18:55:43 +02:00
parent 85da11181d
commit 0ad4b44866
15 changed files with 781 additions and 564 deletions
@@ -1,127 +1,153 @@
<div class="control-group well">
<label class="control-label">{l s='Free shipping'}</label>
<div class="controls">
<label class="t radio" for="free_shipping_on">
<div class="row">
<label class="control-label col-lg-3">{l s='Free shipping'}</label>
<div class="input-group col-lg-2">
<span class="switch prestashop-switch">
<input type="radio" name="free_shipping" id="free_shipping_on" value="1" {if $currentTab->getFieldValue($currentObject, 'free_shipping')|intval}checked="checked"{/if} />
<i class="icon-check-sign"></i> {l s='Yes'}
</label>
<label class="t radio" for="free_shipping_off">
<label class="t radio" for="free_shipping_on">
<i class="icon-check-sign"></i> {l s='Yes'}
</label>
<input type="radio" name="free_shipping" id="free_shipping_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'free_shipping')|intval}checked="checked"{/if} />
<i class="icon-ban-circle"></i> {l s='No'}
</label>
<label class="t radio" for="free_shipping_off">
<i class="icon-ban-circle"></i> {l s='No'}
</label>
<span class="slide-button btn btn-default"></span>
</span>
</div>
</div>
<div class="control-group well">
<label class="control-label">{l s='Apply a discount'}</label>
<div class="controls">
<label class="t radio" for="apply_discount_percent">
<div class="row">
<label class="control-label col-lg-3">{l s='Apply a discount'}</label>
<div class="input-group col-lg-8">
<span class="switch prestashop-switch switch-three">
<input type="radio" name="apply_discount" id="apply_discount_percent" value="percent" {if $currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval > 0}checked="checked"{/if} />
<i class="icon-check-sign"></i> {l s='Percent (%)'}
</label>
<label class="t radio" for="apply_discount_amount">
<label class="t radio" for="apply_discount_percent">
<i class="icon-check-sign"></i> {l s='Percent (%)'}
</label>
<input type="radio" name="apply_discount" id="apply_discount_amount" value="amount" {if $currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval > 0}checked="checked"{/if} />
<i class="icon-check-sign"></i> {l s='Amount'}
</label>
<label class="t radio" for="apply_discount_off">
<label class="t radio" for="apply_discount_amount">
<i class="icon-check-sign"></i> {l s='Amount'}
</label>
<input type="radio" name="apply_discount" id="apply_discount_off" value="off" {if !$currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval > 0 && !$currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval > 0}checked="checked"{/if} />
<i class="icon-ban-circle"></i> {l s='None'}
</label>
<label class="t radio" for="apply_discount_off">
<i class="icon-ban-circle"></i> {l s='None'}
</label>
<span class="slide-button btn btn-default"></span>
</span>
</div>
</div>
<div id="apply_discount_percent_div" class="row">
<label class="control-label col-lg-3">{l s='Value'}</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">%</span>
<input type="text" id="reduction_percent" class="input-mini" name="reduction_percent" value="{$currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval}" />
</div>
<span class="help-block"><i class="icon-warning-sign"></i> {l s='Does not apply to the shipping costs'}</span>
</div>
<div id="apply_discount_percent_div">
<label class="control-label">{l s='Value'}</label>
<div class="controls">
<input type="text" id="reduction_percent" class="input-mini" name="reduction_percent" value="{$currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval}" /> %
<span class="help-block">{l s='Does not apply to the shipping costs'}</span>
<div id="apply_discount_amount_div" class="row">
<label class="control-label col-lg-3">{l s='Amount'}</label>
<div class="col-lg-7">
<div class="row">
<div class="col-lg-4">
<input type="text" id="reduction_amount" name="reduction_amount" value="{$currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval}" onchange="this.value = this.value.replace(/,/g, '.');" />
</div>
<div class="col-lg-4">
<select name="reduction_currency" >
{foreach from=$currencies item='currency'}
<option value="{$currency.id_currency|intval}" {if $currentTab->getFieldValue($currentObject, 'reduction_currency') == $currency.id_currency || (!$currentTab->getFieldValue($currentObject, 'reduction_currency') && $currency.id_currency == $defaultCurrency)}selected="selected"{/if}>{$currency.iso_code}</option>
{/foreach}
</select>
</div>
<div class="col-lg-4">
<select name="reduction_tax" >
<option value="0" {if $currentTab->getFieldValue($currentObject, 'reduction_tax') == 0}selected="selected"{/if}>{l s='Tax excluded'}</option>
<option value="1" {if $currentTab->getFieldValue($currentObject, 'reduction_tax') == 1}selected="selected"{/if}>{l s='Tax included'}</option>
</select>
</div>
</div>
</div>
</div>
<div id="apply_discount_amount_div">
<label class="control-label">{l s='Amount'}</label>
<div class="controls">
<input type="text" id="reduction_amount" class="input-mini" name="reduction_amount" value="{$currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval}" onchange="this.value = this.value.replace(/,/g, '.');" />
<select name="reduction_currency" class="input-small">
{foreach from=$currencies item='currency'}
<option value="{$currency.id_currency|intval}" {if $currentTab->getFieldValue($currentObject, 'reduction_currency') == $currency.id_currency || (!$currentTab->getFieldValue($currentObject, 'reduction_currency') && $currency.id_currency == $defaultCurrency)}selected="selected"{/if}>{$currency.iso_code}</option>
{/foreach}
</select>
<select name="reduction_tax" class="input-medium">
<option value="0" {if $currentTab->getFieldValue($currentObject, 'reduction_tax') == 0}selected="selected"{/if}>{l s='Tax excluded'}</option>
<option value="1" {if $currentTab->getFieldValue($currentObject, 'reduction_tax') == 1}selected="selected"{/if}>{l s='Tax included'}</option>
</select>
</div>
</div>
<div id="apply_discount_to_div">
<label class="control-label">{l s='Apply a discount to'}</label>
<div class="controls">
<div id="apply_discount_to_div" class="row">
<label class="control-label col-lg-3">{l s='Apply a discount to'}</label>
<div class="col-lg-7">
<p class="checkbox">
<label class="t radio" for="apply_discount_to_order">
<input type="radio" name="apply_discount_to" id="apply_discount_to_order" value="order" {if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval == 0}checked="checked"{/if} />
{l s='Order (without shipping)'}
</label>
</p>
<p class="checkbox">
<label class="t radio" for="apply_discount_to_product">
<input type="radio" name="apply_discount_to" id="apply_discount_to_product" value="specific" {if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval > 0}checked="checked"{/if} />
{l s='Specific product'}
</label>
</p>
<p class="checkbox">
<label class="t radio" for="apply_discount_to_cheapest">
<input type="radio" name="apply_discount_to" id="apply_discount_to_cheapest" value="cheapest" {if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval == -1}checked="checked"{/if} />
{l s='Cheapest product'}
</label>
</p>
<p class="checkbox">
<label class="t radio" for="apply_discount_to_selection">
<input type="radio" name="apply_discount_to" id="apply_discount_to_selection" value="selection" {if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval == -2}checked="checked"{/if} />
{l s='Selected product(s)'}
</label>
</div>
<div id="apply_discount_to_product_div">
<label class="control-label">{l s='Product'}</label>
<div class="controls">
<input type="hidden" id="reduction_product" name="reduction_product" value="{$currentTab->getFieldValue($currentObject, 'reduction_product')|intval}" />
<input type="text" id="reductionProductFilter" class="input-large" name="reductionProductFilter" value="{$reductionProductFilter|escape:'htmlall':'UTF-8'}" />
</div>
</div>
</p>
</div>
</div>
<div id="apply_discount_to_product_div" class="row">
<label class="control-label col-lg-3">{l s='Product'}</label>
<div class="input-group col-lg-5">
<input type="text" id="reductionProductFilter" name="reductionProductFilter" value="{$reductionProductFilter|escape:'htmlall':'UTF-8'}" />
<input type="hidden" id="reduction_product" name="reduction_product" value="{$currentTab->getFieldValue($currentObject, 'reduction_product')|intval}" />
<span class="input-group-addon"><i class="icon-search"></i></span>
</div>
</div>
<div class="control-group well">
<label class="control-label">{l s='Send a free gift'}</label>
<div class="controls">
<label class="t radio" for="free_gift_on">
<div class="row">
<label class="control-label col-lg-3">{l s='Send a free gift'}</label>
<div class="input-group col-lg-2">
<span class="switch prestashop-switch">
<input type="radio" name="free_gift" id="free_gift_on" value="1" {if $currentTab->getFieldValue($currentObject, 'gift_product')|intval}checked="checked"{/if} />
<i class="icon-check-sign"></i> {l s='Yes'}
</label>
<label class="t radio" for="free_gift_off">
<label class="t radio" for="free_gift_on">
<i class="icon-check-sign"></i> {l s='Yes'}
</label>
<input type="radio" name="free_gift" id="free_gift_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'gift_product')|intval}checked="checked"{/if} />
<i class="icon-ban-circle"></i> {l s='No'}
</label>
<label class="t radio" for="free_gift_off">
<i class="icon-ban-circle"></i> {l s='No'}
</label>
<span class="slide-button btn btn-default"></span>
</span>
</div>
</div>
<div id="free_gift_div">
<label class="control-label">{l s='Search a product'}</label>
<div class="controls">
<input type="text" id="giftProductFilter" class="input-large" value="{$giftProductFilter}" />
</div>
<div id="gift_products_found" {if $gift_product_select == ''}style="display:none"{/if}>
<div id="gift_product_list">
<label>{l s='Matching products'}</label>
<select name="gift_product" id="gift_product" onclick="displayProductAttributes();">
{$gift_product_select}
</select>
</div>
<div id="gift_attributes_list" {if !$hasAttribute}style="display:none"{/if}>
<label>{l s='Available combinations'}</label>
<div id="gift_attributes_list_select">
{$gift_product_attribute_select}
</div>
</div>
</div>
<div id="gift_products_err" class="alert alert-block" style="display:none"></div>
<div id="free_gift_div" class="row">
<label class="control-label col-lg-3">{l s='Search a product'}</label>
<div class="input-group col-lg-5">
<input type="text" id="giftProductFilter" value="{$giftProductFilter}" />
<span class="input-group-addon"><i class="icon-search"></i></span>
</div>
</div>
</div>
<div id="gift_products_found" {if $gift_product_select == ''}style="display:none"{/if}>
<br/>
<div id="gift_product_list" class="row" >
<label class="control-label col-lg-3">{l s='Matching products'}</label>
<div class="col-lg-5">
<select name="gift_product" id="gift_product" onclick="displayProductAttributes();">
{$gift_product_select}
</select>
</div>
</div>
<div id="gift_attributes_list" class="row" {if !$hasAttribute}style="display:none"{/if}>
<label class="control-label col-lg-3">{l s='Available combinations'}</label>
<div class="col-lg-5" id="gift_attributes_list_select">
{$gift_product_attribute_select}
</div>
</div>
</div>
<div id="gift_products_err" class="alert alert-block" style="display:none"></div>
@@ -1,276 +1,302 @@
<div class="control-group">
<label class="control-label">
<div class="row">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Optional: The cart rule will be available to everyone if you leave this field blank.'}">
{l s='Limit to a single customer'}
</span>
</label>
<div class="controls">
<div class="input-group col-lg-4">
<span class="input-group-addon"><i class="icon-user"></i></i></span>
<input type="hidden" id="id_customer" name="id_customer" value="{$currentTab->getFieldValue($currentObject, 'id_customer')|intval}" />
<input type="text" id="customerFilter" class="input-xlarge" name="customerFilter" value="{$customerFilter|escape:'htmlall':'UTF-8'}" />
<span class="input-group-addon"><i class="icon-search"></i></span>
</div>
</div>
<div class="control-group">
<label class="control-label">
<div class="row">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='The default period is one month.'}">
{l s='Valid'}
</span>
</label>
<div class="controls">
<div class="input-prepend">
<span class="add-on">{l s='From'}</span>
<input type="text" class="datepicker input-medium" name="date_from"
value="{if $currentTab->getFieldValue($currentObject, 'date_from')}{$currentTab->getFieldValue($currentObject, 'date_from')|escape}{else}{$defaultDateFrom}{/if}" />
</div>
<div class="input-prepend">
<span class="add-on">{l s='To'}</span>
<input type="text" class="datepicker input-medium" name="date_to"
value="{if $currentTab->getFieldValue($currentObject, 'date_to')}{$currentTab->getFieldValue($currentObject, 'date_to')|escape}{else}{$defaultDateTo}{/if}" />
<div class="col-lg-9">
<div class="row">
<div class="input-group col-lg-6">
<span class="input-group-addon">{l s='From'}</span>
<input type="text" class="datepicker input-medium" name="date_from"
value="{if $currentTab->getFieldValue($currentObject, 'date_from')}{$currentTab->getFieldValue($currentObject, 'date_from')|escape}{else}{$defaultDateFrom}{/if}" />
<span class="input-group-addon"><i class="icon-calendar-empty"></i></span>
</div>
<div class="input-group col-lg-6">
<span class="input-group-addon">{l s='To'}</span>
<input type="text" class="datepicker input-medium" name="date_to"
value="{if $currentTab->getFieldValue($currentObject, 'date_to')}{$currentTab->getFieldValue($currentObject, 'date_to')|escape}{else}{$defaultDateTo}{/if}" />
<span class="input-group-addon"><i class="icon-calendar-empty"></i></span>
</div>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">
<div class="row">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='You can choose a minimum amount for the cart either with or without the taxes and shipping.'}">
{l s='Minimum amount'}
</span>
</label>
<div class="controls">
<input type="text" class="input-mini" name="minimum_amount" value="{$currentTab->getFieldValue($currentObject, 'minimum_amount')|floatval}" />
<select name="minimum_amount_currency" class="input-small">
{foreach from=$currencies item='currency'}
<option value="{$currency.id_currency|intval}"
{if $currentTab->getFieldValue($currentObject, 'minimum_amount_currency') == $currency.id_currency
|| (!$currentTab->getFieldValue($currentObject, 'minimum_amount_currency') && $currency.id_currency == $defaultCurrency)}
selected="selected"
{/if}
>
{$currency.iso_code}
</option>
{/foreach}
</select>
<select name="minimum_amount_tax" class="input-small">
<option value="0" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_tax') == 0}selected="selected"{/if}>{l s='Tax excluded'}</option>
<option value="1" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_tax') == 1}selected="selected"{/if}>{l s='Tax included'}</option>
</select>
<select name="minimum_amount_shipping" class="input-medium">
<option value="0" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_shipping') == 0}selected="selected"{/if}>{l s='Shipping excluded'}</option>
<option value="1" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_shipping') == 1}selected="selected"{/if}>{l s='Shipping included'}</option>
</select>
<div class="col-lg-9">
<div class="row">
<div class="col-lg-3">
<input type="text" name="minimum_amount" value="{$currentTab->getFieldValue($currentObject, 'minimum_amount')|floatval}" />
</div>
<div class="col-lg-2">
<select name="minimum_amount_currency">
{foreach from=$currencies item='currency'}
<option value="{$currency.id_currency|intval}"
{if $currentTab->getFieldValue($currentObject, 'minimum_amount_currency') == $currency.id_currency
|| (!$currentTab->getFieldValue($currentObject, 'minimum_amount_currency') && $currency.id_currency == $defaultCurrency)}
selected="selected"
{/if}
>
{$currency.iso_code}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<select name="minimum_amount_tax">
<option value="0" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_tax') == 0}selected="selected"{/if}>{l s='Tax excluded'}</option>
<option value="1" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_tax') == 1}selected="selected"{/if}>{l s='Tax included'}</option>
</select>
</div>
<div class="col-lg-4">
<select name="minimum_amount_shipping">
<option value="0" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_shipping') == 0}selected="selected"{/if}>{l s='Shipping excluded'}</option>
<option value="1" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_shipping') == 1}selected="selected"{/if}>{l s='Shipping included'}</option>
</select>
</div>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">
<div class="row">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='The cart rule will be applied to the first "X" customers only.'}">
{l s='Total available'}
</span>
</label>
<div class="controls">
<input type="text" class="input-mini" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" />
<div class="input-group col-lg-2">
<span class="input-group-addon">×</span>
<input type="text" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" />
</div>
</div>
<div class="control-group">
<label class="control-label">
<div class="row">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='A customer will only be able to use the cart rule "X" time(s).'}">
{l s='Total available for each user.'}
</span>
</label>
<div class="controls">
<input type="text" class="input-mini" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" />
<div class="input-group col-lg-2">
<span class="input-group-addon">×</span>
<input type="text" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" />
</div>
</div>
<div class="control-group">
{if $countries.unselected|@count + $countries.selected|@count > 1}
<div class="controls well">
<label class="checkbox">
<input type="checkbox" id="country_restriction" name="country_restriction" value="1" {if $countries.unselected|@count}checked="checked"{/if} />
{l s='Country selection'}
</label>
<div id="country_restriction_div">
<table>
<tr>
<td >
<p><strong>{l s='Unselected countries'}</strong></p>
<select id="country_select_1" class="input-large" multiple>
{foreach from=$countries.unselected item='country'}
<option value="{$country.id_country|intval}">&nbsp;{$country.name|escape}</option>
{/foreach}
</select>
<a id="country_select_add" class="btn btn-block clearfix">{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p><strong>{l s='Selected countries'}</strong></p>
<select name="country_select[]" id="country_select_2" class="input-large" multiple>
{foreach from=$countries.selected item='country'}
<option value="{$country.id_country|intval}">&nbsp;{$country.name|escape}</option>
{/foreach}
</select>
<a id="country_select_remove" class="btn btn-block clearfix"><i class="icon-arrow-left"></i> {l s='Remove'} </a>
</td>
</tr>
</table>
<div class="row">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="">
{l s='Restrictions'}
</span>
</label>
<div class="col-lg-8">
{if $countries.unselected|@count + $countries.selected|@count > 1}
<div class="row">
<label class="checkbox">
<input type="checkbox" id="country_restriction" name="country_restriction" value="1" {if $countries.unselected|@count}checked="checked"{/if} />
{l s='Country selection'}
</label>
<span class="help-block">{l s='This restriction applies to the country of delivery.'}</span>
<div id="country_restriction_div">
<table>
<tr>
<td >
<p>{l s='Unselected countries'}</p>
<select id="country_select_1" multiple>
{foreach from=$countries.unselected item='country'}
<option value="{$country.id_country|intval}">&nbsp;{$country.name|escape}</option>
{/foreach}
</select>
<a id="country_select_add" class="btn btn-block clearfix">{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p>{l s='Selected countries'}</p>
<select name="country_select[]" id="country_select_2" class="input-large" multiple>
{foreach from=$countries.selected item='country'}
<option value="{$country.id_country|intval}">&nbsp;{$country.name|escape}</option>
{/foreach}
</select>
<a id="country_select_remove" class="btn btn-block clearfix"><i class="icon-arrow-left"></i> {l s='Remove'} </a>
</td>
</tr>
</table>
</div>
</div>
</div>
{/if}
{if $carriers.unselected|@count + $carriers.selected|@count > 1}
<div class="controls well">
<label class="checkbox">
<input type="checkbox" id="carrier_restriction" name="carrier_restriction" value="1" {if $carriers.unselected|@count}checked="checked"{/if} />
{l s='Carrier selection'}
</label>
<div id="carrier_restriction_div">
<table>
<tr>
<td>
<p><strong>{l s='Unselected carriers'}</strong></p>
<select id="carrier_select_1" class="input-large" multiple>
{foreach from=$carriers.unselected item='carrier'}
<option value="{$carrier.id_reference|intval}">&nbsp;{$carrier.name|escape}</option>
{/foreach}
</select>
<a id="carrier_select_add" class="btn btn-block clearfix" >{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p><strong>{l s='Selected carriers'}</strong></p>
<select name="carrier_select[]" id="carrier_select_2" class="input-large" multiple>
{foreach from=$carriers.selected item='carrier'}
<option value="{$carrier.id_reference|intval}">&nbsp;{$carrier.name|escape}</option>
{/foreach}
</select>
<a id="carrier_select_remove" class="btn btn-block clearfix"><i class="icon-arrow-left"></i> {l s='Remove'} </a>
</td>
</tr>
</table>
</div>
</div>
{/if}
{/if}
{if $groups.unselected|@count + $groups.selected|@count > 1}
<div class="controls well">
<label class="checkbox">
<input type="checkbox" id="group_restriction" name="group_restriction" value="1" {if $groups.unselected|@count}checked="checked"{/if} />
{l s='Customer group selection'}
</label>
<div id="group_restriction_div">
<table>
<tr>
<td>
<p><strong>{l s='Unselected groups'}</strong></p>
<select id="group_select_1" class="input-large" multiple>
{foreach from=$groups.unselected item='group'}
<option value="{$group.id_group|intval}">&nbsp;{$group.name|escape}</option>
{/foreach}
</select>
<a id="group_select_add" class="btn btn-block clearfix" >{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p><strong>{l s='Selected groups'}</strong></p>
<select name="group_select[]" class="input-large" id="group_select_2" multiple>
{foreach from=$groups.selected item='group'}
<option value="{$group.id_group|intval}">&nbsp;{$group.name|escape}</option>
{/foreach}
</select>
<a id="group_select_remove" class="btn btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove'}</a>
</td>
</tr>
</table>
{if $carriers.unselected|@count + $carriers.selected|@count > 1}
<div class="row">
<label class="checkbox">
<input type="checkbox" id="carrier_restriction" name="carrier_restriction" value="1" {if $carriers.unselected|@count}checked="checked"{/if} />
{l s='Carrier selection'}
</label>
<div id="carrier_restriction_div">
<table class="col-lg-12">
<tr>
<td>
<p>{l s='Unselected carriers'}</p>
<select id="carrier_select_1" class="input-large" multiple>
{foreach from=$carriers.unselected item='carrier'}
<option value="{$carrier.id_reference|intval}">&nbsp;{$carrier.name|escape}</option>
{/foreach}
</select>
<a id="carrier_select_add" class="btn btn-default btn-block clearfix" >{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p>{l s='Selected carriers'}</p>
<select name="carrier_select[]" id="carrier_select_2" class="input-large" multiple>
{foreach from=$carriers.selected item='carrier'}
<option value="{$carrier.id_reference|intval}">&nbsp;{$carrier.name|escape}</option>
{/foreach}
</select>
<a id="carrier_select_remove" class="btn btn-default btn-block clearfix"><i class="icon-arrow-left"></i> {l s='Remove'} </a>
</td>
</tr>
</table>
</div>
</div>
</div>
{/if}
{/if}
{if $cart_rules.unselected|@count + $cart_rules.selected|@count > 0}
<div class="controls well">
<label class="checkbox">
<input type="checkbox" id="cart_rule_restriction" name="cart_rule_restriction" value="1" {if $cart_rules.unselected|@count}checked="checked"{/if} />
{l s='Compatibility with other cart rules'}
</label>
<div id="cart_rule_restriction_div" >
<table>
<tr>
<td style="padding-left:20px;">
<p><strong>{l s='Uncombinable cart rules'}</strong></p>
<select id="cart_rule_select_1" class="input-large" multiple="">
{foreach from=$cart_rules.unselected item='cart_rule'}
<option value="{$cart_rule.id_cart_rule|intval}">&nbsp;{$cart_rule.name|escape}</option>
{/foreach}
</select>
<a id="cart_rule_select_add" class="btn btn-block clearfix">{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p><strong>{l s='Combinable cart rules'}</strong></p>
<select name="cart_rule_select[]" class="input-large" id="cart_rule_select_2" multiple>
{foreach from=$cart_rules.selected item='cart_rule'}
<option value="{$cart_rule.id_cart_rule|intval}">&nbsp;{$cart_rule.name|escape}</option>
{/foreach}
</select>
<a id="cart_rule_select_remove" class="btn btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove'}</a>
</td>
</tr>
</table>
{if $groups.unselected|@count + $groups.selected|@count > 1}
<div class="row">
<label class="checkbox">
<input type="checkbox" id="group_restriction" name="group_restriction" value="1" {if $groups.unselected|@count}checked="checked"{/if} />
{l s='Customer group selection'}
</label>
<div id="group_restriction_div">
<table class="col-lg-12">
<tr>
<td>
<p>{l s='Unselected groups'}</p>
<select id="group_select_1" class="input-large" multiple>
{foreach from=$groups.unselected item='group'}
<option value="{$group.id_group|intval}">&nbsp;{$group.name|escape}</option>
{/foreach}
</select>
<a id="group_select_add" class="btn btn-default btn-block clearfix" >{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p>{l s='Selected groups'}</p>
<select name="group_select[]" class="input-large" id="group_select_2" multiple>
{foreach from=$groups.selected item='group'}
<option value="{$group.id_group|intval}">&nbsp;{$group.name|escape}</option>
{/foreach}
</select>
<a id="group_select_remove" class="btn btn-default btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove'}</a>
</td>
</tr>
</table>
</div>
</div>
</div>
{/if}
{/if}
<div class="controls well">
<label class="checkbox">
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rule_groups|@count}checked="checked"{/if} />
{l s='Product selection'}
</label>
<div id="product_restriction_div">
<table id="product_rule_group_table" cellpadding="0" cellspacing="0">
{foreach from=$product_rule_groups item='product_rule_group'}
{$product_rule_group}
{/foreach}
</table>
<a href="javascript:addProductRuleGroup();" class="btn">
<i class="icon-plus-sign"></i> {l s='Product selection'}
</a>
{if $cart_rules.unselected|@count + $cart_rules.selected|@count > 0}
<div class="row">
<label class="checkbox">
<input type="checkbox" id="cart_rule_restriction" name="cart_rule_restriction" value="1" {if $cart_rules.unselected|@count}checked="checked"{/if} />
{l s='Compatibility with other cart rules'}
</label>
<div id="cart_rule_restriction_div" >
<table class="col-lg-12">
<tr>
<td>
<p>{l s='Uncombinable cart rules'}</p>
<select id="cart_rule_select_1" multiple="">
{foreach from=$cart_rules.unselected item='cart_rule'}
<option value="{$cart_rule.id_cart_rule|intval}">&nbsp;{$cart_rule.name|escape}</option>
{/foreach}
</select>
<a id="cart_rule_select_add" class="btn btn-default btn-block clearfix">{l s='Add'} <i class="icon-arrow-right"></i></a>
</td>
<td>
<p>{l s='Combinable cart rules'}</p>
<select name="cart_rule_select[]" id="cart_rule_select_2" multiple>
{foreach from=$cart_rules.selected item='cart_rule'}
<option value="{$cart_rule.id_cart_rule|intval}">&nbsp;{$cart_rule.name|escape}</option>
{/foreach}
</select>
<a id="cart_rule_select_remove" class="btn btn-default btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove'}</a>
</td>
</tr>
</table>
</div>
</div>
</div>
{/if}
{if $shops.unselected|@count + $shops.selected|@count > 1}
<div class="controls well">
<label class="checkbox">
<input type="checkbox" id="shop_restriction" name="shop_restriction" value="1" {if $shops.unselected|@count}checked="checked"{/if} />
{l s='Shop selection'}
</label>
<div id="shop_restriction_div" >
<table>
<tr>
<td>
<p><strong>{l s='Unselected shops'}</strong></p>
<select id="shop_select_1" multiple>
{foreach from=$shops.unselected item='shop'}
<option value="{$shop.id_shop|intval}">&nbsp;{$shop.name|escape}</option>
{/foreach}
</select>
<a id="shop_select_add" class="btn" >{l s='Add'} &gt;&gt; </a>
</td>
<td>
<p><strong>{l s='Selected shops'}</strong></p>
<select name="shop_select[]" id="shop_select_2" multiple>
{foreach from=$shops.selected item='shop'}
<option value="{$shop.id_shop|intval}">&nbsp;{$shop.name|escape}</option>
{/foreach}
</select>
<a id="shop_select_remove" class="btn" > &lt;&lt; {l s='Remove'} </a>
</td>
</tr>
</table>
<div class="row">
<label class="checkbox">
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rule_groups|@count}checked="checked"{/if} />
{l s='Product selection'}
</label>
<div id="product_restriction_div">
<table id="product_rule_group_table" cellpadding="0" cellspacing="0">
{foreach from=$product_rule_groups item='product_rule_group'}
{$product_rule_group}
{/foreach}
</table>
<a href="javascript:addProductRuleGroup();" class="btn btn-default ">
<i class="icon-plus-sign"></i> {l s='Product selection'}
</a>
</div>
</div>
{if $shops.unselected|@count + $shops.selected|@count > 1}
<div class="row">
<label class="checkbox">
<input type="checkbox" id="shop_restriction" name="shop_restriction" value="1" {if $shops.unselected|@count}checked="checked"{/if} />
{l s='Shop selection'}
</label>
<div id="shop_restriction_div" >
<table class="col-lg-12">
<tr>
<td>
<p>{l s='Unselected shops'}</p>
<select id="shop_select_1" multiple>
{foreach from=$shops.unselected item='shop'}
<option value="{$shop.id_shop|intval}">&nbsp;{$shop.name|escape}</option>
{/foreach}
</select>
<a id="shop_select_add" class="btn btn-default" >{l s='Add'} &gt;&gt; </a>
</td>
<td>
<p>{l s='Selected shops'}</p>
<select name="shop_select[]" id="shop_select_2" multiple>
{foreach from=$shops.selected item='shop'}
<option value="{$shop.id_shop|intval}">&nbsp;{$shop.name|escape}</option>
{/foreach}
</select>
<a id="shop_select_remove" class="btn" > &lt;&lt; {l s='Remove'} </a>
</td>
</tr>
</table>
</div>
</div>
{/if}
</div>
{/if}
</div>
@@ -24,22 +24,21 @@
<form action="{$currentIndex|escape}&token={$currentToken|escape}&addcart_rule" id="cart_rule_form" class="form-horizontal" method="post">
{if $currentObject->id}<input type="hidden" name="id_cart_rule" value="{$currentObject->id|intval}" />{/if}
<input type="hidden" id="currentFormTab" name="currentFormTab" value="informations" />
<div id="cart_rule_informations" class="cart_rule_tab">
<h2>{l s='Cart-rule information'}</h2>
<fieldset id="cart_rule_informations" class="cart_rule_tab">
<legend>{l s='Cart-rule information'}</legend>
{include file='controllers/cart_rules/informations.tpl'}
</div>
<div id="cart_rule_conditions" class="cart_rule_tab">
<h2>{l s='Cart-rule conditions'}</h2>
</fieldset>
<fieldset id="cart_rule_conditions" class="cart_rule_tab">
<legend>{l s='Cart-rule conditions'}</legend>
{include file='controllers/cart_rules/conditions.tpl'}
</div>
<div id="cart_rule_actions" class="cart_rule_tab">
<h2>{l s='Cart-rule actions'}</h2>
</fieldset>
<fieldset id="cart_rule_actions" class="cart_rule_tab">
<legend>{l s='Cart-rule actions'}</legend>
{include file='controllers/cart_rules/actions.tpl'}
</div>
<div>
<input type="submit" value="{l s='Save'}" class="btn" name="submitAddcart_rule" id="{$table|escape}_form_submit_btn" />
<!--<input type="submit" value="{l s='Save and stay'}" class="button" name="submitAddcart_ruleAndStay" id="" />-->
</div>
</fieldset>
<hr/>
<button type="submit" class="btn btn-primary btn-large pull-right" name="submitAddcart_rule" id="{$table|escape}_form_submit_btn"><i class="icon-save"></i> {l s='Save'}</button>
<!--<input type="submit" value="{l s='Save and stay'}" class="button" name="submitAddcart_ruleAndStay" id="" />-->
</form>
</div>
@@ -1,5 +1,5 @@
<div class="row">
<label class="col-lg-3 control-label required">
<label class="control-label col-lg-3 required">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='This will be displayed in the cart summary, as well as on the invoice.'}">
{l s='Name'}
@@ -7,7 +7,7 @@
</label>
<!-- For demo -->
<div class="input-group col-lg-5">
<div class="input-group col-lg-8">
{foreach from=$languages item=language}
<input id="name_{$language.id_lang|intval}" type="text" name="name_{$language.id_lang|intval}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang|intval)|escape:html:'UTF-8'}">
<div class="input-group-btn">
@@ -34,19 +34,19 @@
</div>
<div class="row">
<label class="col-lg-3 control-label">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='For your eyes only. This will never be displayed to the customer.'}">
{l s='Description'}
</span>
</label>
<div class="col-lg-5">
<div class="col-lg-8">
<textarea name="description" rows="2" >{$currentTab->getFieldValue($currentObject, 'description')|escape}</textarea>
</div>
</div>
<div class="row">
<label class="col-lg-3 control-label">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Caution! The rule will automatically be applied if you leave this field blank.'}">
{l s='Code'}
@@ -61,14 +61,14 @@
</div>
<div class="row">
<label class="col-lg-3 control-label">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='If the voucher is not yet in the cart, it will be displayed in the cart summary.'}">
{l s='Highlight'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="switch candy">
<span class="switch prestashop-switch">
<input type="radio" name="highlight" id="highlight_on" value="1" {if $currentTab->getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if}/>
<label class="t radio" for="highlight_on"><i class="icon-check-sign"></i> {l s='Yes'}</label>
<input type="radio" name="highlight" id="highlight_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if} />
@@ -79,7 +79,7 @@
</div>
<div class="row">
<label class="col-lg-3 control-label">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Only applicable if the voucher value is greater than the cart total.'}
{l s='If you do not allow partial use, the voucher value will be lowered to the total order amount. If you allow partial use, however, a new voucher will be created with the remainder.'}">
@@ -87,7 +87,7 @@
</span>
</label>
<div class="input-group col-lg-2">
<span class="switch candy">
<span class="switch prestashop-switch">
<input type="radio" name="partial_use" id="partial_use_on" value="1" {if $currentTab->getFieldValue($currentObject, 'partial_use')|intval}checked="checked"{/if} />
<label class="t radio" for="partial_use_on"><i class="icon-check-sign"></i> {l s='Yes'}</label>
<input type="radio" name="partial_use" id="partial_use_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'partial_use')|intval}checked="checked"{/if} />
@@ -98,7 +98,7 @@
</div>
<div class="row">
<label class="col-lg-3 control-label">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Cart rules are applied by priority. A cart rule with a priority of "1" will be processed before a cart rule with a priority of "2".'}">
{l s='Priority'}
@@ -110,9 +110,9 @@
</div>
<div class="row">
<label class="col-lg-3 control-label">{l s='Status'}</label>
<label class="control-label col-lg-3">{l s='Status'}</label>
<div class="input-group col-lg-2">
<span class="switch candy">
<span class="switch prestashop-switch">
<input type="radio" name="active" id="active_on" value="1" {if $currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
<label class="t radio" for="active_on"><i class="icon-check-sign"></i> {l s='Yes'}</label>
<input type="radio" name="active" id="active_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
@@ -120,5 +120,4 @@
<span class="slide-button btn btn-default"></span>
</span>
</div>
</div>
<hr/>
</div>
@@ -63,9 +63,9 @@
{/block}
{block name="defaultForm"}
<div>
<div class="row-fluid">
<div class="productTabs" style="display:none;">
<ul class="tab">
<ul class="tab nav nav-tabs">
{*todo href when nojs*}
{foreach $product_tabs key=numStep item=tab}
<li class="tab-row">
@@ -54,17 +54,21 @@
</script>
<div class="bloc-leadin">
<div id="container_category_tree">
<a href="#" id="toggle_category_tree">
<form>
<input type="checkbox" {if $is_category_filter}checked="checked"{/if} />{l s='Filter by category'}
</form>
</a>
<div id="block_category_tree" {if !$is_category_filter}style="display:none"{/if}>
<br />
{$category_tree}
</div>
</div>
</div>
{/if}
{/block}