v0.30: product pages, categories, sale prices and order status timeline
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{{define "product_card"}}
|
||||
<article class="product-card">
|
||||
<a href="/product/{{.ID}}" class="product-card__link">
|
||||
<div class="product-card__image">
|
||||
<img src="{{.ImageURL}}" alt="{{.Name}}" loading="lazy">
|
||||
{{if .HasSale}}<span class="product-card__sale">-{{.DiscountPercent}}%</span>{{end}}
|
||||
<span class="product-card__badge">{{.Category}}</span>
|
||||
</div>
|
||||
<div class="product-card__body">
|
||||
<h3 class="product-card__title">{{.Name}}</h3>
|
||||
<p class="product-card__desc">{{plain .Description}}</p>
|
||||
<div class="product-card__footer">
|
||||
<div class="price-block">
|
||||
{{if .HasSale}}
|
||||
<span class="price-block__old">{{printf "%.0f" .Price}} ₽</span>
|
||||
<span class="product-card__price price-block__sale">{{printf "%.0f" .SalePrice}} ₽</span>
|
||||
{{else}}
|
||||
<span class="product-card__price">{{printf "%.0f" .Price}} ₽</span>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<form method="POST" action="/cart/add" class="product-card__cart">
|
||||
<input type="hidden" name="product_id" value="{{.ID}}">
|
||||
<input type="hidden" name="quantity" value="1">
|
||||
<button type="submit" class="btn btn--primary btn--sm">В корзину</button>
|
||||
</form>
|
||||
</article>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user