Add/Update/Remove/empty cart without refreshing the page
parent
f96d8335d6
commit
3373a60d8f
6
app.js
6
app.js
|
@ -302,6 +302,12 @@ handlebars = handlebars.create({
|
||||||
'/': lvalue / rvalue,
|
'/': lvalue / rvalue,
|
||||||
'%': lvalue % rvalue
|
'%': lvalue % rvalue
|
||||||
}[operator];
|
}[operator];
|
||||||
|
},
|
||||||
|
showCartButtons: (cart) => {
|
||||||
|
if(!cart){
|
||||||
|
return'd-none';
|
||||||
|
}
|
||||||
|
return'';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* eslint-disable prefer-arrow-callback, no-var, no-tabs */
|
/* eslint-disable prefer-arrow-callback, no-var, no-tabs */
|
||||||
/* globals showNotification */
|
/* globals showNotification, numeral */
|
||||||
$(document).ready(function (){
|
$(document).ready(function (){
|
||||||
if($(window).width() < 768){
|
if($(window).width() < 768){
|
||||||
$('.menu-side').on('click', function(e){
|
$('.menu-side').on('click', function(e){
|
||||||
|
@ -19,13 +19,6 @@ $(document).ready(function (){
|
||||||
$('#offcanvasClose').hide();
|
$('#offcanvasClose').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If cart was open before reload, open it again
|
|
||||||
var isCartOpen = (localStorage.getItem('cartOpen') === 'true');
|
|
||||||
if(isCartOpen === true){
|
|
||||||
localStorage.setItem('cartOpen', false);
|
|
||||||
$('body').addClass('pushy-open-right');
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#userSetupForm').validator().on('submit', function(e){
|
$('#userSetupForm').validator().on('submit', function(e){
|
||||||
if(!e.isDefaultPrevented()){
|
if(!e.isDefaultPrevented()){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -304,8 +297,8 @@ $(document).ready(function (){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.done(function(msg){
|
.done(function(msg){
|
||||||
$('#cart-count').text(msg.totalCartItems);
|
showNotification(msg.message, 'success');
|
||||||
showNotification(msg.message, 'success', true);
|
updateCartDiv();
|
||||||
})
|
})
|
||||||
.fail(function(msg){
|
.fail(function(msg){
|
||||||
showNotification(msg.responseJSON.message, 'danger');
|
showNotification(msg.responseJSON.message, 'danger');
|
||||||
|
@ -335,8 +328,8 @@ $(document).ready(function (){
|
||||||
data: { productId: $(this).attr('data-id') }
|
data: { productId: $(this).attr('data-id') }
|
||||||
})
|
})
|
||||||
.done(function(msg){
|
.done(function(msg){
|
||||||
$('#cart-count').text(msg.totalCartItems);
|
showNotification(msg.message, 'success');
|
||||||
showNotification(msg.message, 'success', true);
|
updateCartDiv();
|
||||||
})
|
})
|
||||||
.fail(function(msg){
|
.fail(function(msg){
|
||||||
showNotification(msg.responseJSON.message, 'danger');
|
showNotification(msg.responseJSON.message, 'danger');
|
||||||
|
@ -350,7 +343,7 @@ $(document).ready(function (){
|
||||||
url: '/product/emptycart'
|
url: '/product/emptycart'
|
||||||
})
|
})
|
||||||
.done(function(msg){
|
.done(function(msg){
|
||||||
$('#cart-count').text(msg.totalCartItems);
|
updateCartDiv();
|
||||||
showNotification(msg.message, 'success', true);
|
showNotification(msg.message, 'success', true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -405,8 +398,8 @@ function deleteFromCart(element){
|
||||||
data: { productId: element.attr('data-id') }
|
data: { productId: element.attr('data-id') }
|
||||||
})
|
})
|
||||||
.done(function(msg){
|
.done(function(msg){
|
||||||
setCartOpen();
|
showNotification(msg.message, 'success');
|
||||||
showNotification(msg.message, 'success', true);
|
updateCartDiv();
|
||||||
})
|
})
|
||||||
.fail(function(msg){
|
.fail(function(msg){
|
||||||
showNotification(msg.responseJSON.message, 'danger');
|
showNotification(msg.responseJSON.message, 'danger');
|
||||||
|
@ -423,14 +416,6 @@ function cartUpdate(element){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCartOpen(){
|
|
||||||
if($('body').hasClass('pushy-open-right') === true){
|
|
||||||
localStorage.setItem('cartOpen', true);
|
|
||||||
}else{
|
|
||||||
localStorage.setItem('cartOpen', false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateCart(element){
|
function updateCart(element){
|
||||||
// update cart on server
|
// update cart on server
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -442,8 +427,7 @@ function updateCart(element){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.done(function(msg){
|
.done(function(msg){
|
||||||
setCartOpen();
|
updateCartDiv();
|
||||||
showNotification(msg.message, 'success', true);
|
|
||||||
})
|
})
|
||||||
.fail(function(msg){
|
.fail(function(msg){
|
||||||
showNotification(msg.responseJSON.message, 'danger', true);
|
showNotification(msg.responseJSON.message, 'danger', true);
|
||||||
|
@ -487,3 +471,128 @@ function getSelectedOptions(){
|
||||||
});
|
});
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateCartDiv(){
|
||||||
|
$.ajax({
|
||||||
|
method: 'GET',
|
||||||
|
url: '/checkout/cartdata'
|
||||||
|
})
|
||||||
|
.done(function(result){
|
||||||
|
// Update the cart div
|
||||||
|
var cart = result.cart;
|
||||||
|
var session = result.session;
|
||||||
|
var productHtml = '';
|
||||||
|
var totalAmount = numeral(session.totalCartAmount).format('0.00');
|
||||||
|
|
||||||
|
// Work out the shipping
|
||||||
|
var shippingTotalAmt = numeral(session.totalCartShipping).format('0.00');
|
||||||
|
var shippingTotal = `<strong id="shipping-amount">${result.currencySymbol}${shippingTotalAmt}</strong>`;
|
||||||
|
if(shippingTotalAmt === 0){
|
||||||
|
shippingTotal = '<strong id="shipping-amount">FREE</strong>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the cart has contents
|
||||||
|
if(cart){
|
||||||
|
$('#cart-empty').empty();
|
||||||
|
Object.keys(cart).forEach(function(productId){
|
||||||
|
var item = cart[productId];
|
||||||
|
// Setup the product
|
||||||
|
var productTotalAmount = numeral(item.totalItemPrice).format('0.00');
|
||||||
|
var optionsHtml = '';
|
||||||
|
var optionIndex = 1;
|
||||||
|
Object.keys(item.options).forEach(function(key){
|
||||||
|
var option = item.options[key];
|
||||||
|
if(optionIndex === Object.keys(item.options).length){
|
||||||
|
optionsHtml += `<strong>${upperFirst(option.name)}</strong>: ${option.value}`;
|
||||||
|
}else{
|
||||||
|
optionsHtml += `<strong>${upperFirst(option.name)}</strong>: ${option.value} / `;
|
||||||
|
}
|
||||||
|
optionIndex++;
|
||||||
|
});
|
||||||
|
var productImage = `<img class="img-fluid" src="/uploads/placeholder.png" alt="${item.title} product image"></img>`;
|
||||||
|
if(item.productImage){
|
||||||
|
productImage = `<img class="img-fluid" src="${item.productImage}" alt="${item.title} product image"></img>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup the product html
|
||||||
|
productHtml += `
|
||||||
|
<div class="d-flex flex-row bottom-pad-15">
|
||||||
|
<div class="col-4 col-md-3">
|
||||||
|
${productImage}
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md-7">
|
||||||
|
<div class="row h-200">
|
||||||
|
<div class="col-sm-12 text-left no-pad-left">
|
||||||
|
<h6><a href="/product/${item.link}">${item.title}</a></h6>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 text-left no-pad-left">
|
||||||
|
${optionsHtml}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8 no-pad-left">
|
||||||
|
<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="${productId}-qty" data-id="${productId}" maxlength="2" value="${item.quantity}">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button class="btn btn-outline-primary btn-qty-add" type="button">+</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 text-right">
|
||||||
|
<button class="btn btn-outline-danger btn-delete-from-cart" data-id="${productId}" type="button"><i class="far fa-trash-alt" data-id="${productId}" aria-hidden="true"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md-2 align-self-center text-right no-pad-right">
|
||||||
|
<strong class="my-auto">${result.currencySymbol}${productTotalAmount}</strong>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#cartBodyWrapper').html(productHtml);
|
||||||
|
$('#cart-count').text(session.totalCartItems);
|
||||||
|
}else{
|
||||||
|
$('#cartBodyWrapper').html('');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the totals section
|
||||||
|
var cartTotalsHtml = `
|
||||||
|
<div class="row">
|
||||||
|
<div class="cart-contents-shipping col-md-12 no-pad-right">
|
||||||
|
<div class="text-right">
|
||||||
|
Shipping: ${shippingTotal}
|
||||||
|
</div>
|
||||||
|
<div class="text-right">
|
||||||
|
Total:
|
||||||
|
<strong id="total-cart-amount">${result.currencySymbol}${totalAmount}</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
var cartTotalsEmptyHtml = `
|
||||||
|
<div id="cart-empty" class="row">
|
||||||
|
<div class="cart-contents-shipping col-md-12 no-pad-right">
|
||||||
|
Cart empty
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
// Set depending on cart contents
|
||||||
|
if(cart){
|
||||||
|
$('#cartTotalsWrapper').html(cartTotalsHtml);
|
||||||
|
$('#cart-buttons').removeClass('d-none');
|
||||||
|
}else{
|
||||||
|
$('#cartTotalsWrapper').html(cartTotalsEmptyHtml);
|
||||||
|
$('#cart-buttons').addClass('d-none');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.fail(function(result){
|
||||||
|
showNotification(result.responseJSON.message, 'danger');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function upperFirst(value){
|
||||||
|
return value.replace(/^\w/, (chr) => {
|
||||||
|
return chr.toUpperCase();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -131,6 +131,7 @@ router.get('/checkout/shipping', async (req, res, next) => {
|
||||||
session: req.session,
|
session: req.session,
|
||||||
cartSize: 'part',
|
cartSize: 'part',
|
||||||
cartClose: false,
|
cartClose: false,
|
||||||
|
cartReadOnly: true,
|
||||||
page: 'checkout-shipping',
|
page: 'checkout-shipping',
|
||||||
countryList,
|
countryList,
|
||||||
message: clearSessionValue(req.session, 'message'),
|
message: clearSessionValue(req.session, 'message'),
|
||||||
|
@ -146,7 +147,7 @@ router.get('/checkout/cart', (req, res) => {
|
||||||
res.render(`${config.themeViews}checkout-cart`, {
|
res.render(`${config.themeViews}checkout-cart`, {
|
||||||
page: req.query.path,
|
page: req.query.path,
|
||||||
cartSize: 'full',
|
cartSize: 'full',
|
||||||
config: req.app.config,
|
config,
|
||||||
session: req.session,
|
session: req.session,
|
||||||
message: clearSessionValue(req.session, 'message'),
|
message: clearSessionValue(req.session, 'message'),
|
||||||
messageType: clearSessionValue(req.session, 'messageType'),
|
messageType: clearSessionValue(req.session, 'messageType'),
|
||||||
|
@ -156,7 +157,13 @@ router.get('/checkout/cart', (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/checkout/cartdata', (req, res) => {
|
router.get('/checkout/cartdata', (req, res) => {
|
||||||
res.status(200).json(req.session.cart);
|
const config = req.app.config;
|
||||||
|
|
||||||
|
res.status(200).json({
|
||||||
|
cart: req.session.cart,
|
||||||
|
session: req.session,
|
||||||
|
currencySymbol: config.currencySymbol || '$'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/checkout/payment', (req, res) => {
|
router.get('/checkout/payment', (req, res) => {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/css/css.min.js" integrity="sha256-D5oJ11cOmRhXSYWELwG2U/XYH3YveZJr9taRYLZ2DSM=" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/css/css.min.js" integrity="sha256-D5oJ11cOmRhXSYWELwG2U/XYH3YveZJr9taRYLZ2DSM=" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/xml/xml.min.js" integrity="sha256-ERFGS58tayDq5kkyNwd/89iZZ+HglMH7eYXxG1hxTvA=" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/xml/xml.min.js" integrity="sha256-ERFGS58tayDq5kkyNwd/89iZZ+HglMH7eYXxG1hxTvA=" crossorigin="anonymous"></script>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.6/numeral.min.js" integrity="sha256-LlHVI5rUauudM5ZcZaD6hHPHKrA7CSefHHnKgq+/AZc=" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.7/js/tether.min.js" integrity="sha256-4lietOiwRDBKx1goZZbRiwB06L+/bPYEGDIKZt82bgg=" crossorigin="anonymous"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.7/js/tether.min.js" integrity="sha256-4lietOiwRDBKx1goZZbRiwB06L+/bPYEGDIKZt82bgg=" crossorigin="anonymous"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.9/validator.min.js"></script>
|
||||||
<script src="/javascripts/jquery.bootpag.min.js"></script>
|
<script src="/javascripts/jquery.bootpag.min.js"></script>
|
||||||
|
@ -138,12 +139,10 @@
|
||||||
<div id="cart" class="col-md-12">
|
<div id="cart" class="col-md-12">
|
||||||
{{> (getTheme 'cart')}}
|
{{> (getTheme 'cart')}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{#if @root.session.cart}}
|
<div id="cart-buttons" class="col-sm-12 {{showCartButtons @root.session.cart}}">
|
||||||
<div class="col-sm-12">
|
|
||||||
<button class="btn btn-outline-danger float-left" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
<button class="btn btn-outline-danger float-left" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
||||||
<a href="/checkout/information" class="btn btn-outline-primary float-right">Checkout</a>
|
<a href="/checkout/information" class="btn btn-outline-primary float-right">Checkout</a>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
|
|
||||||
<div class="card top-marg-15 bottom-marg-15">
|
<div class="card top-marg-15 bottom-marg-15">
|
||||||
<div class="card-body cart-body">
|
<div class="card-body cart-body">
|
||||||
<h5 class="card-title">{{ @root.__ "Cart contents" }}</h5>
|
<h5 class="card-title">{{ @root.__ "Cart contents" }}</h5>
|
||||||
<div id="cartBodyWrapper">
|
<div id="cartBodyWrapper">
|
||||||
{{#each @root.session.cart}}
|
{{#each @root.session.cart}}
|
||||||
<div class="d-flex flex-row bottom-pad-15">
|
<div class="d-flex flex-row bottom-pad-15">
|
||||||
<div class="col-xs-4 col-md-3">
|
<div class="col-4 col-md-3">
|
||||||
{{#if productImage}}
|
{{#if productImage}}
|
||||||
<img class="img-fluid" src="{{this.productImage}}" alt="{{this.title}} product image"> {{else}}
|
<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}}
|
<img class="img-fluid" src="/uploads/placeholder.png" alt="{{this.title}} product image"> {{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 col-md-7">
|
<div class="col-12 col-md-7">
|
||||||
<div class="row h-200">
|
<div class="row h-200">
|
||||||
<div class="col-sm-12 text-left no-pad-left">
|
<div class="col-sm-12 text-left no-pad-left">
|
||||||
<h6><a href="/product/{{this.link}}">{{this.title}}</a></h6>
|
<h6><a href="/product/{{this.link}}">{{this.title}}</a></h6>
|
||||||
|
@ -20,18 +19,17 @@
|
||||||
{{#if @last}}
|
{{#if @last}}
|
||||||
<strong>{{#upperFirst this.name}}{{/upperFirst}}</strong>: {{this.value}}
|
<strong>{{#upperFirst this.name}}{{/upperFirst}}</strong>: {{this.value}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<strong>{{#upperFirst this.name}}{{/upperFirst}}:</strong> {{this.value}} /
|
<strong>{{#upperFirst this.name}}{{/upperFirst}}:</strong> {{this.value}} /
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
{{#ifCond cartReadOnly '!=' true}}
|
{{#ifCond @root.cartReadOnly '!=' true}}
|
||||||
<div class="col-md-8 no-pad-left">
|
<div class="col-md-8 no-pad-left">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<button class="btn btn-outline-primary btn-qty-minus" type="button">-</button>
|
<button class="btn btn-outline-primary btn-qty-minus" type="button">-</button>
|
||||||
</div>
|
</div>
|
||||||
<input type="number" class="form-control cart-product-quantity text-center" data-id="{{../this.productId}}" data-index="{{@key}}"
|
<input type="number" class="form-control cart-product-quantity text-center" id="{{../this.productId}}-qty" data-id="{{../this.productId}}" maxlength="2" value="{{../this.quantity}}">
|
||||||
maxlength="2" value="{{../this.quantity}}">
|
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn btn-outline-primary btn-qty-add" type="button">+</button>
|
<button class="btn btn-outline-primary btn-qty-add" type="button">+</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,35 +41,35 @@
|
||||||
{{/ifCond}}
|
{{/ifCond}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="align-self-center col-sm-12 col-md-2 text-right no-pad-right">
|
<div class="col-12 col-md-2 align-self-center text-right no-pad-right">
|
||||||
<strong class="my-auto">{{currencySymbol @root.config.currencySymbol}}{{formatAmount this.totalItemPrice}}</strong>
|
<strong class="my-auto">{{currencySymbol @root.config.currencySymbol}}{{formatAmount this.totalItemPrice}}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
<div class="container-fluid">
|
<div id="cartTotalsWrapper" class="container-fluid">
|
||||||
{{#if @root.session.cart}}
|
{{#if @root.session.cart}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="cart-contents-shipping col-md-12 no-pad-right">
|
<div class="cart-contents-shipping col-md-12 no-pad-right">
|
||||||
{{#ifCond @root.session.shippingCostApplied '===' true}}
|
{{#ifCond @root.session.shippingCostApplied '===' true}}
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
{{ @root.__ "Shipping" }}
|
{{ @root.__ "Shipping" }}
|
||||||
<strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}</strong>
|
<strong id="shipping-amount">{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartShipping}}</strong>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
{{ @root.__ "Shipping" }}
|
{{ @root.__ "Shipping" }}
|
||||||
<strong>FREE</strong>
|
<strong id="shipping-amount">FREE</strong>
|
||||||
</div>
|
</div>
|
||||||
{{/ifCond}}
|
{{/ifCond}}
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
Total:
|
Total:
|
||||||
<strong>{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartAmount}}</strong>
|
<strong id="total-cart-amount">{{currencySymbol @root.config.currencySymbol}}{{formatAmount @root.session.totalCartAmount}}</strong>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="row">
|
<div id="cart-empty" class="row">
|
||||||
<div class="cart-contents-shipping col-md-12 no-pad-right">
|
<div class="cart-contents-shipping col-md-12 no-pad-right">
|
||||||
Cart empty
|
Cart empty
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,12 +3,10 @@
|
||||||
<div id="cart" class="col-md-12">
|
<div id="cart" class="col-md-12">
|
||||||
{{> (getTheme 'cart')}}
|
{{> (getTheme 'cart')}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{#if @root.session.cart}}
|
<div id="cart-buttons" class="col-sm-12 {{showCartButtons @root.session.cart}}">
|
||||||
<div class="col-sm-12">
|
|
||||||
<button class="btn btn-outline-danger float-left" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
<button class="btn btn-outline-danger float-left" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
||||||
<a href="/checkout/information" class="btn btn-outline-danger float-right">Checkout</a>
|
<a href="/checkout/information" class="btn btn-outline-danger float-right">Checkout</a>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
{{> (getTheme 'cart')}}
|
{{> (getTheme 'cart')}}
|
||||||
{{#if @root.session.cart}}
|
{{#if @root.session.cart}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div id="cart-buttons" class="col-sm-12 {{showCartButtons @root.session.cart}}">
|
||||||
<button class="btn btn-outline-danger float-right" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
<button class="btn btn-outline-danger float-right" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -29,11 +29,9 @@
|
||||||
<div id="cart" class="col-md-7 d-none d-sm-block">
|
<div id="cart" class="col-md-7 d-none d-sm-block">
|
||||||
{{> (getTheme 'cart')}}
|
{{> (getTheme 'cart')}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{{#if @root.session.cart}}
|
<div id="cart-buttons" class="col-sm-12 {{showCartButtons @root.session.cart}}">
|
||||||
<div class="col-sm-12">
|
|
||||||
<button class="btn btn-outline-danger float-right" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
<button class="btn btn-outline-danger float-right" id="empty-cart" type="button">{{ @root.__ "Empty cart" }}</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue