Wednesday, March 21, 2012

Defining and Detecting Abandoned Orders : ATG Commerce

Defining Abandoned and Lost Orders

By default you can define what constitutes an abandoned and lost order using the following criteria:

number of idle days

minimum amount (optional)

You set these criteria for abandoned and lost orders in the following properties of the /atg/commerce/order/abandoned/AbandonedOrderService component:

idleDaysUntilAbandoned

idleDaysUntilLost

minimumAmount

For the default values of these properties see Configuring AbandonedOrderService later in this chapter. Note that an amount specified in the AbandonedOrderService.minimumAmount property is used as a criterion when detecting both abandoned and lost orders.

You may want to define different types of abandoned or lost orders. For example, you may want to differentiate between high-priced and low-priced abandoned orders in order to respond differently to each type. For information on this type of customization, see Customizations and Extensions in this chapter.



Detecting Abandoned and Lost Orders

The /atg/commerce/order/abandoned/AbandonedOrderService not only defines what constitutes an abandoned or lost order, but also queries the order repository for these types of orders according to the schedule that you specify in its schedule property. The default schedule is “every day at 3:00 AM.”

When an AbandonedOrderService job is run, the service queries the order repository for both abandoned and lost orders. The following table lists the criteria orders must meet to be identified as abandoned or lost:


Criteria for Identification as “Abandoned” Criteria for Identification as “Lost”
The order’s state matches one in the AbandonedOrderTools.abandonableOrderStatesproperty. Same
The order has no associated abandonmentInfo item or its abandonment state is REANIMATED. In other words, the order is either newly abandoned or re-abandoned. The order has no associated abandonmentInfo item or its abandonment state is not LOST. In other words, the order is newly lost.
The order has been idle for the number of days specified in theAbandonedOrderService.idleDaysUntilAbandoned property. The order has been idle for the number of days specified in theAbandonedOrderService.idleDaysUntilLost property.
The order’s subtotal is greater than or equal to the amount specified in theAbandonedOrderService.minimumAmount property, if set.
Same






See Configuring AbandonedOrderTools and Configuring AbandonedOrderService for information on setting the properties referenced in the table above.

For each abandoned order found, the AbandonedOrderService does the following:

Adds the order to the list of abandoned orders in the user’s abandonedOrders profile property.

If necessary, creates an abandonmentInfo item for the order; then updates the item with the relevant information:

The state property is set to ABANDONED.

The abandonmentDate property is set to the current date and time.

If the abandonmentInfo item is new, the abandonmentCount property is set to 1. Otherwise, it is incremented.

Fires an OrderAbandoned message if the AbandonedOrderTools.sendOrderAbandonedMessage property is set to true.

For each lost order found, the AbandonedOrderService does the following:

Removes the order from the list of abandoned orders in the user’s abandonedOrders profile property.

If the AbandonedOrderTools.deleteLostOrders property is set to true, the lost order is deleted from the order repository.

If the AbandonedOrderTools.leaveAbandonmentInfoForDeletedOrders property is set to true, the abandonmentInfo item for the order is updated with the relevant information:

The state property is set to LOST.

The lostDate property is set to the current date and time.

Fires an OrderLost message if the AbandonedOrderTools.sendOrderLostMessage property is set to true.

As previously mentioned, the AbandonedOrderService is a configured instance of class atg.commerce.order.abandoned.AbandonedOrderService. This class extends atg.service.scheduler.SingletonSchedulableService, which uses locking to enable multiple servers to run the same scheduled service while ensuring that only one instance performs the scheduled task at a given time.

No comments:

Popular Posts