Variant Price Surcharge: Configuration
Configuring Variant Price Surcharge: base variant and surcharge in the variant form, per-channel overrides, formula with worked examples, global switch, overview and the cases where no surcharge applies.
Variant Price Surcharge: Configuration
The plugin has no configuration file. Everything happens in the admin: in the variant form (global and per channel), on a settings page with one global switch, and in an overview of all surcharges.
Setting a surcharge on a variant
Open a product, edit a variant and scroll to the Price surcharge section. It contains four fields that apply to every channel unless you override them there:
| Field | Default | Meaning |
|---|---|---|
| Base variant | off | This variant provides the reference price for all other variants of the same product. It always keeps its own price. The field applies to the whole product and cannot be overridden per channel |
| Apply surcharge | off | The price of this variant is calculated from the price of the base variant |
| Percentage | 100 | 100 leaves the price unchanged, 150 means 50 percent more, 50 means 50 percent less. Allowed values are 0 to 100000 with two decimals. An empty field counts as 100 |
| Fixed surcharge | 0 | Amount added to the base price before the percentage is applied. An empty field counts as 0 |
The help text in the form sums up the rule: mark exactly one variant of the product as base variant. Every other variant with the surcharge enabled is priced at (base price + fixed surcharge) x (percentage / 100).
The plugin does not check that a product has only one base variant. If you mark several, it uses one of them and you cannot control which. Keep exactly one base variant per product.
Overriding settings per channel
Below the global fields, the section Per-channel overrides has a collapsible entry for every channel. There you can set three values for exactly that channel:
| Field | Choice or input | Meaning |
|---|---|---|
| Apply surcharge | Inherit global value, Yes, for this channel, No, for this channel | Turns the surcharge on or off for this channel only. With "Yes" it applies even when the global field is off |
| Percentage | Number or empty | Empty takes the global percentage |
| Fixed surcharge | Amount or empty | Empty takes the global surcharge. You enter it in the base currency of this channel |
The override works field by field: a field you leave empty or at "Inherit global value" takes the global value, even if you overrode the other fields of the same channel. A channel without any override behaves like the global values. The global switch (see below) and the base variant cannot be overridden per channel.
On a base variant, the plugin removes all per-channel overrides when saving, because the base variant never gets a surcharge. It also does not store entries where every field is set to inherit.
How the price is calculated
price = (base price + fixed surcharge) x (percentage / 100)
- The base price is the price of the base variant in the current channel, as Sylius reports it. Catalog promotions that apply to the base variant therefore carry over to the variants with a surcharge.
- The fixed surcharge is stored in the smallest currency unit (cents). In the form you enter it as an amount, for example
5.00. - The result is rounded to whole cents and is never below 0.
- For the current channel, the plugin takes surcharge enabled, percentage and fixed surcharge from that channel's override, otherwise from the global values. The base price comes from the base variant per channel.
Examples with a base variant priced at 20.00:
| Percentage | Fixed surcharge | Result |
|---|---|---|
| 150 | 0 | 30.00 |
| 100 | 5.00 | 25.00 |
| 50 | 0 | 10.00 |
| 120 | 5.00 | 30.00 |
When no surcharge applies
The variant keeps its own price in any of these cases:
- The global switch is off.
- No surcharge is stored for the variant.
- Apply surcharge is off in the current channel: either the global setting is off and the channel does not override it, or the channel is set to "No, for this channel".
- The variant is itself marked as base variant.
- The product has no base variant.
- An error occurs while resolving the surcharge. The plugin then writes a log entry at level
errorand returns the variant's own price.
Global switch
Menu path: MMKreativ Plugins > Price surcharges in the admin sidebar. The page is titled Price surcharge settings.
| Setting | Default | Effect |
|---|---|---|
| Enable price surcharges | on | When off, every variant in the shop is priced at its regular price. Configured surcharges stay stored and take effect again as soon as you switch it back on |
The switch applies to the whole shop and cannot be overridden per channel. After saving, the message "Settings have been saved." appears. Without a stored settings row the switch counts as on. The menu entry belongs to the MMKreativ Plugins group, which several plugins share.
Overview of surcharges
The Overview button at the top of the settings page opens the Price surcharges list. It has one row per stored surcharge, newest first:
| Column | Content |
|---|---|
| ID | Internal ID |
| Product / variant | Link to edit the variant |
| Base variant | Yes/No |
| Apply surcharge | Yes/No, the global value only |
| Percentage | Global value as stored |
| Fixed surcharge | Global value in cents, not a formatted amount |
Each row has a Delete action. It removes the variant's surcharge configuration including its per-channel overrides and leaves the variant itself untouched. The list is read-only, you make changes in the variant form.
The Apply surcharge column shows the global field only. A variant that gets a surcharge only through a per-channel override still appears there as "No".
A row is only created once you save the variant with Base variant or Apply surcharge enabled, or with at least one channel carrying its own setting.
Practical examples
Size ladder: Variant "S" is the base variant at 20.00. On "XL" you enable the surcharge with a percentage of 150 and get 30.00.
Premium edition: The standard variant is the base variant. On the premium variant you enable the surcharge with a percentage of 100 and a fixed surcharge of 15.00. It always costs 15.00 more than the base variant, even when you change the base price.
Different percentage in one channel: "XL" has a global percentage of 150. In the business customer channel you set the percentage to 130 and leave everything else at inherit. With a base price of 20.00, "XL" then costs 26.00 there and 30.00 in all other channels.
Pause surcharges shop-wide: Switch off Enable price surcharges. All variants immediately show their own stored price.