-
AuthorPosts
-
July 14, 2019 at 9:28 pm #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?July 15, 2019 at 11:52 pm #1118986Hey 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,
IsmaelJuly 16, 2019 at 7:13 am #1119057Hey Ismael,
I think no.
Here are the pages I want to use this functionality:Best regards,
AnnaJuly 17, 2019 at 3:19 am #1119333Hi,
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,
IsmaelJuly 18, 2019 at 9:01 am #1119846HI,
Yes it is checked from before. So this is not the problem.Best regards,
AnnaJuly 19, 2019 at 11:28 am #1120142Hi,
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,
IsmaelJuly 20, 2019 at 11:16 pm #1120494Hi 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.July 22, 2019 at 1:28 pm #1120839Hi,
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,
IsmaelJuly 22, 2019 at 10:40 pm #1121017Hi 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.July 24, 2019 at 5:19 am #1121371Hi,
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,
IsmaelJuly 30, 2019 at 11:30 am #1123114Hi, 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?July 31, 2019 at 10:20 am #1123483Hi 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 -
AuthorPosts
- You must be logged in to reply to this topic.