How can I see from which pricelist I am getting my price?

How can I tell in which pricelist Litium found the returned price?

ping @MartinBrandt

Litium version: 7

If you create your own pricecalculator, you can make a class that inherits from the normal PriceCalculatorResult that has extra properties.

public class CustomerPriceCalculatorResult : PriceCalculatorResult
{
   public Guid PriceListSystemId { get; set; }

   public CustomerPriceCalculatorResult(decimal price, decimal vatPercentage, Guid priceListSystemId)
   {
      ListPrice = price;
      VatPercentage = vatPercentage;
      PriceListSystemId = priceListSystemId;
   }
 }

Code examples from price calculator:
return new CustomerPriceCalculatorResult(newPrice, z.VatPercentage, z.PriceListSystemId);

fetch price:

if (_priceCalculator.GetListPrices(priceCalculatorArgs, priceCalculatorItemArgs).TryGetValue(priceCalculatorItemArgs.VariantSystemId, out priceListResult))
{
   var customerPriceResult = (CustomerPriceCalculatorResult)priceListResult;
   var priceList = customerPriceResult.PriceListSystemId;
}

I have been looking into this solution, but I do not have a custom IPriceCalculator. Is that necessary to get the name of the pricelist? Or is there any simple way to get the name/id of the pricelist from where the price is fetched? With the use of the standard implementation of IPriceCalculator

still haven’t solved this. Anyone else with a good idea?

The default implementation is not including the price list information together with the price. To get that information you need to implement your own IPriceCalculator and include that information in the result as in the example above.

Ok, is it possible to add this in the default implementation in a future release? if so I will make a feature request

Please, create a bug on docs-site and write in description what you want and that it is a feature request.

done, #45737

1 Like

Any update on this?