Tier prices problem 3.80

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I set up tier prices the way I thought it should be done, but must have missed something.
This block of code in the Product Controller keeps overwriting tier pricing with 'priceBase'

I guess I should check more in the methods that assign to priceBase ...





#region Tier prices

            if (product.TierPrices.Any() && _permissionService.Authorize(StandardPermissionProvider.DisplayPrices))
            {
                model.TierPrices = product.TierPrices
                    .OrderBy(x => x.Quantity)
                    .ToList()
                    .FilterByStore(_storeContext.CurrentStore.Id)
                    .FilterForCustomer(_workContext.CurrentCustomer)
                    .RemoveDuplicatedQuantities()
                    .Select(tierPrice =>
                    {
                        var m = new ProductDetailsModel.TierPriceModel
                        {
                            Quantity = tierPrice.Quantity,
                        };
                        decimal taxRate;
                        decimal priceBase = _taxService.GetProductPrice(product, _priceCalculationService.GetFinalPrice(product, _workContext.CurrentCustomer, decimal.Zero, _catalogSettings.DisplayTierPricesWithDiscounts, tierPrice.Quantity), out taxRate);
                        decimal price = _currencyService.ConvertFromPrimaryStoreCurrency(priceBase, _workContext.WorkingCurrency);
                        m.Price = _priceFormatter.FormatPrice(price, false, false);
                        return m;
                    })
                    .ToList();
            }
6 years ago
reducing the number of spec attrs solved it. I had a really hard time profiling this on local dev, seems like it always runs slow for a while after fresh compile, so hard to know what the cause is unless on a more persistent server.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.