(Enterprise)

Registering custom command implementations in the command registry

If the store uses custom commands that handle pricing terms for contracts that do not use price rules, we must register the command implementations. This is required so that we can continue to use our custom command implementations for existing contracts, and also use price rules for new or updated contracts.

This task applies to stores that have already been enabled to use price rules according to Task flow: Set up an existing store to use Management Center price rules and price lists. This task also applies to new starter stores published after installing WebSphere Commerce Version 7 Feature Pack 2, if you customize commands that handle pricing terms.


Task info

This task applies to:


Procedure

  1. Review the following SQL statements; then run the statements that apply to commands you have customized.

    In each SQL statement, replace the STOREENT_ID variable with the actual STOREENT_ID of the target store:

    • To change the storefront price calculation command, use the following SQL statement. Replace com.mycompany.MyGetProductContractUnitPriceCmdImpl with the actual command implementation class name.

        UPDATE CMDREG SET CLASSNAME = 'com.mycompany.MyGetProductContractUnitPriceCmdImpl' 
        WHERE INTERFACENAME = 'com.ibm.commerce.price.commands.GetProductContractUnitPriceCmd+AfterCompositeSecondary' 
        AND STOREENT_ID = STOREENT_ID;

    • To change the shopping cart or current order price calculation command, use the following SQL statement. Replace com.mycompany.MyGetContractUnitPriceCmdImpl with the actual command implementation class name.

        UPDATE CMDREG SET CLASSNAME = 'com.mycompany.MyGetContractUnitPriceCmdImpl' 
        WHERE INTERFACENAME = 'com.ibm.commerce.price.commands.GetContractUnitPriceCmd+AfterCompositeSecondary' 
        AND STOREENT_ID = STOREENT_ID;

    • To change the order price calculation command, use the following SQL statement. Replace com.mycompany.MyGetContractSpecialPriceCmdImpl with the actual command implementation class name.

        UPDATE CMDREG SET CLASSNAME = 'com.mycompany.MyGetContractSpecialPriceCmdImpl' 
        WHERE INTERFACENAME = 'com.ibm.commerce.price.commands.GetContractSpecialPriceCmd+AfterCompositeSecondary' 
        AND STOREENT_ID = STOREENT_ID;

  2. Restart the WebSphere Commerce server for the commands to take effect. Alternatively, we can use the procedure Updating registry components, and select the Commerce Commands component.

Previous topic: Registering new command implementations in the command registry
Next topic: Registering your existing offer and list price lists in the STORETPC table


Related concepts
Price rules: An overview
Price lists