mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Widget: original price for variations
This commit is contained in:
@@ -208,6 +208,7 @@ class WidgetAPIProductList(EventListMixin, View):
|
|||||||
'order_max': var.order_max,
|
'order_max': var.order_max,
|
||||||
'description': str(rich_text(var.description, safelinks=False)) if var.description else None,
|
'description': str(rich_text(var.description, safelinks=False)) if var.description else None,
|
||||||
'price': price_dict(item, var.display_price),
|
'price': price_dict(item, var.display_price),
|
||||||
|
'original_price': getattr(var, 'original_price') or item.original_price,
|
||||||
'avail': [
|
'avail': [
|
||||||
var.cached_availability[0],
|
var.cached_availability[0],
|
||||||
var.cached_availability[1] if self.request.event.settings.show_quota_left else None
|
var.cached_availability[1] if self.request.event.settings.show_quota_left else None
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
|||||||
{
|
{
|
||||||
"value": "Red",
|
"value": "Red",
|
||||||
"id": self.shirt_red.pk,
|
"id": self.shirt_red.pk,
|
||||||
|
'original_price': None,
|
||||||
"price": {"gross": "14.00", "net": "11.76", "tax": "2.24", "name": "",
|
"price": {"gross": "14.00", "net": "11.76", "tax": "2.24", "name": "",
|
||||||
"rate": "19.00", "includes_mixed_tax_rate": False},
|
"rate": "19.00", "includes_mixed_tax_rate": False},
|
||||||
"description": None,
|
"description": None,
|
||||||
@@ -174,6 +175,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
|||||||
{
|
{
|
||||||
"value": "Blue",
|
"value": "Blue",
|
||||||
"id": self.shirt_blue.pk,
|
"id": self.shirt_blue.pk,
|
||||||
|
'original_price': None,
|
||||||
"price": {"gross": "12.00", "net": "10.08", "tax": "1.92", "name": "",
|
"price": {"gross": "12.00", "net": "10.08", "tax": "1.92", "name": "",
|
||||||
"rate": "19.00", "includes_mixed_tax_rate": False},
|
"rate": "19.00", "includes_mixed_tax_rate": False},
|
||||||
"description": None,
|
"description": None,
|
||||||
@@ -280,6 +282,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
|||||||
'value': 'Red',
|
'value': 'Red',
|
||||||
'order_max': 2,
|
'order_max': 2,
|
||||||
'description': None,
|
'description': None,
|
||||||
|
'original_price': None,
|
||||||
'price': {
|
'price': {
|
||||||
'gross': '14.00',
|
'gross': '14.00',
|
||||||
'net': '11.76',
|
'net': '11.76',
|
||||||
|
|||||||
Reference in New Issue
Block a user