Merge branch 'ticket-fidelite' into develop

This commit is contained in:
Marion Muszynski 2016-04-22 12:58:01 +02:00
commit 4bc9303ff7

View File

@ -616,13 +616,18 @@ class Loyalty extends Module
die(Tools::displayError('Incorrect object Customer.'));
$details = LoyaltyModule::getAllByIdCustomer((int)$params['id_customer'], (int)$params['cookie']->id_lang);
$valid_orders = LoyaltyModule::getAllByIdCustomerCustom((int)$params['id_customer'], (int)$params['cookie']->id_lang, false, false, $nb = 10, $page = 1, true);
$discount_value = LoyaltyModule::getVoucherValueByPercentOfOrder($valid_orders, (int)Configuration::get('PS_CURRENCY_DEFAULT'));
$valid_orders = LoyaltyModule::getAllByIdCustomerCustom((int)$params['id_customer'], (int)$params['cookie']->id_lang, true, false, $nb = 10, $page = 1, false);
if (!empty($valid_orders)) {
$discount_value = LoyaltyModule::getVoucherValueByPercentOfOrder($valid_orders, (int)Configuration::get('PS_CURRENCY_DEFAULT'));
} else {
$discount_value = 0;
}
$html = '
<br /><h2>'.$this->l('Loyalty progam').' ('.Tools::displayPrice($discount_value, (int)Configuration::get('PS_CURRENCY_DEFAULT')).')</h2>';
if ($discount_value == 0) {
if (!$details || empty($details)) {
return $html.' '.$this->l('This customer has no points');
}
@ -651,7 +656,7 @@ class Loyalty extends Module
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>'.$this->l('Voucher value:').'</td>
<td>'.Tools::displayPrice(LoyaltyModule::getVoucherValueByPercentOfOrder($details, (int)Configuration::get('PS_CURRENCY_DEFAULT')), new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'))).'</td>
<td>'.Tools::displayPrice($discount_value, new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'))).'</td>
<td>&nbsp;</td>
</tr>
</table>';