feat: progressive price bands per product (front 8.2)
A price may carry up to five bands, "from N m, R$ Y": the order's total billed metres of that product chooses one price for its whole quantity, the manual-file extra still on top. Bands start and become history with their price row. The Site charges the same band for the cart, shows "Faltam X m para R$ Y o metro" and lists the bands under the price table; the Kanban's Site tab edits them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -49,7 +49,12 @@ def session(request: Request, response: Response):
|
||||
# Zero keeps the designer's treatment hidden, as an off product does.
|
||||
'treatment_cents': treatment['unit_cents'] if treatment['enabled'] else 0,
|
||||
# What the Site sells now: a switched-off product is hidden there.
|
||||
'products': {mode: products[mode] for mode in catalog.MODES},
|
||||
# Bands travel with the price; the Site reads them as numbers.
|
||||
'products': {mode: {**products[mode],
|
||||
'bands': [{'from_metres': float(band['from_metres']),
|
||||
'unit_cents': band['unit_cents']}
|
||||
for band in products[mode]['bands']]}
|
||||
for mode in catalog.MODES},
|
||||
# Public by design: Mercado Pago's card form needs it in the browser.
|
||||
'payment_public_key': os.environ.get('MP_PUBLIC_KEY', '') if payment.name == 'mercadopago' else '',
|
||||
# The delivery options the cart quotes, or none: pickup only.
|
||||
|
||||
Reference in New Issue
Block a user