3 Replies Latest reply on Apr 11, 2017 2:44 PM by Nooruddin Shaik

    ShippingGroupCommerceItemRelationship creation


      Hi Dudes,


      Can any one help me to clear my doubt


      When a ShippingGroupCommerceItemRelationship will create in ATG first time,How to maintain relation ship between shipping group and commerce items


      Ex : i added 4 commerce items

      A items with sg1

      B items with sg2


      i want to change shippinggroup of items A to sg2


      Q1)then how to change the shippinggroupinformation in relationship

      Q2)first how to split the items to different shippinggroups.


      my humble please don't share any atg docs from google

      i need customized code base clarification, if you have any can please share.




        • 1. Re: ShippingGroupCommerceItemRelationship creation
          Nooruddin Shaik

          The below code creates the shippingGroupCommerceItemRelationship to with cItem and sg1 shipping group with quantity 1.


          // remove the existing relationship between commerceItemId and shippingGroupId

            getCommerceItemManager().removeItemQuantityFromShippingGroup(pOrder, pCommerceItemId, pShippingGroupId, quantity);


          //Now create the new relationship

            ShippingGroup sg = (ShippingGroup) order.getShippingGroup(sg1);

            getCommerceItemManager().addItemQuantityToShippingGroup(order, cItem.getId(), sg.getId(), 1L);



          For split shipping you can customize the code to add above logic for each each shipping group or use OOTB ShippingGroup droplet and ShippingGroupFormHandler.handleSplitShippingInfos()

          Hope this help!




          • 2. Re: ShippingGroupCommerceItemRelationship creation

            thanks Nooru got it


            got it in removeItemQuantityFromShippingGroup() we have to pass the relationshipquantity along with CI and SG id's and order to remove the shipping information from relationship

            then after to addItemQuantityToShippingGroup we have to pass the new sg id along with ci id and quantity.


            instead of OOTB and customisation for splitting shippinggroup for Ci can you please share overview of code base.

            • 3. Re: ShippingGroupCommerceItemRelationship creation
              Nooruddin Shaik

              You can find ATG OOTB ShippingGroupFormHandler code and related classes here C:\ATG\ATG11.2\DCS\src\Java\atg\commerce\order\purchase


              Let me know if you are looking for anything specific.