questo è il pezzo di codice che ho modificato, adesso mi seleziona la data ma nel carrello se metto esempio giorno 27/07/2018 mi spunta giorno 9 e non ho capito da dove lo prede.
static $jDate;
if(!class_exists('VmHtml')) require(VMPATH_ADMIN.DS.'helpers'.DS.'html.php');
$id = VmHtml::ensureUniqueId($id);
$dateFormat = vmText::_('COM_VIRTUEMART_DATE_FORMAT_INPUT_J16');//="m/d/y"
$search = array('m', 'd', 'Y');
$replace = array('mm', 'dd', 'yy');
$jsDateFormat = str_replace($search, $replace, $dateFormat);
if ($date) {
$formatedDate = JHtml::_('date', $date, $dateFormat, false );
/*$date1 = new DateTime($date);
$formatedDate = $date1->format($dateFormat);*/
}
else {
$formatedDate = vmText::_('COM_VIRTUEMART_NEVER');
}
$display = '<input class="datepicker-db" id="'.$id.'" type="hidden" name="'.$name.'" value="'.$date.'" />';
$display .= '<input id="'.$id.'_date" class="datepicker" type="date" value="'.$formatedDate.'" />';
if ($resetBt) {
$display .= '<span class="vmicon vmicon-16-logout icon-nofloat js-date-reset"></span>';
}
// If exist exit
if ($jDate) {
return $display;
}
self::addJScript('datepicker','
jQuery(document).ready( function($) {
$(document).on( "focus",".datepicker", function() {
$( this ).datepicker({
changeMonth: true,
changeYear: true,
'.$yearRange.'
'.$minMax.'
dateFormat:"'.$jsDateFormat.'",
altField: $(this).prev(),
altFormat: "dd-mm-yy"
});
});
$(document).on( "click",".js-date-reset", function() {
$(this).prev("input").val("'.vmText::_('COM_VIRTUEMART_NEVER').'").prev("input").val("0");
});
});
');
questo l'originale
static $jDate;
if(!class_exists('VmHtml')) require(VMPATH_ADMIN.DS.'helpers'.DS.'html.php');
$id = VmHtml::ensureUniqueId($id);
$dateFormat = vmText::_('COM_VIRTUEMART_DATE_FORMAT_INPUT_J16');//="m/d/y"
$search = array('m', 'd', 'Y');
$replace = array('mm', 'dd', 'yy');
$jsDateFormat = str_replace($search, $replace, $dateFormat);
if ($date) {
$formatedDate = JHtml::_('date', $date, $dateFormat, false );
/*$date1 = new DateTime($date);
$formatedDate = $date1->format($dateFormat);*/
}
else {
$formatedDate = vmText::_('COM_VIRTUEMART_NEVER');
}
$display = '<input class="datepicker-db" id="'.$id.'" type="hidden" name="'.$name.'" value="'.$date.'" />';
$display .= '<input id="'.$id.'_text" class="datepicker" type="text" value="'.$formatedDate.'" />';
if ($resetBt) {
$display .= '<span class="vmicon vmicon-16-logout icon-nofloat js-date-reset"></span>';
}
// If exist exit
if ($jDate) {
return $display;
}
self::addJScript('datepicker','
jQuery(document).ready( function($) {
$(document).on( "focus",".datepicker", function() {
$( this ).datepicker({
changeMonth: true,
changeYear: true,
'.$yearRange.'
'.$minMax.'
dateFormat:"'.$jsDateFormat.'",
altField: $(this).prev(),
altFormat: "yy-mm-dd"
});
});
$(document).on( "click",".js-date-reset", function() {
$(this).prev("input").val("'.vmText::_('COM_VIRTUEMART_NEVER').'").prev("input").val("0");
});
});
');
tra l'altro prima senza loggarmi vedevo i prodotti nel carrello anche solo facendo acquista, mentre adesso se non mi loggo i prodotti non li vedo. Questa da cosa può essere causato ?