Assigning a catalog filter by modifying the contract XML
The storefront asset store base for default contract of a B2C store is not viewable in HCL Commerce Accelerator. For this reason, you must edit the contract XML when you want to change the name of the assigned catalog filter. You can use this procedure to assign catalog filter to other types of contracts if you do not want to use HCL Commerce Accelerator.
You might need a site administrator to assist you with this task because it involves querying database tables and editing XML files.
Before you begin
Query the HCL Commerce database to obtain the following values for the price rule
and contract:
- catalogFilterId
- The ID for the catalog filter you want to assign. The catalog filter must belong to either the
store that the contract belongs to or the related storefront asset store (for an extended site)To find the catalogFilterId, run the following SQL statement:
select * from catfilter;
- storeId
- The ID for the store to which the contract belongs. To find the
storeId
, run the following SQL statement:select * from storeent;
- contractId
- The ID for the contract you want to export.To find the
contractId
, run the following SQL statement:select * from contract;
Procedure
-
To export the contract to which you want to assign the price rule, issue the following URL
using the
storeId
andcontractId
: - Open the exported contract XML in an editor.
-
To determine whether the contract already has a catalog filter assigned, search for lines of
code similar to the following example:
<TermCondition type = "CatalogFilterTC" mandatory = "false" changeable = "false" > <Property name = "catalogFilterId" value = "catalogFilterId_value" /> </TermCondition>
-
Complete one of these steps, whichever one applies:
- If you found the lines of code in step 3, update the catalogFilterId_value to the catalogFilterId of the catalog filter you want to assign.
- If you did not find the lines of code in step 3:
- Locate the </BuyerContract> element.
- Above the </BuyerContract> element, copy the three lines of code from step 3.
- Replace catalogFilterId_value with the catalogFilterId of the catalog filter you want to assign, for example, 10001.
-
Search for the following string:
minorVersionNumber
-
Increase the value of
minorVersionNumber
by 1.You can only assign one catalog filter to the same contract.
- Save and close the contract XML.
- Import the contract to HCL Commerce by issuing the following URL: