London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Ok, if I add
((OrderForm)returnOrderForm).AcceptChanges();
in the last step it works. Is that the way to do it? Feels a little Mediachase old school :)
/Viktor
I might be missing something, but the general advice is to not have to cast back to the concrete implementations. For example I'm not sure why this is needed:
((OrderForm)returnOrderForm).Total = order.GetFirstForm().GetTotal(order.Market, order.Currency).Amount;
((OrderForm)returnOrderForm).DiscountAmount = 0;
((OrderForm)returnOrderForm).ShippingTotal = 0;
Also this might not be correct (your might mean returnLineItem.Quantity?)
lineItem.ReturnQuantity = lineItem.Quantity;
Hi,
The code is taken from the article I linked to and from reflecting the code used in the commerce manager. Without the lines of code (more correct and not "test" code as I posted above) all totals will be 0 on the returns tab in Commerce Manager. Do you have an example code that just creates a return for one line item in the way it should look?
/Viktor
The part of creating the return order form is OK (although I'd recommend to use constructor injection instead of servicelocator ). The part of casting back to OrderForm is not OK IMO. I can't look it up now (on vacation actually), but there should be APIs to validate and calculate the total and such.
IPurchaseOrderProcessor.ProcessOrder, maybe?
Hi,
EPiServer CMS: 11.3.3
EPiServer Commerce: 11.8.1
I'm trying to create a return on an order and have found this, https://world.episerver.com/documentation/developer-guides/commerce/orders/using-the-return-order-form/, but it only shows every step in isolation and I can't seem to get them to work together. I can create the return form but line items are not included. The code I have tried with is the following,
But like I said it only creates the return but without any line items. Any pointers to what I'm missing?
/Viktor