Zum Inhalt springen
Shopware 6 Manual

Disposal charge

Disposal charges do not belong in the product price: this plugin works out the charge per product from material and weight and adds it to the cart as its own line item.

Version 6.7.1 Compatible with 6.7.0 und neuer 16 min read
On this page

Introduction

Disposal charge helps you show the statutory disposal charge required by packaging legislation separately from the product price.

What you achieve with this plugin

  • You record which packaging material applies to each product — the plugin works out the amount itself.
  • Your customers see the charge on the product page, not only at checkout.
  • In the cart the charge appears as its own clearly named line — it does not disappear into the product price.
  • You can let your customers choose the charge or calculate it for every order.
  • You decide for each sales channel individually whether the charge is applied at all.

Who is this plugin for?

For every shop owner who has to — or wants to — show disposal or recycling charges separately from the goods price, for example for packaging, electrical appliances or batteries. No technical knowledge is required.

Installation

After your purchase, the plugin is available directly in your administration — there is nothing to download.

  1. Log in to your Shopware administration (YourShop.com/admin)
  2. Open Extensions → My extensions in the menu on the left
  3. Find the entry Disposal charge in the list and click Install next to it
  4. Then switch the plugin on using the toggle next to the entry — that is all.

Plugin installed and active Fig. 1: The “Disposal charge” entry under “My extensions” — switched on, with the version and the “Configure” link.

As soon as the plugin is switched on, it adds the input fields for the charge to your products. From now on you will find them on every product under Specifications → Custom fields.

If Disposal charge does not appear in the list, your Shopware account is not yet connected to the shop. You can do this under Extensions → My extensions by logging in with your Shopware account.

Getting started

This is how you get your first charge into the shop within a few minutes:

  1. Open the settings: Click Configure next to Disposal charge, or go to Settings → Extensions → Disposal charge.

    The plugin configuration page Fig. 2: The configuration page with the sales channel selection, the switch for the channel and the basic configuration.

  2. Decide how the customer sees the charge: Under Basic Configuration, the entry Show the disposal charge to the customer as determines whether your customers may select and deselect the charge themselves. See Settings for details.

  3. Create a charge product: This is the product that represents a material such as “Plastic packaging” and carries the price per weight unit. See Step 1: Create the charge product.

  4. Assign the charge to a product you sell: On that product you switch the calculation on and select the charge product — see Step 2: Assign the charge to the product you sell.

  5. Check the result: Open the product in your shop. The charge line with the calculated amount now appears below the Add to shopping cart button.

Important: The order of steps 3 and 4 matters. Only once a charge product exists can you select it on the product you sell.

Settings

You will find the settings under Settings → Extensions → Disposal charge. You get there just as quickly via Extensions → My extensions and the Configure link next to the Disposal charge entry.

At the very top you first select the Sales Channel. Everything you set below applies to exactly that channel. The value All Sales Channels defines the basic setting for your entire shop. After every change, remember the Save button in the top right corner.

Enable plugin for this sales channel

The switch Enable plugin for this sales channel determines whether a disposal charge is calculated and displayed in this channel at all. It is switched on by default.

What this is good for: If you run several sales channels — for example a consumer shop and a dealer shop — you can apply the charge only where it belongs. Switch the channel at the top, turn the switch off and save. Your products remain untouched: as soon as you switch it back on, the plugin calculates exactly as before.

Right next to it you will find the to documentation button. It takes you to this manual online at any time.

Show the disposal charge to the customer as

Here you define how much freedom your customer has regarding the charge. Open the drop-down list and you will see exactly three options.

The three display options Fig. 3: The drop-down list with the three possible display options.

  • not preselected — The customer sees the charge on the product page with an empty check box. They have to tick it actively for the charge to apply. This is the default setting.
  • preselected — The box is ticked from the start. The customer pays the charge without having to do anything, but can deliberately deselect it.
  • no selection possible (is always calculated) — The charge always applies. The customer sees it but cannot deselect it.

What this is good for: If you are legally obliged to levy the charge, choose no selection possible (is always calculated) — then no order can reach you without the charge. If the charge is voluntary for your customers, for example as a take-back offer, not preselected is the better fit. preselected is the middle ground: most customers leave the tick in place, and anyone who does not want it removes it.

How to set up the disposal charge

Setting up always takes two steps. First you create a product that represents a material and carries the charge rate. Then you link the products you sell to that charge product.

Step 1: Create the charge product

What this does for you: You maintain the charge rate in exactly one place. If the rate changes later, you only adjust this single product — every linked product immediately calculates with the new amount.

Step by step

  1. Go to Catalogues → Products and create a new product, for example named Plastic packaging.
  2. Enter the rate per weight unit as the price of this product — for example €0.80 if you charge 0.80 per kilogram.
  3. Make sure the product is active and available in the sales channel where the charge should apply. If the plugin cannot find the product in the channel, it cannot calculate the charge.
  4. Switch to the Specifications tab and open Custom fields there.
  5. Select the DisposalCharge tab and switch Article is charge on.
  6. Click Save.

