Commerce Service Center uses four calculators for pricing exchange orders. There are two item pricing post calculators in /atg/commerce/custsvc/pricing/calculators:

There are two order pricing post calculators in /atg/commerce/custsvc/pricing/calculators:

The ReturnManagercontains the following exchange order calculator API. For additional information, refer to the ATG API Reference for Commerce Service Center:

public void calculateExchangeOrderPromotionDiscountValues(ReturnRequest
  pReturnRequest) throws ReturnException
public void calculateExchangeManualAdjustmentDiscountValues(ReturnRequest
  pReturnRequest) throws ReturnException

The ReturnManager contains a property to hold the generated GiftWIthPurchaseSelection and two APIs for generating the GiftWithPurchaseSelectionobjects and filtering the objects based on the gift items in the exchange order:

public Map<GWPMultiHashKey,GiftWithPurchaseSelection> getGWPSelections()
{
  return mGWPSelections;
}

public void setGWPSelections(Map<GWPMultiHashKey,
    GiftWithPurchaseSelection> pGWPSelections)
{
  mGWPSelections = pGWPSelections;
 }

...

public void generateGWPSelectionsForReturnItems(ReturnRequest
pReturnRequest) throws ReturnException

//this method will be called by the CSRGiftWithPurchaseSelectionDroplet to
produce selection links on the cart page.

public Collection generateFilteredReturnRequestSelections(ReturnRequest
pReturnRequest) throws MarkerException, ReturnException
{
  Map requestSelections pReturnRequest.getGWPSelections();
  if(requestSelections == null)
  {
generateGWPSelectionsForReturnItems(pReturnRequest);
requestSelections = pReturnRequest.getGWPSelections();
  }
}

The ReturnRequest contains the following exchange order API:

public Map getExchangeOrderPromotionValue()
public void setExchangeOrderPromotionValue(Map
  pExchangeOrderPromotionValue)

public Map getExchangeManualAdjustmentValue()
public void setExchangeManualAdjustmentValue(Map
  pExchangeManualAdjustmentValue)
Tiered Pricing and Exchanges

When you work with exchanges, tiered pricing produces the correct results, but exhibits the following behavior as a result of how the cost of exchange items is determined.

For example, in an order with a quantity of 7 items within the same tier levels, the original item would be priced at 2 at 50, 3 at 40, 2 at 30. In an exchange of 1 for 1, the expected refund would be $30 and the exchange order item would be $30, with a net no charge. However, because of the methodology used in pricing the exchange items in the promotion evaluation order, the exchange order item is priced at 50, and the refund is calculated at $50. This results in the expected net no charge for the 1 item in the exchange order. Additionally, if exchange order quantity increases to 2, the total would be $100 and the refund would be $70, with an expected net change of $30 for the additional item.

For additional information on pricing calculators, refer to the Pricing Overview section.