Metadata-Version: 2.4
Name: lfs-bulk-prices
Version: 2.0.1
Summary: Bulk prices (price tiers by quantity) for LFS
Author: Kai Diefenbach
License-Expression: BSD-3-Clause
Project-URL: Source, https://github.com/diefenbach/lfs-bulk-prices
Keywords: django,e-commerce,online-shop
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: django-lfs<2,>=1.0
Dynamic: license-file

# lfs-bulk-prices

Bulk prices for [LFS](https://github.com/diefenbach/django-lfs): price tiers by quantity ("from 10 pieces 8.50 €").

- A price calculator, `BulkPricesCalculator`, that picks the tier for the ordered amount.
- A **Bulk prices** tab on the product management page, shown for products that use this calculator.
- Template tags and a small script for the product page that show the tiers and update the price when the
  customer changes the amount. lfs-theme includes them when the add-on is installed.

## Installation

```sh
pip install lfs-bulk-prices        # or, in lfs-starter: uv sync --extra bulk-prices
```

```python
# settings.py
INSTALLED_APPS = [..., "lfs_bulk_prices"]

LFS_PRICE_CALCULATORS = [
    ["lfs.gross_price.calculator.GrossPriceCalculator", _("Price includes tax")],
    ["lfs.net_price.calculator.NetPriceCalculator", _("Price excludes tax")],
    ["lfs_bulk_prices.calculator.BulkPricesCalculator", _("Bulk prices")],
]

# urls.py
urlpatterns += [path("bulk-prices/", include("lfs_bulk_prices.urls"))]
```

Then run `python manage.py migrate`. In the management interface choose the price calculator "Bulk prices" for a
product (or for the shop as default); the product then gets the **Bulk prices** tab.

## Tests

```sh
pytest
```

The tests use `lfs_bulk_prices.tests.settings` and need django-lfs with its required add-ons installed.

## License

BSD-3-Clause, see `LICENSE.txt`.
