// Cart rules fixed in admin customers
This commit is contained in:
@@ -296,29 +296,25 @@
|
||||
{/if}
|
||||
|
||||
<div class="clear"> </div>
|
||||
<h2>{l s='Discounts'} ({count($discounts)})</h2>
|
||||
<h2>{l s='Vouchers'} ({count($discounts)})</h2>
|
||||
{if count($discounts)}
|
||||
<table cellspacing="0" cellpadding="0" class="table">
|
||||
<tr>
|
||||
<th>{l s='ID'}</th>
|
||||
<th>{l s='Code'}</th>
|
||||
<th>{l s='Type'}</th>
|
||||
<th>{l s='Value'}</th>
|
||||
<th>{l s='Qty available'}</th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Status'}</th>
|
||||
<th>{l s='Actions'}</th>
|
||||
</tr>
|
||||
{foreach $discounts AS $key => $discount}
|
||||
<tr {if $key %2}class="alt_row"{/if}>
|
||||
<td align="center">{$discount['id_discount']}</td>
|
||||
<td align="center">{$discount['id_cart_rule']}</td>
|
||||
<td>{$discount['code']}</td>
|
||||
<td>{$discount['name']}</td>
|
||||
<td>{$discount['type']}</td>
|
||||
<td align="right">{$discount['value']}</td>
|
||||
<td align="center">{$discount['quantity_for_user']}</td>
|
||||
<td align="center"><img src="../img/admin/{if $discount['active']}enabled.gif{else}disabled.gif{/if}" alt="{l s='Status'}" title="{l s='Status'}" /></td>
|
||||
<td align="center">
|
||||
<a href="?tab=AdminDiscounts&id_discount={$discount['id_discount']}&adddiscount&token={getAdminToken tab='AdminDiscounts'}"><img src="../img/admin/edit.gif" /></a>
|
||||
<a href="?tab=AdminDiscounts&id_discount={$discount['id_discount']}&deletediscount&token={getAdminToken tab='AdminDiscounts'}"><img src="../img/admin/delete.gif" /></a>
|
||||
<a href="?tab=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&addcart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/edit.gif" /></a>
|
||||
<a href="?tab=AdminCartRules&id_cart_rule={$discount['id_cart_rule']}&deletecart_rule&token={getAdminToken tab='AdminCartRules'}"><img src="../img/admin/delete.gif" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
||||
@@ -192,7 +192,7 @@ class CartRuleCore extends ObjectModel
|
||||
if (!CartRule::isFeatureActive())
|
||||
return array();
|
||||
|
||||
Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'cart_rule` cr
|
||||
LEFT JOIN `'._DB_PREFIX_.'cart_rule_lang` crl ON (cr.`id_cart_rule` = crl.`id_cart_rule` AND crl.`id_lang` = '.(int)$id_lang.')
|
||||
|
||||
@@ -194,7 +194,7 @@ class AdminCartRulesControllerCore extends AdminController
|
||||
Context::getContext()->smarty->assign('product_rule_choose_content', $choose_content);
|
||||
break;
|
||||
case 'categories':
|
||||
// Todo: Consider optimization (with code below)
|
||||
// Todo: Consider optimization
|
||||
$categories = array('selected' => array(), 'unselected' => array());
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
SELECT name, id_category as id
|
||||
@@ -206,16 +206,6 @@ class AdminCartRulesControllerCore extends AdminController
|
||||
Context::getContext()->smarty->assign('product_rule_itemlist', $categories);
|
||||
$choose_content = Context::getContext()->smarty->fetch('cart_rules/product_rule_itemlist.tpl');
|
||||
Context::getContext()->smarty->assign('product_rule_choose_content', $choose_content);
|
||||
// $translations = array(
|
||||
// 'Home' => $this->l('Home'),
|
||||
// 'selected' => $this->l('selected'),
|
||||
// 'Collapse All' => $this->l('Collapse All'),
|
||||
// 'Expand All' => $this->l('Expand All'),
|
||||
// 'Check All' => $this->l('Check All'),
|
||||
// 'Uncheck All' => $this->l('Uncheck All'),
|
||||
// 'search' => $this->l('Search a category')
|
||||
// );
|
||||
// Context::getContext()->smarty->assign('product_rule_choose_content', Helper::renderAdminCategorieTree($translations, $selected, 'categoryBox', false, true));
|
||||
break;
|
||||
default:
|
||||
die;
|
||||
|
||||
Reference in New Issue
Block a user