Custom Delivery Dates on Attributes
$( document ).ready(function() {
$("#aw_box .aw_content .aw_content td div div div:contains('días')").each(function( index ) {
var months = new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
var days = new Array ("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
var num_days_text=$(this).text();
var num_days= num_days_text.trim().substring(0,2);
var curdate = new Date();
var realDaysToAdd = num_days;
if (curdate.getDay()!=6 && curdate.getDay()!=0) {
if(curdate.getHours()>=12) realDaysToAdd++;
} else {
realDaysToAdd++;
}
while (realDaysToAdd > 0){
curdate.setDate(curdate.getDate()+1);
if (curdate.getDay()!=6 && curdate.getDay()!=0) realDaysToAdd--;
}
var date = curdate;
var day = date.getDate();
var year = date.getFullYear();
var fecha = days[curdate.getDay()]+' '+day+' de '+months[date.getMonth()];
$(this).text(fecha);
});
$("#aw_box tr:contains('Entrega Prevista')").css("position","relative").hover(
function() {
$( this ).append("<div class='entregatooltip' style='left:0;top:-160px;background-color: black; color:white;font-weight: bold; border: 2px solid #FF0084; position: absolute;height:110px;width: 250px;box-shadow:3px 3px 5px rgba(0,0,0,0.4); border-radius:10px;padding: 20px;'>No tiene en cuenta festivos locales y nacionales.El plazo se incrementaría 1 día laborable.</div>" );
}, function() {
$( this ).find( ".entregatooltip" ).remove();
}
);
$("#aw_box tr:contains('Entrega Prevista(*)')").css("position","relative").hover(
function() {
$( this ).append("<div class='entregatooltip' style='left:0;top:-160px;background-color: black; color:white;font-weight: bold; border: 2px solid #FF0084; position: absolute;height:110px;width: 250px;box-shadow:3px 3px 5px rgba(0,0,0,0.4); border-radius:10px;padding: 20px;'>Para cantidades superiores a 15000 uds, el plazo podría verse aumentado 2 días laborables. No tiene en cuenta festivos locales y nacionales.</div>" );
}, function() {
$( this ).find( ".entregatooltip" ).remove();
}
);
$("#aw_box tr:contains('Entrega Prevista(**)')").css("position","relative").hover(
function() {
$( this ).append("<div class='entregatooltip' style='left:0;top:-160px;background-color: black; color:white;font-weight: bold; border: 2px solid #FF0084; position: absolute;height:110px;width: 250px;box-shadow:3px 3px 5px rgba(0,0,0,0.4); border-radius:10px;padding: 20px;'>Para cantidades superiores a 15000 ud y gramaje de 170/250 gr, el plazo podría verse aumentado 2 días laborables. No tiene en cuenta festivos locales y nacionales.</div>" );
}, function() {
$( this ).find( ".entregatooltip" ).remove();
}
);
$("#aw_box tr:contains('Entrega Prevista(***)')").css("position","relative").hover(
function() {
$( this ).append("<div class='entregatooltip' style='left:0;top:-160px;background-color: black; color:white;font-weight: bold; border: 2px solid #FF0084; position: absolute;height:110px;width: 250px;box-shadow:3px 3px 5px rgba(0,0,0,0.4); border-radius:10px;padding: 20px;'>Plastificado o Barniz UVI, el plazo podría verse aumentado 2 días laborables. No tiene en cuenta festivos locales y nacionales.</div>" );
}, function() {
$( this ).find( ".entregatooltip" ).remove();
}
);
});
in source code of template/pruduct.tpl add:
<script type="text/javascript" src="customdates.js" charset="utf-8"></script>