Special offers integration

Special offers list in JSON format

You can view the list of special offers using the following URL:

https://YOUR_DOMAIN_FOR_REZON.COM/ru/HelperAsync/GetAviaOffersList

The response format is JSON. Language for decoding airports, cities, is set in the URL. Example script for the integration of special offers, place this code in a convenient place on your website:

<div id="galileoSpecialOffers"></div>
<script type="text/javascript">
    var galileoProject = "https://YOUR_DOMAIN_FOR_REZON.COM/ru/";

    var specialOffersInitialize = function () {
        if (galileoProject[galileoProject.length - 1] === '/') galileoProject = galileoProject.substring(0, galileoProject.length - 1);
        new function (cb) {
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == XMLHttpRequest.DONE) {
                    if (xmlhttp.status == 200) {
                        cb(JSON.parse(xmlhttp.responseText));
                    }
                    else {
                        alert('Error occurred while loading Galileo Special Offers', xmlhttp);
                    }
                }
            };
            xmlhttp.open("GET", galileoProject + "/HelperAsync/GetAviaOffersList", true);
            xmlhttp.send();
        }(function (rsp) {
            console.log(rsp);
            if (!rsp || !rsp.Data || !rsp.Data.Data || rsp.Data.Data.length === 0) return;

            var ul = document.createElement('ul');
            document.getElementById('galileoSpecialOffers').appendChild(ul);

            for (var i = 0; i < rsp.Data.Data.length; i++) {
                var offer = rsp.Data.Data[i];

                var li = document.createElement('li');
                ul.appendChild(li);
                var a = document.createElement('a');
                li.appendChild(a);

                a.href = offer.LinkToOffer;
                a.setAttribute("target", "_parent");
                a.innerText = "{FROM} {ARROW} {TO} от {PRICE} {CURRENCY}"
                    .replace("{FROM}", offer.CityLangDep)
                    .replace("{TO}", offer.CityLangArr)
                    .replace("{ARROW}", offer.RouteType == "RT" ? "↔" : "→")
                    .replace("{PRICE}", offer.DisplFinalPrice.toFixed(0))
                    .replace("{CURRENCY}", offer.Currency);

            }
        });

    }
    specialOffersInitialize();
</script>

Do not forget to substitute YOUR_DOMAIN_FOR_REZON.COM with the correct URL of your RezOn powered website.

Special offers integration via iframe

To integrate special offer into agency website a script is used that generates an iframe with special offers.

Simply place this code into a relevant place on your website:

<!-- Paste it into your website code -->
<div id="galileoForm"></div>

<script type="text/javascript">
    //iframe link, do not forget to use your website URL instead of YOURDOMAIN
    var galileoProject = "https://YOUR_DOMAIN_FOR_REZON.COM/ru/IFrame?t=aviaoffers"; 
    (function(d) {
        d.head.appendChild((function() {
            var s = d.createElement('script');
            s.src = 'https://bo.rezonuniversal.com/Scripts/iframe.js';
            s.defer = true;
            return s;
        })());
    })(document);
</script>

Last updated

Was this helpful?