In ATG Commerce, the purchase process controls the refreshing of Orders.
When an Order is loaded from the Order Repository, the loadOrder() method in the OrderManager calls into the PipelineManager to execute the loadOrder pipeline, which creates and loads the Order object, as well as its OrderPriceInfo and TaxPriceInfo objects. (See Loading Orders above for details.) Later, when an Order property is accessed (for example, by calling getCommerceItems() or getPriceInfo()), the refreshOrder pipeline is invoked, which creates and loads the rest of the contained objects in the Order.
The refreshOrder pipeline is called only when the Order is first accessed and subsequently when an Order is invalidated and, therefore, needs to be reloaded from the Order Repository.
The following table describes the individual processors in the refreshOrder pipeline. They are listed in order of execution.
PipelineLink name | Description |
|---|---|
| Given an |
| Creates |
| Creates |
| Creates |
| Creates |
| Creates |
| Creates |
| Reloads the The |
| Sets the Note that, if The |
| Sets the Note that, if The |
| Used in conjunction with The |
For more information about pipelines, the PipelineManager, and the transactional modes and transitions of the processors in the refreshOrder pipeline, see the Commerce Processor Chains section.
Managing Orders that Contain Deleted Products and SKUs
As described in the previous section, Refreshing Orders, the last three processors in the refreshOrder pipeline can be used to operate on the commerce items in an order that refer to products and/or SKUs that have been deleted from the catalog. If your catalog administrators delete products and/or SKUs in the ongoing management of the product catalog, you should configure these processors to handle affected orders appropriately. Note:If you’re running the Customer Service Module, this is particularly important because the Customer Service Module cannot display orders that contain deleted products or SKUs.
To configure the refreshOrder pipeline to manage deleted SKUs, do the following:
Create a new SKU in the product catalog. In an
Order, this “dummy” SKU will be substituted for any SKU that has been deleted from the catalog.If you’re using custom catalogs, make sure to add a “dummy” SKU to all existing catalogs.
Set the
SetCatalogRefs.substituteDeletedSkuIdproperty to the ID of the dummy SKU you created in step 1.Set the
SetCatalogRefs.substituteRemovedSkuproperty to true. If this property is true, the processor replaces any deleted SKU found in theOrderwith the SKU defined in thesubstituteDeletedSkuIdproperty.If the
Orderis in an open state, all dummy SKUs in theOrderare removed automatically by a later processor in therefreshOrderpipeline,RemoveExpiredCommerceItems. SeeRemoveExpiredCommerceItemsin the table above for more information.
To configure the refreshOrder pipeline to manage deleted products, do the following:
Create a new product in the product catalog. In an
Order, this “dummy” product will be substituted for any product that has been deleted from the catalog.Note: If you’re using custom catalogs, make sure to add a “dummy” product to all existing catalogs.
Set the
SetCatalogRefs.substituteDeletedProductIdproperty to the ID of the dummy product you created in step 1.Set the
SetProductRefs.substituteRemovedProductproperty to true. If this property is true, the processor replaces any deleted product found in theOrderwith the product defined in thesubstituteDeletedProductIdproperty.If you want all dummy products in an
Order(in an open state) to be removed later on in therefreshOrderpipeline by theRemoveExpiredCommerceItemsprocessor, set itsremoveItemsWithDeletedProductsproperty to true. (SeeRemoveExpiredCommerceItemsin the table above for more information.)
It’s important to note that deleting products and SKUs is not recommended because of its impact on customers’ order histories. Site pages that render order histories typically draw order information (descriptions, media, and so on) from product and SKU repository items. If those items are deleted, order histories cannot be rendered accurately.
If you need to remove products and SKUs from your database (for example, because of a high turnover rate), you should implement a strategy that addresses its impact on order histories. Possible strategies include:
Storing the relevant description information in the
CommerceItem. Note that this will cause a significant duplication of information across multiple items.Removing all historical orders that contain products or SKUs that have been removed.
Keeping all historical orders that contain products or SKUs that have been removed. These orders will display description information for the “dummy” SKUs and products instead of for the actual items that were purchased.

