PriceFilter returning wrong pricing

Siddharth Gupta
Member since: 2018
 

Hi,

I am using Commerce 12.15 and creating a price filter to pass to GetPrices method of PriceServiceDatabase class which implements IPriceService. 

Below is the price filter I create, so now I am expecting that this will give me prices which have Currency: USD, CustomerPricing: AllCustomers and no price code and where the minimum quantity is 1.

PriceFilter filter = new PriceFilter()
{
Currencies = new Currency[] { new Currency("USD") },
CustomerPricing = new CustomerPricing[]
{
new CustomerPricing(CustomerPricing.PriceType.AllCustomers, string.Empty)
},
Quantity = 1
};

But upon passing this to GetPrices, it gives me back a price whose Minimum Quantity is 0. Also, this happens when I dont have a price code.

Below is a screen shot for reference:

https://www.screencast.com/t/cwdHzPQomULX

I have the filter and the prices returned back from the call. 

#202287
Mar 22, 2019 0:35
Quan Mai
Member since: 2011
 

I think you understand thing in reverse. Quantity is to make sure you will not get prices for quantity more than that - that's why it is not named MinQuantity (yeah I know Quantity is not that clearer). If you want to get prices for min quantity = 1 then you will have to filter it yourself. 

#202300
Mar 22, 2019 10:41
Siddharth Gupta
Member since: 2018
 

Thank you @Quan!

#202322
Mar 22, 2019 15:36