//promo start/end date
var startDate = isDateBeforeToday(new Date("Sun Apr 14 2024"));
var endDate = isDateAfterToday(new Date("Thu May 2 2024"));
//get url to check language
var url = location.href;
var id = '<%= product.mpn %>';
var repo = document.getElementById("repo").getAttribute("flag");
//mpn cashback $100
var prod0 = "3380C002";
var prod1 = "3380C132";
var prod2 = "6128C002";
var prod3 = "x";
//mpn cashback $150
var prod4 = "5137C002";
var prod5 = "5137C009";
var prod6 = "5668C002";
function isDateBeforeToday(date) {
return new Date(date.toDateString()) < new Date(new Date().toDateString());
}
function isDateAfterToday(date) {
return new Date(date.toDateString()) > new Date(new Date().toDateString());
}
if (startDate && endDate) {
if (repo == "on") {
if (id == prod0 || id == prod1 || id == prod2 || id == prod3) {
canonCashback100();
}
else if (id == prod4 || id == prod5 || id == prod6) {
canonCashback150();
}
}
}
//create image element
function canonCashback100 () {
var elem = document.createElement("img");
if (url.toString().includes("magasin")) {
elem.setAttribute("src", "https://cdn.prod.website-files.com/5cdb2c0ad519d739e4dedf1e/661d4afb590d7cd9cb2c1890_canonCashback100.png");
}
else {
elem.setAttribute("src", "https://cdn.prod.website-files.com/5cdb2c0ad519d739e4dedf1e/661d4afb590d7cd9cb2c1890_canonCashback100.png");
}
elem.setAttribute("height", "188");
elem.setAttribute("width", "200");
elem.setAttribute("alt", "Canon Promo Badge");
elem.setAttribute("class", "canonPromoBadge");
document.getElementsByClassName("dakis-product-images")[0].appendChild(elem);
document.getElementById("demo").setAttribute("repo", "off");
}
function canonCashback150 () {
var elem = document.createElement("img");
if (url.toString().includes("magasin")) {
elem.setAttribute("src", "https://cdn.prod.website-files.com/5cdb2c0ad519d739e4dedf1e/661d4afb92866134194fdec0_canonCashback150.png");
}
else {
elem.setAttribute("src", "https://cdn.prod.website-files.com/5cdb2c0ad519d739e4dedf1e/661d4afb92866134194fdec0_canonCashback150.png");
}
elem.setAttribute("height", "188");
elem.setAttribute("width", "200");
elem.setAttribute("alt", "Canon Promo Badge");
elem.setAttribute("class", "canonPromoBadge");
document.getElementsByClassName("dakis-product-images")[0].appendChild(elem);
document.getElementById("demo").setAttribute("repo", "off");
}
function canonFreeClass () {
var elem = document.createElement("img");
if (url.toString().includes("magasin")) {
elem.setAttribute("src", "https://irp.cdn-website.com/14aefc77/dms3rep/multi/canon-course-badge-fr.png");
}
else {
elem.setAttribute("src", "https://irp.cdn-website.com/14aefc77/dms3rep/multi/canon-course-badge-fr.png");
}
elem.setAttribute("height", "200");
elem.setAttribute("width", "250");
elem.setAttribute("alt", "Canon Promo Badge");
elem.setAttribute("class", "canonPromoBadge");
document.getElementsByClassName("dakis-product-images")[0].appendChild(elem);
document.getElementById("demo").setAttribute("repo", "off");
}
function canonFreeBattery () {
var elem = document.createElement("img");
if (url.toString().includes("magasin")) {
elem.setAttribute("src", "https://irp.cdn-website.com/14aefc77/dms3rep/multi/canon-battery-badge-fr.png");
}
else {
elem.setAttribute("src", "https://irp.cdn-website.com/14aefc77/dms3rep/multi/canon-battery-badge-fr.png");
}
elem.setAttribute("height", "200");
elem.setAttribute("width", "250");
elem.setAttribute("alt", "Canon Promo Badge");
elem.setAttribute("class", "canonPromoBadge");
document.getElementsByClassName("dakis-product-images")[0].appendChild(elem);
document.getElementById("demo").setAttribute("repo", "off");
}
Parcourir le catalogue des produits