Total de publicaciones:
21
Karma:
103
Unido:
14/1/2012
Ubicación:
United States
We have applied a 50% discount to a certain category of products. When you click on that category, it shows the "From [full price]" instead of "From [50% off discounted price]". Is there a way to do that? Also in another thread I have modified the SP to make the products sorted by price, but they are still sorted by "position", as opposed to price (@OrderBy = 10).
Total de publicaciones:
21
Karma:
103
Unido:
14/1/2012
Ubicación:
United States
Why do some questions get ignored and others have many replies?
Total de publicaciones:
17
Karma:
125
Unido:
2/7/2009
Ubicación:
United States
Do you have multiple variants for a product?
Total de publicaciones:
21
Karma:
103
Unido:
14/1/2012
Ubicación:
United States
If anyone can point me in the right direction I would be appreciative.
Total de publicaciones:
21
Karma:
103
Unido:
14/1/2012
Ubicación:
United States
OK well here is the hack. I don't know if it is the best approach but it works so far. In the CatalogController.cs, I created this method. private decimal GetDiscountedProductPrice(ProductVariant productVariant) { decimal taxRate = decimal.Zero; decimal oldPriceBase = _taxService.GetProductPrice(productVariant, productVariant.OldPrice, out taxRate); decimal finalPriceWithoutDiscountBase = _taxService.GetProductPrice(productVariant, _priceCalculationService.GetFinalPrice(productVariant, false), out taxRate); decimal finalPriceWithDiscountBase = _taxService.GetProductPrice(productVariant, _priceCalculationService.GetFinalPrice(productVariant, true), out taxRate); decimal oldPrice = _currencyService.ConvertFromPrimaryStoreCurrency(oldPriceBase, _workContext.WorkingCurrency); decimal finalPriceWithoutDiscount = _currencyService.ConvertFromPrimaryStoreCurrency(finalPriceWithoutDiscountBase, _workContext.WorkingCurrency); decimal finalPriceWithDiscount = _currencyService.ConvertFromPrimaryStoreCurrency(finalPriceWithDiscountBase, _workContext.WorkingCurrency); return finalPriceWithDiscount; } I then set the single variants with decimal finalPrice = GetDiscountedProductPrice(productVariant); //_currencyService.ConvertFromPrimaryStoreCurrency(finalPriceBase, _workContext.WorkingCurrency); and the multiple variants with decimal fromPrice = GetDiscountedProductPrice(productVariant); //_currencyService.ConvertFromPrimaryStoreCurrency(fromPriceBase, _workContext.WorkingCurrency); Let me know if you think there is a cleaner way.