Question:
Hi everyone! I’m new here and sorry if I’ll ask some funny questions. **I’m trying to create a customized Ticket Picker for Events using code. I need help in fetching the data by EventID and also in passing to the check-out page (ticket-form).
Product:
Wix Editor, Wix Events
What are you trying to achieve:
As a final result, I need to create a page similar to Event Details & Registration, representing one unique event, which contains only Ticket Picker with minimal information (Event Title, Date & Time, Types of tickets, Price, Dropdown for choosing a quantity), without all other details. After choosing ticket quantity and pressing the “Buy” button, a visitor should be redirected to the checkout page (ticket-form) for purchase completion. I need the Ticket Picker to fetch the data from Events/Tickets and Events/Events collections by passing parameters exactly how it works in the current Event Details & Registration page.
My first question is How do I pass the EventID to this page, or maybe I should pass another parameter.
Second - How do I fetch data from two collections Events/Events and Events/Ticket.
Third - How do I fetch the Slug of the Event in order to pass to the next page.
Any help will be very appreciated.
What have you already tried:
I tried to create a customized Ticket Picker for Events by using this example. The code works except of a few problems. I have many different tickets for different events which, at the current stage, are all represented in one big list. Here is my page.
Another problem is that when I select the quantity of a specific ticket and press the “Buy” button, nothing happens. By using console.log I saw that it gets the correct Tickets quantity and the ticketID of chosen ticket, but the eventID is always the same - the eventID of “Concert” from March 25, and also, it cannot redirect to the ticket-form page, because it doesn’t receive the correct Slug. The link in the example contains the event’s name, but it isn’t the actual slug that has to appear there.
To resolve these problems, I tried to run the getEvent() function, as it suggested in the explanation, but I got stuck there and I can’t find what my mistake is.
I also tried to implement explanations from this post: wix-events tickets - #3 by davidva, but there is also lack of information about how to fetch the EventID.
Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]