v0.30: product pages, categories, sale prices and order status timeline
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<h2 class="section__title">Популярные категории</h2>
|
||||
<div class="categories">
|
||||
{{range .Categories}}
|
||||
<a href="#catalog" class="category-card">
|
||||
<a href="/category/{{.Slug}}" class="category-card">
|
||||
<span class="category-card__name">{{.Name}}</span>
|
||||
<span class="category-card__count">{{.Count}} товаров</span>
|
||||
</a>
|
||||
@@ -60,24 +60,7 @@
|
||||
</div>
|
||||
<div class="products">
|
||||
{{range .Products}}
|
||||
<article class="product-card">
|
||||
<div class="product-card__image">
|
||||
<img src="{{.ImageURL}}" alt="{{.Name}}" loading="lazy">
|
||||
<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">
|
||||
<span class="product-card__price">{{printf "%.0f" .Price}} ₽</span>
|
||||
<form method="POST" action="/cart/add">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{{template "product_card" .}}
|
||||
{{else}}
|
||||
<p class="empty">Товары скоро появятся в каталоге.</p>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user