Technical Documentation

Widget installation

Integrate the booking widget on your website in minutes

4 min min read

The booking widget allows your customers to make bookings directly from your website.

Get the code

  1. Go to WidgetCode in the sidebar menu
  2. Copy the integration code
  3. Your unique clientId is already included

Integration options

Option 1: Full page (recommended)

The widget takes up the entire page, ideal for a dedicated booking experience.

<!-- Add this in the <head> of your page -->
<script src="https://widget.reservadehamacas.com/embed.js"></script>

<!-- Add this where you want the widget -->
<div id="reserva-hamacas-widget"></div>

<script>
  ReservaHamacas.init({
    clientId: 'YOUR_CLIENT_ID',
    container: '#reserva-hamacas-widget'
  });
</script>
Selecciona para copiar

Option 2: Floating button

A button that opens the widget in a modal.

<script src="https://widget.reservadehamacas.com/embed.js"></script>

<script>
  ReservaHamacas.init({
    clientId: 'YOUR_CLIENT_ID',
    mode: 'floating-button',
    buttonText: 'Book Sun Lounger',
    buttonPosition: 'bottom-right'
  });
</script>
Selecciona para copiar

Option 3: Direct link

Send your customers directly to the booking page:

https://reserva.reservadehamacas.com/YOUR_CLIENT_ID
Selecciona para copiar

Use it in:

  • Emails
  • Social media
  • Printed QR codes

Specific integrations

WordPress

  1. Install the "Insert Headers and Footers" plugin (or similar)
  2. Paste the widget code in the footer section
  3. Create a new page for bookings
  4. Add the container <div>

You can also use a custom HTML block in the block editor.

Wix

  1. Go to your site editor
  2. Add an "Embed" > "Custom HTML" element
  3. Paste the complete widget code
  4. Adjust the container size

Squarespace

  1. Go to the page where you want the widget
  2. Add a "Code" block
  3. Paste the widget code
  4. Save and publish

Shopify

  1. Go to Online Store > Pages
  2. Create a new page
  3. Switch to HTML editor
  4. Paste the widget code

Verify installation

  1. Visit the page where you installed the widget
  2. You should see the booking calendar
  3. Try making a test booking

Troubleshooting

Widget doesn't appear

  • Verify the clientId is correct
  • Check the browser console (F12) for errors
  • Make sure the container exists in the HTML

Widget appears but doesn't load data

  • Verify your account is active
  • Check that you have at least one published zone
  • Verify you have available sun loungers

CORS error

  • The widget must be loaded from a public domain
  • Doesn't work opening the HTML file directly (file://)

Technical requirements

RequirementMinimum
JavaScriptEnabled
HTTPSRecommended
BrowsersChrome, Firefox, Safari, Edge (latest 2 versions)

Next step

Learn to customize the widget with colors and options.

Help Center - Sunbed Booking System | Reserva de Hamacas