Charge product with the switch turned on Fig. 4: “Article is charge” is switched on for the charge product — this makes it available for selection later.

Tip: Give the charge product a meaningful name and a meaningful product number. Your customer will see both in the cart. “Plastic packaging” reads far better there than “Product 4711”.

Important: Create a separate charge product for each material — one for plastic, one for glass, one for electronics. That way you can select the right material for each product you sell.

Step 2: Assign the charge to the product you sell

What this does for you: From now on your product shows the charge in the shop, and the amount moves into the cart as its own line.

Step by step

  1. Open the product you sell under Catalogues → Products.
  2. Switch to the Specifications tab and open Custom fields.
  3. Select the DisposalCharge tab. You will see four entries.
  4. Switch Activate calculation of the charge on the article on. Without this switch nothing happens.
  5. Under DisposalCharge-Material, select the matching charge product, for example Plastic packaging. This list only shows products for which you switched Article is charge on in step 1.
  6. Leave Price DisposalCharge empty as a rule. The price of the charge product then applies. If you enter an amount here, that value applies to this one product and overrides the charge product.
  7. Click Save.

The four entries on the product you sell Fig. 5: The “DisposalCharge” tab on the product you sell, with all four entries.

Important: Leave the Article is charge switch off on the product you sell. It marks the charge products from step 1 only.

How the amount is calculated

The plugin uses one single, simple formula:

Amount = rate × product weight × ordered quantity

The rate is either the price of the assigned charge product or — if you entered something there — the value from Price DisposalCharge on the product you sell. The weight is the weight you maintain on the product as usual.

Three examples, exactly as they come out in the shop:

Starting pointResult
Rate €0.80, product weight 2.5, quantity 1€2.00
Own price €1.50 on the product, weight 1.0€1.50
Own price €3.00, no weight maintained on the product€3.00

If a customer orders twice the quantity, the charge doubles as well: €2.00 at quantity 1 becomes €4.00 at quantity 2.

How to set a fixed flat rate

What this does for you: Not every charge depends on weight. For a fixed amount per product — for example €3.00 per electrical appliance — you do not need to change anything or convert anything.

Simply maintain no weight on the product you sell. The plugin then applies the rate unchanged as a fixed amount per item. A rate of €3.00 therefore results in exactly €3.00 — and €6.00 at quantity 2.

You define the amount itself as usual: either through the price of the charge product or through Price DisposalCharge directly on the product you sell.

Tip: If you want both weight-based and flat charges for one material, you do not need two charge products. It is enough to leave the weight empty on the products with a flat charge.

How your customer sees the charge

On the product page

What this does for you: Your customer learns about the charge before adding the product to the cart. This avoids questions and abandoned checkouts.

Directly below the Add to shopping cart button there is a line following this pattern:

Disposal charge: Plastic packaging (€2.00)

In front of it there is a check box — unless you selected no selection possible (is always calculated). Whether the box is ticked in advance depends on your setting from Settings.

The charge line on the product page Fig. 6: Product page with the charge line below the buy button.

In the cart

What this does for you: The charge is clearly recognisable in the cart and does not mix with the goods prices.

The charge appears as its own line carrying the name of your charge product:

Disposal charges - Plastic packaging

If several products in the cart use the same charge product, the plugin combines them into one line and adds the amounts up. In the following example the cart holds two different products — one with a charge of €4.00, one with €1.50. The customer sees a single line of €5.50 for both.

The combined charge line in the cart Fig. 7: Two products, one shared charge line of €5.50.

Next to the name, this line also shows the product number of the charge product. That is why the effort from Step 1: Create the charge product pays off: name and number should make sense to your customers.

Important: If your customer clicks the cross on the charge line, it only disappears for a moment. It reappears the next time the cart is recalculated, as long as the triggering product is still in the cart. This is intentional — nobody can keep the goods and get rid of the charge. Anyone who really does not want the charge removes the product from the cart, or — if you made the charge selectable — adds it again without ticking the box.

In product lists and search results

For products with an active charge, the Details link appears in lists, categories and search results where the buy button would normally be.

This is intentional: the charge can only be selected on the product page. If the product went straight from the list into the cart, your customer would never have seen the charge. The link therefore takes them to the product page first.

Repeating orders

If an order contains a charge line, the Repeat order entry is not available for it in the customer account under the orders.

This is intentional as well: when an order is repeated, Shopware only carries over the ordered products — the charge selection is lost along the way. The new order would therefore reach you without a disposal charge. To prevent that, the entry is hidden for such orders. Instead, your customer simply adds the product to the cart again, and the charge is calculated fresh.

Troubleshooting

The charge does not appear on the product page

