expressCart/views/themes/Cloth/cart.hbs

82 lines
4.7 KiB
Handlebars
Raw Normal View History

<div class="card top-marg-15 bottom-marg-15">
<div class="card-body cart-body">
<h5 class="card-title">{{ @root.__ "Cart contents" }}</h5>
<div class="cartBodyWrapper">
2019-12-30 13:10:57 +10:00
{{#each @root.session.cart}}
<div class="d-flex flex-row bottom-pad-15">
<div class="p-2">
2019-12-30 13:10:57 +10:00
<div class="row h-200">
<div class="col-4 col-md-3 no-pad-left">
{{#if productImage}}
<img class="img-fluid" src="{{this.productImage}}" alt="{{this.title}} product image">
{{else}}
<img class="img-fluid" src="/uploads/placeholder.png" alt="{{this.title}} product image">
{{/if}}
2019-12-30 13:10:57 +10:00
</div>
<div class="col-8 col-md-9">
<div class="row">
<div class="col-12 no-pad-left mt-md-4">
<h6><a href="/product/{{this.link}}">{{this.title}}</a></h6>
{{#each this.options}}
{{#if @last}}
<strong>{{#upperFirst this.name}}{{/upperFirst}}</strong>: {{this.value}}
{{else}}
<strong>{{#upperFirst this.name}}{{/upperFirst}}:</strong> {{this.value}} /
{{/if}}
{{/each}}
</div>
{{#ifCond @root.cartReadOnly '!=' true}}
<div class="col-12 col-md-6 no-pad-left mb-2">
<div class="input-group">
<div class="input-group-prepend">
<button class="btn btn-outline-primary btn-qty-minus" type="button">-</button>
</div>
<input type="number" class="form-control cart-product-quantity text-center" id="{{../this.productId}}-qty" data-id="{{../this.productId}}" maxlength="2" value="{{../this.quantity}}">
<div class="input-group-append">
<button class="btn btn-outline-primary btn-qty-add" type="button">+</button>
</div>
</div>
2019-12-30 13:10:57 +10:00
</div>
<div class="col-4 col-md-2 no-pad-left">
<button class="btn btn-outline-danger btn-delete-from-cart" data-id="{{../this.productId}}" type="button"><i class="far fa-trash-alt" data-id="{{../this.productId}}" aria-hidden="true"></i></button>
</div>
{{/ifCond}}
<div class="col-8 col-md-4 align-self-center text-right">
<strong class="my-auto">{{currencySymbol @root.config.currencySymbol}}{{formatAmount this.totalItemPrice}}</strong>
2019-12-30 13:10:57 +10:00
</div>
2018-01-07 04:55:48 +10:00
</div>
</div>
</div>
2019-12-30 13:10:57 +10:00
</div>
2018-01-07 04:55:48 +10:00
</div>
2019-12-30 13:10:57 +10:00
{{/each}}
2018-01-07 04:55:48 +10:00
</div>
<div class="cartTotalsWrapper container-fluid">
2019-11-03 19:34:20 +10:00
{{#if @root.session.cart}}
<div class="row">
<div class="cart-contents-shipping col-md-12 no-pad-right">
{{#ifCond @root.session.totalCartShipping '>' 0}}
<div class="text-right">
2020-01-04 17:26:30 +10:00
{{@root.session.shippingMessage}}: <strong id="shipping-amount">{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}</strong>
</div>
{{else}}
<div class="text-right">
2020-01-04 17:26:30 +10:00
<span id="shipping-amount">{{@root.session.shippingMessage}}</span>
</div>
{{/ifCond}}
<div class="text-right">
Total:
<strong id="total-cart-amount">{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartAmount}}</strong>
</div>
</div>
2018-02-05 07:39:42 +10:00
</div>
{{else}}
<div id="cart-empty" class="row">
<div class="cart-contents-shipping col-md-12 no-pad-right">
Cart empty
</div>
2018-02-05 07:39:42 +10:00
</div>
{{/if}}
2018-01-07 04:55:48 +10:00
</div>
2018-02-05 07:39:42 +10:00
</div>
</div>