Try our conversational search powered by Generative AI!

StoreHelper.GetSalePrice Is null (Commerce 8.11)

Vote:
 

Hi

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?

Thanks

#122218
May 28, 2015 13:13
Vote:
 

Hi,

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.

Regards.

/Q

#122220
May 28, 2015 13:33
Vote:
 

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?

/Juan

#122376
Jun 01, 2015 15:32
Vote:
 

"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 ...

Regards.

/Q

#122378
Jun 01, 2015 15:38
Vote:
 

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" ...?

#122381
Jun 01, 2015 16:12
Vote:
 

Hi,

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?

.Q

#122392
Jun 01, 2015 20:28
Vote:
 

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.

R

#122468
Jun 03, 2015 10:45
Vote:
 

Hi

@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...

#122476
Jun 03, 2015 11:40
Vote:
 

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.

Regards.

/Q 

#122478
Jun 03, 2015 11:44
Vote:
 

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

/J

#122496
Jun 03, 2015 13:21
Vote:
 
<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>
#132635
Aug 14, 2015 13:09
Vote:
 

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.

Regards,

/Q

#132636
Aug 14, 2015 13:18
Vote:
 

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

Regards,
Ardi

#132637
Aug 14, 2015 13:49
Vote:
 

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 ... )

Regards,

/Q

#132638
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.