expressCart/views/themes/Cloth/cart.hbs

101 lines
5.3 KiB
Handlebars
Raw Normal View History

2018-02-05 07:39:42 +10:00
<div class="row">
2018-02-14 06:21:22 +10:00
<div class="col-xs-12 col s12">
2018-01-07 04:55:48 +10:00
{{#if pageCloseBtn}}
<div class="row {{checkout}}">
2018-02-14 06:21:22 +10:00
<div class="col-lg-12 col l12 text-right">
2018-01-07 04:55:48 +10:00
<button class="pushy-link btn btn-primary" type="button">X</button>
</div>
</div>
{{/if}}
<div class="panel panel-default" style="margin-top: 30px;">
<div class="panel-heading">Cart contents</div>
<div class="panel-body cart-body">
<div class="container-fluid">
2018-02-05 07:39:42 +10:00
{{#each session.cart}}
2018-01-07 04:55:48 +10:00
<div class="row cart-row">
2018-02-14 06:21:22 +10:00
<div class="col-xs-4 col-md-2 col s4 m2">
2018-01-07 04:55:48 +10:00
{{#if productImage}}
2018-02-05 07:39:42 +10:00
<img class="img-responsive" src="{{this.productImage}}" alt="{{this.title}} product image"> {{else}}
<img class="img-responsive" src="/uploads/placeholder.png" alt="{{this.title}} product image"> {{/if}}
2018-01-07 04:55:48 +10:00
</div>
2018-02-14 06:21:22 +10:00
<div class="cart-item-row text-left col-xs-12 col-md-7 col s12 m7">
2018-01-07 04:55:48 +10:00
<p>
2018-02-05 07:39:42 +10:00
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p>
<p>
&nbsp;{{#each this.options}} {{#if @last}} {{this}} {{else}} {{this}} / {{/if}} {{/each}}
2018-01-07 04:55:48 +10:00
</p>
<p>
2018-02-05 07:39:42 +10:00
<div class="form-group">
2018-02-14 06:21:22 +10:00
<div class="col-lg-5 col l5 no-pad-left">
2018-02-05 07:39:42 +10:00
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-sm btn-primary btn-qty-minus" type="button">-</button>
</span>
<input type="number" class="form-control cart-product-quantity input-sm text-center" data-id="{{this.productId}}" id="{{@key}}"
maxlength="2" value="{{this.quantity}}">
<span class="input-group-btn">
<button class="btn btn-sm btn-primary btn-qty-add" type="button">+</button>
</span>
</div>
2018-01-07 04:55:48 +10:00
</div>
2018-05-21 23:36:12 +10:00
<span class="pull-right">
<button class="btn btn-sm btn-danger btn-delete-from-cart" data-id="{{this.productId}}" type="button"><i class="fa fa-trash" data-id="{{this.productId}}" aria-hidden="true"></i></button>
</span>
2018-01-07 04:55:48 +10:00
</div>
</p>
</div>
2018-02-14 06:21:22 +10:00
<div class="col-xs-12 col-lg-4 col s12 l4 cart-item-row text-right no-pad-right">
2018-01-07 04:55:48 +10:00
<strong>{{currencySymbol ../config.currencySymbol}}{{formatAmount this.totalItemPrice}}</strong>
2018-02-05 07:39:42 +10:00
</div>
2018-01-07 04:55:48 +10:00
</div>
2018-02-05 07:39:42 +10:00
{{/each}}
2018-01-07 04:55:48 +10:00
</div>
<div class="container-fluid">
2018-02-05 07:39:42 +10:00
{{#if session.cart}}
2018-01-07 04:55:48 +10:00
<div class="row">
2018-02-14 06:21:22 +10:00
<div class="cart-contents-shipping col-md-12 col m12 no-pad-right">
2018-01-07 04:55:48 +10:00
{{#ifCond session.shippingCostApplied '===' true}}
2018-02-05 07:39:42 +10:00
<div class="text-right">
Shipping:
<strong>{{currencySymbol config.currencySymbol}}{{formatAmount config.flatShipping}}</strong>
</div>
{{else}}
<div class="text-right">
Shipping:
<strong>FREE</strong>
</div>
2018-01-07 04:55:48 +10:00
{{/ifCond}}
<div class="text-right">
2018-02-05 07:39:42 +10:00
Total:
<strong>{{currencySymbol config.currencySymbol}}{{formatAmount session.totalCartAmount}}</strong>
2018-01-07 04:55:48 +10:00
</div>
</div>
</div>
2018-02-05 07:39:42 +10:00
{{else}}
<div class="row">
<div class="cart-contents-shipping col-md-12 no-pad-right">
Cart empty
</div>
</div>
{{/if}}
2018-01-07 04:55:48 +10:00
</div>
</div>
</div>
<div class="row">
{{#if session.cart}}
2018-02-14 06:21:22 +10:00
<div class="col-xs-6 col s6 text-left align-right">
2018-02-05 07:39:42 +10:00
<button class="btn btn-danger" id="empty-cart" type="button">Empty cart</button>
</div>
{{#ifCond page '!=' 'pay'}}
2018-02-14 06:21:22 +10:00
<div class="text-right align-right col-xs-6 col s6">
2018-02-05 07:39:42 +10:00
{{#ifCond page '==' 'checkout'}}
<a href="/pay" class="btn btn-default">Pay now</a>
{{else}}
<a href="/checkout" class="btn btn-default">Checkout</a>
2018-01-07 04:55:48 +10:00
{{/ifCond}}
2018-02-05 07:39:42 +10:00
</div>
{{/ifCond}} {{/if}}
2018-01-07 04:55:48 +10:00
</div>
2018-02-05 07:39:42 +10:00
</div>
2018-01-07 04:55:48 +10:00
</div>