Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1118564

    Hello,
    we make a website for our client and we want on contact form of the date field to display a monthly calendar like in: https://kriesi.at/themes/enfold-restaurant-one-page/#reservations
    We found from your documentation how to visualize it:
    .ui-datepicker-calendar .ui-datepicker-week-end+.ui-datepicker-week-end a.ui-state-default, .ui-datepicker-calendar tr > td:first-child a.ui-state-default {
    background-color: gold;
    pointer-events: none !important;
    }

    But it turned out to be only visible when you logged in as an admin.
    After searching in the forum, we found here (https://kriesi.at/support/topic/date-selection-contact-form/) a code for file function.php :

    The script is being executed before jQuery loads, which is why it’s not working. I’ve added this code in the functions.php file to fix the issue temporarily
    function ava_load_jquery_dep_script() {
    wp_enqueue_script( ‘avia-datepicker-dummy’, get_template_directory_uri() . ‘/js/test.js’, array(‘jquery’), ‘1.0’ );

    wp_add_inline_script( ‘avia-datepicker-dummy’, ‘jQuery(document).ready(function(){ jQuery(“.avia_datepicker”).datepicker({
    beforeShow: function(input, inst) {
    jQuery(“#ui-datepicker-div”).addClass(this.id);
    inst.dpDiv.addClass(“avia-datepicker-div”);
    },
    showButtonPanel: true,
    closeText: AviaDatepickerTranslation.closeText,
    currentText: AviaDatepickerTranslation.currentText,
    nextText: AviaDatepickerTranslation.nextText,
    prevText: AviaDatepickerTranslation.prevText,
    monthNames: AviaDatepickerTranslation.monthNames,
    monthNamesShort: AviaDatepickerTranslation.monthNamesShort,
    dayName: AviaDatepickerTranslation.dayNames,
    dayNamesShort: AviaDatepickerTranslation.dayNamesShort,
    dayNamesMin: AviaDatepickerTranslation.dayNamesMin,
    dayNames: AviaDatepickerTranslation.dayNames,
    dateFormat: AviaDatepickerTranslation.dateFormat,
    firstDay: AviaDatepickerTranslation.firstDay,
    isRTL: AviaDatepickerTranslation.isRTL,
    changeMonth: true,
    changeYear: true,
    yearRange: “c-80:c+10”
    }); });’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘ava_load_jquery_dep_script’, 10 );

    but we put it in our site broke: the full slider stopped working, the menu refused, and more.

    I appreciate the work of your team, the quick reaction and the exact directions.
    Can you give me support?
    Is it possible for a site visitor to choose only dates from today + 7 days?

    #1118986

    Hey Cherryadvertising,

    Thank you for using Enfold.

    Did you set jQuery to load in the footer? Please provide the link to the actual page with the date picker element so that we can check the issue.

    Best regards,
    Ismael

    #1119057

    Hey Ismael,
    I think no.
    Here are the pages I want to use this functionality:

    Best regards,
    Anna

    #1119333

    Hi,

    Thank you for the update.

    Looks like jQuery is not defined or it’s loaded after the script. Please go to the Enfold > Performance panel, look for the “Change WordPress defaults” section, then check if jQuery is currently set to load in the footer.

    Best regards,
    Ismael

    #1119846

    HI,
    Yes it is checked from before. So this is not the problem.

    Best regards,
    Anna

    #1120142

    Hi,

    Thank you for the update.

    Have you tried disabling it? Sorry if our previous reply is somewhat confusing. Please turn that option off if it’s enabled.

    Best regards,
    Ismael

    #1120494

    Hi Ismael,
    now trying this th menu IS working, but the the slider is not. the slider is full wide easy slider. It is on the homepage.

    #1120839

    Hi,

    Thank you for the update.

    The “ava_load_jquery_dep_script” function is causing an error. Please disable it temporarily. The datepicker should be visible whether you’re logged in or not.

    Best regards,
    Ismael

    #1121017

    Hi Ismael,
    Thank you for your response.
    Since I am not a developer could I kindly ask you to write me which part of code I should remove, or in other words how the code should look like in order to make it all work.
    In the mean time I found out one more bug: the animated count down and events count down are not working too.

    #1121371

    Hi,

    Thank for the update.

    They’re all because of the script above. Please look for this code:

    add_action( ‘wp_enqueue_scripts’, ‘ava_load_jquery_dep_script’, 10 );
    

    Replace it with:

    // add_action( ‘wp_enqueue_scripts’, ‘ava_load_jquery_dep_script’, 10 );
    

    That will disable the script completely. Don’t forget to disable the File Compression settings afterwards.

    Best regards,
    Ismael

    #1123114

    Hi, and thanks a lot, that actually worked!
    Now I wanted to ask you one more thing.
    How can I make a set up, so when a user opens the calendar the calendar lets him see the dates available only after 7 days from the date that is now?

    #1123483

    Hi Cherryadvertising,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.