Anyone able to point me in the right direction?
On a popup, I have the following script - which works nicely.
<div id="example-widget-trigger"></div>
<script src="https://www.eventbrite.com/static/widgets/eb_widgets.js"></script>
<script type="text/javascript">
var exampleCallback = function() {
console.log("Order complete!");
// Update the thank you page URL with your own custom thank you page URL
setTimeout(function() {window.open("https://example.com/thank-you/","_self")}, 500);
};
// Update the eventId with your own Eventbrite event id
window.EBWidgets.createWidget({
widgetType: "checkout",
eventId: "52766401728",
iframeContainerId: "example-widget-trigger",
iframeContainerHeight: 425,
onOrderComplete: exampleCallback
});
</script>
What I do on the “window.open” is go to “this URL” (i.e. the page I am on) and append a URL parameter.
Then on page load I check to see if this parameter is there and show our “thank you” popup with some navigation (which is why we can’t use EB’s customised checkout).
Firstly, getting rid of the page parameter is then somewhat annoying (so you don’t want the popup to show again on this page).
However the main issue is that I then get a console error when the redirect happens.
TypeError: Cannot read properties of undefined (reading 'createWidget')
If this was a new page, then it should not be too much of a problem, but the Widget remembers where it was, so if you click on the button to show the popup again, then it will not show the checkout again.
Any clues as to where I should be looking here.
Thank you !