Skip to main content
The discount.dat configuration defines the discount groups that WEBSALE V8s uses to grant the group discount. Each line is one level of a tier scale, based either on order quantity or on order value. You do not create this file by hand. It is written by the WSPManager or by the connected merchandise management system as soon as you assign products to a discount group there. Rabattgruppen 1
A product can only ever belong to one discount group.
Guide: Defining discounts · Reference: GD tags for group discounts, shop.config, basket and checkout process · Basics: Configuration basics

Where the file is located

The file is located in the configuration directory of the subshop:
There is a fallback level for the product data export. If the export does not find a file there, it falls back to a discount.dat directly in the shop’s configuration directory, that is, one level higher and without a subshop subdirectory. This lets you maintain a shared tier scale for all subshops. This fallback level is not documented and is added here.

Structure

The file is tab-separated. The first line contains the column names, and from the second line onward there is one line per discount level. The WSPManager writes the following column names. If you connect a merchandise management system, it must use the same names. Example of a file with two discount groups. Winterware is tiered by quantity, Zubehoer by merchandise value, and the third level of Winterware only applies in a specific period. The tab character is shown as (TAB):
Column names are matched case-insensitively, and the order of the columns is free. The shop does not evaluate more than ten columns. Neither is documented, and both are added here.

When the shop reads the file

The shop does not read discount.dat on every request, but only when at least one item in the basket has a DiscountID. This leads to a useful diagnostic rule: If a group discount does not take effect, first check whether a discount group is assigned to the product at all. A correctly maintained discount.dat has no effect as long as no product refers to it.

Which lines are discarded

Not every line in the file ends up in the tier scale. The following rules are not documented and are added here. Expired and future periods drop out. If ValidFrom is in the future or ValidUntil is in the past, the shop skips the line completely. It then does not appear in the tier display either. A timestamp must be complete. The YYYYMMDDhhmmss format has fourteen digits. Shorter values cause the line to be discarded during the product data export. So write 20261201000000, not 20261201. Empty required values discard the line. A line without DiscountID, with a Type other than 1 and 2, with a discount rate of 0 or less, or with an Amount of 0 or less is skipped. If one of the four required columns is missing from the header line, the entire file is ignored. This affects DiscountID, Type, Discount, and Amount. ValidFrom and ValidUntil may be missing. The shop does not report this as an error; the discount simply does not apply.

How the shop normalizes the tiers

The shop does not use the file as it stands. It first builds a cleaned-up tier scale from it. This explains why the displayed tier scale sometimes has fewer levels than the file has lines. For each combination of DiscountID and Type, the cleanup runs in four steps:
  1. Lines whose Amount is less than or equal to an Amount further down in the same group drop out. With contradictory levels, the later line in the file wins.
  2. The remaining levels are sorted by DiscountID, Type, and Amount.
  3. Adjacent levels with an identical discount rate are merged into the smallest Amount. Two levels with ten percent each from quantity 10 and from quantity 25 therefore result in a single level from quantity 10.
  4. Leading levels with a discount rate of 0 are removed.
The output via the GD- tags uses the normalized tier scale, not the file contents. If a level is missing in the shop even though it is in the file, it has most likely fallen victim to one of these four steps.
Reference: GD tags for group discounts

Interaction with other discounts

You control whether and how the group discount interacts with the other discount types in the OrderConditions section of the shop.config. The most important switches for this are:
ConsiderProductGroupDiscountForOrderDiscount and UseOnlyHighestDiscount are mutually exclusive. If you set both at the same time, the shop writes a critical error to the log and ignores ConsiderProductGroupDiscountForOrderDiscount.This relationship is not documented and is added here.
If the “customer discount only” lock is set for a customer, the group discount does not apply to them at all.

During the product data export

The product data export evaluates the same file when it passes prices to price comparison portals. A special rule applies there that follows from the nature of the export: it prices a single unit. That is why, of the quantity tiers with Type = 1, it only considers levels with an Amount of 1 or less. A tier that only applies from ten units does not appear in the exported price. Value tiers with Type = 2, on the other hand, apply as soon as the unit price reaches the Amount.
If several matching levels apply in the export, the one with the highest discount rate wins. Whether the group discount is deducted there in addition to the order value discount, or only the higher of the two, depends on the same setting as in the shop.