Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
<html>
<head>
	<!-- import your css here -->
	<link rel="stylesheet" type="text/css" href="https://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 (!SecuTixAPI.getContact()) {
			var myAcountLink = document.getElementByHide("my_account");
			myAcountLink .classList.remove("hide");
			myAcountLink.attributes.href.value = SecuTixAPI.getUrls().account;
		}
		document.getElementById("my_account_mobile").addEventListener(function (event) {
			event.preventDefault();
			SecuTixAPI.toggleSecutixMobileMenu();
		});
	</script>
</body>
</html>

...

Code Block
languagejs
/**
 * 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 () {}

Accès aux informations de panier

Code Block
languagejs
/**
 * 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 () {}

 

...

Utiliser le menu mobile SecuTix

SecuTix expose une méthode pour manipuler le menu mobile fourni par défaut par le tunnel d'achat. Par exemple, vous pouvez ouvrir le menu SecuTix mobile lorsque l'utilisateur clique sur un bouton menu dans le header.

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