Developer docs  /  Themes

Recipe: checkout buttons

The full contract is in checkout-integration.md.The Fluid-side version (per-block "Book now" buttons):

{% comment %} spaceId comes from a block setting of type "space" (numeric Id).
Checkout needs the UId — resolve it through the Spaces context. Caveat:
Spaces holds vacant, active spaces (capped at 200); if the picked space
isn't in it (occupied/inactive), render no button rather than a dead one. {% endcomment %}
{% assign bookSpace = nil %}
{% for s in Spaces %}
{% if s.Id == block.Settings.spaceId %}{% assign bookSpace = s %}{% endif %}
{% endfor %}
{% if bookSpace and bookSpace.AllowOnlineBookings and Settings.ShowBookOnline %}
<a class="btn-primary" href="/checkouts/cn/booking?spaceUId={{ bookSpace.UId }}&months=3">Book now</a>
{% endif %}

  • months means billing cycles for that space's own cycle type, not calendar months — a weekly-billed space with months=3 preselects 3 weeks. Omit the param entirely for a quantity of 1.
  • Omit promotionUId and checkout evaluates promotions itself; passing it only pre-selects one.
  • Fluid HTML-encodes output, so & between params in a template-built href arrives as &amp; in the markup — browsers parse that correctly in attribute values; no special handling needed.