product_alternatives.cfg configuration controls the alternative product data. It lets the shop show certain buyers different prices or different product data without changing anything in the regular data set.
The file consists of a list of entries. Each entry describes three things: how the deviation comes about, who it applies to, and when it applies. If more than one entry matches, the priority decides.
Alternative product data must be enabled for your shop. Without this activation, the shop doesn’t read the file at all. Contact your WEBSALE representative about this.
Where the file is located
The file is located directly in the shop’s configuration directory:ValidInSubShops-List parameter exists, which lets you restrict a single entry to specific subshops.
The shop treats lines that start with # as comments.
Basic structure
+Entry section can occur any number of times.
Identity and mode
The three modes differ in where the deviating data comes from:
The alternative product data file
In all three modes, the deviating data is stored in a second file next to the regular product data file. Here you enter only the additional characters of the file name. If the original product data is in1234.prd and the alternative data is in 1234.prd-apd, the entry is -apd.
The shop doesn’t even read the other of the two parameters. An
AlternativeProductDataFileExtension in a PriceRule entry therefore has no effect, and the same applies the other way around.Strikethrough prices
Validity
Price rule
These parameters apply only withType = PriceRule.
The shop then calculates
price minus price times percentage divided by 100 or price plus price times percentage divided by 100.
Without a percentage in
PriceRuleParameter1, the price remains unchanged, even if PriceRule is set. The same applies to a percentage of 0 or less.The parameters PriceRuleParameter2 and PriceRuleParameter3 also appear in the file. The shop reads them but currently doesn’t evaluate them when calculating prices. They’re intended for future calculation rules. This isn’t documented and has been added here.Conditions
In theConditions subsection, you define who the entry applies to.
The logical combination results from the nesting:
- Multiple
+ConditionSetblocks are combined with or. It’s enough for one set to match. - Multiple
+Conditionblocks within a set are combined with and. All of them must match.
If multiple valid URL parameters are used during a session, the shop remembers the most recently found valid combination of name and value.
Which entry wins
On every request, the shop checks all entries in the file in order and keeps the winner for the duration of the request. An entry is only considered if it passes the test mode, the validity period, and the subshop restriction and its conditions match. If several entries remain after that,Priority decides.
When an entry doesn’t apply
The following causes all result in a seemingly correct entry having no effect. None of them produces a visible error message. The feature isn’t enabled for the shop. In that case, the shop doesn’t read the file, regardless of its content. The file is missing or in the wrong location. The shop expects it directly underkonfiguration/, not in a subshop subdirectory.
The value of Type isn’t one of the three allowed values. A typo in AlternativeProductDataFields-Complementary is enough.
The timestamp is formatted incorrectly. This makes the entry invalid, not valid indefinitely.
Another entry has the lower Priority. See above.
The alternative product data file doesn’t exist. For each product, the shop checks whether the file with the configured extension actually exists in the product data directory. If it’s missing, that product keeps its regular data.
For troubleshooting in the shop itself, there are tags with the prefix
APD-. In test mode, you can use them to output which entry has currently won, with which mode, file extension, and validity.