Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 4c727541 authored by 65160270's avatar 65160270
Browse files

update-cart

parent 6fe24348
No related branches found
No related tags found
No related merge requests found
<%- include('partials/header') %> <%- include('partials/header') %>
<a href="/products/add"> <a href="/products/add">
<button style="background-color: blue; color: white; padding: 10px 15px; border: none; cursor: pointer;"> <button style="background-color: blue; color: white; padding: 10px 15px; border: none; cursor: pointer;">
เพิ่มสินค้า Add Product
</button> </button>
</a> </a>
<div class="products"> <div class="products">
...@@ -13,7 +12,7 @@ ...@@ -13,7 +12,7 @@
<img src="<%= product.image_url %>" alt="<%= product.name %>"> <img src="<%= product.image_url %>" alt="<%= product.name %>">
<h3><%= product.name %></h3> <h3><%= product.name %></h3>
<p><%= product.description %></p> <p><%= product.description %></p>
<p>สินค้าเหลือ <%= product.stock %> ชิ้น</p> <p>Stock left: <%= product.stock %> pcs</p>
<p class="price">฿<%= product.price.toLocaleString() %></p> <p class="price">฿<%= product.price.toLocaleString() %></p>
<form action="/cart/add" method="POST"> <form action="/cart/add" method="POST">
<input type="hidden" name="productId" value="<%= product.id %>"> <input type="hidden" name="productId" value="<%= product.id %>">
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
<button type="submit">Add to Cart</button> <button type="submit">Add to Cart</button>
</form> </form>
<td> <td>
<a href="/products/edit/<%= product.id %>">แก้ไข</a> <!-- ปุ่มแก้ไข --> <a href="/products/edit/<%= product.id %>">Edit</a> <!-- Edit button -->
</td> </td>
</div> </div>
<% }); %> <% }); %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment