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

@@ -1221,6 +1221,7 @@ class OrderRefundView(OrderView):
giftcard = self.request.organizer.issued_gift_cards.create(
expires=expires,
currency=self.request.event.currency,
customer=order.customer,
testmode=order.testmode
)
giftcard.log_action('pretix.giftcards.created', user=self.request.user, data={})

View File

@@ -3085,6 +3085,8 @@ class CustomerDetailView(OrganizerDetailViewMixin, OrganizerPermissionRequiredMi
.annotate(spending=Sum("total"))
)
ctx["gift_cards"] = self.customer.customer_gift_cards.all()
return ctx