modif tpl

This commit is contained in:
Marion Muszynski 2016-04-21 12:01:10 +02:00
parent 5d52bff134
commit 15f3b6fa20
5 changed files with 12 additions and 12 deletions

View File

@ -114,6 +114,7 @@ class LoyaltyModule extends ObjectModel
}
foreach ($cart->getDiscounts(false) AS $discount)
$total -= $discount['value_real'];
}
return self::getDiscountValueByPrice($total);
@ -154,10 +155,9 @@ class LoyaltyModule extends ObjectModel
if ($currency->conversion_rate)
$price = $price / $currency->conversion_rate;
}
$discount_value = (float)(Configuration::get('PS_LOYALTY_PERCENT_VALUE') * $price) / 100;
return (float)$discount_value;
return $discount_value;
}
/*public static function getPointsByCustomer($id_customer)

View File

@ -459,9 +459,9 @@ class Loyalty extends Module
{
if (Validate::isLoadedObject($params['cart']))
{
$discountValueBefore = (int)(LoyaltyModule::getCartDiscountValue($params['cart']));
$discountValueAfter = (int)(LoyaltyModule::getCartDiscountValue($params['cart'], $product));
$discountValue = (int)($discountValueAfter - $discountValueBefore);
$discountValueBefore = (LoyaltyModule::getCartDiscountValue($params['cart']));
$discountValueAfter = (LoyaltyModule::getCartDiscountValue($params['cart'], $product));
$discountValue = ($discountValueAfter - $discountValueBefore);
}
else
{

View File

@ -27,7 +27,7 @@
<!-- MODULE Loyalty -->
<p id="loyalty">
<img src="{$module_template_dir}loyalty.gif" alt="{l s='loyalty' mod='loyalty'}" class="icon" />
{if $discount_value > 0}
{if $discount_value>0}
{l s='By checking out of this shopping cart you can collect up to' mod='loyalty'} <b>{convertPrice price=$voucher}</b>
{l s='that can be converted into a voucher of' mod='loyalty'} {convertPrice price=$voucher}{if isset($guest_checkout) && $guest_checkout}<sup>*</sup>{/if}.<br />
{if isset($guest_checkout) && $guest_checkout}<sup>*</sup> {l s='Not available for Instant checkout order' mod='loyalty'}{/if}

View File

@ -25,16 +25,16 @@
*}
{if $points}
{if $discountValue>0}
<div id="loyalty" class="align_justify">
<p class="title">
<img src="/img/loyalty.jpg" alt="{l s='Loyalty program' mod='loyalty'}" class="icon" />
<span class="title_text">{l s='Loyalty credit' mod='loyalty'} <span class="loyalty_price">{convertPrice price=($points * $point_value)}</span></span>
<span class="title_text">{l s='Loyalty credit' mod='loyalty'} <span class="loyalty_price">{convertPrice price=$discountValue}</span></span>
</p>
<div class="desc">
{if $points}
{l s='By buying this product you can collect up to' mod='loyalty'} <b><span id="loyalty_points">{convertPrice price=($points * $point_value)}</span></b>
{l s='de crédits fidélité, à utiliser sur votre prochaine commande. '}
{if $total_discounts>0}
{l s='By buying this product you can collect up to' mod='loyalty'} <b><span id="loyalty_points">{convertPrice price=$total_discounts}</span></b>
{l s='de crédits fidélité, à utiliser sur votre prochaine commande. '}
{/if}
</div>
</div>

View File

@ -1,5 +1,5 @@
<p id="loyalty_cart">
{if $points > 0}
{if $discount_value > 0}
{l s='En validant ce panier vous recevrez un crédit de '} <b>{convertPrice price=$voucher}</b> {l s='à utiliser lors de vos prochaines commandes'}
{/if}
</p>