In its advanced customization settings, SecuTix allows you to use a custom header and/or footer. This adjustment is made by uploading the header and/or footer’s HTML code in the Advanced tab in the graphic theme settings. The web agency that created your organization’s website may therefore reuse the code that it created, without having to write new code just for ticketing.

Setup

For each point of sale, you can change a certain number of elements of the graphic theme. Go to Your Point of Sale > Internet Theme. On this settings page, a tab allows you to make advanced changes to the headers and footers. For every two blocks of pages, a text field for each activated language will appear for the point of sale,allowing you to make changes to labels more easily.

Maximum size: Important point: For technical and performance reasons, avoid uploading headers and footers of more than 20,000 characters (including spaces and hard returns) for each language.If this proves difficult, there are some tricks for getting more room:

  • Most code-editing software (even Notepad ++) allows spaces and hard returns to be deleted. This type of formatting can reduce your characters by 10 to 20%.
  • CSS can take up room quickly, so we recommend that you import what was used for your main site. 

Header and footer structure

The header and footer are two static HTML pages that are inserted into the purchase process through <iframes>. These iframes will automatically re-size according to their content, which means that the following conditions must be respected:

  • The header or footer must be contained in a unique <div> in the body of the inserted page.
  • The body must have the following styles:

body, html {	
	margin: 0;
    padding: 0;
    overflow: hidden;
}
  • The header or footer must be re-sized seamlessly so that all content is visible, without needing scroll bars.
  • All uploaded HTML resources must be imported with the https protocol. 
  • For technical reasons, links contained in headers and footers undergo special processing. They may therefore be used normally.

Accessing the SecuTix API

SecuTix will insert the header and footer content in an iframe. However, some elements, such as the user login and requests to change the language etc., are specific to ticketing. We therefore use a documented API for interactions with the rest of the page.

Retrieving the API

Before uploading the page, downloading the API in the iframe is useful so that it may be used more easily.


<script type="text/javascript">
	var SecuTixAPI = window.parent.SecuTixAPI;
</script>

Accessing contact information

/**
 * Get the details on loggued contact. Null if not logged. Otherwise:
 * {
 *		lang:  // the contact prefered language
 *		firstName: // the contact first name
 *		lastName: // the contact last name
 *		title: // the contact title
 *		structureName: // if contact belongs to a structure, structure name
 *	}
 * 
 * @returns {Object}
 */
getContact: function() {}

Accessing usable URLs

The following API gives access to usable URLs in the links.

/**
 * Return available urls:
 * {
 * 		account: // url to account page
 * 		cart: // url to cart page
 * 		continueShopping: // url to continue shopping
 * 		logout: // url to logout the user 
 * 		langs: // map of urls for the langs. Keys are the language codes
 * }
 * @returns {Object}
 */
getUrls: function () {}

Accessing basket information

/**
 * Get the current content of the cart. Null is empty. Otherwise:
 * {
 * nbItems: // number of items in cart {number}
 * amount: // amount of cart as {string}
 * currency: // currency of the amount
 * }
 * 
 * @returns
 */
 getCart: function () {}

Using the mobile SecuTix menu

SecuTix uses a method for manipulating the mobile menu provided by default by the purchase process. For example, the mobile SecuTix menu can be opened when the user clicks on the menu button in the header.

/**
 * Show or hide the secutix mobile menu.
 * @param {boolean} show
 * @returns
 */
 toggleSecutixMobileMenu: function (show) {}

Header example

Example of html for a header, where the My account link becomes the contact name when they are logged in.


<html>
<head>
	<!-- import your css here -->
	<link rel="stylesheet" type="text/css" href="//my.css">
</head>
<body>
	<!-- there should be only one div as child of the body tag -->
	<div>
		<!-- the header or the footer content should be here -->
		<a href="#" id="my_account" class="hide">My account</a>
		<a href="#" id="my_account_mobile"> ☰ </a>
	</div>
	<!-- import your scripts here -->
	<script type="text/javascript">
		var SecuTixAPI = window.parent.SecuTixAPI;
		// If the contact is not logged in, show the "My account" link
		if (!SecuTixAPI.getContact()) {
			var myAcountLink = document.getElementById("my_account");
			myAcountLink .classList.remove("hide");
			myAcountLink.attributes.href.value = SecuTixAPI.getUrls().account;
		}
		// Clicking on the mobile link opens the mobile menu
		document.getElementById("my_account_mobile").addEventListener(function (event) {
			event.preventDefault();
			SecuTixAPI.toggleSecutixMobileMenu();
		});
	</script>
</body>
</html>