thomas-shop/templates/order_info.html

58 lines
3.2 KiB
HTML
Raw Permalink Normal View History

2022-05-02 16:26:06 +02:00
{{define "body"}}
<main>
<div class="c-section" style="margin-top: 25px;">
<div class="c-section__content">
<form action="/order/create-order" method="POST">
{{range $k, $v := .order}}
<input name="products[{{$k}}]" type="hidden" value="{{$v}}">
{{end}}
<h2 class="t-h2">Order summary</h2>
<div class="c-order-info">
<div class="c-form-row">
<table class="c-price-table">
{{range $k, $v := .order}}
{{if gt $v 0}}
{{$prod := getProd $k $.products}}
<tr>
<td style="font-weight: 400;">{{$prod.Name}} &times; {{$v}}</td>
<td class="c-price-table__right">{{formatMoney (mult $prod.Price $v)}}</td>
</tr>
{{end}}
{{end}}
<tr class="c-price-table__underline">
<td style="font-weight: 400;">{{.shippingLabel}}</td>
<td class="c-price-table__right">{{formatMoney .shippingCost}}</td>
</tr>
<tr class="c-price-table__top">
<td style="font-weight: 400;">Total</td>
<td class="c-price-table__right">{{formatMoney .total}}</td>
</tr>
</table>
</div>
</div>
<div style="margin-top: 50px">
<h2 class="t-h2">Shipping info</h2>
<label for="" class="c-label">Name/Email</label>
<div class="c-form-row">
<input type="hidden" name="name" id="name" readonly class="c-input" value="{{.shipping.Name}}"/>
<input type="hidden" name="email" readonly class="c-input" value="{{.shipping.Email}}"/>
<input readonly class="c-input" value="{{.shipping.Name}}"/>
<input readonly class="c-input" value="{{.shipping.Email}}"/>
</div>
<label for="" class="c-label">Address</label>
<div class="c-form-row">
<input type="hidden" name="address" readonly class="c-input" value="{{.shipping.Address}}"/>
<input type="hidden" name="postcode" readonly class="c-input" value="{{.shipping.Postcode}}"/>
<input type="hidden" name="city" readonly class="c-input" value="{{.shipping.City}}"/>
<input type="hidden" name="country" readonly class="c-input" value="{{.shipping.Country}}"/>
<input readonly class="c-input" value="{{.shipping.Address}}"/>
<input readonly class="c-input" value="{{.shipping.Postcode}} {{.shipping.City}}, {{index countries .shipping.Country}}"/>
</div>
<button class="c-button c-button">Pay</button>
</form>
</div>
</div>
</main>
{{end}}