Customize to allow multiple manual adjustments in the getOrderPrice API

The default integration configuration supplies a manual adjustment apply policy, FixedReplacement, to the getOrderPrice API. A CSR can make a single adjustment against an order for each of the three adjustment types: LineAdjustment, OrderAdjustment, or ShipmentAdjustment. To support receipt of more than one order, line, or shipment manual adjustment, perform the following customization.


Procedure

  1. In <INSTALL_DIR>\bin\resources.jar, open the file GetOrderPriceToProcessOrderInput.xsl and locate the CalculationInfo section. Replace the following at the line, order, and or shipment level(s):

      <_ord:AdjustmentApplyPolicy>
      <xsl:text>FixedReplacement</xsl:text>

    with

      <_ord:AdjustmentApplyPolicy>
      <xsl:text>FixedAdjustment</xsl:text>

  2. Restart the Sterling application.

Next, customize WebSphere Commerce.

  1. To enable the manual adjustment policy, run the applicable SQL commands:

    • For an order-level adjustment (OrderAdjustment):

        UPDATE CALRANGE SET CALMETHOD_ID=-13 WHERE CALRANGE_ID=-11;
        UPDATE CALRLOOKUP SET VALUE=0 WHERE CALRLOOKUP_ID=-11;

    • For a shipping-level manual adjustment (ShippingAdjustment):

        INSERT INTO CALMETHOD VALUES (newidXXXXX, -1, -7,      'com.ibm.commerce.order.calculation.FixedAmountCalculationRangeCmd' ,      'method for a shipping discount range returning a  fixed discount' , 10,      'CalculationRange',NULL);
        
        UPDATE CALRANGE SET CALMETHOD_ID = newidXXXX;
        UPDATE CALRLOOKUP SET VALUE=0 WHERE CALRLOOKUP_ID=-12;

  2. Refresh the registry or restart the server.