33 lines
1.4 KiB
HTML
33 lines
1.4 KiB
HTML
{{define "content"}}
|
|
<script type="text/javascript">
|
|
function deleteitem(id) {
|
|
location.href = '/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="/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}}
|
|
<div style="float: right; margin-right: 5%; margin-top:20px; text-align: right;">Wartość koszyka: {{ .cart.PriceTotal }} zł<br>
|
|
{{if gt .cart.ItemsTotal 0}}
|
|
<a href="/checkout"><input type="button" value="Podsumowanie"></a>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|