modif tpl loyalty
This commit is contained in:
parent
c8befd1ede
commit
ba0e8d29bc
@ -459,8 +459,8 @@ class Loyalty extends Module
|
||||
{
|
||||
if (Validate::isLoadedObject($params['cart']))
|
||||
{
|
||||
$discountValueBefore = (int)(LoyaltyModule::getCartNbdiscountValue($params['cart']));
|
||||
$discountValueAfter = (int)(LoyaltyModule::getCartNbdiscountValue($params['cart'], $product));
|
||||
$discountValueBefore = (int)(LoyaltyModule::getCartDiscountValue($params['cart']));
|
||||
$discountValueAfter = (int)(LoyaltyModule::getCartDiscountValue($params['cart'], $product));
|
||||
$discountValue = (int)($discountValueAfter - $discountValueBefore);
|
||||
}
|
||||
else
|
||||
@ -470,18 +470,18 @@ class Loyalty extends Module
|
||||
$discountValue = 0;
|
||||
$smarty->assign('no_pts_discounted', 1);
|
||||
} else {
|
||||
$discountValue = (int)(LoyaltyModule::getNbdiscountValueByPrice($product->getPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true, (int)($product->getIdProductAttributeMostExpensive()))));
|
||||
$discountValue = (int)(LoyaltyModule::getDiscountValueByPrice($product->getPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true, (int)($product->getIdProductAttributeMostExpensive()))));
|
||||
}
|
||||
$discountValueAfter = $discountValue;
|
||||
$discountValueBefore = 0;
|
||||
}
|
||||
|
||||
$smarty->assign(array(
|
||||
'discountValue' => (int)($discountValue),
|
||||
'total_discounts' => (int)($discountValueAfter),
|
||||
'discount_value' => Configuration::get('PS_LOYALTY_PERCENT_VALUE'),
|
||||
'discounts_in_cart' => (int)$discountValueBefore,
|
||||
'voucher' => LoyaltyModule::getVoucherValue((int)$discountValueAfter)));
|
||||
'discountValue' => $discountValue,
|
||||
'total_discounts' => $discountValueAfter,
|
||||
'discount_percent' => Configuration::get('PS_LOYALTY_PERCENT_VALUE'),
|
||||
'discounts_in_cart' => $discountValueBefore
|
||||
));
|
||||
|
||||
return $this->display(__FILE__, 'product.tpl');
|
||||
}
|
||||
|
@ -26,17 +26,15 @@
|
||||
|
||||
<p id="loyalty" class="align_justify">
|
||||
<img src="{$module_template_dir}loyalty.gif" alt="{l s='Loyalty program' mod='loyalty'}" class="icon" />
|
||||
{if $points}
|
||||
{l s='By buying this product you can collect up to' mod='loyalty'} <b><span id="loyalty_points">{$points}</span>
|
||||
{if $points > 1}{l s='loyalty points' mod='loyalty'}{else}{l s='loyalty point' mod='loyalty'}{/if}</b>.
|
||||
{l s='Your cart will total' mod='loyalty'} <b><span id="total_loyalty_points">{$total_points}</span>
|
||||
{if $total_points > 1}{l s='points' mod='loyalty'}{else}{l s='point' mod='loyalty'}{/if}</b> {l s='that can be converted into a voucher of' mod='loyalty'}
|
||||
<span id="loyalty_price">{convertPrice price=$voucher}</span>.
|
||||
{if $discountValue}
|
||||
{l s='By buying this product you can collect up to' mod='loyalty'} <b><span id="loyalty_points">{convertPrice price=$discountValue}</span></b>.
|
||||
{l s='Your cart will total' mod='loyalty'} <b><span id="total_loyalty_points">{convertPrice price=$discountValueAfter}</span></b> {l s='that can be converted into a voucher of' mod='loyalty'}
|
||||
<span id="loyalty_price">{convertPrice price=$discountValueAfter}</span>.
|
||||
{else}
|
||||
{if isset($no_pts_discounted) && $no_pts_discounted == 1}
|
||||
{l s='No reward points for this product because there\'s already a discount.' mod='loyalty'}
|
||||
{l s='No reward discounts for this product because there\'s already a discount.' mod='loyalty'}
|
||||
{else}
|
||||
{l s='No reward points for this product.' mod='loyalty'}
|
||||
{l s='No reward discounts for this product.' mod='loyalty'}
|
||||
{/if}
|
||||
{/if}
|
||||
</p>
|
||||
|
@ -27,13 +27,12 @@
|
||||
<!-- MODULE Loyalty -->
|
||||
<p id="loyalty">
|
||||
<img src="{$module_template_dir}loyalty.gif" alt="{l s='loyalty' mod='loyalty'}" class="icon" />
|
||||
{if $points > 0}
|
||||
{l s='By checking out of this shopping cart you can collect up to' mod='loyalty'} <b>{$points}
|
||||
{if $points > 1}{l s='loyalty points' mod='loyalty'}{else}{l s='loyalty point' mod='loyalty'}{/if}</b>
|
||||
{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}
|
||||
{else}
|
||||
{l s='Add some products to your shopping cart to collect some loyalty points.' mod='loyalty'}
|
||||
{l s='Add some products to your shopping cart to collect some loyalty discounts.' mod='loyalty'}
|
||||
{/if}
|
||||
</p>
|
||||
<!-- END : MODULE Loyalty -->
|
Loading…
Reference in New Issue
Block a user