[-] MO :Fixed #PNM-1654 (Loyalty module) by using most expensive attribute instead of default one

This commit is contained in:
Fabio Chelly committed 2013-11-08 18:12:11 +01:00
1 parent 92cf31e5c3
commit 4312d241f3
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -101,9 +101,9 @@ class LoyaltyModule extends ObjectModel
{ {
$cartProductsNew['id_product'] = (int)$newProduct->id; $cartProductsNew['id_product'] = (int)$newProduct->id;
if ($taxesEnabled == PS_TAX_EXC) if ($taxesEnabled == PS_TAX_EXC)
$cartProductsNew['price'] = number_format($newProduct->getPrice(false, (int)$newProduct->getDefaultIdProductAttribute()), 2, '.', ''); $cartProductsNew['price'] = number_format($newProduct->getPrice(false, (int)$newProduct->getIdProductAttributeMostExpensive()), 2, '.', '');
else else
$cartProductsNew['price_wt'] = number_format($newProduct->getPrice(true, (int)$newProduct->getDefaultIdProductAttribute()), 2, '.', ''); $cartProductsNew['price_wt'] = number_format($newProduct->getPrice(true, (int)$newProduct->getIdProductAttributeMostExpensive()), 2, '.', '');
$cartProductsNew['cart_quantity'] = 1; $cartProductsNew['cart_quantity'] = 1;
$cartProducts[] = $cartProductsNew; $cartProducts[] = $cartProductsNew;
} }
+1 -1
View File
@@ -453,7 +453,7 @@ class Loyalty extends Module
$points = (int)LoyaltyModule::getNbPointsByPrice( $points = (int)LoyaltyModule::getNbPointsByPrice(
$product->getPrice( $product->getPrice(
Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true, Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true,
(int)$product->getDefaultIdProductAttribute() (int)$product->getIdProductAttributeMostExpensive()
) )
); );
@@ -39,7 +39,7 @@ $(document).ready(function() {
if (typeof(productPrice) == 'undefined' || typeof(productPriceWithoutReduction) == 'undefined') if (typeof(productPrice) == 'undefined' || typeof(productPriceWithoutReduction) == 'undefined')
return; return;
var points = Math.round(productPrice / point_rate); var points = {$points};
var total_points = points_in_cart + points; var total_points = points_in_cart + points;
var voucher = total_points * point_value; var voucher = total_points * point_value;
if (!none_award && productPriceWithoutReduction != productPrice) { if (!none_award && productPriceWithoutReduction != productPrice) {