(Enterprise)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 WebSphere Commerce Accelerator. For this reason, edit the contract XML when we want to change the name of the assigned catalog filter. We can use this procedure to assign catalog filter to other types of contracts if you do not want to use WebSphere 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 beginning
To learn more about assigning catalog filters to contracts for different business models, read Catalog filter assignment and contracts.Query the WebSphere Commerce database to obtain the following values for the price rule and contract:
- catalogFilterId
- The ID for the catalog filter we 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 we want to export.To find the contractId, run the following SQL statement: select * from contract;
Procedure
- To export the contract to which we want to assign the price rule, issue the following URL using the storeId and contractId:
- 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 we want to assign.
- If we 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 we want to assign, for example, 10001.
- Search for the following string: minorVersionNumber
- Increase the value of minorVersionNumber by 1.
We can only assign one catalog filter to the same contract.
- Save and close the contract XML.
- Import the contract to WebSphere Commerce by issuing the following URL:
Results
The catalog filter is now assigned to the contract. The customer entitled to the contract can not browse and buy the products filtered by this catalog filter.