// cart rules > conditions > product rules WIP
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{l s='Limit to a single customer'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-group col-lg-4">
|
||||
<div class="input-group col-lg-9">
|
||||
<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'}" />
|
||||
@@ -87,9 +87,8 @@
|
||||
{l s='Total available'}
|
||||
</span>
|
||||
</label>
|
||||
<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 class="col-lg-9">
|
||||
<input class="form-control" type="text" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -100,9 +99,8 @@
|
||||
{l s='Total available for each user.'}
|
||||
</span>
|
||||
</label>
|
||||
<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 class="col-lg-9">
|
||||
<input class="form-control" type="text" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -110,18 +108,16 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="">
|
||||
{l s='Restrictions'}
|
||||
</span>
|
||||
{l s='Restrictions'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{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>
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="country_restriction" name="country_restriction" value="1" {if $countries.unselected|@count}checked="checked"{/if} />
|
||||
{l s='Country selection'}
|
||||
</label>
|
||||
</p>
|
||||
<span class="help-block">{l s='This restriction applies to the country of delivery.'}</span>
|
||||
<div id="country_restriction_div">
|
||||
<table class="table">
|
||||
@@ -147,11 +143,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $carriers.unselected|@count + $carriers.selected|@count > 1}
|
||||
<div class="row">
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="carrier_restriction" name="carrier_restriction" value="1" {if $carriers.unselected|@count}checked="checked"{/if} />
|
||||
@@ -182,11 +176,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $groups.unselected|@count + $groups.selected|@count > 1}
|
||||
<div class="row">
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="group_restriction" name="group_restriction" value="1" {if $groups.unselected|@count}checked="checked"{/if} />
|
||||
@@ -217,11 +209,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $cart_rules.unselected|@count + $cart_rules.selected|@count > 0}
|
||||
<div class="row">
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="cart_rule_restriction" name="cart_rule_restriction" value="1" {if $cart_rules.unselected|@count}checked="checked"{/if} />
|
||||
@@ -252,10 +242,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="row">
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rule_groups|@count}checked="checked"{/if} />
|
||||
@@ -272,10 +260,8 @@
|
||||
<i class="icon-plus-sign"></i> {l s='Product selection'}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $shops.unselected|@count + $shops.selected|@count > 1}
|
||||
<div class="row">
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="shop_restriction" name="shop_restriction" value="1" {if $shops.unselected|@count}checked="checked"{/if} />
|
||||
|
||||
@@ -1,54 +1,51 @@
|
||||
<div class="productTabs">
|
||||
<ul class="tab nav nav-tabs">
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_informations" href="javascript:displayCartRuleTab('informations');"><i class="icon-info"></i> {l s='Information'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_conditions" href="javascript:displayCartRuleTab('conditions');"><i class="icon-random"></i> {l s='Conditions'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_actions" href="javascript:displayCartRuleTab('actions');"><i class="icon-wrench"></i> {l s='Actions'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="panel">
|
||||
<h3><i class="icon-tag"></i> {l s='Cart rule'}</h3>
|
||||
<div class="productTabs">
|
||||
<ul class="tab nav nav-tabs">
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_informations" href="javascript:displayCartRuleTab('informations');"><i class="icon-info"></i> {l s='Information'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_conditions" href="javascript:displayCartRuleTab('conditions');"><i class="icon-random"></i> {l s='Conditions'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_actions" href="javascript:displayCartRuleTab('actions');"><i class="icon-wrench"></i> {l s='Actions'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<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="panel cart_rule_tab">
|
||||
{include file='controllers/cart_rules/informations.tpl'}
|
||||
</div>
|
||||
<div id="cart_rule_conditions" class="panel cart_rule_tab">
|
||||
{include file='controllers/cart_rules/conditions.tpl'}
|
||||
</div>
|
||||
<div id="cart_rule_actions" class="panel cart_rule_tab">
|
||||
{include file='controllers/cart_rules/actions.tpl'}
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default pull-right" name="submitAddcart_rule" id="{$table|escape}_form_submit_btn">{l s='Save'}
|
||||
</button>
|
||||
<!--<input type="submit" value="{l s='Save and stay'}" class="button" name="submitAddcart_ruleAndStay" id="" />-->
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
var product_rule_groups_counter = {if isset($product_rule_groups_counter)}{$product_rule_groups_counter|intval}{else}0{/if};
|
||||
var product_rule_counters = new Array();
|
||||
var currentToken = '{$currentToken|escape:'quotes'}';
|
||||
var currentFormTab = '{if isset($smarty.post.currentFormTab)}{$smarty.post.currentFormTab|escape:'quotes'}{else}informations{/if}';
|
||||
|
||||
var languages = new Array();
|
||||
{foreach from=$languages item=language key=k}
|
||||
languages[{$k}] = {
|
||||
id_lang: {$language.id_lang},
|
||||
iso_code: '{$language.iso_code|escape:'quotes'}',
|
||||
name: '{$language.name|escape:'quotes'}'
|
||||
};
|
||||
{/foreach}
|
||||
displayFlags(languages, {$id_lang_default});
|
||||
</script>
|
||||
<script type="text/javascript" src="themes/default/template/controllers/cart_rules/form.js"></script>
|
||||
{include file="footer_toolbar.tpl"}
|
||||
</div>
|
||||
<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="panel cart_rule_tab">
|
||||
<h3><i class="icon-info"></i> {l s='Cart rule information'}</h3>
|
||||
{include file='controllers/cart_rules/informations.tpl'}
|
||||
{include file="footer_toolbar.tpl"}
|
||||
</div>
|
||||
<div id="cart_rule_conditions" class="panel cart_rule_tab">
|
||||
<h3><i class="icon-random"></i> {l s='Cart rule conditions'}</h3>
|
||||
{include file='controllers/cart_rules/conditions.tpl'}
|
||||
{include file="footer_toolbar.tpl"}
|
||||
</div>
|
||||
<div id="cart_rule_actions" class="panel cart_rule_tab">
|
||||
<h3><i class="icon-wrench"></i> {l s='Cart rule actions'}</h3>
|
||||
{include file='controllers/cart_rules/actions.tpl'}
|
||||
{include file="footer_toolbar.tpl"}
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default pull-right" name="submitAddcart_rule" id="{$table|escape}_form_submit_btn">{l s='Save'}
|
||||
</button>
|
||||
<!--<input type="submit" value="{l s='Save and stay'}" class="button" name="submitAddcart_ruleAndStay" id="" />-->
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
var product_rule_groups_counter = {if isset($product_rule_groups_counter)}{$product_rule_groups_counter|intval}{else}0{/if};
|
||||
var product_rule_counters = new Array();
|
||||
var currentToken = '{$currentToken|escape:'quotes'}';
|
||||
var currentFormTab = '{if isset($smarty.post.currentFormTab)}{$smarty.post.currentFormTab|escape:'quotes'}{else}informations{/if}';
|
||||
|
||||
var languages = new Array();
|
||||
{foreach from=$languages item=language key=k}
|
||||
languages[{$k}] = {
|
||||
id_lang: {$language.id_lang},
|
||||
iso_code: '{$language.iso_code|escape:'quotes'}',
|
||||
name: '{$language.name|escape:'quotes'}'
|
||||
};
|
||||
{/foreach}
|
||||
displayFlags(languages, {$id_lang_default});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="themes/default/template/controllers/cart_rules/form.js"></script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<tr id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_tr">
|
||||
<td>
|
||||
<a href="javascript:removeProductRule({$product_rule_group_id|intval}, {$product_rule_id|intval});">
|
||||
<img src="../img/admin/disabled.gif" alt="{l s='Remove'}" title="{l s='Remove'}" />
|
||||
<a class="btn btn-default" href="javascript:removeProductRule({$product_rule_group_id|intval}, {$product_rule_id|intval});">
|
||||
<i class="icon-remove"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@@ -17,8 +17,9 @@
|
||||
<input type="text" id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_match" value="" disabled="disabled" />
|
||||
</td>
|
||||
<td>
|
||||
<a id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_link" href="#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content">
|
||||
<img src="../img/admin/choose.gif" alt="{l s='Choose'}" title="{l s='Choose'}" /> {l s='Choose'}
|
||||
<a class="btn btn-default" id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_link" href="#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content">
|
||||
<i class="icon-list-ul"></i>
|
||||
{l s='Choose'}
|
||||
</a>
|
||||
<div>
|
||||
<div id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content">
|
||||
|
||||
@@ -1,36 +1,59 @@
|
||||
<tr id="product_rule_group_{$product_rule_group_id|intval}_tr">
|
||||
<td style="vertical-align:center;padding-right:10px">
|
||||
<a href="javascript:removeProductRuleGroup({$product_rule_group_id|intval});">
|
||||
<img src="../img/admin/disabled.gif" alt="{l s='Remove'}" title="{l s='Remove'}" />
|
||||
<td>
|
||||
<a class="btn btn-default" href="javascript:removeProductRuleGroup({$product_rule_group_id|intval});">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td style="padding-bottom:15px">
|
||||
<input type="hidden" name="product_rule_group[]" value="{$product_rule_group_id|intval}" />
|
||||
{l s='The cart must contain at least'}
|
||||
<input type="text" name="product_rule_group_{$product_rule_group_id|intval}_quantity" value="{$product_rule_group_quantity|intval}" style="width:30px" />
|
||||
{l s='Product(s) matching the following rules:'}
|
||||
<br />
|
||||
<a href="javascript:addProductRule({$product_rule_group_id|intval});">
|
||||
<img src="../img/admin/add.gif" alt="{l s='Add'}" title="{l s='Add'}" />
|
||||
{l s='Add a rule concerning'}
|
||||
</a>
|
||||
<select id="product_rule_type_{$product_rule_group_id|intval}">
|
||||
<option value="">{l s='-- Choose --'}</option>
|
||||
<option value="products">{l s='Products:'}</option>
|
||||
<option value="attributes">{l s='Attributes'}</option>
|
||||
<option value="categories">{l s='Categories:'}</option>
|
||||
<option value="manufacturers">{l s='Manufacturers:'}</option>
|
||||
<option value="suppliers">{l s='Suppliers'}</option>
|
||||
</select>
|
||||
<a href="javascript:addProductRule({$product_rule_group_id|intval});">
|
||||
<input type="button" class="button" value="OK" />
|
||||
</a>
|
||||
<table id="product_rule_table_{$product_rule_group_id|intval}" class="table" cellpadding="0" cellspacing="0">
|
||||
<td>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='The cart must contain at least'}</label>
|
||||
<div class="col-lg-9">
|
||||
<input class="form-control" type="hidden" name="product_rule_group[]" value="{$product_rule_group_id|intval}" />
|
||||
|
||||
{l s='Product(s) matching the following rules:'}
|
||||
|
||||
|
||||
<input class="form-control fixed-width-xs" type="text" name="product_rule_group_{$product_rule_group_id|intval}_quantity" value="{$product_rule_group_quantity|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label col-lg-3">{l s='Add a rule concerning'}</label>
|
||||
<div class="col-lg-9">
|
||||
<select class="form-control fixed-width-lg" id="product_rule_type_{$product_rule_group_id|intval}">
|
||||
<option value="">{l s='-- Choose --'}</option>
|
||||
<option value="products">{l s='Products:'}</option>
|
||||
<option value="attributes">{l s='Attributes'}</option>
|
||||
<option value="categories">{l s='Categories:'}</option>
|
||||
<option value="manufacturers">{l s='Manufacturers:'}</option>
|
||||
<option value="suppliers">{l s='Suppliers'}</option>
|
||||
</select>
|
||||
<a class="btn btn-default" href="javascript:addProductRule({$product_rule_group_id|intval});">
|
||||
<i class="icon-ok"></i>
|
||||
{l s="Add"}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table id="product_rule_table_{$product_rule_group_id|intval}" class="table">
|
||||
{if isset($product_rules) && $product_rules|@count}
|
||||
{foreach from=$product_rules item='product_rule'}
|
||||
{$product_rule}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
+25
-43
@@ -1,46 +1,28 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td style="padding-left:20px">
|
||||
<p><strong>{l s='Unselected'}</strong></p>
|
||||
<select
|
||||
id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_1"
|
||||
style="border:1px solid #AAAAAA;width:400px;height:160px"
|
||||
multiple
|
||||
>
|
||||
{foreach from=$product_rule_itemlist.unselected item='item'}
|
||||
<option value="{$item.id|intval}"> {$item.name}</option>
|
||||
{/foreach}
|
||||
</select><br /><br />
|
||||
<a
|
||||
id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add"
|
||||
style="cursor:pointer;text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"
|
||||
>
|
||||
{l s='Add'} >>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<p><strong>{l s='Selected'}</strong></p>
|
||||
<select
|
||||
name="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}[]"
|
||||
id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_2"
|
||||
class="product_rule_toselect"
|
||||
style="border:1px solid #AAAAAA;width:400px;height:160px"
|
||||
multiple
|
||||
>
|
||||
{foreach from=$product_rule_itemlist.selected item='item'}
|
||||
<option value="{$item.id|intval}"> {$item.name}</option>
|
||||
{/foreach}
|
||||
</select><br /><br />
|
||||
<a
|
||||
id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_remove"
|
||||
style="cursor:pointer;text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"
|
||||
>
|
||||
<< {l s='Remove'}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="col-lg-6">
|
||||
{l s='Unselected'}
|
||||
<select multiple id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_1">
|
||||
{foreach from=$product_rule_itemlist.unselected item='item'}
|
||||
<option value="{$item.id|intval}"> {$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add" class="btn btn-default btn-block" >
|
||||
{l s='Add'}
|
||||
<i class="icon-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{l s='Selected'}
|
||||
<select multiple name="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}[]" id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_2" class="product_rule_toselect" >
|
||||
{foreach from=$product_rule_itemlist.selected item='item'}
|
||||
<option value="{$item.id|intval}"> {$item.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_remove" class="btn btn-default btn-block" >
|
||||
<i class="icon-arrow-left"></i>
|
||||
{l s='Remove'}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_remove').click(function() { removeCartRuleOption(this); updateProductRuleShortDescription(this); });
|
||||
$('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add').click(function() { addCartRuleOption(this); updateProductRuleShortDescription(this); });
|
||||
|
||||
Reference in New Issue
Block a user