Skip to content

Commit 7711443

Browse files
authored
Merge pull request #73 from HiEventsDev/soldout-ticket-fix
Fix sold out ticket breaking preventing checkout
2 parents 3d3f364 + 99f3964 commit 7711443

File tree

1 file changed

+11
-0
lines changed
  • frontend/src/components/routes/ticket-widget/SelectTickets

1 file changed

+11
-0
lines changed

frontend/src/components/routes/ticket-widget/SelectTickets/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,17 @@ const SelectTickets = (props: SelectTicketsProps) => {
183183
})
184184
});
185185

186+
// this is hacky way to add empty quantity for a sold out ticket.
187+
// this is needed to avoid validation error when the ticket is sold out.
188+
// @todo - refactor this code so returning here doesn't break the checkout process.
189+
if (quantitiesValues.length === 0) {
190+
quantitiesValues.push({
191+
quantity: 0,
192+
price_id: 0,
193+
price: 0,
194+
})
195+
}
196+
186197
ticketValues.push({
187198
ticket_id: Number(ticket.id),
188199
quantities: quantitiesValues,

0 commit comments

Comments
 (0)