<%= config.widget.attributes.titlePart1 %>
<%= config.widget.attributes.titlePart2 %>
<% for (var i = 0; i < recommendations.length; i++) { %> <% var {url, title, photo, brand, publicprice, discount_rate, price, _id, newstodate} = recommendations[i].product %> <% var discount = Math.round((100 - recommendations[i].product.price * 100 / recommendations[i].product.publicprice)) %>
<% if (publicprice && price < parseInt(publicprice) && discount >= 20) { %>
-<%= discount %>%
<% } else if (new Date(newstodate) > new Date()) { %>
Nouveau
<% } %>
<% if (publicprice && price < parseInt(publicprice) && discount >= 20){ %>
<%= price.toLocaleString('fr', { minimumFractionDigits: 2 }) %>€
<%= parseInt(publicprice) %>€
<% } else { %>
<%= price.toLocaleString('fr', { minimumFractionDigits: 2 }) %>€
<% } %>
<%= title %>
<% if (brand.toLowerCase() === 'adidas') { %>
<%= brand %>
<% } else { %>
<%= brand %>
<% } %>
<%}%>