Tagged: ,

Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #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&gt;
    <script src=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js”></script&gt;
    <link rel=”stylesheet” href=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css”&gt;

    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

    #911269

    here 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-778242

    i 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

    #911270

    my 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 .pp

    #911502

    Hi,

    Thanks for sharing @guenni007, did you have any luck with the resources above @marco3253?

    Best regards,
    Rikard

    #911586

    ok 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?

    #911591

    this 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&gt;

    <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>

    #912013

    Hi,

    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,
    Ismael

    #914194

    Hi 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.
    Marco

    #914515

    Hi,

    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,
    Basilis

    #914869
    This reply has been marked as private.
    #915254

    Hi,

    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,
    Ismael

    #915793

    Hi,
    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.

    #915796

    Hi,

    Yes, since you made the update to the child theme, it will be safe in the event of updates.

    Best regards,
    Jordan Shannon

    #939312

    Hi 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

    #940174

    Hi,

    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,
    Ismael

    #940442

    Thank 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:

    screenshot

    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 :(

    #941364

    Hi,

    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,
    Ismael

    #941379

    hi 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:

    italian

    english

    french

    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,
    Marco

    #942403

    Hi,

    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):447

    Best regards,
    Ismael

    #942523

    Thank you Ismael, now it’s working fine!

    Thank you for all your patience and help.

    Marco

    #942621

    Hi,

    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

Viewing 21 posts - 1 through 21 (of 21 total)
  • The topic ‘How to include google Jquery and JqueryUI’ is closed to new replies.