Goal: Add Date & Time Picker to checkout page.
Site & Page: indianhomecooks.com/shopping-cart/checkout/
The TimePicker add-on adds a timepicker to jQuery UI Datepicker. I've successfully installed datepicker using the jQuery UI Widgets plugin. However, I have not been able to properly configure the timepicker add-on.
What would the Custom jQuery Code be for this? Add-on author states that the datepicker and slider components are required. Therefore I've (unsuccessfully) tried various versions of this (both slider & datepicker are selected in jQuery UI Scripts):
jQuery(document).ready(function($) {
$( "#datepicker" ).datepicker();
$( "#slider" ).slider();
$('#datetimepicker').datetimepicker();
});
When I call the datetimepicker with id="datetimepicker", nothing occurs, it just displays the input label with an empty input field. If I call with id="datepicker" then the datepicker calendar displays, but without the timepicker add-on. Can I use numerous id's, such as below:
// Add an additional field to the checkout within a new fieldset
add_filter('eshopaddtocheckout','eshop_extras_checkout');
function eshop_extras_checkout($echo){
$echo .= '<fieldset class="eshop eshop_extra">' . "\n";
$echo .= '<legend>Delivery Date:</legend>' . "\n";
$echo .= '<label for="eshop_extra">'.__('Date To Be Delivered','eshop').' <span class="reqd">*</span><br />
<input class="short" type="text" name="eshop_extra" id="datepicker" id="slider" id="datetimepicker" value="" /></label><br />';
$echo .= '</fieldset>' . "\n";
return $echo;
}
my header.php contains:
<script type='text/javascript' src='http://indianhomecooks.com/wp-content/themes/TheCorporation/js/jquery.datePicker-min.js'></script>
<script type='text/javascript' src='http://indianhomecooks.com/wp-content/themes/TheCorporation/js/jquery-ui-timepicker-addon.js'></script>
And I call the css from the header.php, as well:
<link rel="stylesheet" type="text/css" href="http://indianhomecooks.com/wp-content/themes/TheCorporation/jquery-ui-timepicker-addon.css" />
Any suggestions on what I'm missing?
Thank you!