London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

PriceFilter returning wrong pricing

Vote:
 

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
Vote:
 

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
Vote:
 

Thank you @Quan!

#202322
Mar 22, 2019 15:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.