In Oracle ATG Web 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 Appendix F, Pipeline Chains.
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.
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.Set the
SetCatalogRefs.substituteDeletedSkuId
property to the ID of the dummy SKU you created in step 1.Set the
SetCatalogRefs.substituteRemovedSku
property to true. If this property is true, the processor replaces any deleted SKU found in theOrder
with the SKU defined in thesubstituteDeletedSkuId
property.If the
Order
is in an open state, all dummy SKUs in theOrder
are removed automatically by a later processor in therefreshOrder
pipeline,RemoveExpiredCommerceItems
. SeeRemoveExpiredCommerceItems
in 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.Set the
SetCatalogRefs.substituteDeletedProductId
property to the ID of the dummy product you created in step 1.Set the
SetProductRefs.substituteRemovedProduct
property to true. If this property is true, the processor replaces any deleted product found in theOrder
with the product defined in thesubstituteDeletedProductId
property.If you want all dummy products in an
Order
(in an open state) to be removed later on in therefreshOrder
pipeline by theRemoveExpiredCommerceItems
processor, set itsremoveItemsWithDeletedProducts
property to true. (SeeRemoveExpiredCommerceItems
in 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.