mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Original price for variations (#1258)
* Original price for variations * Documentation * API-GET * Fix existing tests to accomodate new attribute * Test for variation's original_price on API
This commit is contained in:
@@ -550,6 +550,8 @@ class ItemVariation(models.Model):
|
||||
:type active: bool
|
||||
:param default_price: This variation's default price
|
||||
:type default_price: decimal.Decimal
|
||||
:param original_price: The item's "original" price. Will not be used for any calculations, will just be shown.
|
||||
:type original_price: decimal.Decimal
|
||||
"""
|
||||
item = models.ForeignKey(
|
||||
Item,
|
||||
@@ -578,6 +580,13 @@ class ItemVariation(models.Model):
|
||||
null=True, blank=True,
|
||||
verbose_name=_("Default price"),
|
||||
)
|
||||
original_price = models.DecimalField(
|
||||
verbose_name=_('Original price'),
|
||||
blank=True, null=True,
|
||||
max_digits=7, decimal_places=2,
|
||||
help_text=_('If set, this will be displayed next to the current price to show that the current price is a '
|
||||
'discounted one. This is just a cosmetic setting and will not actually impact pricing.')
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Product variation")
|
||||
|
||||
Reference in New Issue
Block a user