# Discounts

Discounts live under **Webshop → Discounts**. A discount is either a code the shopper types at checkout or an automatic promotion that applies on its own, and it can target the whole order, specific products, shipping, or work as a buy-X-get-Y deal.

## The discounts list

The list shows 25 discounts per page with search (matches as you type), three filters, and a sortable **Name** column.

- **Method** filter: All / Code / Automatic.
- **Type** filter: All / Order / Products / Shipping / Buy X get Y.
- **Status** filter: All / Active / Inactive. This filter only looks at the on/off flag, so filtering on **Active** can still return discounts whose badge shows Scheduled or Expired.

| Column | Description |
| --- | --- |
| Name | The discount's name, linked to its edit page |
| Method | The code itself (for code discounts) or "Automatic" |
| Type | Order / Products / Shipping / Buy X get Y |
| Value | `10%` for percent discounts, a money amount for fixed |
| Usage | Uses against the total limit, for example `3/100`, or `3/∞` when unlimited |
| Window | The start–end date window; an em-dash for a missing side |
| Status | Derived status badge (see below) |

### Discount status

The badge is derived from the discount's on/off flag and its date window:

| Status | Meaning |
| --- | --- |
| Active | Switched on and inside (or without) a date window |
| Scheduled | Switched on, but the start date is in the future |
| Expired | Switched on, but the end date has passed |
| Disabled | Switched off |

### Bulk actions

Select rows with the checkboxes to use **Activate**, **Deactivate**, or **Delete** (destructive). Each asks for confirmation and reports the result as "{n} updated, {m} failed" with per-row failure reasons. Bulk **Delete** is the only way to delete a discount; there is no delete button on the edit form.

## Create a discount

Click **New discount**. The form is grouped into cards; **Create discount** stays disabled until the requirements are met, with a hint explaining what is missing.

### Basics

| Field | Description |
| --- | --- |
| Name | Required |
| Method | **Code** (shopper enters a code) or **Automatic** (applies on its own). Default: Code |
| Code | Shown only for the Code method, required for it. Automatically uppercased as you type (for example `SUMMER10`) |
| Active | Switch, on by default |

### Value

| Field | Description |
| --- | --- |
| Type | **Order**, **Products**, **Shipping**, or **Buy X get Y**. Default: Order |
| Value type | **Percent** or **Fixed amount** tabs. Hidden for Shipping and Buy X get Y, which are always percent-based |
| Percent | The percentage, when value type is Percent |
| Amount | The fixed amount in major units (for example `10.50`), when value type is Fixed amount |

Two types behave specially:

- **Shipping** has no value input at all: it is always free shipping. The form says so: "Free shipping — this discount waives the shipping cost in full."
- **Buy X get Y** applies a percentage to the free/discounted items, defaulting to `100` ("Discount applied to each free item, 100% makes it free").

### Targeting (Products and Buy X get Y only)

For **Products** discounts this card is called Targeting; for **Buy X get Y** it is titled **Buy** and defines what the customer must purchase.

| Field | Description |
| --- | --- |
| Products | Search-driven multi-select: type 2+ characters and pick from the results (name + SKU). Selected products appear as removable badges |
| Categories | Checkbox tree of your category hierarchy (hidden when you have no categories) |
| Minimum buy quantity | Buy X get Y only; how many qualifying items must be bought. Default 1 |

Leaving targeting empty makes a Products discount apply to the whole order.

### Get (Buy X get Y only)

| Field | Description |
| --- | --- |
| Free/discounted products | Which products the customer gets, using the same product picker |
| Get quantity | How many discounted items the customer receives. Default 1 |

The get quantity applies once per qualification: the engine divides the qualifying buy quantity in the cart by the minimum buy quantity (rounded down) and multiplies the get quantity by that number, capped at the quantity of the cheapest get line. Buy 2 get 1 with 6 qualifying items and 3 get items discounts all 3; with 5 qualifying items it discounts 2.

### Conditions

| Field | Description |
| --- | --- |
| Minimum order amount | Order total required before the discount applies, in major units. Empty = no minimum |
| Audience | **All customers**, **B2B only**, or **B2C only**. Default: All customers |
| Total usage limit | Maximum total uses. Empty = unlimited |
| Usage limit per customer | Maximum uses per customer. Empty = unlimited |
| Starts at / Ends at | Optional date-time window |
| First order only | Switch: restrict to a customer's first order |
| Customer groups | Checkboxes to restrict the discount to specific groups. This section only appears when the Customers module is available and at least one active group exists |

### Combinations

Three switches control whether this discount can stack with other discounts on the same order:

| Field | Description |
| --- | --- |
| Combine with order discounts | Default off |
| Combine with product discounts | Default off |
| Combine with shipping discounts | Default on |

Click **Create discount** to save. On success you see the toast "Discount created." and return to the list. Validation problems appear under the matching field.

## Edit a discount

Open a discount from the list. The edit page uses the identical form with everything pre-filled. Click **Save changes**; on success ("Discount saved.") you return to the list.
