-
AuthorPosts
-
February 12, 2018 at 6:54 pm #911267
Dear customer support,
i’m using a booking engine for an hotel in enfold, the booking engine is just a js script to paste in the page i want to show, but the requirements they ask me is to initialise jquery and jqueryUI pasting this code into head section of the website.
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js”></script>
<script src=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js”></script>
<link rel=”stylesheet” href=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css”>i tried to put into functions.php (child) into index.php (child and main enfold both) but i’m doing wrong something.
Where should i put that code?Thank you
February 12, 2018 at 7:02 pm #911269here is an interesting discussion on that – and why you better don’t do that.
https://kriesi.at/support/topic/google-jquery-loading/
with my code here https://kriesi.at/support/topic/google-jquery-loading/#post-778242i tested the performance aspect on gtmetrix and it was nearby zero effect
on using latest version read this here: https://kriesi.at/support/topic/google-jquery-loading/#post-779335
February 12, 2018 at 7:06 pm #911270my script here: https://kriesi.at/support/topic/google-jquery-loading/#post-778242 has the advantage that if google resource could not be loaded – the local one will be loaded instead.
Maybe you are on a local install and internet is offline or fails etc .ppFebruary 13, 2018 at 5:03 am #911502Hi,
Thanks for sharing @guenni007, did you have any luck with the resources above @marco3253?
Best regards,
RikardFebruary 13, 2018 at 10:31 am #911586ok let’s see the question from above.
I need to let work that script for showing a booking form, they asked me to include that code i pasted before, this is a must have requirement?
or i can show any js code making it work with the local libraries already loaded in the website?February 13, 2018 at 10:37 am #911591this is the embed code that i need to let it work:
<div class=”quickSearch”></div>
<script src=’https://scripts.resasecure.net/serv_jScript/webLibraries/js/ext/HNEwidget.js’></script>
<script type=”text/javascript”>
jQuery(document).ready(function () {
jQuery(‘.quickSearch’).HNetBOL({
hotel: (hotelcodehere),
hasPromo: false,
maxNights: 30,
maxAdults: 4,
maxRooms: 4,
maxChildren: 3,
maxChildAge: 12,
language: ‘it’,
forceVertical: false,
hasBestPrice: true,
availableDate: ”,
themeActionColor: ”,
themeActionTextColor: ”,
hideBestPriceAfter: 30
});});
</script>
February 14, 2018 at 1:39 am #912013Hi,
It should work inside a code block element. Have you tried that? If it’s not working, please provide the login details and we’ll test the script.
Best regards,
IsmaelFebruary 19, 2018 at 11:08 am #914194Hi Ismael and thanks for the advice.
You mean “it should work” just pasting inside a code block that script?
Without do anything with the jquery call i posted in the #post-911267?Or i have in any case load the google jquery?
Thank you.
MarcoFebruary 19, 2018 at 8:36 pm #914515Hi,
Jquery is been loaded from WordPress and UI also.
Can you list us your web site so we can check what is missing maybe?Best regards,
BasilisFebruary 20, 2018 at 4:18 pm #914869This reply has been marked as private.February 21, 2018 at 5:28 am #915254Hi,
Thank you for the update.
We loaded the scripts and stylesheets in the functions.php file. You can find the code block in a test page. ( see private field )
The form may require a few css adjustments.
Best regards,
IsmaelFebruary 22, 2018 at 12:25 am #915793Hi,
first of all, thank you. i would never understand how to make it works.I saw you edited function.php into child theme, this means that i can update the main theme without problem, can I?
also, i commented the debug mode call, i can see the script working anyway.I don’t have the ability to understand exactly how you manage this, but it works, and i should not touch it.
Thank you again.February 22, 2018 at 12:31 am #915796Hi,
Yes, since you made the update to the child theme, it will be safe in the event of updates.
Best regards,
Jordan ShannonApril 9, 2018 at 5:06 pm #939312Hi guys, finally the website adopted the new booking engine we talked before.
Just one question, this script is in just one language, as you can see in this row:
language: ‘it’,The website is running WPML, so i tried to do this, unfortunately without success:
added other two code block into the functions.php changing the language tag, and the name of the function:
jQuery(‘.quickSearch_en’).HNetBOL({
…
language: ‘en’,
…jQuery(‘.quickSearch_fr’).HNetBOL({
…
language: ‘fr’,
…then call the function into the page with the code block:
<div class=”quickSearch_en”></div>
or
<div class=”quickSearch_fr”></div>but this is not working. the scripts are called all together and the result is that language are mixed together into the front view.
How do i separate functions and call one by one?
Thank you
April 11, 2018 at 4:26 am #940174Hi,
We modified the script in the functions.php file and the html tags in the test page. The EN version is translated to IT because of W P M L but it should work properly on the actual EN version of the site.
Best regards,
IsmaelApril 11, 2018 at 11:24 am #940442Thank you ismael for your patience, unfortunately i got the same problem:
these are the tries i did now to understand what is not working:
WPML: edited the way permalink are shown, from ?lang=en to “subfolder” mode /en/
Wordpress: re saved permalink option
functions.php: changed the color of the parameter themeActionColor: “#randomhex”; for the three functions, so we can see which one is loaded.
Edited the “welcome” page in all of the three languages:
Italian is calling: <div class=”quickSearch_it”></div>
french is calling: <div class=”quickSearch_fr”></div>
english is calling: <div class=”quickSearch_en”></div>but the result is shown ONLY into the italian language front-page. Also, the content is mixed, cause i see this:
As you can see, button and labels are written in italian, “night” is written in french “nuit” and the color of the button is from the function of the french part #db0d5c
what is happening :(
April 13, 2018 at 9:34 am #941364Hi,
Why do you need to modify the permalink? We already modified the script in the functions.php file. You have to move the code block element with the “quickSearch” container to their respective pages. The code block of the EN version or language should have this container.
<div class="quickSearch_en"></div>
Adjust the country code for the other languages.
Best regards,
IsmaelApril 13, 2018 at 10:16 am #941379hi ismael, thank you for answering.
i changed the permalink into wpml to see if something would change.
maybe i’m not able to describe well the problem, so i made three screenshots one for each language to let me explain better:as you can see, using the code block in wpml pages is working only for italian (main language of the website). also the color of the button is from the french function.
I saw the “test script” page you made, in the front page it’s showing three modules, at a first look seems to work, but:
1) the three codes are in the same ITALIAN WMPL page, if you translate the page and put one of the code it will not show
2) language of the modules are mixed each other like half in italian half in french and non english
3) the button colors should be 3 different colours, instead of the french function color ( i used 3 different colours to see if the call to the functions is really call that specific function)so this is driving me crazy, can’t understand if this stuff is not compatible at all with WPML or it’s just a question of coding.
hope you can now understand my view.
Thank,
MarcoApril 16, 2018 at 4:29 am #942403Hi,
Thank you for the update. We found the following error so we modified the code on the functions.php file. It will now load the script for a particular language only.
HNEwidget.js:1016 Uncaught TypeError: selArrivalDate.getFullYear is not a function
at getBestPrice (HNEwidget.js:1016)
at a.fn.init.$.fn.HNetBOL (HNEwidget.js:1289)
at (index):397
at (index):447Best regards,
IsmaelApril 16, 2018 at 11:45 am #942523Thank you Ismael, now it’s working fine!
Thank you for all your patience and help.
Marco
April 16, 2018 at 3:54 pm #942621Hi,
I’m glad you got this issue solved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘How to include google Jquery and JqueryUI’ is closed to new replies.