Adding agoda affiliate searchbox (javascript) into sidebar?
-
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 Samsarin PHP Widget 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' width='32' height='32' 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>
…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. Does anyone know why the old code works, but the new one doesn’t?
-
Somebody helped me out, Agoda forgot to include the closing paramaters in the code they sent me. Here is the correct code if this helps anybody.
<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: 000000, filterCityName: '', fixedCityName: false, hotelID: '', checkInDateBefore: 1, night: 1, language: 1, currencyCode: 'USD', newWindow: false, header: '', footer: '', style: "default", Element: 'SearchBox' }); </script>
- The topic ‘Adding agoda affiliate searchbox (javascript) into sidebar?’ is closed to new replies.