Connect giftcards with customer accounts (#5126)

Connect giftcards with customer accounts, show giftcards during checkout and in account , show giftcard list in backend customer view
This commit is contained in:
Phin Wolkwitz
2025-10-16 13:20:00 +02:00
committed by GitHub
parent 71f2c8093f
commit 8a3da37b45
22 changed files with 490 additions and 6 deletions

View File

@@ -368,6 +368,12 @@ class CustomerAccountBaseMixin(CustomerRequiredMixin):
'active': url_name.startswith('organizer.customer.membership'),
'icon': 'id-badge',
},
{
'label': _('Gift cards'),
'url': eventreverse(self.request.organizer, 'presale:organizer.customer.giftcards', kwargs={}),
'active': url_name.startswith('organizer.customer.giftcard'),
'icon': 'gift',
},
{
'label': _('Addresses'),
'url': eventreverse(self.request.organizer, 'presale:organizer.customer.addresses', kwargs={}),
@@ -461,6 +467,15 @@ class MembershipUsageView(CustomerAccountBaseMixin, ListView):
return ctx
class GiftcardView(CustomerAccountBaseMixin, ListView):
template_name = 'pretixpresale/organizers/customer_giftcards.html'
context_object_name = 'gift_cards'
paginate_by = 20
def get_queryset(self):
return self.request.customer.customer_gift_cards.all()
class AddressView(CustomerAccountBaseMixin, ListView):
template_name = 'pretixpresale/organizers/customer_addresses.html'
context_object_name = 'invoice_addresses'