diff --git a/modules/loyalty/loyalty.php b/modules/loyalty/loyalty.php index c7af29c9c..96bc404d3 100644 --- a/modules/loyalty/loyalty.php +++ b/modules/loyalty/loyalty.php @@ -449,7 +449,7 @@ class Loyalty extends Module $points = 0; $this->smarty->assign('no_pts_discounted', 1); } - else + else $points = (int)(LoyaltyModule::getNbPointsByPrice($product->getPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true, (int)($product->getIdProductAttributeMostExpensive())))); $pointsAfter = $points; $pointsBefore = 0; @@ -460,7 +460,8 @@ class Loyalty extends Module 'point_rate' => Configuration::get('PS_LOYALTY_POINT_RATE'), 'point_value' => Configuration::get('PS_LOYALTY_POINT_VALUE'), 'points_in_cart' => (int)$pointsBefore, - 'voucher' => LoyaltyModule::getVoucherValue((int)$pointsAfter))); + 'voucher' => LoyaltyModule::getVoucherValue((int)$pointsAfter), + 'none_award' => Configuration::get('PS_LOYALTY_NONE_AWARD'))); return $this->display(__FILE__, 'product.tpl'); } diff --git a/modules/loyalty/views/templates/hook/product.tpl b/modules/loyalty/views/templates/hook/product.tpl index 9c9ed9157..96393b325 100644 --- a/modules/loyalty/views/templates/hook/product.tpl +++ b/modules/loyalty/views/templates/hook/product.tpl @@ -23,7 +23,50 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} +
{if $points} {l s='By buying this product you can collect up to' mod='loyalty'} {$points} diff --git a/themes/default/css/global.css b/themes/default/css/global.css index f5b48ad1f..56f6b31b0 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -1718,7 +1718,8 @@ ul#suppliers_list li .right_side {float:right;} #product p#loyalty { padding:10px 0 0 20px; border-top:1px solid #ccc; - background:url(../img/icon/info.png) no-repeat 0 8px + background:url(../img/icon/info.png) no-repeat 0 8px; + margin-top: 10px; } #footer .myaccount li.loyalty img {display:none} diff --git a/themes/default/js/product.js b/themes/default/js/product.js index a59973794..031e5aedb 100644 --- a/themes/default/js/product.js +++ b/themes/default/js/product.js @@ -345,17 +345,17 @@ function updateDisplay() var taxExclPrice = (display_specific_price ? (specific_currency ? display_specific_price : display_specific_price * currencyRate) : priceTaxExclWithoutGroupReduction) + selectedCombination['price'] * currencyRate; if (display_specific_price) - var productPriceWithoutReduction = priceTaxExclWithoutGroupReduction + selectedCombination['price'] * currencyRate; + productPriceWithoutReduction = priceTaxExclWithoutGroupReduction + selectedCombination['price'] * currencyRate; // Need to be global => no var if (!displayPrice && !noTaxForThisProduct) { - var productPrice = taxExclPrice * tax; + productPrice = taxExclPrice * tax; // Need to be global => no var if (display_specific_price) productPriceWithoutReduction = ps_round(productPriceWithoutReduction * tax, 2); } else { - var productPrice = ps_round(taxExclPrice, 2); + productPrice = ps_round(taxExclPrice, 2); // Need to be global => no var if (display_specific_price) productPriceWithoutReduction = ps_round(productPriceWithoutReduction, 2); } @@ -393,6 +393,7 @@ function updateDisplay() $('#our_price_display').text(formatCurrency(productPrice, currencyFormat, currencySign, currencyBlank)); else $('#our_price_display').text(formatCurrency(0, currencyFormat, currencySign, currencyBlank)); + $('#old_price_display').text(formatCurrency(productPriceWithoutReduction, currencyFormat, currencySign, currencyBlank)); if (productPriceWithoutReduction > productPrice)