2 Replies Latest reply: Aug 7, 2013 3:47 PM by pveedu1 RSS

    Related to order creation

    pveedu1

      Hi,

       

      Could you please give some idea about new order creation as per below scenario

       

       

      1)  i need to create  a new order for example "A" using ATG OOTB orderHolder class.

       

      2) if the order is  already  exists then no need to create and but i need to iterate this order("A") from shopping cart

       

      2) Then i need to copy commerceItem from  current for example "B"  order to newly created order ("A") and vice versa.

       

       

      Thanks in advance.

      pveedu

        • 1. Re: Related to order creation
          Ricky S

          is it for anonymous users or logged in users?

           

          when a req flows through DAF pipeline it creates 2 session object - Profile and Cart.

          cart.getCurrent will give u the current order.

           

          if the user is logged in u can call cart.getSaved to see if an order is already there for the user. U can set the saved order to current order.

          u can merge the commerce items calling mergeOrdersCopyCommerceItem method of CommerceItemManager.

           

          u can get reference for CommerceItemManager from OrderManager.

           

          CommerceItemManager.mergeOrdersCopyCommerceItem()

          • 2. Re: Related to order creation
            pveedu1

            Thanks