Surcharges & discounts

What Shopware does out of the box and what the plugin adds

Shopware ships with Promotions and supports rules in the shipping price matrix. For discounts that is often enough. For surcharges, free items and notes it is not. Every row here has been checked in the Shopware source code.

TaskShopware standardWith the plugin
Automatic discount when a rule applies yes: Promotions with "No promotion code required": percentage, absolute, fixed price or free product, controlled by rules. yes: A discount as an item of its own, percentage or fixed amount.
Surcharge when a rule applies no: Not in Promotions: their calculators always deduct. With an app script a surcharge can be written in code. yes: Percentage or fixed amount, set up in the administration.
Discount or fee per payment method partly: Discount through a promotion with the Applied payment method condition. Not a fee, though; see the surcharge row. yes: Both, one item per payment method with its own rule.
Costs tied to the delivery yes: A shipping method's price matrix supports rules. The result appears in the shipping costs. partly: A surcharge or subsidy as a line of its own next to the shipping costs, for instance per bulky product. The shipping costs themselves remain the shipping method's business.
Put a product into the cart automatically no: Promotions change the price of products that are already in the cart. "Free product" is a 100% discount on such a product. yes: A Shopware product is added automatically, with its price or free of charge, with stock reduction.
A free insert as a visible line no: No setting for this, see above. yes: A pseudo product at €0.00, with image or symbol, removable if you like.
Quantity per product in the cart partly: A discount can be applied to certain products. yes: The item's quantity follows products, product groups or tags, per piece or per position.
Limit per customer yes: "Max. uses per customer" on the promotion. yes: "Maximum purchase per customer", summed over all quantities across previous orders.
A note in the product page buy box no: No setting on promotions or rules that places a message in the buy box. yes: In three places, in four colours, for selected products, groups or tags.

When Promotions are enough.

If you only want to give discounts, Shopware's standard features will get you a long way. A promotion with "No promotion code required" is applied automatically as soon as its conditions are met. It can work with a percentage, an absolute amount or a fixed price and can be limited per customer.

Where the plugin comes in.

As soon as something is to be added rather than deducted: insurance, a fee, a surcharge, an insert, a whole product. In the source code the Promotions calculators always deduct, and they only change the prices of products already in the cart.

With app scripts a developer can write surcharges and discounts in code. The plugin turns that into settings in the administration, with notes and quantity.

Only with the pluginRule Builder

  • Applied payment methodIs one of Cash on delivery

Cash on delivery fee €5.00

Both can be combined: discounts keep running through Promotions, surcharges and free items through the plugin. Both use the same rules from the Rule Builder.

Examples Calculation

Sources: what Shopware itself writes, and what the law says.

Quoted word for word, with the source. The table above rests on the Shopware 6.7 source code; here are the places to read it for yourself.

Discounts apply by themselves

The Shopware documentation on promotions: “No promotional code required: No separate entry is required for the promotion to be applied.” That is the first row of the table. Source: Shopware documentation, Promotions.

The discount calculators always deduct

In the Shopware source code the percentage calculator sets the value with -abs($definition->getPercentage()), the absolute one with -min(abs($definition->getPrice()), $totalOriginalSum). Whatever is entered, the result is a deduction, never a surcharge. Sources: DiscountPercentageCalculator, DiscountAbsoluteCalculator.

A surcharge only comes as code

The Shopware developer documentation on app scripts: “The surcharge() methods creates a new surcharge line-item with the given type and value.” So a surcharge is possible, but as a script in an app, not as a setting in the administration. Source: Shopware developer documentation, cart manipulation script services.

What gets asked in the Shopware forum

A thread in the Shopware forum consists of exactly one question (translated from German): “How can I add a fee to the cash on delivery payment method?” The standard has no field for that on the payment method. With the plugin it is an item with the condition Applied payment method. Source: Shopware forum, German.

And the law: Under § 312a BGB (4) of the German Civil Code, a fee for a means of payment is void towards consumers if there is no common and reasonable free payment option for them, or if it exceeds the costs the business incurs for that means of payment. Under § 270a BGB a fee for SEPA direct debit, SEPA transfer and, with consumers, payment cards is void. And under § 312a BGB (3), in e-commerce a payment beyond the main service only becomes part of the contract if the business does not bring it about through a default setting. The plugin calculates what you set up; whether a fee or a surcharge is permissible in your shop is something to settle with your legal adviser.

Sources

Ready to let your cart do the maths?

Put a product into the cart in the demo shop and watch the items appear. Or try it free for 30 days in your own shop.

Open the demo shop View in the store