29 lines
1.2 KiB
HTML
29 lines
1.2 KiB
HTML
{{define "content"}}
|
|
<script type="text/javascript">
|
|
function deleteitem(id) {
|
|
location.href = 'http://127.0.0.1:8000/removeFromCart?id=' + id;
|
|
}
|
|
</script>
|
|
<h1>Koszyk</h1>
|
|
<div class="cartItem">
|
|
<div class="cartItemColumn"><h3>Produkt</h3></div>
|
|
<div class="cartItemColumn"><h3>Cena za szt.</h3></div>
|
|
<div class="cartItemColumn"><h3>Ilość</h3></div>
|
|
<div class="cartItemColumn"><h3>Łącznie</h3></div>
|
|
<div class="cartItemColumn"></div>
|
|
</div>
|
|
{{range $.cart.Products}}
|
|
<div class="cartItem">
|
|
<div class="cartItemColumn">
|
|
<a href="http://127.0.0.1:8000/product?id={{ .Product.Id }}"><b>{{ .Product.Name }}</b>
|
|
<div class="cartItemIcon" style="background-image: url({{ .Product.ImgUrl }});"></div></a>
|
|
</div>
|
|
<div class="cartItemColumn">{{ .Product.Price }} zł</div>
|
|
<div class="cartItemColumn">{{ .Quantity }}</div>
|
|
<div class="cartItemColumn">{{ .PriceTotal }} zł</div>
|
|
<div class="cartItemColumn"><input type="button" value="Usuń" onclick="deleteitem({{ .Product.Id }});" style="background-color: red;"></div>
|
|
</div>
|
|
{{end}}
|
|
Wartość koszyka: {{ .cart.PriceTotal }} zł
|
|
{{end}}
|