================================================================================ HOTELBOOK — Shopify Integration Guide Version: 1.0.0 Author: Pinky Creative Studio (pinkycreativestudio.com) Support: hello@hotelbook.io ================================================================================ TABLE OF CONTENTS ───────────────── 1. Overview 2. Method A — Shopify App (recommended) 3. Method B — Theme Liquid snippet (manual) 4. Method C — App Embed (Theme Editor) 5. Method D — Section in theme 6. Configuration options 7. Shopify Markets & multilingual setup 8. Troubleshooting 9. FAQ ================================================================================ 1. OVERVIEW ================================================================================ HotelBook integrates with Shopify to add a fully-functional hotel booking widget to your Shopify store. Ideal for: - Boutique hotels with a Shopify online store (selling merchandise + bookings) - B&Bs and guesthouses using Shopify as their website - Hotel chains managing multiple storefronts Requirements: - Shopify Basic plan or higher - Online Store 2.0 theme (Dawn, Craft, Sense, Debut, etc.) OR Legacy theme with manual liquid snippet - Active HotelBook account (hotelbook.io) - HTTPS (all Shopify stores are HTTPS by default ✓) Your Hotel ID and API key: HotelBook Dashboard → Settings → API & Integrations ================================================================================ 2. METHOD A — SHOPIFY APP (RECOMMENDED) ================================================================================ The HotelBook Shopify App installs in one click and adds the widget with zero code required. Installation: ───────────── 1. Go to: apps.shopify.com → search "HotelBook Direct Booking" 2. Click "Add app" 3. Review permissions → click "Install app" 4. You'll be redirected to HotelBook setup: a. Log in or create your HotelBook account b. Connect your Shopify store c. Enter your Hotel ID d. Configure: theme, language, currency, rooms Placing the widget: ──────────────────── After installation, the widget can be placed via: - Theme Editor (recommended): Online Store → Themes → Customize → Add section → HotelBook Booking Widget - App block: Available in any section that supports app blocks The app uses Shopify's App Bridge and creates no changes to theme files. Uninstalling the app cleanly removes all widget instances. ================================================================================ 3. METHOD B — THEME LIQUID SNIPPET (MANUAL) ================================================================================ For developers or users who prefer direct theme control. Step 1: Create the snippet file ──────────────────────────────── In Shopify Admin: Online Store → Themes → (your theme) → Actions → Edit code a. Under "Snippets" → click "Add a new snippet" b. Name it: hotelbook-widget c. Paste the following code: ────────────────────────── hotelbook-widget.liquid ───────────────────────────── {% comment %} HotelBook Booking Widget Snippet Include with: {% render 'hotelbook-widget' %} or with options: {% render 'hotelbook-widget', theme: 'dark', lang: 'nl' %} {% endcomment %} {% assign hb_hotel_id = hotel_id | default: 'YOUR_HOTEL_ID' %} {% assign hb_theme = theme | default: 'auto' %} {% assign hb_lang = lang | default: 'auto' %} {% assign hb_currency = currency | default: 'EUR' %} {% assign hb_position = position | default: 'inline' %}
{% comment %} Optional: Add widget CSS overrides to match your Shopify theme {% endcomment %} ────────────────────────────── END SNIPPET ───────────────────────────────────── d. Click "Save" Step 2: Include the snippet in a template ────────────────────────────────────────── Add this line wherever you want the widget to appear: {% render 'hotelbook-widget' %} With custom options: {% render 'hotelbook-widget', theme: 'dark', lang: 'nl', currency: 'EUR' %} Common template files to add it to: A) Custom page template (recommended): - Create a new template: Templates → Add template → page - Name it: page.booking - Add: {% render 'hotelbook-widget' %} - In Shopify Pages: create a page "Book a Room", assign template "booking" B) index.json (homepage): Add as a section (requires section file — see Method D) C) Existing page template: Open templates/page.liquid (or page.json) and add: {% render 'hotelbook-widget' %} ================================================================================ 4. METHOD C — APP EMBED (THEME EDITOR) ================================================================================ Online Store 2.0 themes support App Embeds — the cleanest way to add scripts. 1. Go to: Online Store → Themes → Customize 2. Click the puzzle piece icon (🧩 App embeds) in the left panel 3. Find "HotelBook" in the list 4. Toggle it ON 5. Configure: - Hotel ID - Theme (light/dark/auto) - Language - Floating button (optional — shows a "Book Now" button on all pages) 6. Save App Embed adds the widget script globally. Then use the section or block to place the widget where you want it on specific pages. ================================================================================ 5. METHOD D — SECTION IN THEME (ONLINE STORE 2.0) ================================================================================ For Online Store 2.0 themes, create a reusable section: Step 1: Create section file ──────────────────────────── Online Store → Themes → Edit code → Sections → Add new section Name: hotelbook-section Paste the following: ────────────────────────── hotelbook-section.liquid ──────────────────────────── {% schema %} { "name": "HotelBook Booking", "tag": "section", "class": "hotelbook-section", "settings": [ { "type": "text", "id": "hotel_id", "label": "Hotel ID", "info": "Found in HotelBook Dashboard → Settings → API & Integrations", "placeholder": "YOUR_HOTEL_ID" }, { "type": "select", "id": "theme", "label": "Widget Theme", "options": [ { "value": "auto", "label": "Auto (system preference)" }, { "value": "light", "label": "Light" }, { "value": "dark", "label": "Dark" } ], "default": "auto" }, { "type": "select", "id": "lang", "label": "Language", "options": [ { "value": "auto", "label": "Auto-detect" }, { "value": "en", "label": "English" }, { "value": "nl", "label": "Nederlands" }, { "value": "de", "label": "Deutsch" }, { "value": "fr", "label": "Français" }, { "value": "pl", "label": "Polski" }, { "value": "es", "label": "Español" } ], "default": "auto" }, { "type": "select", "id": "currency", "label": "Currency", "options": [ { "value": "EUR", "label": "EUR (€)" }, { "value": "GBP", "label": "GBP (£)" }, { "value": "USD", "label": "USD ($)" }, { "value": "PLN", "label": "PLN (zł)" } ], "default": "EUR" }, { "type": "range", "id": "max_width", "label": "Maximum Width (px)", "min": 360, "max": 1200, "step": 20, "default": 600 }, { "type": "select", "id": "alignment", "label": "Widget Alignment", "options": [ { "value": "left", "label": "Left" }, { "value": "center", "label": "Center" }, { "value": "right", "label": "Right" } ], "default": "center" } ], "presets": [ { "name": "HotelBook Booking Widget", "category": "Bookings" } ] } {% endschema %}