Please check what is your current market and have you added price for your current market? (see Market column in below image)
Can you also verify few more things,
Quantity is set (more than 0), for example
Product is not expired
In addition, I want to know your default curreny set in CommerceManager -> Administration -> Common Settings (see below image)
The default currency is US Dollar. Product is not expired and min and max quantity in inventory tab are 1 and 4 repectively. BTW I have min and max quantity in pricing tab of catalog management in Commerce Manager as well, what the difference between them?
Hi Muller
The RemovedDueToInvalidPrice
validation issue is returned because no suitable price value was found. Or they were found, but filtered away because:
I assume that the cart currency is AUD (since you are testing with a price of AUD 100), the cart market is DEFAULT and that the price value is for "All Customers". Is that correct?
Price is applied to all customer and not expired.How to check if price is in the range? Where is the price range defined? Currency is matching with Currency in administration, I have also tried with different currencies though. Cart market is Default and price value is for "All Customers".
The range I mentioned is about quantity, not price.
When you have mininum quantity of 1 and maximum quantity of 4, what is the quantity on the line item you are testing with?
priceService.GetPrices( marketId, DateTime.Now, new CatalogKey(code), new PriceFilter { Currencies = new[] { currency } }) .OrderBy(x => x.UnitPrice.Amount).FirstOrDefault();
is giving null for some variants. This is causing issue. No idea why getprices gives null.
Do you want to get all market prices? If yes, then pass new PriceFilter()
as empty and if no then it will return prices for the currencies that you are passing into PriceFilter()
And, are you trying to get the currency as?
var currency = SiteContext.Current.Currency;
Price issue is fixed. But I'm still getting RemovedDueToInvalidPrice error.
Can you describe the full story scene? Like: Number of items in cart, their quantity in cart and their inventory and pricing details in commerce. Are you adding more items than max quantity (of item) in cart? When does your validation is called? Your complete test scenario.
Removing sales code fixed the issue. No idea why sales code is giving Invalid price validation error.
Is that percentage based or amount based? If it was amount based and did you try with amount in your (default) currency. For example USD in my case (US Dollar)?
No, not promotion code. It's SALE CODE in pricing tab of variant (you can see this in pricing tab of the second screenshot you posted). All the price and quantity were proper and there is no discount.
Hi Muller,
Episerver out of the box code ignores a pricing record when "All Customers" price/sales type is applied with a sales code for a valid reason. Sales code is used in various ways and it is always dependent on what type of price/sales type you are using it for. E.g. When we use "Customer Price Group" as sales type, it tries to match contact's customer price group, and assigns a matching price record applicable for the user. In case of the system does not find a matching record, then it falls back to All Customers price (with empty sales code), which is usually used for MSRP price. There is "User Name" sales or price type, which can also be another way to assign specific price to specific customers.
On top of out of the box price/sales type, you can also add additional price/sales type to your application and customize the pricing scenarios to your business need. Once we added a new sales type as "Minimum Advertised Price" which is also called MAP in B2B market, to display MAP price to the customer. Episerver Pricing system is expandable based on various need.
~ Sujit
Though sale code fixed the issue. I've got the issue again in another variant. Currently, it has minimum quantity 2, if I change it to 1, the issue is fixed. I am really wondering why I am getting this issue in different different scenarios.
Hi Muller,
I would suggest you to read more carefully about the uses of the pricing and inventory. If the cart validation doesn't fit into the criteria of pricing and inventory to the items in the cart you will face these errors. That's obvious. So, here is the link to documentation. I hope this will help you.
https://webhelp.episerver.com/latest/en/commerce/catalog-management/catalog-entry-properties.htm
Thanks
While adding cart to cart service, I have validation from OrderValidationService.ValidateOrder and I am getting RemovedDueToInvalidPrice error (Item has been removed due to invalid price.). I have set AUD100 to variant price.