I am embedding an Eventbrite order form using the modal view option into my website. There is a JustGiving extension I am using that allows users to seamlessly switch to create their JustGiving fundraising page once the order is complete.
This is done by generating a link on a subdomain of JustGiving i.e.
https://eventbrite.justgiving.com/fundraise/$event_id/$order_id
This process doesn't work with an embedded form, but I really want that to work. So I'm trying to modify the embed code to do this.
So far I have the following code:
<button id="eventbrite-widget-modal-trigger-425325779857" type="button">Register</button>
<script src="https://www.eventbrite.co.uk/static/widgets/eb_widgets.js"></script>
<script type="text/javascript">
var exampleCallback = function () {
console.log("Registration was successful");
jgurl = "https://eventbrite.justgiving.com/fundraise/425325779857/"
window.open(jgurl)
};
window.EBWidgets.createWidget({
widgetType: 'checkout',
eventId: '425325779857',
modal: true,
modalTriggerElementId: 'eventbrite-widget-modal-trigger-425325779857',
onOrderComplete: exampleCallback
});
</script>
As the event ID is static, all I need to do is retrieve the order ID and append it to the URL variable I've created. This will then allow me to open a new tab with the correct URL and allow people to complete the process.
I simply don't understand enough to get that order ID variable.
I'd appreciate any help.