This section provides information on how to customize or extend the Abandoned Order Services module in the following ways:

Defining Additional Types of Abandoned and Lost Orders

While the default implementation of the Abandoned Order Services module enables you to identify both abandoned and lost orders, some sites may require more granularity. For example, you may want to differentiate between high-priced and low-priced abandoned orders in order to respond differently to each type via scenarios and other campaigns. This section describes how to customize the module in this way, using this very example of high-priced and low-priced abandoned orders. You could use the same process to define and manage additional types of lost orders.

First, configure an instance of atg.commerce.order.abandoned.AbandonedOrderTools for each type of abandoned order you want to manage. The AbandonedOrderTools component stores the definitions of abandonment states, including the default states. In this example, you’ll need to configure two instances, one for high-priced abandoned orders and a second for low-priced abandoned orders. The following table describes how to configure each component:

Component

Description of Configuration

AbandonedOrderTools #1
for high-priced abandoned orders

Set the defaultAbandonedState property to HIGH_ABANDONED.

Set the reanimatableAbandonmentStates property to the list of all possible states that an order can be in to be considered for identification as reanimated. In this example, set the property to:

HIGH_ABANDONED, LOW_ABANDONED, LOST

Configure the remaining properties as necessary.

AbandonedOrderTools #2
for low-priced abandoned orders

Set the defaultAbandonedState property to LOW_ABANDONED.

Set the reanimatableAbandonmentStates property to the list of all possible states that an order can be in to be considered for identification as reanimated. In this example, set the property to:

HIGH_ABANDONED, LOW_ABANDONED, LOST

Configure the remaining properties as necessary.

Then, configure an instance of atg.commerce.order.abandoned.AbandonedOrderService for each type of abandoned order you want to identify and manage. Again, in this example you’ll need to configure two instances, one for high-priced abandoned orders and a second for low-priced abandoned orders. The following table describes how to configure each component:

Component

Description of Configuration

AbandonedOrderService #1
for high-priced abandoned orders

Set the minimumAmount property as desired, for example, to $100 dollars.

Set the abandonedOrderTools property to point to the AbandonedOrderTools component you created for high-priced orders.

Set the schedule property so that this service runs before the AbandonedOrderService that you created for low-priced abandoned orders. Otherwise, the latter service will return and identify both the high-priced and low-priced orders as abandoned.

Configuring the remaining properties as necessary.

AbandonedOrderService #2
for low-priced abandoned orders

Set the minimumAmount property as desired, for example, to $10 dollars.

Set the abandonedOrderTools property to point to the AbandonedOrderTools component you created for low-priced orders.

Set the schedule property so that this service runs after the AbandonedOrderService that you created for high-priced abandoned orders. Otherwise, this service will return and identify both the high-priced and low-priced orders as abandoned.

Configuring the remaining properties as necessary.

Modifying the Criteria Used to Identify Abandoned and Lost Orders

As described in Detecting Abandoned and Lost Orders, the /atg/commerce/order/abandoned/AbandonedOrderService uses a specific set of criteria when it queries the order repository for orders to identify as abandoned and lost. (See that section for the list of criteria.) The queries used are returned by the following methods of class atg.commerce.order.abandoned.AbandonedOrderService:

  • generateAbandonedQuery(), which returns a query created from the following sub-queries:

    • getDateQueryForAbandonedOrders()

    • getOrderStatesQuery()

    • getAbandonmentInfoQueryForAbandonedOrders()

    • getMinimumAmountQuery()

  • generateLostQuery(), which returns a query created from the following sub-queries:

    • getDateQueryForLostOrders()

    • getOrderStatesQuery()

    • getAbandonmentInfoQueryForLostOrders()

    • getMinimumAmountQuery()

For details on these methods, see atg.commerce.order.abandoned.AbandonedOrderService in the ATG API Reference.

If desired, you can modify the criteria used to identify abandoned or lost orders. To do so, create a class that extends atg.commerce.order.abandoned.AbandonedOrderService and overrides the appropriate method listed above. Then configure an instance of your custom class in Nucleus by layering on a configuration file for the /atg/commerce/order/abandoned/AbandonedOrderService.

 
loading table of contents...