2

OrderItemAddCmd can add new items to the cart & order,ortderItems table. But to add items to an existing order Can we use OrderItemAddCmd or OrderItemUpdateCmd has to be used?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Narendra Jaggi
  • 1,297
  • 11
  • 33

2 Answers2

2

OrderItemUpdate is actually an extension of OrderItemAdd and can do anything Add can do. That said, OrderItemAdd WILL add new items to existing orders.

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_6.0.0/com.ibm.commerce.developer.doc/refs/rosorderitemupdate.htm?lang=en

  • Thanks for ur ans,So we can just pass the member id and partNumber_i,quantity_i. and this command will automatically check if any pending order is present if yes just add these to those. is that what you are saying? – Narendra Jaggi May 06 '15 at 12:47
  • Yes, see Abed's answer for specifying "orderId=. " – Michael Rasmussen May 06 '15 at 14:33
  • without specifying orderID can i do that, that's my concern – Narendra Jaggi May 06 '15 at 14:35
  • Yes, follow the link in Abed's answer and see "orderId This is an internally-generated identifier that specifies zero or more orders to be updated, using order reference numbers or one of the special abbreviations "**", ".", "*", ".t", "*t". See Order abbreviations for a description of these abbreviations. If no pending orders exist for a particular store, a new pending order will be created." You don't have to keep track of the customer's order in your code, the framework will do that for you – Michael Rasmussen May 06 '15 at 14:38
1

for more information , read this:

http://www-01.ibm.com/support/knowledgecenter/SSZLC2_6.0.0/com.ibm.commerce.developer.doc/refs/rosorderitemupdate.htm?lang=en

as Michael mentioned, OrderItemUpdate can be used to add,update,delete from current order

  • if you specify orderId=. , this mean operations will be performed to current pending orders .. if order is not yet created , command will create new orderId with Status=P , this will be your current pending order

  • if you specify orderItemId param , operation will be performed to that lineItem (ORDERITEMS record) to update qty to more or even assign quantity = 0 to delete the record .

check URL above for parameters syntax and for more details.

Abed Yaseen
  • 522
  • 4
  • 12