Stephen Rufle wrote:
Steps
ShoppingCartEvents.loadCartFromOrder(HttpServletRequest,
HttpServletResponse)
ShoppingCart cart = ShoppingCartEvents.getCartObject(request);
String contactMech = cart.getContactMech("SHIPPING_LOCATION");
I expected the value of contactMech to be filled with a value from
OrderCcontactMech, but it returns an empty string. Do I have to
populate the SHIPPING_LOCATION's separately?
A more general question is, after an order is saved what is the best
way to manipulate it. I have been trying to reload the cart manipulate
the cart then pass it back to updateOrderItems and updateOrderHeader
services respectively. Am I going about this incorrectly? Should I
instead be manipulating the underlying Order* entities using a
different set of services or methods?
In general, if you are editing the ordered products, their quantities or
prices you should use the shopping cart to manipulate the order. This
will ensure that the promotions and price rules are recalculated
according to the changes. For an example of this check how Edit Order works.
Bilgin