Thursday 6 November 2014

Assigning Items to Shipping Groups In ATG

                   when ever first order is created,it has an empty shipping group,this will serves as default shipping group,this default shipping group is defined by a property defaultShippingGroupType in OrderTools component.
OrderTools.properties
defaultShippingGroupType=hardgoodShippingGroup
1.If there is a only one shipping group,if you add any commerce item to order that item is part of default shipping group.
Ex1:
Shipping group : default shipping group.
Commerce Items : ci1,ci2,ci3,ci4
Order : all the items will set to default shipping group
2.if there is any other shipping groups in order,then the items we have to explicitly assigned to one of the existed shipping groups.
Ex2:
Shipping group : sgp1,sgp2
Commerce Items : ci1,ci2,ci3
Order : so order contains 3 items and 2 shipping groups
1. ci1 and ci2 we are setting to sgp1
2. c i3 setting to sgp2
Before order is checked every item in the order must and should part of shipping group(s),this requirement check by the validateForCheckout pipeline,validateForCheckout pipeline validates a different part of theOrder as complete.

In validateForCheckout pipelinechain we have one processor validateShippingGroupsForCheckout,this processor validates the shipping groups in the order.As per the ATG,shipping group will complete when ever it met the below criteria.

I..name, address, city, state, and postal code these fields should not be empty in ShippingGroup

II.All of the items in order should be assigned to shipping group,for this some requirements are there.

            If there is only one ShippingGroup in the Order and no relationships exist between that ShippingGroup and the commerce items in the Order, then the shipping of all commerce items in the Order implicitly is accounted for by that ShippingGroup.

             If there is only one ShippingGroup in the Order and relationships exist between that ShippingGroup and the commerce items in the Order, or if there is more than one ShippingGroup in the Order, then every CommerceItem in the Order must have its shipping explicitly accounted for with one or more ShippingGroupCommerceItemRelationship objects, as follows:

              *1.If a CommerceItem has a ShippingGroupCommerceItemRelationship of type ShippingQuantityRemaining, then the item’s shipping is accounted for regardless of whether it has other shipping relationships. This is because a “remaining” relationship type covers any quantity of the CommerceItem that is not accounted for by other shipping relationships.

              *2.If a CommerceItem has one or more ShippingGroupCommerceItemRelationship objects of type ShippingQuantity, but no relationship of typeShippingQuantityRemaining, then the total quantity of the CommerceItem covered by the relationships must be equal to or greater than the quantity in theCommerceItem.
The range property in the ShippingGroupCommerceItemRelationship identifies which particular items out of the total quantity of a CommerceItem are associated with a given ShippingGroup.

1 comment:

  1. hi, how can i update this default Shipping Group? i mean update some properties. greatings

    ReplyDelete