6/7
${data.index + 1}/${data.total}
Description
You may also like
${data.index + 1}/${data.total}
Recently Viewed
Products list
${(function () {
return automatic_discount_list.map((item) => {
const template_type = item.discount[0].template_type;
const is_show_automatic_discount = item.discount[0].product_enabled;
const is_redirection = item.discount[0].is_redirection;
const discount_icon = item.discount_icon;
const first_automatic_discount = item.discount[0];
const first_landing_url = `/promotions/discount-default/${first_automatic_discount.discount_id}`;
const automatic_discount_total = item.discount.length;
const isHasDiscountIcon = discount_icon ? true : false;
const isHasDiscountIconWithNoTag = (template_type != "tag" && isHasDiscountIcon)? true : false;
let color = "#EB391B";
let bgColor = template_type === "text" ? "transparent" : "rgba(235, 57, 27, 0.04)";
let border = template_type == "tag" ? "1px solid rgb(235, 57, 27)": "none";
let template_config = first_automatic_discount.template_config;
if(template_config.length !== 0){
template_config = JSON.parse(template_config);
color= isHasDiscountIconWithNoTag ? template_config.color[template_type].icon_text_color : template_config.color[template_type].text_color;
bgColor = template_type === "text" ? "transparent" : template_config.color[template_type].background_color;
const arrayRgba = bgColor.split(",");
arrayRgba.splice(3, 1, " 1)");
border = template_type === "tag" ? `1px solid ${arrayRgba.join(",")}` : "none";
}
return `
`;
}).join('');
})()}
`
} else {
return ``;
}
})()}