Hello,
I am trying to create a custom booking experience on my wix website using Velo. I managed to have a service page where clients can select the date they want and click on a button that redirects them to a new page with a form.
I have all my form fields ready. I’d like to add a text input where they can put a coupon and click on a button “Apply” that would calculate and update the price in the reservation info recap I made. (Then they can click on the “Pay” button and i think i will have to use the checkoutBooking() for this.)
I need help regarding the coupon method. I have to get the user input and see if it is one of the coupon I have created and also if it respects the condition because i’d like the user to be able to see the updated price on the reservation recap before clicking on pay .
I can see that the checkoutBooking has PaymentOptions object with a payment method and a coupon that can be passed. This would be after the user has clicked on pay. I also assume i’d have to test if the coupon exists anyway ? I haven’t tested the checkoutBooking yet so i’m not sure how it’s working.
I found there is a applyCoupon in the wix-stores documentation but it seems like it’s to apply a coupon on a cart, however using wix bookings, there is not a cart so I think this is not the solution.
Is there another way I could access my website coupon using velo so I could check if the coupon applied can be used on the user reservation and update the displayed price before the payment process?
Is there a better or more correct way to achieve this ? I’m putting a screen capture to try and explain what I’d like to do.
Thank you for any help and advice