// BO : cart rules form improved
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10290 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -186,7 +186,7 @@ div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0
|
||||
#productBox { position:relative; width:100%; float:left;}
|
||||
|
||||
/*tab-pane*/
|
||||
form#product, form#access_form{ background-color:#ebedf4; border:1px solid #ccced7; min-height:300px; padding: 5px 10px 10px; margin-left:140px;}
|
||||
form#product, form#access_form, form#cart_rule_form { background-color:#ebedf4; border:1px solid #ccced7; min-height:300px; padding: 5px 10px 10px; margin-left:140px;}
|
||||
/*form.defaultForm{ background-color:#ebedf4; border:1px solid #ccced7; min-height:300px; padding: 5px 10px 10px;}*/
|
||||
.tab-row {}
|
||||
.tab-row .tab {background:#EFEFEF;width:100px;}
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<label>{l s='Validity'}</label>
|
||||
<div class="margin-form">
|
||||
<strong>{l s='from'}</strong>
|
||||
<input type="text" name="date_from" value="{if $currentTab->getFieldValue($currentObject, 'date_from')}{$currentTab->getFieldValue($currentObject, 'date_from')}{else}{$defaultDateFrom}{/if}" />
|
||||
<input type="text" class="datepicker" name="date_from" value="{if $currentTab->getFieldValue($currentObject, 'date_from')}{$currentTab->getFieldValue($currentObject, 'date_from')}{else}{$defaultDateFrom}{/if}" />
|
||||
<strong>{l s='to'}</strong>
|
||||
<input type="text" name="date_to" value="{if $currentTab->getFieldValue($currentObject, 'date_to')}{$currentTab->getFieldValue($currentObject, 'date_to')}{else}{$defaultDateTo}{/if}" />
|
||||
<input type="text" class="datepicker" name="date_to" value="{if $currentTab->getFieldValue($currentObject, 'date_to')}{$currentTab->getFieldValue($currentObject, 'date_to')}{else}{$defaultDateTo}{/if}" />
|
||||
<p>{l s='Default period is one year.'}</p>
|
||||
</div>
|
||||
<label>{l s='Minimum amount'}</label>
|
||||
|
||||
@@ -298,3 +298,32 @@ $('#customerFilter')
|
||||
$('#id_customer').val(data.id_customer);
|
||||
$('#customerFilter').val(data.cname + ' (' + data.email + ')');
|
||||
});
|
||||
|
||||
function displayCartRuleTab(tab)
|
||||
{
|
||||
$('.cart_rule_tab').hide();
|
||||
$('.tab-page').removeClass('selected');
|
||||
$('#cart_rule_' + tab).show();
|
||||
$('#cart_rule_link_' + tab).addClass('selected');
|
||||
}
|
||||
|
||||
$('.cart_rule_tab').hide();
|
||||
$('.tab-page').removeClass('selected');
|
||||
$('#cart_rule_informations').show();
|
||||
$('#cart_rule_link_informations').addClass('selected');
|
||||
|
||||
var date = new Date();
|
||||
var hours = date.getHours();
|
||||
if (hours < 10)
|
||||
hours = "0" + hours;
|
||||
var mins = date.getMinutes();
|
||||
if (mins < 10)
|
||||
mins = "0" + mins;
|
||||
var secs = date.getSeconds();
|
||||
if (secs < 10)
|
||||
secs = "0" + secs;
|
||||
$('.datepicker').datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd ' + hours + ':' + mins + ':' + secs
|
||||
});
|
||||
@@ -1,59 +1,49 @@
|
||||
<div>
|
||||
<div class="productTabs">
|
||||
<ul class="tab">
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_informations" href="javascript:displayCartRuleTab('informations');">{l s='Informations'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_conditions" href="javascript:displayCartRuleTab('conditions');">{l s='Conditions'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_actions" href="javascript:displayCartRuleTab('actions');">{l s='Actions'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{$currentIndex}&token={$currentToken}&addcart_rule" id="cart_rule_form" method="post">
|
||||
<fieldset>
|
||||
<legend><img src="../img/t/AdminCartRules.gif" /> {l s='Cart Rule'}</legend>
|
||||
{if $currentObject->id}<input type="hidden" name="id_cart_rule" value="{$currentObject->id|intval}" />{/if}
|
||||
<label>{l s='Name'}</label>
|
||||
<div class="margin-form">
|
||||
|
||||
{foreach from=$languages item=language}
|
||||
<input type="text" name="name_{$language.id_lang}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang)}" style="width:300px" />
|
||||
<br />
|
||||
{/foreach}
|
||||
<p>{l s='Will be displayed in the cart summary as well as on the invoice.'}</p>
|
||||
</div>
|
||||
<label>{l s='Description'}</label>
|
||||
<div class="margin-form">
|
||||
<textarea name="description" style="width:90%;height:100px">{$currentTab->getFieldValue($currentObject, 'description')}</textarea>
|
||||
<p>{l s='For you only, never displayed to the customer.'}</p>
|
||||
</div>
|
||||
<label>{l s='Code'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" id="code" name="code" value="{$currentTab->getFieldValue($currentObject, 'code')}" />
|
||||
<img src="../img/admin/news-new.gif" onclick="gencode(8);" style="cursor:pointer" />
|
||||
<p>{l s='Optional, the rule will automatically be applied if you leave this field blank.'}</p>
|
||||
</div>
|
||||
<label>{l s='Partial use'}</label>
|
||||
<div class="margin-form">
|
||||
<select name="partial_use">
|
||||
<option value="0" {if $currentTab->getFieldValue($currentObject, 'partial_use') == 0}selected="selected"{/if}>{l s='No - Lower the voucher value to the total order amount'}</option>
|
||||
<option value="1" {if $currentTab->getFieldValue($currentObject, 'partial_use') == 1}selected="selected"{/if}>{l s='Yes - Create a new voucher with the remainder'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<label>{l s='Priority'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="priority" value="{$currentTab->getFieldValue($currentObject, 'priority')|intval}" />
|
||||
</div>
|
||||
<label>{l s='Status'}</label>
|
||||
<div class="margin-form">
|
||||
|
||||
<input type="radio" name="active" id="active_on" value="1" {if $currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled'}" title="{l s='Enabled'}" style="cursor:pointer" /></label>
|
||||
|
||||
<input type="radio" name="active" id="active_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled'}" title="{l s='Disabled'}" style="cursor:pointer" /></label>
|
||||
</div>
|
||||
<hr />
|
||||
<legend style="margin:-22px 0 10px 0"><img src="../img/admin/access.png" /> {l s='Conditions'}</legend>
|
||||
<div id="cart_rule_informations" class="cart_rule_tab">
|
||||
<h4>{l s='Cart rule informations'}</h4>
|
||||
<div class="separation"></div>
|
||||
{include file='cart_rules/informations.tpl'}
|
||||
</div>
|
||||
<div id="cart_rule_conditions" class="cart_rule_tab">
|
||||
<h4>{l s='Cart rule conditions'}</h4>
|
||||
<div class="separation"></div>
|
||||
{include file='cart_rules/conditions.tpl'}
|
||||
<div class="clear"> </div><hr />
|
||||
<legend style="margin:-22px 0 10px 0"><img src="../img/admin/asterisk.gif" /> {l s='Actions'}</legend>
|
||||
</div>
|
||||
<div id="cart_rule_actions" class="cart_rule_tab">
|
||||
<h4>{l s='Cart rule actions'}</h4>
|
||||
<div class="separation"></div>
|
||||
{include file='cart_rules/actions.tpl'}
|
||||
<hr />
|
||||
<input type="submit" value="{l s='Save'}" class="button" name="submitAddcart_rule" />
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="separation"></div>
|
||||
<div style="text-align:center"><input type="submit" value="{l s='Save'}" class="button" name="submitAddcart_rule" /></div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var product_rules_counter = {if isset($product_rules_counter)}{$product_rules_counter}{else}0{/if};
|
||||
var currentToken = '{$currentToken}';
|
||||
|
||||
var languages = new Array();
|
||||
{foreach from=$languages item=language key=k}
|
||||
languages[{$k}] = {
|
||||
id_lang: {$language.id_lang},
|
||||
iso_code: '{$language.iso_code}',
|
||||
name: '{$language.name}'
|
||||
};
|
||||
{/foreach}
|
||||
displayFlags(languages, {$defaultLanguage});
|
||||
</script>
|
||||
<script type="text/javascript" src="themes/template/cart_rules/form.js"></script>
|
||||
@@ -0,0 +1,58 @@
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td style="width:50%">
|
||||
{if $currentObject->id}<input type="hidden" name="id_cart_rule" value="{$currentObject->id|intval}" />{/if}
|
||||
<label>{l s='Name'}</label>
|
||||
<div class="margin-form">
|
||||
<div class="translatable">
|
||||
{foreach from=$languages item=language}
|
||||
<div class="lang_{$language.id_lang}" style="display:{if $language.id_lang == $defaultLanguage}block{else}none{/if};float:left">
|
||||
<input type="text" id="name_{$language.id_lang}" name="name_{$language.id_lang}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang)}" style="width:300px" />
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<p class="clear">{l s='Will be displayed in the cart summary as well as on the invoice.'}</p>
|
||||
</div>
|
||||
<label>{l s='Code'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" id="code" name="code" value="{$currentTab->getFieldValue($currentObject, 'code')}" />
|
||||
<img src="../img/admin/news-new.gif" onclick="gencode(8);" style="cursor:pointer" />
|
||||
<p>{l s='Optional, the rule will automatically be applied if you leave this field blank.'}</p>
|
||||
</div>
|
||||
<label>{l s='Partial use'}</label>
|
||||
<div class="margin-form">
|
||||
|
||||
<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" for="partial_use_on"> <img src="../img/admin/enabled.gif" alt="{l s='Allowed'}" title="{l s='Allowed'}" style="cursor:pointer" /></label>
|
||||
|
||||
<input type="radio" name="partial_use" id="partial_use_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'partial_use')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="partial_use_off"> <img src="../img/admin/disabled.gif" alt="{l s='Not allowed'}" title="{l s='Not allowed'}" style="cursor:pointer" /></label>
|
||||
<p>
|
||||
{l s='Only applicable if the voucher value is greater than the cart total.'}<br />
|
||||
{l s='If you do not allow partial use, the voucher value will be lowered to the total order amount, but if you do, a new voucher will be created with the remainder.'}
|
||||
</p>
|
||||
</div>
|
||||
<label>{l s='Priority'}</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" name="priority" value="{$currentTab->getFieldValue($currentObject, 'priority')|intval}" />
|
||||
<p>{l s='Cart rules are applied to the cart by priority. A cart rule with priority of "1" will be processed before a cart rule with a priority of "2".'}</p>
|
||||
</div>
|
||||
<label>{l s='Status'}</label>
|
||||
<div class="margin-form">
|
||||
|
||||
<input type="radio" name="active" id="active_on" value="1" {if $currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="active_on"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled'}" title="{l s='Enabled'}" style="cursor:pointer" /></label>
|
||||
|
||||
<input type="radio" name="active" id="active_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="active_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled'}" title="{l s='Disabled'}" style="cursor:pointer" /></label>
|
||||
</div>
|
||||
</td>
|
||||
<td style="width:50%">
|
||||
<label>{l s='Description'}</label>
|
||||
<div class="margin-form">
|
||||
<textarea name="description" style="width:90%;height:200px">{$currentTab->getFieldValue($currentObject, 'description')}</textarea>
|
||||
<p>{l s='For you only, never displayed to the customer.'}</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user