Skip to main content
Widget Golfmanager
Updated over a week ago

Index

Introduction

The booking widget is a paid functionality created by Visualgolf for Golfmanager customers that allows them to embed a floating button on the club's website where customers can complete their bookings. When the customer clicks on this "Book Now" button, a pop up screen expands and the customer can complete a booking without leaving the club's website.

For this widget to work properly it has to be configured as follows.

Allow the widget access to the club's Golfmanager application.

The club must contact Golfmanager Support and authorize this connection. To do this the Golfmanager team will complete the following steps:

Create a new administrator user in the club's tenant > security > administrator > new, with name visualgolf, email info@visualgolf.net and activate is Api.

In the club tenant go to Clients, create new client with name Visualgolf and activate the option is Api.

In Superadmin > Apikeys > Visualgolf Admin > Tenants > New select the tenant of the club with the user Visualgolf that we have just created.

In Superadmin > Apikeys > Visualgolf Consumer > Tenants > New, select the tenant of the club with the Visualgolf client.

With these steps we have now created the connection between the widget provided by Visualgolf and the Golfmanager booking system.

Embed the widget in the club's web page

For the widget to appear on the Club's website, it is necessary to copy these lines below and paste them in the header () of the page/s of the website where you want to display it. For this step the club will probably need to contact its web manager.

<script type="application/javascript">


var area = 'X';

var state = 'open';

var position = 'right';

var tenant = 'reservas';


var constructor_css = document.createElement('link');

constructor_css.href = 'https://widget.golfmanager.com/librerias/css/css_constructor.css?version=' + Date.now(); constructor_css.type = 'text/css'; constructor_css.rel = 'stylesheet';


document.getElementsByTagName('head')[0].appendChild(constructor_css);

var constructor_js = document.createElement('script');

constructor_js.src = 'https://widget.golfmanager.com/librerias/js/funciones_constructor.js?version=' + Date.now(); constructor_js.type = 'text/javascript';

document.getElementsByTagName('head')[0].appendChild(constructor_js); var constructor_iframe = document.createElement('iframe');

constructor_iframe.id = 'widget'; constructor_iframe.src = 'https://widget.golfmanager.com/'+ tenant + '/widget.php';

constructor_iframe.setAttribute('frameborder', '0');

document.body.appendChild(constructor_iframe);

</script>

As you can see, there are two parameters that must be configured for each Club:

nombredeltenant: where we will put the name of the tenant or app of the club. This name can be taken from the first part of the url with which we normally access Golfmanager. For example sanroque.golfmanager.com. The tenant name would be sanroque.

token: changes for each club and is the key to operate with the widget. It is built using the SHA256 algorithm. To create this algorithm we can go to the following link: https://emn178.github.io/online-tools/sha256.html. The way in which the final value to be defined is concatenating (without spaces) the tenant of the Club plus "GolfmanagerWidget". For the same example above, in the SHA256 page we will write: sanroqueGolfmanagerWidget. The code below will be our token.

**status"": "open" appears the pop displayed. "closed" or "" will appear collapsed.

For any other inquiries please contact our support team via chat.

Install the Widget plugin

Access the App Center and download the "Widget" plugin, and configure the plugin:

  • Admin key*: (provided by the Golfmanager dev team. Cookie)

  • Domain*: .app. Rest of examples:

    • Demo: .es

    • Demo APP: .app

    • Spain: .com

    • Europe: .com

    • Europe AWS: .com

    • Asia: .com

    • America: .com

    • Golf Santander: .com

  • API subdomain*: https://mt. Rest of examples:

    • Demo .ES: https://mt

    • Demo APP: https://mt

    • Spain: https://mt

    • Europe: https://mt-europa

    • Europe AWS: https://mt-aws-europa

    • Asia: https://mt-asia

    • America: https://mt-america

    • Golf Santander: https://mt-gs

Widget opened by default

There is a parameter within the call in which the widget is generated to control, a priori, the state (open / closed) when loading the page containing it.

Thus, the data sheet of the script call looks like this:

data-tenant="lareserva" data-token="554abf67af1ecb7f0cb8588546c5aee76bbe501fd64752a7c5f3acd3f3ab543a" data-estado="abierto"

If you want the widget to appear open, it is set to open. Any other value will cause the widget to appear closed on startup.

This code must be provided to the person responsible for managing the client's website.

Did this answer your question?