Skip to content

Commit 242ff7d

Browse files
committed
Fixes wrong base price on product and cart page when a special price is active
1 parent 69bb4fa commit 242ff7d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* File upload of a checkout attribute was not stored on cart page.
4141
* Redirecting within checkout may have displayed an incorrect URL in the browser.
4242
* Server cannot modify cookies after HTTP headers have been sent.
43+
* Wrong base price on product and cart page when a special price is active.
4344

4445

4546
## SmartStore.NET 3.1.5

src/Presentation/SmartStore.Web/Controllers/CatalogHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,15 +1159,17 @@ public ProductDetailsModel PrepareProductDetailModel(
11591159
model.ProductPrice.NoteWithDiscount = T("Products.Bundle.PriceWithDiscount.Note");
11601160
}
11611161

1162+
var basePriceAdjustment = (_priceCalculationService.GetFinalPrice(product, true) - finalPriceWithDiscount) * (-1);
1163+
11621164
model.BasePriceInfo = product.GetBasePriceInfo(
11631165
_localizationService,
11641166
_priceFormatter,
11651167
_currencyService,
11661168
_taxService,
11671169
_priceCalculationService,
11681170
customer,
1169-
currency,
1170-
(product.Price - finalPriceWithDiscount) * (-1));
1171+
currency,
1172+
basePriceAdjustment);
11711173
}
11721174

11731175
// Calculate saving.

src/Presentation/SmartStore.Web/Controllers/ShoppingCartController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ private ShoppingCartModel.ShoppingCartItemModel PrepareShoppingCartItemModel(Org
283283
DisableWishlistButton = product.DisableWishlistButton
284284
};
285285

286-
model.BasePrice = product.GetBasePriceInfo(_localizationService, _priceFormatter, _currencyService, _taxService, _priceCalculationService, customer, currency);
287286
model.ProductUrl = _productUrlHelper.GetProductUrl(model.ProductSeName, sci);
288287

289288
if (item.BundleItem != null)
@@ -417,6 +416,8 @@ private ShoppingCartModel.ShoppingCartItemModel PrepareShoppingCartItemModel(Org
417416
model.Discount = _priceFormatter.FormatPrice(itemDiscount);
418417
}
419418

419+
var basePriceAdjustment = (_priceCalculationService.GetFinalPrice(product, true) - _priceCalculationService.GetUnitPrice(sci, true)) * (-1);
420+
420421
model.BasePrice = product.GetBasePriceInfo(
421422
_localizationService,
422423
_priceFormatter,
@@ -425,7 +426,7 @@ private ShoppingCartModel.ShoppingCartItemModel PrepareShoppingCartItemModel(Org
425426
_priceCalculationService,
426427
customer,
427428
currency,
428-
(product.Price - _priceCalculationService.GetUnitPrice(sci, true)) * (-1)
429+
basePriceAdjustment
429430
);
430431
}
431432

0 commit comments

Comments
 (0)