Merge branch 'ticket-fidelite' into develop
This commit is contained in:
commit
eafb801028
@ -42,28 +42,26 @@ Tools::addCSS(_PS_CSS_DIR_.'jquery.cluetip.css', 'all');
|
|||||||
Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.dimensions.js',_PS_JS_DIR_.'jquery/jquery.cluetip.js'));
|
Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.dimensions.js',_PS_JS_DIR_.'jquery/jquery.cluetip.js'));
|
||||||
|
|
||||||
$displayorders = LoyaltyModule::getAllByIdCustomerCustom((int)($cookie->id_customer), (int)($cookie->id_lang), false, true, ((int)(Tools::getValue('n')) > 0 ? (int)(Tools::getValue('n')) : 10), ((int)(Tools::getValue('p')) > 0 ? (int)(Tools::getValue('p')) : 1));
|
$displayorders = LoyaltyModule::getAllByIdCustomerCustom((int)($cookie->id_customer), (int)($cookie->id_lang), false, true, ((int)(Tools::getValue('n')) > 0 ? (int)(Tools::getValue('n')) : 10), ((int)(Tools::getValue('p')) > 0 ? (int)(Tools::getValue('p')) : 1));
|
||||||
//$orderToConvert = LoyaltyModule::getAllByIdCustomerCustom((int)($cookie->id_customer), (int)($cookie->id_lang), true, false, $nb = 10, $page = 1);
|
if ($displayorders && !empty($displayorders)) {
|
||||||
//$total_discount = LoyaltyModule::getVoucherValueByPercentOfOrder($orderToConvert, (int)($cookie->id_currency));
|
$allOrders = LoyaltyModule::getOrdersWithDiscountByIdCustomer((int) $cookie->id_customer);
|
||||||
/*$total_discount = Db::getInstance()->getValue('
|
$total_discount = 0;
|
||||||
SELECT SUM(`discount_value`) FROM `'._DB_PREFIX_.'loyalty`
|
if (!empty($allOrders)) {
|
||||||
WHERE `id_loyalty_state`=2
|
$nb_orders = count($allOrders);
|
||||||
AND `id_discount`=0
|
foreach ($allOrders as $key => $order) {
|
||||||
AND `id_customer` = ' .(int) $cookie->id_customer
|
if ((int)$order['id_loyalty_state'] !=2){
|
||||||
);*/
|
continue;
|
||||||
$allOrders = LoyaltyModule::getOrdersWithDiscountByIdCustomer((int) $cookie->id_customer);
|
}
|
||||||
$total_discount = 0;
|
$total_discount += (float)$order['discount_value'];
|
||||||
if (!empty($allOrders)) {
|
|
||||||
$nb_orders = count($allOrders);
|
|
||||||
foreach ($allOrders as $key => $order) {
|
|
||||||
if ((int)$order['id_loyalty_state'] !=2){
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
$total_discount += (float)$order['discount_value'];
|
} else {
|
||||||
|
$nb_orders = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$nb_orders = 0;
|
$nb_orders = 0;
|
||||||
|
$total_discount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* transform point into voucher if needed */
|
/* transform point into voucher if needed */
|
||||||
if (Tools::getValue('transform-points') == 'true' AND $total_discount > 0)
|
if (Tools::getValue('transform-points') == 'true' AND $total_discount > 0)
|
||||||
{
|
{
|
||||||
@ -162,7 +160,7 @@ if ($ids_discount = LoyaltyModule::getDiscountByIdCustomer((int)($cookie->id_cus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$allCategories = Category::getSimpleCategories((int)($cookie->id_lang));
|
/*$allCategories = Category::getSimpleCategories((int)($cookie->id_lang));
|
||||||
$voucherCategories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY');
|
$voucherCategories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY');
|
||||||
if ($voucherCategories != '' AND $voucherCategories != 0)
|
if ($voucherCategories != '' AND $voucherCategories != 0)
|
||||||
$voucherCategories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'));
|
$voucherCategories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'));
|
||||||
@ -181,12 +179,12 @@ else
|
|||||||
$categoriesNames = Tools::truncate(implode(', ', $categoriesNames), 100).'.';
|
$categoriesNames = Tools::truncate(implode(', ', $categoriesNames), 100).'.';
|
||||||
else
|
else
|
||||||
$categoriesNames = null;
|
$categoriesNames = null;
|
||||||
}
|
}*/
|
||||||
$smarty->assign(array(
|
$smarty->assign(array(
|
||||||
'nbDiscounts' => (int)$nbDiscounts,
|
'nbDiscounts' => (int)$nbDiscounts,
|
||||||
'discounts' => $discounts,
|
'discounts' => $discounts,
|
||||||
'minimalLoyalty' => (float)Configuration::get('PS_LOYALTY_MINIMAL'),
|
'minimalLoyalty' => (float)Configuration::get('PS_LOYALTY_MINIMAL'),
|
||||||
'categories' => $categoriesNames
|
/*'categories' => $categoriesNames*/
|
||||||
));
|
));
|
||||||
|
|
||||||
echo Module::display(dirname(__FILE__).'/loyalty.php', 'loyalty.tpl');
|
echo Module::display(dirname(__FILE__).'/loyalty.php', 'loyalty.tpl');
|
||||||
|
Loading…
Reference in New Issue
Block a user