Blog

Sales Center returns incorrect Floor Price with new price Commands after updating WebSphere Commerce Enterprise to V7. FEP 6

Problem Abstract:

IBM Sales-Center has the capability for a Customer Service Representative (CSR) to override an existing item price.

IBM provides several features:

1. Restricting CSR’s to allow overriding price on particular catalogs/categories/products.
2. Defining the Maximum Limit, so that CSR cannot override price beyond that limit.
3. Restricting Price-Override access to only specific Users and lot more.

All this can be done by creating Price-Override Limits in Accelerator. Please click here for more information.

With Commerce Enterprise V7. FEP 6,  Sales Center returns incorrect Floor Price with new pricing Commands.  We have lots of changes in price Commands to support multiple Price List’s.

1. With new pricing Commands, Commerce is no longer returning exact floor price in Sales-Center.
2. Due to the above-mentioned issue, orders are always getting blocked when CSRs try to perform a Price-Override in Sales-Center.
3. This is creating additional work for CSRs, by requiring them to always resolve the block for the order manually.
4. Before IBM introduced new pricing commands, orders would be blocked only when a CSR tries to give a greater discount than what s/he was entitled to give. (Which will be declared while creating Price-Override Limits)

Reason:
1.When a Price-Override was created in Accelerator, it always creates two entries in PARTICIPNT table with PARTROLE_ID as (0,15)
0 = creator and 15 = service representative.
2.Price-Override trading agreement will be associated with these two roles.
3.With new pricing commands, it is always considering trading agreement in PARTICIPNT table with PARTROLE_id=2. So it’s not returning exact floor price, that it suppose to.

Solution:
We can do this in two ways:
1.Insert an entry manually in PARTICIPNT table with PARTROLE_ID=2, for each price override trading agreement per memberGroup.
2.FloorPrice will be retrieved using FloorPriceLookupCmd.In this we are calling GetContractUnitPriceCmd.So extend this cmd, override that particular method where we are invoking GetContractUnitPriceCmd. call old price GetContractUnitPriceCmdImpl

We need to do this if the request is coming from Sales Center. For all the remaining requests we need to invoke existing logic i.e (CatalogFilterGetContractUnitPriceCmdImp).

In VFCFloorUnitPriceCmdImpl
protected GetContractUnitPriceCmd getPriceCmd() throws ECException
{
String commandName=”com.ibm.commerce.price.commands.GetContractUnitPriceCmd”;
if(Request is coming from sales center)
commandName=commandName.concat(“+SCFloorPricing”);

                      GetContractUnitPriceCmd priceCmd =
(GetContractUnitPriceCmd)CommandFactory.createCommand(commandName,getStoreId());
return priceCmd;
}

And insert a CMDREG entry for this INTERFACENAME “com.ibm.commerce.price.commands.GetContractUnitPriceCmd+SCFloorPricing” and CLASSNAME “com.ibm.commerce.price.commands.GetContractUnitPriceCmdImpl”.

 

Note:
Here is the sql which checks for patrol as 2, to determine trading id:

SELECT T.trading_id, T.account_id, T.endtime FROM PARTICIPNT P, TRADING T, STORECNTR S WHERE T.trading_id = P.trading_id and T.trading_id = S.contract_id and S.store_id = ? and P.partrole_id = 2 and P.termcond_id is null and (P.member_id = ? or P.member_id = ? or P.member_id is null) and T.state = 1 and T.markfordelete = 0 and T.trdtype_id = ? and (T.starttime < ? or T.starttime is null) and (T.endtime > ? or T.endtime is null) UNION SELECT T.trading_id, T.account_id, T.endtime FROM PARTICIPNT P, TRADING T, STORECNTR S, mbrrel M WHERE T.trading_id = P.trading_id and T.trading_id = S.contract_id and S.store_id = ? and P.partrole_id = 2 and P.termcond_id is null and P.member_id = M.ancestor_id and M.descendant_id = ? and T.state = 1 and T.markfordelete = 0 and T.trdtype_id = ? and (T.starttime < ? or T.starttime is null) and (T.endtime > ? or T.endtime is null) UNION SELECT T.trading_id, T.account_id, T.endtime FROM PARTICIPNT P, TRADING T, STORECNTR S, mbrgrpmbr M WHERE T.trading_id = P.trading_id and T.trading_id = S.contract_id and S.store_id = ? and P.partrole_id = 2 and P.termcond_id is null and P.member_id = M.mbrgrp_id and M.member_id = ? and M.exclude=’0′ and T.state = 1 and T.markfordelete = 0 and T.trdtype_id = ? and (T.starttime < ? or T.starttime is null) and (T.endtime > ? or T.endtime is null) order by trading_id”;