November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
Are you running some promotions which give items for free? Is the order form total still correct?
/Q
Hello Quan,
We are not running any promotions.
Orderfrom Toal is correct.
Its not happening all the time .
Regards
Phani
Hi,
Do you have any customization on the workflows?
Can you take a screenshot of the entire order detail (sensetive information can be blurred out, of course)
/Q
Hello Quan,
Yes, we have some sort of custmisation for caluclation prices
I have changed the code in OrderGroupActivityBase.Cs
protected Money? GetItemPrice(CatalogEntryDto.CatalogEntryRow entry, LineItem lineItem, CustomerContact customerContact) { List<CustomerPricing> customerPricing = new List<CustomerPricing>(); // customerPricing.Add(CustomerPricing.AllCustomers); customerPricing.Add(new CustomerPricing(CustomerPricing.AllCustomers.PriceTypeId, "RRP")); customerPricing.Add(new CustomerPricing(CustomerPricing.AllCustomers.PriceTypeId, "SP")); if (customerContact != null) { var userKey = _mapUserKey.ToUserKey(customerContact.UserId); if (userKey != null && !string.IsNullOrWhiteSpace(userKey.ToString())) { customerPricing.Add(new CustomerPricing(CustomerPricing.PriceType.UserName, userKey.ToString())); } if (!string.IsNullOrEmpty(customerContact.EffectiveCustomerGroup)) { //ToDo: Phani Need to Validate the expiry date of Linen Lovers Group customerPricing.Add(new CustomerPricing(CustomerPricing.PriceType.PriceGroup, customerContact.EffectiveCustomerGroup)); } } //To apply the Linen Lover Price var cartHelper = new CartHelper(Orders.Cart.DefaultName); var orderForm = cartHelper.Cart.OrderForms.FirstOrDefault(); try { if (orderForm != null) { var linenNumber = orderForm.GetString("LinenCardNumber"); var isLinenPriceApplicable =Convert.ToBoolean(orderForm.GetBool("IsLinenPriceApplicable")); if (!string.IsNullOrEmpty(linenNumber) || isLinenPriceApplicable) { customerPricing.Add(new CustomerPricing(CustomerPricing.PriceType.PriceGroup, "Linen Lovers Club")); } } } catch (Exception ex) { _log.Error(ex.ToString()); } IPriceService priceService = ServiceLocator.Current.GetInstance<IPriceService>(); PriceFilter priceFilter = new PriceFilter() { Currencies = new List<Currency>() { new Currency(lineItem.Parent.Parent.BillingCurrency) }, Quantity = lineItem.Quantity, CustomerPricing = customerPricing, ReturnCustomerPricing = false // just want one value }; // Get the lowest price among all the prices matching the parameters IPriceValue priceValue = priceService .GetPrices(lineItem.Parent.Parent.MarketId, FrameworkContext.Current.CurrentDateTime, new CatalogKey(entry), priceFilter) .OrderBy(pv => pv.UnitPrice) .FirstOrDefault(); return priceValue?.UnitPrice; }
The picture is a bit small to my eyes :)
What price configurations do you have for the free item? My theory is that your GetItemPrice might return 0 in some scenarios.
/Q
Hi Quan,
Please note in my code I have mentioned the two custom prcing groups
customerPricing.Add(new CustomerPricing(CustomerPricing.AllCustomers.PriceTypeId, "RRP"));
customerPricing.Add(new CustomerPricing(CustomerPricing.AllCustomers.PriceTypeId, "SP"));
and more over RRP has expiry date after 40 years . There is no chance for GetItemPrice(CatalogEntryDto.CatalogEntryRow entry, LineItem lineItem, CustomerContact customerContact) to return zero value. Moreover other guys did purchase of same item at that secenario price is correct.
is there any other place in work flows where the item price will be caluculated.
Hi,
I'm a bit confused now - as you said the orderform total is correct, and I think it's correct in term of:
209.95 + 169.95 + 49.95 = 429.85
Or did you mean the total is "correct" for the missing price?
I missed an important question: Is this order placed in front-end, or is it created directly in Commerce Manager?
/Q
Hi Quan,
Please find below the order Summary of the above Order. for better understanding .
Order Form Total is correct , I mean ( 209.95 + 169.95 + 49.95 = 429.85) .
For some resons the provider id is missing for this order. It was not created from Commerce Manager.
Hi,
It looks like the order is missing a crucial part of information - ProviderId should be "FrontEnd".
The GetItemPrice's return value only takes effect if ProviderId is FrontEnd. So I suppose that the order was created in some other sources (I don't know, front-end or perhaps some third party services?), as the PlacedPrice was set to 0 and then ProviderId missing, your GetItemPrice value (which is supposedly 55.95AUD) was not set during the workflows.
Set the ProviderId to "FrontEnd" then run the workflow ( RecalculatePurchaseOrderWorkflow) should solve the problem.
Regards,
/Q
Hi Quan ,
Thanks a lot.
Is there any way that I can set the Provider Id by default (as a global configuration).
Becuase I am assigning the provider Id at the time of adding an item to the Cart.
Do we need to assign the provide Id only once or every thime while execution of workflows like Cart Validation, CarPreparation and CartCheckout ?
Regards
Phani
Hi,
You don't have to set ProviderId everytime. You just need to set it once before running CartValidate and saving. Something like this:
ch.Cart.ProviderId = "FrontEnd";
ch.RunWorkflow(OrderGroupWorkflowManager.CartValidateWorkflowName);
ch.Cart.AcceptChanges();
/Q
Hi All,
I am facing a strange issue with my pruchase orders .
Placed price is becmong zero for one of the line items in Purchase orders .
Any suggestion to get ride of this issue will be appreciated.