> 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/margins-purchase-prices-product-listing/2.-installation.md).

# 2. Installation

## Installing the plugin

### Via the Shopware Store (recommended)

1. Open **Extensions → Store** in the Shopware administration.
2. Search for "Margins & Purchase Prices in Product Listing".
3. Click **Buy** or **Install**.
4. The plugin is downloaded and installed automatically.

### Manual installation via ZIP

1. Download the plugin ZIP file from your Shopware account.
2. Open **Extensions → My Extensions** in the administration.
3. Click **Upload plugin** and select the ZIP file.
4. The plugin will appear in the plugin list.

## Activating the plugin

1. Open **Extensions → My Extensions**.
2. Find **Margins & Purchase Prices in Product Listing** in the list.
3. Toggle the switch to **activate** the plugin.
4. Confirm the cache clear if prompted.

## First steps after installation

Once activated, the plugin automatically starts a background indexing run to calculate margin data for all existing products. The new columns are immediately visible:

1. Open **Catalogues → Products**.
2. Scroll right in the table — you will see four new columns: **Purchase Price**, **Net Price**, **Margin**, and **Margin %**.
3. While the background indexing is in progress, the margin columns may still show a dash (–). This is normal — values fill in as the indexing completes.
4. Products without a stored purchase price will always show a dash (–) in the margin columns. Add purchase prices directly on the product page under the **List price → Purchase price** field.

## Using the purchase price filter

To quickly find all products without a purchase price:

1. Open **Catalogues → Products**.
2. Click the **Filter** icon (funnel) in the upper right corner.
3. Scroll down in the filter panel to the **Purchase Price** section.
4. Select **Without purchase price**.
5. The product list will show only products without a stored purchase price.

![Filter panel with active purchase price filter](/files/zno8w6DSPwEfFOXysftz)

## Notes

* The **Margin** and **Margin %** columns are calculated based on the net price in the default currency and the stored purchase price.
* For products with variants, each variant must have its purchase price set individually.
* Sorting by margin and margin % is server-side and uses a precomputed database table. The plugin stores both calculation methods (Gross Margin and Markup) simultaneously, so switching the method in the configuration takes effect immediately without a re-index. The table is updated automatically whenever prices change.
