Offer

Module key: offer

Content

Key

Type

Description

name

String

pre_title

String

If you need a line before the name of the offer

sub_title

String

If you need a line after the name of the offer

short_description

WYSIWYG

long_description

WYSIWYG

configuration_text

WYSIWYG

Additional WYSIWYG

email

String

external_link

String

booking_engine_url

String

The booking engine url. Usually, opens in a new tab

rate

String

The price of the offer. This includes the currency

Configuration

key

Type

is_featured

0 / 1

If the offer is featured

is_guest_portal

0 / 1

If the offer should also display on the Guest Portal

Photos

has_photo

Returns 0 or 1

nb_photo

Returns the number of photos

first_photo

second_photo

photos

(loop)

photos_featured

(loop)

Documents

{if=" '{{item.nb_document}}' != '0' "}
    <ul>
        #$loop|{{item.offer_document}}|{document}| $#
        <li><a href="{document.url}">{document.titre}</a></li>
        #$/loop|{{item.offer_document}}|{document}| $#
    </ul>
{/if}

In context data

Offers can linked to several hotels, and some information can be different for each hotel. For example if your offer is for HOTEL A and HOTEL B, the booking url for each of this hotel can be different.

item.booking_engine_url

item.booking_engine_url : this will automatically get the correct booking url based on the current context. For example, in the context of an hotel, this will return you the correct booking url (the one for the selected hotel, or fallback to the brand or master brand url)

item.booking_engine_urls

item.booking_engine_urls (loop) : allows you to loop on the different booking url that have been set for each hotel in the BO.

#$loop|{{item.booking_engine_urls}}|{h}| $#
    <a href="{h.url}">{h.name}</a>
#$/loop|{{item.booking_engine_urls}}|{h}| $#

Highlight / Conditions:

{{item.highlights_in_context}}
{{item.condition_in_context}}

item.hotel

item.hotel (loop) : allows you to loop on the different hotels linked to this offer.

<!-- On offer detail page --->
#$loop|{{item.hotel}}|{h}| $#
    {h.id}
    {h.name}
    {h.brand_id}
    {h.region.id} - {h.region.name}
    {h.location.id} - {h.location.city}
    {h.country.id} - {h.country.name} - {h.country.continent}
    {h.telephone}
    {h.city}
    {h.googlecountry}
    {h.first_photo}
#$/loop|{{item.hotel}}|{h}| $#

Get offers by category

If you want to let the user choose the category:

<!-- Get offers of a specific category.
#$variable|category$# is a variable type "unit", 
module name "category_offer_mb" -->

#$loop|{offer,[category_id=#$variable|category$#]}|{a}| $#
<div>{a.name}</div>
#$/loop|{offer,[category_id=#$variable|category$#]}|{a}| $#

Get offers by hotel (group website)

If you are using a variable to decide which hotel:

#$loop|{offer,[hotel_id=#$variable|hotel$#]}|{a}| $#
<div>{a.name}</div>
#$/loop|{offer,[hotel_id=#$variable|hotel$#]}|{a}| $#

Group Detail Offer linking to property detail offer

This case is pretty complex, make sure you have the correct configuration (group website with detail page, property website with offer detail page)

If you have a configuration with:

  • 1 group website (with offer detail page)

  • N property websites (with offer detail page)

And from the detail page offer in a group website you have a list of linked hotels, with a link to the offer detail page in the hotel website. There is a specific function created for this use case.

Code inside the group offer detail page where you will use {detail_page(a.id,3,'offer')}

<!-- This needs to be inside an offer detail page -->
{if=" '{{item.nb_hotel}}' != '0' "}
  #$loop|{{item.hotel}}|{a}|$#
      <div>
        hotel name = {a.name} -
        {if=" '{detail_page(a.id,3,'offer')}' "}
          <a href="{detail_page(a.id,3,'offer')}">link to detail page in property website</a>
        {/if}
      </div>
  #$/loop|{{item.hotel}}|{a}|$#
{else}
  <div>No hotels</div>
{/if}

The only thing here that needs to be adapted is a.id , it can be different if your loop is not using "a" but something else. Make sure when you copy it not to add extra spaces.

This function will search for the offer detail page in the website that is attached to the hotel (a.id)

The link of the offer detail page can be the "live URL" (with the domain) not the local website link.

Last updated