Example: Understanding how prices are displayed on extended sites stores
Learn about the database relationships that are used to display prices on an extended sites store. These relationships are important because an extended sites store can use customer-specific prices, site-specific prices, or asset store-specific prices during runtime.
- To use customer-specific prices, an extended sites store must have a customer-specific contract with an associated price rule, which is responsible for pointing to a customer-specific price list.
- To use site-specific prices during runtime, the default contract or the base default contract must be associated to a price rule, which points to the store's default price list.
- To use shared pricing across extended sites stores, the storefront asset store's base default contract must be associated to a price rule, which points to an asset store-specific price list.
In all three scenarios, you must associate a price rule to your contract in order to use the correct price list at runtime. For more information about price rules, see Price rule assignment and contracts.
- 1 The STORECNTR database table defines the
relationship between a store and a contract. A store can be associated with multiple contracts. You
can use the CONTRACT database table to determine the types of contracts that are
associated to a store. You can have a default contract, Base for
default contract, Storefront asset store base for default contract, or
a customer specific contract.
- A default contract applies to all shoppers who browse the store and do not have any other associated customer contract.
- A Base for default contract is a base contract that can be shared by other contracts.
- A StorefrontAssetStore Base for default contract is a default base contract that is inherited by all associated extended sites stores. This contract is a reference contract for the store, which can be shared between multiple stores.
- A customer contract applies to a specific shopper account.
- 2 Each contract can have 'reference contracts', which are specified
in the TRADING database table. By default, the default contract for an extended
site store refers to the 'Base for default contracts', which refers to the 'StorefrontAssetStore
Base for default Contract' with a trading agreement type of 'Contract'
(Reftrading_Id). Therefore, all terms and conditions that are associated with the
referrer contracts are inherited. In this price list example, if a valid price rule is not
associated to the default contract, WebSphere Commerce checks its referrer contracts for valid price
rules. Note: It is not necessary that a customer-specific contract inherits from its default or base contracts.
In the image, you can see in the TRADING database table that 10504 (e-site default contract) references 10503 (e-site Base for default contract) which in turn references 10003 (SFAS Base Default Contract). The contract_Id is the same as the trading_Id.
- 3 Each contract has multiple terms and conditions that are
associated with it, which govern a seller's relationship with a buyer. For example, terms and
conditions can dictate the products and prices that a buyer is able to see on the storefront. For
price rules, from the TERMCOND database table, look at the termcond_Id's that have
tcsubtype_Id=PriceRuleTC. Ensure that the row with the relevant trading_Id
(contract_Id) has a pricerule_Id value in the Stringfield1 column of the table. The row that has a
value in the Stringfield1 column is the default price rule that is associated with this contract.
Each contract can have only one associated price rule at a time. If a
pricerule_Id does not exist for the specific row, WebSphere Commerce searches for rows with referrer
trading_Ids (trading_Id==reftrading_Id) and the tcsubtype_Id=PriceRuleTC condition. WebSphere
Commerce uses the first pricerule_Id that is returned within its referenced contracts.Note: If your price rule is not assigned to your customer contract or default contract as expected, then assign your price rule to a contract. For more information, see Assigning a price rule to a contract.In the image, Term condition 10005 is associated with trading_Id 10504 (e-site default contract), which has Stringfield1 (pricerule_Id) 10801. If a pricerule_Id did not exist for this record, WebSphere Commerce first checks termcond_Id=10004 for an associated price rule as the term condition belongs to the 'e-site base default contract'. Then, it would check termcond_Id=10003 for a price rule as it is associated to 'SFAS base default contract'. The key here is to ensure that for term condition 10005, the correct pricerule_Id exists in the Stringfield1 column unless you want your store to use the asset store-specific price rule.
- 4 Each store is associated with a number of offer price and list
price lists. The association is defined within the STORETPC database table. If you
encounter issues where the expected price list is not available in Management Center for a given
extended sites store, then the relationship between the price list and the store does not exist in
the STORETPC table. The table links the STOREENT_ID and the TRADEPOSCN_ID (which is
your price list).
In the image, 10701 is associated to tradeposcn_Id 11551, which is the store-specific price list. You can see from the name and description field of the TRADEPOSCN database table. Any price list that you want your store to use must be associated to the storeent_Id in the STORETPC database table.
- 5 A price rule has many elements that are either a condition or an
action. These elements are defined within the PRELEMENT database table and are
associated to a pricerule_Id. Ensure that this table contains the price list element that you want
your price rule to use. The element is described in the PRELEMENTATTR database
table with the specific tradepsocn_Id (price list).In the image, Prelement_Id 10006 is associated to tradepsocn_Id 11551 in the PRELEMENTATTR table. Prelement_Id 10006 means that the price rule element is referencing the store-specific price list (tradepsocn_Id 11551).Note: If the price list is incorrect, then you need to either fix your price rule in Management Center to reference the correct price list, or fix the term condition to reference the correct price rule.