Adding agoda affiliate searchbox (javascript) into sidebar?

  • BelmontSlayer

    #3568

    I have a new wordpress site that I’ve affiliated with Agoda. I installed their affilate searchbox into my sidebar using the text/html widget. Now they have sent me an email saying that I must update the code as they will be discontinuing the old searchbox code. I’ve tried using the new code, but it will not load at all. Agoda suggested I try adding it via the widgets “Samsarin PHP” or the “HTML Javascript Adder”, but neither of those work either.

    Here is my working code:

    <div id='agoda_searchbox'><img src='http://ajaxsearch.partners.agoda.com/affiliates/images/ajaxloader.gif' alt='Loading search box ...' /></div>
    <script type='text/javascript' src='http://ajaxsearch.partners.agoda.com/affiliates/js/agoda_search.js'></script>
    <script type='text/javascript'>
    var so = new SrchObject();
    so.clientID('1506166');
    so.addParam('countryid','106');
    so.addParam('cityid','8584');
    so.addParam('usecal','true');
    so.addParam('hidehotel','true');
    so.addParam('uselogo','4');
    so.setColor('text','#000000');
    so.setColor('bg','#ffffff');
    so.setColor('border','#ff3200');
    so.setColor('button_text','#000000');
    so.setColor('button_bg','#ff3200');
    so.addParam('backlink','http://pattayasource.com');
    so.addParam('headerlink','http://pattayasource.com/wp-content/uploads/2012/02/Header2.jpg');
    so.displaySearch('agoda_searchbox');
    </script>
    </div>[/code]

    ...and here's the new code I have to update to:

    <div id="SearchBox"> </div> <script type="text/javascript" src="http://www.agoda.com/js/jquery/jquery-1.4.2.min.js"></script> <script src="http://ajaxsearch.partners.agoda.com/partners/SearchBox/Scripts/Agoda.SearchBox.js" type="text/javascript"></script> <script type="text/javascript"> var AgodaSearch = new AgodaSearchBox({ cid: 1506166, filterCityName: 'Pattaya', fixedCityName: false, hotelID: '', checkInDateBefore: 1, night: 1, language: 1, currencyCode: 'THB', newWindow: false, header: '', footer: '', style: "default", Element: 'SearchBox' </script>

    My website is http://www.pattayasource.com running on 3.3.1 with the Graphene theme.

    [code]<div id="SearchBox"> </div>
    <script type="text/javascript" src="http://www.agoda.com/js/jquery/jquery-1.4.2.min.js"></script&gt;
    <script src="http://ajaxsearch.partners.agoda.com/partners/SearchBox/Scripts/Agoda.SearchBox.js&quot; type="text/javascript"></script>
    <script type="text/javascript">
    var AgodaSearch = new AgodaSearchBox({
    cid: 1506166,
    filterCityName: 'Pattaya',
    fixedCityName: false,
    hotelID: '',
    checkInDateBefore: 1,
    night: 1,
    language: 1,
    currencyCode: 'THB',
    newWindow: false,
    header: '',
    footer: '',
    style: "default",

    Element: 'SearchBox'
    </script>

    My website is http://www.pattayasource.com running on 3.3.1 with the Graphene theme.

    Anonymous

    #24904

    Your missing close params. Try this:

    <div id="SearchBox"> </div>
    <script type="text/javascript" src="http://www.agoda.com/js/jquery/jquery-1.4.2.min.js"></script>
    <script src="http://ajaxsearch.partners.agoda.com/partners/SearchBox/Scripts/Agoda.SearchBox.js" type="text/javascript"></script>
    <script type="text/javascript">
    var AgodaSearch = new AgodaSearchBox({
    cid: 1506166,
    filterCityName: 'Pattaya',
    fixedCityName: false,
    hotelID: '',
    checkInDateBefore: 1,
    night: 1,
    language: 1,
    currencyCode: 'THB',
    newWindow: false,
    header: '',
    footer: '',
    style: "default",

    Element: 'SearchBox'
    });
    </script>

    BelmontSlayer

    #24905

    Wow, I can’t believe they would forget that. This is the “official” code they sent out in their February affiliate newsletter. Thanks a lot Tee_888! You’ve saved me from a long headache. ^_^

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!