WebSphere Commerce EnterpriseIntroduced in Feature Pack 2

Registering custom command implementations in the command registry

If your store uses custom commands that handle pricing terms for contracts that do not use price rules, you must register the command implementations. This is required so that you can continue to use your 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: Setting 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.

About this task

This task applies to:
  • Single stores (stores that are not extended site stores)
  • Extended sites

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, you can use the procedure Updating registry components, and select the Commerce Commands component.