Hello,
I am trying to reference an UDO variable (check out date for a hotel reservation) and I want to add 30 days to it and save it in another variable to be able to map it on one Tradedoubler tracksale tag to pass it to them.
How can I reference an UDO variable from my site in the Javascript code of a Javascript Extension or a Set Data Values Extension using the Javascript code option in the combo?
This is my JS code:
(function getTDValidOn() {
var fecha = new Date(CART_HOTEL_FIRST_DEPARTURE_DASH);
fecha.setDate(fecha.getDate() + 30);
alert (fecha);
function padStrTDValidOn(i) {
return (i < 10) ? "0" + i : "" + i;
}
var temp = new Date(fecha);
var dateStr = padStrTDValidOn(temp.getFullYear()) + "-" +
padStrTDValidOn(1 + temp.getMonth()) + "-" +
padStrTDValidOn(temp.getDate());
return dateStr;
})();
The UDO variable I want to reference is CART_HOTEL_FIRST_DEPARTURE_DASH a js UDO variable that contains what I need, the check out date. So my problem is that I don't know how to reference that variable so that I can use it in Javascript extensions or Set Data values extensions.
Would you be so kind to help me with this issue?
Regards,
Alejandro
... View more