It is possible to adjust an order total by a fixed amount. Adjustments can either be a fixed increase (debit) or decrease (credit) to the order total. The details of a manual adjustment such as the amount, adjustment type and reason code are permanently stored within the database. Any manual adjustments that exist for an order at the time the order is priced will always be applied. For information on the corresponding ATG Commerce API, refer to the ATG Commerce Programming Guide.

All manual adjustments are created as transient repository items. Subsequent processing in the updateOrder pipeline determines if the adjustments is permanently added to the repository based on the following rules.

  • All adjustments created for submitted orders are unconditionally persisted to the repository. As configured by default, this is the only time ATG Commerce and CSC unconditionally saves adjustments to the repository.

  • All adjustments created for persistent, incomplete orders are conditionally saved based on configuration. CSC uses a Boolean configuration setting, whose default value is false, that determines if adjustments should be saved immediately for persistent, incomplete orders.

The Commerce updateOrder pipeline contains a processor that saves the manual adjustment items to the repository when appropriate. saveManualAdjustment executes the atg/commerce/order/
processor/SaveManualAdjustments
processor with the following two processor configurations:

#
# The processor will save the manual adjustments to the repository for
# orders in these states, depending on the value of saveIncomplete
# saveForIncompleteOrders
#

incompleteStates^=/atg/commerce/order/OrderLookupService.incompleteStates

#
# The processor will save the manual adjustments to the repository for
# orders in the configured incomplete states if this property is true.
# Otherwise, the manual adjustments are not saved for incomplete orders.
#

saveIncompleteOrderAdjustments=false

Important: Be aware of a condition that may occur when saving incomplete manual adjustments. Manual adjustments are, by default, applied unconditionally. Once added to the order, manual adjustments affect the order’s price despite the contents of the order. This is important if an incomplete order is saved with manual adjustments as subsequent changes to the order at checkout time will not change any adjustments that have been applied. For example, if an agent applies a $20 credit adjustment to an order with $100 merchandise and saves it in an incomplete state, the customer could return and remove $80 worth of merchandise from the order and checkout with a $0 total. As such, the processor is configured by default to not save manual adjustments for incomplete orders.

The OrderAdjustmentCalculator adjusts the order’s subtotal based on the manual adjustments associated with the order. The /atg/commerce/pricing/calculators/
OrderAdjustmentCalculator
component contains the following configuration:

$class=atg.commerce.pricing.OrderAdjustmentCalculator
pricingTools=/atg/commerce/pricing/PricingTools

The adjustment calculator is added as a postCalculator in the /atg/commerce/pricing/
OrderPricingEngine
. As such, the calculator runs after the pre-calculators and all calculators associated with any promotions for the order. The configuration for the OrderPricingEngine is:

postCalculators+=\
      calculators/OrderAdjustmentCalculator

For additional information on pricing and calculators, refer to the ATG Commerce Programming Guide.

 
loading table of contents...