November Happy Hour will be moved to Thursday December 5th.

Customer Group Prices Retrieval

Vote:
 

Hello All,

Using EPiServer.Commerce 9.19, assume we have the following prices for a variant:

Market     Customer Group       Min Quantity           Price
Retailer             A                          1                    15.00
Retailer             A                          8                    12.00
Retailer             B                          1                    14.00
Retailer                                        16                   10.00

- What would be all qualified prices for customer group A and B supported out-of-the-box within EPiServer framework?
- If I need to show quantity based prices values in product details page, is the only option I have is to use IPriceDetailValue?
- Can anyone share code snippet for retrieving prices for Customer Group A in market Retailer?

Much Appreciated!

#163807
Oct 21, 2016 18:34
Vote:
 

Hi,

IPriceService would work just fine for this case: http://world.episerver.com/documentation/Class-library/?documentId=commerce/7.5/301C04E6

It has an overload to load price of certain entry for a specific market with specific PriceFilter - including the CustomerPricing. 

#163902
Oct 21, 2016 21:58
Vote:
 

Thanks Quan for your comment.

Just want to clarify how the prices framework works, in above prices table, is Customer Group A qualified for 15, 12 and 10 prices or only 15 and 12? (last price tier does not have a customer group)

#163903
Edited, Oct 21, 2016 22:03
Vote:
 

Hi,

Customer Group A should qualify for all three - no customer group means that price applies for all customers. As that has Min Quantity 16 so it does not override the other prices. 

#163906
Oct 22, 2016 8:46
Vote:
 

Hi Quan,

I have used the following EPiServer APIs to get prices for Customer Group A:

  • variationContent.GetPrices(currentMarket.MarketId, new CustomerPricing(CustomerPricing.PriceType.PriceGroup, "A"))
  • variationContent.GetCustomerPrices()

Both of them returned only 2 prices (The prices with customer group A assigned as per above prices table) and not 3 prices as expected (The price with no customer group assigned, in above prices table, was not returned).

I cannot find a way to return prices without a group to customers with a group.

Any idea?

#170767
Oct 28, 2016 21:56
Vote:
 

Hello

If you go directly against the IPriceService you will get more options to load the prices.

You can always select exactly the prices you are after but you need to use an overload that takes an IEnumerable of CustomerPricing and include:

new CustomerPricing(CustomerPricing.PriceType.AllCustomers, string.Empty)

In my experience once you start supplying CustomerPricing you are dictating exactly what you want to load.

The built-in support are based on that the customer is logged in and that you have set up that he should have price group "A" then for example GetCatalogEntryPrices should return the 3 prices you are after as is without any extra PriceFilter.

Kind Regards

Erik

#170804
Oct 31, 2016 10:17
Vote:
 

Thanks Erik for your comment.

I understand that I can get all prices then apply my custom filter but I was looking for using the default behavior by EPiServer.

Unfortunately, using GetCatalogEntryPrices returns all prices including Customer Group B although the customer is assigned Customer Group A.

#171054
Oct 31, 2016 16:00
Vote:
 

Yes you are right GetCatalogEntryPrices will get you all prices.

Then i am stomped, don't know which functions would filter out the customergroup automaticly.

Unless someone else can give you another solution i would recommend you to define the CustomerPricing yourself:

IPriceService.GetPrices(marketId, dateTimeNow, catalogKey, new PriceFilter{
CustomerPricing = new CustomerPricing[]{

CustomerPricing.AllCustomers,

new CustomerPricing(CustomerPricing.PriceType.PriceGroup, "A")

}});

You might need to add some more to the PriceFilter to make it correct, like currency, but that is the basics.

/Erik

#171075
Nov 01, 2016 11:27
* 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.