What causes it: In almost all cases one of the two requirements from chapter 5 is missing, or the sales channel is switched off.

How to fix it — check in this order:

  1. On the product you sell, under Specifications → Custom fields → DisposalCharge, is the switch Activate calculation of the charge on the article switched on?
  2. Is a charge product actually selected under DisposalCharge-Material there?
  3. Under Settings → Extensions → Disposal charge, is the switch Enable plugin for this sales channel on for the affected sales channel? Remember to select the right sales channel at the top first.
  4. Is the charge product itself active and available in this sales channel? If it is not, the plugin cannot find it.

The charge shows €0.00

What causes it: No amount is stored. The charge product has no price, and Price DisposalCharge is empty on the product you sell as well.

How to fix it: Enter a sales price for the charge product — or store an amount under Price DisposalCharge on the product you sell.

The amount is too high or too low

What causes it: Usually the weight on the product does not match what you assumed in your calculation, because the rate is multiplied by the weight.

How to fix it:

  1. Open the product you sell and check the stored weight.
  2. Check the price of the charge product or the value under Price DisposalCharge.
  3. Recalculate: rate × weight × quantity.
  4. If the result equals exactly the rate although you expected more, no weight is stored on the product. The rate is then applied as a fixed amount (see How to set a fixed flat rate).

The charge product is missing from the selection list

What causes it: The Article is charge switch is not yet switched on for that product. The list only shows products where it is on.

How to fix it: Open the charge product, go to Specifications → Custom fields → DisposalCharge, switch Article is charge on and save. It is then available for selection on the product you sell.

The charge fields do not exist on my products at all

What causes it: The plugin is not switched on. The four entries are created when you activate it.

How to fix it: Open Extensions → My extensions and check whether Disposal charge is switched on. Switch it on if necessary and reload the product page in the administration.

I changed something but nothing happens in the shop

What causes it: Your shop is still delivering the page from the cache.

How to fix it: Go to Settings → System → Caches & indexes and clear the cache. Then open the page in the shop again.

FAQ

Q: Can I switch the charge on for all products at once?

A: No, the charge is deliberately switched on and assigned per product. This makes sense, because material and weight differ from product to product — and not every product in your range is subject to a charge.

Q: Can I use several types of charge in parallel?

A: Yes. Simply create a separate charge product for each material — for example one each for plastic, glass and electronics. On each product you sell, you then select the matching material.

Q: Does my customer see the charge before buying?

A: Yes. It appears on the product page below the buy button, with name and amount. It then appears again as its own line in the cart.

Q: Can my customer decline the charge?

A: You decide that with the Show the disposal charge to the customer as setting. With not preselected and preselected they can remove the tick. With no selection possible (is always calculated) the charge always applies.

Q: Why does the charge come back after my customer removed it in the cart?

A: Because the triggering product is still in the cart. The charge belongs to that product and is applied again on every recalculation. Only when the product leaves the cart does the charge disappear as well.

Q: Can I set a different amount for an individual product?

A: Yes. Enter your amount under Price DisposalCharge on the product you sell. That value then applies to this product only, regardless of the price of the charge product.

Q: Are my charge products found as normal products in the shop?

A: They are entirely ordinary products. If you do not want customers to find them in categories or in the search, simply remove them from the categories. For the calculation, however, they must remain active and available in the sales channel.

Q: What happens if I uninstall the plugin?

A: If you do not choose the option to keep user data when uninstalling, the charge fields on the products and the settings are removed. The charge products you created remain in your range as completely normal products — you would have to delete them yourself if you no longer need them.

For administrators / technical details

This section is aimed at technical administrators. You do not need it for normal use.

System requirements

  • Shopware: 6.7
  • PHP: 8.2 or newer

Installation via the command line (Composer)

composer require swp/disposalcharge-six
php bin/console plugin:refresh
php bin/console plugin:install SwpDisposalChargeSix --activate
php bin/console cache:clear

Logging

The plugin writes to its own log channel. If the charge cannot be determined on a product page, the page remains reachable for the customer and the error is logged instead — the shop keeps running.

Updating from versions before 6.7.1

Your existing sales channel setting is carried over automatically during the update. There is nothing you need to re-enter.


This manual was created for Disposal charge version 6.7.1.

Need a team that keeps your shop running?

We have been maintaining Shopware shops for more than 20 years, including updates, hotfixes and the plugins you are configuring right now.

BuI Insights

Shopware- & xentral-Praxiswissen direkt ins Postfach

Plugin-Updates, Best Practices, Migrations-Tipps und Branchen-Cases. Ein Mal im Monat, nur das, was wirklich relevant ist. Jederzeit abbestellbar.

Mit dem Klick stimmst du zu, dass wir dir den Newsletter zusenden dürfen (Art. 6 Abs. 1 lit. a DSGVO). Mehr in der Datenschutzerklärung.