> For the complete documentation index, see [llms.txt](https://docs.momocode.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.momocode.de/en/shopware-6/percentage-based-advanced-pricing/3.-configuration.md).

# 3. Configuration

This plugin has no system-wide settings. The percentage pricing feature is available immediately after installation on the **Advanced prices** tab of every product.

## Defining Percentage-Based Prices

### Step by Step

1. Open a product under **Catalogues → Products**
2. Navigate to the **Advanced prices** tab
3. Click **Add price** or edit an existing price row
4. Enter a value in the **Percentage** column:
   * Negative value → discount (e.g., `-10` for 10% off)
   * Positive value → markup (e.g., `5` for 5% above base price)
5. The absolute price in the **Price** column is calculated automatically
6. Click **Save**

![Price row with percentage value and calculated price](/files/jaMByJrFHR5z5kTuIyAg)

### Input Notes

* Enter plain numbers — no % symbol required
* Positive values increase the price, negative values reduce it
* Existing advanced prices without a percentage value are not affected
* All configured currencies are handled correctly

## Choosing a Calculation Base

For each of the three price types (price, list price, regulation price), you can separately choose whether the percentage is calculated from the product's **sale price** or **purchase price**.

### How the Base Selection Works

Next to each percentage input field, you will see a toggle with two options:

* **Sale price** (default) — calculation uses the product's regular sale price
* **Purchase price** — calculation uses the product's purchase price

![Base toggle next to the percentage field](/files/9zYULmXeeLELbSoLZxhn)

### Example

To define the list price as "purchase price + 20%":

1. Select **Purchase price** as the base for the list price percentage
2. Enter `20` as the percentage value
3. The list price is automatically calculated as purchase price + 20%

### Notes

* The base selection is **always visible**, even before entering a percentage value
* If you select **Purchase price** as the base but no purchase price has ever been set on the product, the calculation is skipped and the existing price remains unchanged. Note: once a purchase price has been entered, clearing the field in the admin sets it to `0` — in that case the calculation runs normally using `0` as the base
* When a product's purchase price changes, all percentage prices using "purchase price" as their base are automatically recalculated

## List Price Field Visibility

When you disable the **Show list prices** toggle in the advanced prices grid, the percentage input fields for list price and regulation price are automatically hidden as well. Only the standard price percentage field is shown.

Re-enabling the toggle restores the fields with their previously entered values — no data is lost.

## Bulk Edit

You can also apply percentage prices to many products at once using Shopware's **bulk edit** feature:

1. Select multiple products under **Catalogues → Products**
2. Click **Bulk edit**
3. Open the **Advanced prices** section
4. Enter the desired percentage values
5. Fill in the absolute price fields with a placeholder value (e.g., `0`)
6. Confirm the bulk edit

The absolute prices are **automatically calculated server-side** for each product individually — based on each product's actual base price. You do not need to open each product separately.

![Bulk edit with percentage values filled in](/files/YkDVQB0Wwdt7ZstCFRu8)

### Bulk Edit Notes

* The instant calculation in the UI is disabled during bulk edit since no single base price is available
* Server-side calculation runs immediately after saving
* You can set both percentage values and calculation base (sale price / purchase price) in bulk edit

## Automatic Recalculation

Absolute prices are automatically recalculated in the following situations:

| Trigger                                     | Effect                                                                 |
| ------------------------------------------- | ---------------------------------------------------------------------- |
| Product's sale price changes                | All percentage prices using "sale price" as base are updated           |
| Product's purchase price changes            | All percentage prices using "purchase price" as base are updated       |
| Percentage value saved via bulk edit or API | Absolute prices are immediately calculated from the current base price |

## Bulk Recalculation (Console Command)

To force a recalculation of all percentage-based prices — for example after a data import or a bulk price update:

```bash
bin/console momo:percentage-prices:recalculate
```

This command recalculates the absolute prices for all percentage-based advanced prices across all products, using the current base prices. The configured calculation base (sale price / purchase price) is respected.

**When is this useful?**

* After a data import that changed base prices
* To verify all prices are up to date
* After migrating from another Shopware version

## How It Interacts with Existing Prices

The plugin extends Shopware's existing pricing — it does not replace it:

* Advanced prices without a percentage value continue to work as before
* Percentage-based and absolute prices can coexist in the same pricing table
* Only rows with a percentage value are automatically recalculated
