The standard process for merging orders involves OrderManager.mergeOrders() calling CommerceItemManager.mergeOrdersCopyCommerceItem() to copy existing commerce items from a source order to a destination order, and calling
ShippingGroupManager.mergeOrdersCopyShippingGroup() to copy existing shipping groups from the source order to the destination order. The
ShippingGroupManager, mergeOrdersCopyShippingGroup(), in turn, calls either mergeOrdersCopyHardgoodShippingGroup(),
mergeOrdersCopyElectronicShippingGroup()
, or mergeOrdersCopyInStorePickupShippingGroup() depending on the type of the shipping group.

If you are using the multisite features of Core Commerce, merging orders must also take site information into account when deciding whether two items are identical, and therefore whether to increment the item count or to add a second item to the order. The methods used are CommerceItemManager.shouldMergeItems() and shouldMergeSubItems().

Note that configurable commerce items’ configurable SKUs are prevented from merging. The CommerceItemManager.shouldMergeItemContainers property is set to false by default and can be set to true to add comparison logic. Refer to the ATG Platform API Reference for additional information.

Note that if you have extended certain Core Commerce classes to store additional information, you must change the methods used for merging orders so the additional information is copied to the destination order when merging orders:

  • If you have extended CommerceItem, you should subclass CommerceItemManager and override the mergeOrdersCopyCommerceItem() method to first call the superclass method to do the basic copy and then copy your extended commerce item data.

  • If you’ve extended HardgoodShippingGroup, you should subclass ShippingGroupManager and override the mergeOrdersCopyHardgoodShippingGroup method to first call the superclass method to do the basic copy and then copy your extended commerce item data.

  • If you’ve extended ElectronicShippingGroup, you should subclass ShippingGroupManager and override the mergeOrdersCopyElectronicShippingGroup method to first call the superclass method to do the basic copy and then copy your extended commerce item data.

  • If you’ve created a new shipping group type that is neither a subclass of HardgoodShippingGroup nor ElectronicShippingGroup, you should subclass ShippingGroupManager and override the mergeOrdersCopyShippingGroup method to examine the class of the shipping group. If the shipping group is of the new type you created, then the subclass should copy it to the destination order. Otherwise, the method can call the superclass mergeOrdersCopyShippingGroup method to handle the standard shipping group types.


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices