Try our conversational search powered by Generative AI!

StoreHelper.GetSalePrice Is null (Commerce 8.11)



For a strange reason my StoreHelper.GetSalePrice is returning null.

Here is the method...

public Mediachase.Commerce.Catalog.Objects.Price GetSalePrice(Entry entry, decimal quantity)
     var currentMarket = _currentMarketService.GetCurrentMarket();
     var priceToReturn = StoreHelper.GetSalePrice(entry, quantity, currentMarket);
     return priceToReturn;

Nothing is null, that i am sending in. I got a Entry, and the currentMarket also.

The price is in the currentmarket, for the sku.

Does anyone any idea? Do I missing something?


May 28, 2015 13:13


Make sure the price in current market is valid, for example, its StartDate and EndDate cover current time, and it has no customer group attached.



May 28, 2015 13:33

Hi Quan

Thank you for reply

But I still not getting any prices, I dobble check the things you saw, but nothing helps.

I notice that I dont have any PriceValues in my Entry...

Does it something to do with it? 

I tryed "StoreHelper.GetBasePrice(entry)" but it didnt help... any other idea?


Jun 01, 2015 15:32

"I notice that I dont have any PriceValues in my Entry..." 

So this is the problem. if you don't have any Optimized prices for the entry, you won't be able to get it. The easiest way to check is to go to Commerce Manager, tab Variation/Pricing. The price you expect to get must be shown here with matching market, minimum quantity, start date/end date ...



Jun 01, 2015 15:38

Hi Q!

Check the picture below, I dont see anything wrong? or?

I am sending the "Rest of Europe" market...

And what du you mean with "if you don't have any Optimized prices for the entry" ...?

Jun 01, 2015 16:12


Yes the prices in the picture are the "optimized prices" I mentioned. Are you sure you're using the correct market. What is the CurrentMarket?


Jun 01, 2015 20:28

I think this may be something to do with the Min Quantity and Max Quantity.  Set the min quantity to 1 and Max quantity to 999 and see if that helps.


Jun 03, 2015 10:45


@Quan: Yes I have a valid market "ROE", i have use debug.

@Rob: I did that, but didnt help.

I am using StoreHelper.GetSalePrice(entry, quantity, currentMarket);

Next step is to get the variant and check manually the price with current market...

Jun 03, 2015 11:40

What is the "Entry" you are using? It's supposed to be the variation, not the product.

Try to use IPriceService (ServiceLocator.Current.GetInstance<IPriceService>()) directly to see if it works for you.



Jun 03, 2015 11:44

ok, My "Entry" was the product, not the variation...


Jun 03, 2015 13:21
<p>I'm having the same issue. But my "Entry" is a variation. The dates seem correct and I do have values in PriceValues. Also my current market seems correct.&nbsp;<br />Any ideas what might be wrong?&nbsp;<br /><br />I get the price through IPriceDetailService though.<br />Using&nbsp;version 8.13</p>
Aug 14, 2015 13:09

IPriceDetailService is for "unoptimized" prices and should only be used for price editing. You should use IPriceService to check, because the two set of prices can be different.



Aug 14, 2015 13:18

From your answer I recon that I should use the IPriceService instead of StoreHelper.GetSalePrice? 


Aug 14, 2015 13:49

StoreHelper.GetSalePrice is a method which uses IPriceService internally. It will do some filter and promotion checking for you. The point of using IPriceService is to make sure that the prices are in good shape (available for current customer/current market/current time ... )



Aug 14, 2015 14:04
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.