Discussion:
OrderItemAddCmd Customization
(too old to reply)
VijayaR
2006-10-28 04:07:29 UTC
Permalink
I would like to customize "OrderItemAddCmd" in such a way that new order items added to the order gets merged with the existing order items with the same part number.

Basically if i add the same product twice to an order, my ORDERITEMS table for that order would have one order item with a quantity of 2.

Any one has done the above type of customization? I would like to hear from you.

-thanks,
m***@ca.ibm.com
2006-11-02 13:49:16 UTC
Permalink
Hi, I think you can do this with the use of the orderId parameter. The definition of this parameter is:
The identifier of the order to which the item is being added. This parameter can be repeated.

You can look at this page in the Information Center for further reference:http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderitemadd.htm

I've contacted our orders developers to see if there is another way to do this.
Robert Brown
2006-11-03 03:42:43 UTC
Permalink
What you mention is true but you cannot rely on the orderId NVP since
the page may be cached in the shopper's browser, or worse, they hit the
Back button to the page with an the old orderId.

R

P.S. Thanks to you and other IBM'ers for piping in on the group the
last month or so...we always appreciate the help and I for one have
noticed and welcome heartily the increase in IBM participation.
Post by m***@ca.ibm.com
The identifier of the order to which the item is being added. This parameter can be repeated.
You can look at this page in the Information Center for further reference:http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderitemadd.htm
I've contacted our orders developers to see if there is another way to do this.
Robert Brown
2006-11-03 03:37:38 UTC
Permalink
Based on our experience, this type of business requirement involves way
more than just the OrderItemAdd command. Keep the following in mind:

*) dealing with BundleBeans (which are decomposed during the add to cart
process)
* supporting CSR order management via Accelerator
* flagging and skipping specific SKUs the client deems non-mergeable
* and last but by no means least, merging a guest cart with their
registered cart after successful login when the guest cart and the
registered cart contain the same SKU

Quick and dirty would be to write JSP code in the cart page and the
order checkout page to halt the checkout process and provide the shopper
a message and a 'Correct cart' button. Fairly easy to code the form to
delete the first duplicate ORDERITEMS_ID and adjust the quantity on the
second duplicate ORDERITEMS_ID. I mention both pages since people do
bookmark the checkout page and can bypass a cart page check. Best
practice would definitely be to write a few lines of Java in the
ExtOrderProcessCmdImpl and fail the order during the OrderProcess
command. Not JSP proactive but keeps them from placing the order.

Another thought is that with ATP enabled in your store you have *merge,
*remerge etc. parameters available to merge orders and orderitems during
the OrderItemAdd command. Perhaps you can start there if your store
supports ATP. If you go this route, then be sure you call the command
to merge carts after the Logon command when a guest cart is present.

R
Post by VijayaR
I would like to customize "OrderItemAddCmd" in such a way that new order items added to the order gets merged with the existing order items with the same part number.
Basically if i add the same product twice to an order, my ORDERITEMS table for that order would have one order item with a quantity of 2.
Any one has done the above type of customization? I would like to hear from you.
-thanks,
Loading...