|
23 | 23 |
|
24 | 24 | <div class="container"> |
25 | 25 | <% products.forEach(product => { %> |
26 | | - <div class="card"> |
27 | | - <img src="<%= product.image %>" alt="<%= product.name %>" class="product-image"> |
28 | | - <div class="product-details"> |
29 | | - <h2><%= product.name %></h2> |
30 | | - <p class="company"><strong>Company:</strong> <%= product.company %></p> |
31 | | - <p class="price"><strong>Price:</strong> <%= product.price %></p> |
32 | | - <p class="category"><strong>Category:</strong> <%= product.category %></p> |
33 | | - <% if (product.featured) { %> |
34 | | - <p class="featured"><strong>Featured:</strong> Yes</p> |
35 | | - <% } else { %> |
36 | | - <p class="featured"><strong>Featured:</strong> No</p> |
37 | | - <% } %> |
38 | | - <% if (product.shipping) { %> |
39 | | - <p class="shipping"><strong>Shipping:</strong> Yes</p> |
40 | | - <% } else { %> |
41 | | - <p class="shipping"><strong>Shipping:</strong> No</p> |
42 | | - <% } %> |
| 26 | + <a href="/product/<%=product.id%>"> |
| 27 | + <div class="card"> |
| 28 | + <img src="<%= product.image %>" alt="<%= product.name %>" class="product-image"> |
| 29 | + <div class="product-details"> |
| 30 | + <h2><%= product.name %></h2> |
| 31 | + <p class="company"><strong>Company:</strong> <%= product.company %></p> |
| 32 | + <p class="price"><strong>Price:</strong> <%= product.price %></p> |
| 33 | + <p class="category"><strong>Category:</strong> <%= product.category %></p> |
| 34 | + <% if (product.featured) { %> |
| 35 | + <p class="featured"><strong>Featured:</strong> Yes</p> |
| 36 | + <% } else { %> |
| 37 | + <p class="featured"><strong>Featured:</strong> No</p> |
| 38 | + <% } %> |
| 39 | + <% if (product.shipping) { %> |
| 40 | + <p class="shipping"><strong>Shipping:</strong> Yes</p> |
| 41 | + <% } else { %> |
| 42 | + <p class="shipping"><strong>Shipping:</strong> No</p> |
| 43 | + <% } %> |
| 44 | + </div> |
43 | 45 | </div> |
44 | | - </div> |
| 46 | + </a> |
45 | 47 | <% }); %> |
46 | 48 | </div> |
47 | 49 | </body> |
|
0 commit comments