[*] BO : new dimension added to the product filter in the cart rules

This commit is contained in:
dMetzger
2012-01-26 13:30:16 +00:00
parent f1bf59fa1a
commit 817a4e6a6c
14 changed files with 721 additions and 298 deletions
@@ -1,28 +1,3 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<label>{l s='Free shipping'}</label>
<div class="margin-form">
&nbsp;&nbsp;
@@ -40,7 +15,7 @@
<label class="t" for="apply_discount_percent"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled'}" title="{l s='Enabled'}" style="cursor:pointer" /> {l s='Percent (%)'}</label>
&nbsp;&nbsp;
<input type="radio" name="apply_discount" id="apply_discount_amount" value="amount" {if $currentTab->getFieldValue($currentObject, 'reduction_amount')|intval}checked="checked"{/if} />
<label class="t" for="apply_discount_amount"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled'}" title="{l s='Enabled'}" style="cursor:pointer" /> {l s='Amount'}</label>
<label class="t" for="apply_discount_amount"> <img src="../img/admin/enabled.gif" alt="{l s='Enabled'}" title="{l s='Enabled'}" style="cursor:pointer" /> {l s='Amount (¤)'}</label>
&nbsp;&nbsp;
<input type="radio" name="apply_discount" id="apply_discount_off" value="off" {if !$currentTab->getFieldValue($currentObject, 'reduction_amount')|intval && !$currentTab->getFieldValue($currentObject, 'reduction_percent')|intval}checked="checked"{/if} />
<label class="t" for="apply_discount_off"> <img src="../img/admin/disabled.gif" alt="{l s='Disabled'}" title="{l s='Disabled'}" style="cursor:pointer" /> {l s='None'}</label>
@@ -53,7 +28,7 @@
</div>
</div>
<div id="apply_discount_amount_div">
<label>{l s='Value'}</label>
<label>{l s='Value (¤)'}</label>
<div class="margin-form">
<input type="text" id="reduction_amount" name="reduction_amount" value="{$currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval}" />
<select name="reduction_currency">
@@ -107,4 +82,4 @@
<input type="hidden" id="gift_product" name="gift_product" value="{$currentTab->getFieldValue($currentObject, 'gift_product')|intval}" />
<input type="text" id="giftProductFilter" name="giftProductFilter" value="{$giftProductFilter}" style="width:400px" />
</div>
</div>
</div>
@@ -1,28 +1,3 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<label>{l s='Limit to a single customer'}</label>
<div class="margin-form">
<input type="hidden" id="id_customer" name="id_customer" value="{$currentTab->getFieldValue($currentObject, 'id_customer')|intval}" />
@@ -58,10 +33,12 @@
<label>{l s='Total available'}</label>
<div class="margin-form">
<input type="text" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" />
<p>{l s='The cart rule will be applied to the X first customers only.'}</p>
</div>
<label>{l s='Total available for each user'}</label>
<div class="margin-form">
<input type="text" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" />
<p>{l s='A customer will only be able to use the cart rule X time(s).'}</p>
</div>
{if $countries.unselected|@count + $countries.selected|@count > 1}
<br />
@@ -192,22 +169,14 @@
</div>
{/if}
<br />
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rules|@count}checked="checked"{/if} /> <strong>{l s='Product selection'}</strong>
<div id="product_restriction_div" style="border:1px solid #AAAAAA;margin-top:10px;padding:10px 10px 10px 10px;background-color:#FFF5D3">
{l s='Add a filter on'}
<select id="product_rule_type">
<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>
</select>
<a href="javascript:addProductRule();">
<img src="../img/admin/add.gif" alt="{l s='Add'}" title="{l s='Add'}" /> {l s='Add'}
</a>
<hr />
<table id="product_rule_table" class="table" cellpadding="0" cellspacing="0">
{foreach from=$product_rules item='product_rule'}
{$product_rule}
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rule_groups|@count}checked="checked"{/if} /> <strong>{l s='Product selection'}</strong>
<div id="product_restriction_div">
<table id="product_rule_group_table" style="border:1px solid #AAAAAA;margin:10px 0 10px 0;padding:10px 10px 10px 10px;background-color:#FFF5D3;width:600px" cellpadding="0" cellspacing="0">
{foreach from=$product_rule_groups item='product_rule_group'}
{$product_rule_group}
{/foreach}
</table>
</div>
<a href="javascript:addProductRuleGroup();">
<img src="../img/admin/add.gif" alt="{l s='Add'}" title="{l s='Add'}" /> {l s='Add a new rule group'}
</a>
</div>
@@ -0,0 +1,349 @@
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 6844 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
function addProductRuleGroup()
{
product_rule_groups_counter += 1;
product_rule_counters[product_rule_groups_counter] = 0;
$.get(
'ajax-tab.php',
{controller:'AdminCartRules',token:currentToken,newProductRuleGroup:1,product_rule_group_id:product_rule_groups_counter},
function(content) {
if (content != "")
$('#product_rule_group_table').append(content);
}
);
}
function removeProductRuleGroup(id)
{
$('#product_rule_group_' + id + '_tr').remove();
}
function addProductRule(product_rule_group_id)
{
product_rule_counters[product_rule_group_id] += 1;
if ($('#product_rule_type_' + product_rule_group_id).val() != 0)
$.get(
'ajax-tab.php',
{controller:'AdminCartRules',token:currentToken,newProductRule:1,product_rule_type:$('#product_rule_type_' + product_rule_group_id).val(),product_rule_group_id:product_rule_group_id,product_rule_id:product_rule_counters[product_rule_group_id]},
function(content) {
if (content != "")
$('#product_rule_table_' + product_rule_group_id).append(content);
}
);
}
function removeProductRule(product_rule_group_id, product_rule_id)
{
$('#product_rule_' + product_rule_group_id + '_' + product_rule_id + '_tr').remove();
}
function toggleCartRuleFilter(id)
{
if ($(id).attr('checked'))
$('#' + $(id).attr('id') + '_div').show(400);
else
$('#' + $(id).attr('id') + '_div').hide(200);
}
function removeCartRuleOption(item)
{
var id = $(item).attr('id').replace('_remove', '');
$('#' + id + '_2 option:selected').remove().appendTo('#' + id + '_1');
}
function addCartRuleOption(item)
{
var id = $(item).attr('id').replace('_add', '');
$('#' + id + '_1 option:selected').remove().appendTo('#' + id + '_2');
}
function updateProductRuleShortDescription(item)
{
var id1 = $(item).attr('id').replace('_add', '').replace('_remove', '');
var id2 = id1.replace('_select', '');
var length = $('#' + id1 + '_2 option').length;
if (length == 1)
$('#' + id2 + '_match').val($('#' + id1 + '_2 option').first().text().trim());
else
$('#' + id2 + '_match').val(length);
}
var restrictions = new Array('country', 'carrier', 'group', 'cart_rule');
for (i in restrictions)
{
toggleCartRuleFilter($('#' + restrictions[i] + '_restriction'));
$('#' + restrictions[i] + '_restriction').click(function() {toggleCartRuleFilter(this);});
$('#' + restrictions[i] + '_select_remove').click(function() {removeCartRuleOption(this);});
$('#' + restrictions[i] + '_select_add').click(function() {addCartRuleOption(this);});
}
toggleCartRuleFilter($('#product_restriction'));
$('#product_restriction').click(function() {toggleCartRuleFilter(this);});
function toggleApplyDiscount(percent, amount, apply_to)
{
if (percent)
{
$('#apply_discount_percent_div').show(400);
if ($('#apply_discount_to_product').attr('checked'))
toggleApplyDiscountTo();
$('#apply_discount_to_cheapest').removeAttr('disabled');
$('#apply_discount_to_cheapest').removeAttr('checked');
}
else
{
$('#apply_discount_percent_div').hide(200);
$('#reduction_percent').val('0');
$('#apply_discount_to_cheapest').attr('disabled', 'disabled');
}
if (amount)
{
$('#apply_discount_amount_div').show(400);
if ($('#apply_discount_to_product').attr('checked'))
toggleApplyDiscountTo();
$('#apply_discount_to_cheapest').attr('disabled', 'disabled');
$('#apply_discount_to_cheapest').removeAttr('checked');
}
else
{
$('#apply_discount_amount_div').hide(200);
$('#reduction_amount').val('0');
$('#apply_discount_to_cheapest').removeAttr('disabled');
}
if (apply_to)
$('#apply_discount_to_div').show(400);
else
{
toggleApplyDiscountTo();
$('#apply_discount_to_div').hide(200);
}
}
function toggleApplyDiscountTo()
{
if ($('#apply_discount_to_product').attr('checked'))
$('#apply_discount_to_product_div').show(400);
else
{
$('#apply_discount_to_product_div').hide(200);
$('#reductionProductFilter').val('');
if ($('#apply_discount_to_order').attr('checked'))
$('#reduction_product').val('0');
if ($('#apply_discount_to_cheapest').attr('checked'))
$('#reduction_product').val('-1');
if ($('#apply_discount_to_selection').attr('checked'))
$('#reduction_product').val('-2');
}
}
function toggleGiftProduct()
{
if ($('#free_gift_on').attr('checked'))
$('#free_gift_div').show(400);
else
{
$('#gift_product').val('0');
$('#giftProductFilter').val('');
$('#free_gift_div').hide(200);
}
}
$('#apply_discount_percent').click(function() {toggleApplyDiscount(true, false, true);});
if ($('#apply_discount_percent').attr('checked'))
toggleApplyDiscount(true, false, true);
$('#apply_discount_amount').click(function() {toggleApplyDiscount(false, true, true);});
if ($('#apply_discount_amount').attr('checked'))
toggleApplyDiscount(false, true, true);
$('#apply_discount_off').click(function() {toggleApplyDiscount(false, false, false);});
if ($('#apply_discount_off').attr('checked'))
toggleApplyDiscount(false, false, false);
$('#apply_discount_to_order').click(function() {toggleApplyDiscountTo();});
if ($('#apply_discount_to_order').attr('checked'))
toggleApplyDiscountTo();
$('#apply_discount_to_product').click(function() {toggleApplyDiscountTo();});
if ($('#apply_discount_to_product').attr('checked'))
toggleApplyDiscountTo();
$('#apply_discount_to_cheapest').click(function() {toggleApplyDiscountTo();});
if ($('#apply_discount_to_cheapest').attr('checked'))
toggleApplyDiscountTo();
$('#apply_discount_to_selection').click(function() {toggleApplyDiscountTo();});
if ($('#apply_discount_to_selection').attr('checked'))
toggleApplyDiscountTo();
$('#free_gift_on').click(function() {toggleGiftProduct();});
$('#free_gift_off').click(function() {toggleGiftProduct();});
toggleGiftProduct();
// Main form submit
$('#cart_rule_form').submit(function() {
if ($('#customerFilter').val() == '')
$('#id_customer').val('0');
for (i in restrictions)
{
if ($('#' + restrictions[i] + '_select_1 option').length == 0)
$('#' + restrictions[i] + '_restriction').removeAttr('checked');
else
{
$('#' + restrictions[i] + '_select_2 option').each(function(i) {
$(this).attr('selected', 'selected');
});
}
}
$('.product_rule_toselect option').each(function(i) {
$(this).attr('selected', 'selected');
});
});
$('#giftProductFilter')
.autocomplete(
'ajax-tab.php', {
minChars: 2,
max: 50,
width: 500,
selectFirst: false,
scroll: false,
dataType: 'json',
formatItem: function(data, i, max, value, term) {
return value;
},
parse: function(data) {
var mytab = new Array();
for (var i = 0; i < data.length; i++)
mytab[mytab.length] = { data: data[i], value: (data[i].reference + ' ' + data[i].name).trim() };
return mytab;
},
extraParams: {
controller: 'AdminCartRules',
token: currentToken,
giftProductFilter: 1
}
}
)
.result(function(event, data, formatted) {
$('#gift_product').val(data.id_product);
$('#giftProductFilter').val((data.reference + ' ' + data.name).trim());
});
$('#reductionProductFilter')
.autocomplete(
'ajax-tab.php', {
minChars: 2,
max: 50,
width: 500,
selectFirst: false,
scroll: false,
dataType: 'json',
formatItem: function(data, i, max, value, term) {
return value;
},
parse: function(data) {
var mytab = new Array();
for (var i = 0; i < data.length; i++)
mytab[mytab.length] = { data: data[i], value: (data[i].reference + ' ' + data[i].name).trim() };
return mytab;
},
extraParams: {
controller: 'AdminCartRules',
token: currentToken,
reductionProductFilter: 1
}
}
)
.result(function(event, data, formatted) {
$('#reduction_product').val(data.id_product);
$('#reductionProductFilter').val((data.reference + ' ' + data.name).trim());
});
$('#customerFilter')
.autocomplete(
'ajax-tab.php', {
minChars: 2,
max: 50,
width: 500,
selectFirst: false,
scroll: false,
dataType: 'json',
formatItem: function(data, i, max, value, term) {
return value;
},
parse: function(data) {
var mytab = new Array();
for (var i = 0; i < data.length; i++)
mytab[mytab.length] = { data: data[i], value: data[i].cname + ' (' + data[i].email + ')' };
return mytab;
},
extraParams: {
controller: 'AdminCartRules',
token: currentToken,
customerFilter: 1
}
}
)
.result(function(event, data, formatted) {
$('#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');
$('#currentFormTab').val(tab);
}
$('.cart_rule_tab').hide();
$('.tab-page').removeClass('selected');
$('#cart_rule_' + currentFormTab).show();
$('#cart_rule_link_' + currentFormTab).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,28 +1,3 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $show_toolbar}
<div class="toolbar-placeholder">
<div class="toolbarBox {if $toolbar_fix}toolbarHead{/if}">
@@ -79,10 +54,11 @@
</div>
</form>
<script type="text/javascript">
var product_rules_counter = {if isset($product_rules_counter)}{$product_rules_counter}{else}0{/if};
var product_rule_groups_counter = {if isset($product_rule_groups_counter)}{$product_rule_groups_counter}{else}0{/if};
var product_rule_counters = new Array();
var currentToken = '{$currentToken}';
var currentFormTab = '{if isset($smarty.post.currentFormTab)}{$smarty.post.currentFormTab|escape}{else}informations{/if}';
var languages = new Array();
{foreach from=$languages item=language key=k}
languages[{$k}] = {
@@ -93,5 +69,4 @@
{/foreach}
displayFlags(languages, {$defaultLanguage});
</script>
<script src="../js/admin_cart_rules.js" type="text/javascript"></script>
<script type="text/javascript" src="themes/default/template/controllers/cart_rules/form.js"></script>
@@ -1,28 +1,3 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width:50%">
@@ -31,7 +6,7 @@
<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" />
<input type="text" id="name_{$language.id_lang}" name="name_{$language.id_lang}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang)}" style="width:500px" />
</div>
{/foreach}
</div>
@@ -40,8 +15,8 @@
<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>
<a href="javascript:gencode(8);" style="cursor:pointer">{l s='(Click to generate random code)'}</a>
<p>{l s='Caution! The rule will automatically be applied if you leave this field blank.'}</p>
</div>
<label>{l s='Partial use'}</label>
<div class="margin-form">
@@ -79,4 +54,4 @@
</div>
</td>
</tr>
</table>
</table>
@@ -1,54 +1,26 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<tr id="product_rule_{$product_rule_id}_tr">
<tr id="product_rule_{$product_rule_group_id}_{$product_rule_id}_tr">
<td>
<a href="javascript:removeProductRule({$product_rule_id});">
<a href="javascript:removeProductRule({$product_rule_group_id}, {$product_rule_id});">
<img src="../img/admin/disabled.gif" alt="{l s='Remove'}" title="{l s='Remove'}" />
</a>
</td>
<td>
<input type="hidden" name="product_rule[]" value="{$product_rule_id}" />
<input type="hidden" name="product_rule_{$product_rule_id}_type" value="{$product_rule_type}" />
[{$product_rule_type}] {l s='The cart must contain at least'}
</td>
<td style="padding:5px">
<input type="text" name="product_rule_{$product_rule_id}_quantity" value="{$product_rule_quantity|intval}" style="width:30px" />
<input type="hidden" name="product_rule_{$product_rule_group_id}[]" value="{$product_rule_id}" />
<input type="hidden" name="product_rule_{$product_rule_group_id}_{$product_rule_id}_type" value="{$product_rule_type}" />
[{$product_rule_type}]
</td>
<td>
{l s='product(s) matching'}
{l s='The product(s) are matching on of these'}
</td>
<td>
<input type="text" id="product_rule_{$product_rule_id}_match" value="" disabled="disabled" />
<input type="text" id="product_rule_{$product_rule_group_id}_{$product_rule_id}_match" value="" disabled="disabled" />
</td>
<td>
<a id="product_rule_{$product_rule_id}_choose_link" href="#product_rule_{$product_rule_id}_choose_content">
<a id="product_rule_{$product_rule_group_id}_{$product_rule_id}_choose_link" href="#product_rule_{$product_rule_group_id}_{$product_rule_id}_choose_content">
<img src="../img/admin/choose.gif" alt="{l s='Choose'}" title="{l s='Choose'}" /> {l s='Choose'}
</a>
<div>
<div id="product_rule_{$product_rule_id}_choose_content">
<div id="product_rule_{$product_rule_group_id}_{$product_rule_id}_choose_content">
{$product_rule_choose_content}
</div>
</div>
@@ -56,6 +28,7 @@
</tr>
<script type="text/javascript">
$('#product_rule_{$product_rule_id}_choose_content').parent().hide();
$("#product_rule_{$product_rule_id}_choose_link").fancybox();
</script>
$('#product_rule_{$product_rule_group_id}_{$product_rule_id}_choose_content').parent().hide();
$("#product_rule_{$product_rule_group_id}_{$product_rule_id}_choose_link").fancybox();
$(document).ready(function() { updateProductRuleShortDescription($('#product_rule_select_{$product_rule_group_id}_{$product_rule_id}_add')); });
</script>
@@ -0,0 +1,36 @@
<tr id="product_rule_group_{$product_rule_group_id}_tr">
<td style="vertical-align:top">
<a href="javascript:removeProductRuleGroup({$product_rule_group_id});">
<img src="../img/admin/disabled.gif" alt="{l s='Remove'}" title="{l s='Remove'}" />
</a>
</td>
<td>
<input type="hidden" name="product_rule_group[]" value="{$product_rule_group_id}" />
{l s='The cart must contain at least'}
<input type="text" name="product_rule_group_{$product_rule_group_id}_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});">
<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}">
<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});">
<input type="button" class="button" value="OK" />
</a>
<table id="product_rule_table_{$product_rule_group_id}" class="table" cellpadding="0" cellspacing="0">
{if isset($product_rules) && $product_rules|@count}
{foreach from=$product_rules item='product_rule'}
{$product_rule}
{/foreach}
{/if}
</table>
</td>
</tr>
@@ -1,49 +1,24 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8971 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<table>
<tr>
<td>
<p><strong>{l s='Selected'}</strong></p>
<select name="product_rule_select_{$product_rule_id}[]" class="product_rule_toselect" id="product_rule_select_{$product_rule_id}_2" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple>
<select name="product_rule_select_{$product_rule_group_id}_{$product_rule_id}[]" class="product_rule_toselect" id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_2" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple>
{foreach from=$product_rule_itemlist.selected item='item'}
<option value="{$item.id|intval}">&nbsp;{$item.name}</option>
{/foreach}
</select><br /><br />
<a style="cursor:pointer;text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="product_rule_select_{$product_rule_id}_remove">
<a style="cursor:pointer;text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_remove">
{l s='Remove'} &gt;&gt;
</a>
</td>
<td style="padding-left:20px;">
<p><strong>{l s='Unselected'}</strong></p>
<select id="product_rule_select_{$product_rule_id}_1" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple>
<select id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_1" style="border:1px solid #AAAAAA;width:400px;height:160px" multiple>
{foreach from=$product_rule_itemlist.unselected item='item'}
<option value="{$item.id|intval}">&nbsp;{$item.name}</option>
{/foreach}
</select><br /><br />
<a style="cursor:pointer;text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="product_rule_select_{$product_rule_id}_add">
<a style="cursor:pointer;text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px" id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_add">
&lt;&lt; {l s='Add'}
</a>
</td>
@@ -51,7 +26,7 @@
</table>
<script type="text/javascript">
$('#product_rule_select_{$product_rule_id}_remove').click(function() { removeCartRuleOption(this); updateProductRuleShortDescription(this); });
$('#product_rule_select_{$product_rule_id}_add').click(function() { addCartRuleOption(this); updateProductRuleShortDescription(this); });
$(document).ready(function() { updateProductRuleShortDescription($('#product_rule_select_{$product_rule_id}_add')); });
</script>
$('#product_rule_select_{$product_rule_group_id}_{$product_rule_id}_remove').click(function() { removeCartRuleOption(this); updateProductRuleShortDescription(this); });
$('#product_rule_select_{$product_rule_group_id}_{$product_rule_id}_add').click(function() { addCartRuleOption(this); updateProductRuleShortDescription(this); });
$(document).ready(function() { updateProductRuleShortDescription($('#product_rule_select_{$product_rule_group_id}_{$product_rule_id}_add')); });
</script>