expressCart/views/themes/Cloth/index.hbs

68 lines
3.4 KiB
Handlebars

{{> themes/Cloth/front-menu}}
<div class="productsWrapper col-sm-12 col-md-8 offset-md-2">
{{#if filtered}}
<div class="product-layout product-results col-sm-12">
{{#ifCond @root.paginateUrl '==' 'category'}}
<h1>{{ @root.__ "Category" }}: <strong>{{@root.searchTerm}}</strong></h1>
{{else}}
<h1>{{ @root.__ "Search results" }}: <strong>{{@root.searchTerm}}</strong></h1>
{{/ifCond}}
</div>
{{/if}}
<div class="row product-layout">
{{#ifCond results.length '==' 0}}
<div class="col-sm-12">
<p class="text-danger">{{ @root.__ "No products found" }}</p>
</div>
{{/ifCond}}
{{#each results}}
<div class="{{perRowClass ../config.productsPerRow}}">
<div class="thumbnail">
{{#if productPermalink}}
<div class="product-wrapper">
<a href="/product/{{this.productPermalink}}">
<div class="vertical-center img-thumbnail">
{{#if productImage}}
<img class="img-fluid" src="{{this.productImage}}" alt="...">
{{else}}
<img class="img-fluid" src="/uploads/placeholder.png" alt="...">
{{/if}}
</div>
<h3 class="product-title product-title-home top-pad-10">
{{this.productTitle}}
</h3>
</a>
</div>
{{else}}
<a href="/product/{{this._id}}">
<div class="vertical-center img-thumbnail">
{{#if productImage}}
<img class="img-fluid" src="{{this.productImage}}" alt="...">
{{else}}
<img class="img-fluid" src="/uploads/placeholder.png" alt="...">
{{/if}}
</div>
<h3 class="product-title product-title-home top-pad-10">
{{this.productTitle}}
</h3>
</a>
{{/if}}
<h3 class="product-price mp-0 text-center">
{{currencySymbol ../config.currencySymbol}}{{formatAmount productPrice}}
</h3>
<p class="text-center">
<a class="btn btn-primary add-to-cart" data-id="{{this._id}}" data-link="{{this.productPermalink}}" data-has-options="{{checkProductOptions this.productOptions}}" role="button">{{ @root.__ "Add to cart" }}</a>
</p>
</div>
</div>
{{/each}}
</div>
</div>
<input type="hidden" id="itemsPerPage" value="{{productsPerPage}}" >
<input type="hidden" id="pageNum" value="{{pageNum}}">
<input type="hidden" id="totalItemCount" value="{{totalProductCount}}">
<input type="hidden" id="paginateUrl" value="{{paginateUrl}}">
<input type="hidden" id="searchTerm" value="{{searchTerm}}">
<div class="col-md-12">
<div id="pager" class="d-flex justify-content-center"></div>
</div>