Skip to content
Snippets Groups Projects
Commit 67e23e70 authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Cart notification true fix.

parent 775f2209
No related merge requests found
......@@ -104,6 +104,7 @@ function removeItemFromCart(id,source) {
}
return false;
}
var cartNotificationTimeout = false;
function registerUpdateCart($form) {
if($form) {
$("#updateCart, #bottom_updateCart").unbind('click').click(function(){
......@@ -129,18 +130,23 @@ function registerUpdateCart($form) {
});
var updated = getFullCartItems();
var added = updated.length - orig.length;
msg += added + " " + vufindString.itemsAddBag + "\n\n";
msg += added + " " + vufindString.itemsAddBag;
if (inCart > 0 && orig.length > 0) {
msg += inCart + " " + vufindString.itemsInBag + "\n\n";
msg += "<br/>" + inCart + " " + vufindString.itemsInBag;
}
if (updated.length >= vufindString.bookbagMax) {
msg += vufindString.bookbagFull;
msg += "<br/>" + vufindString.bookbagFull;
}
$('#'+elId).popover({content:msg, trigger:'manual'}).popover('toggle');
$('#'+elId).data('popover').options.content = msg;
$('#cartItems strong').html(updated.length);
} else {
$('#'+elId).popover({content:vufindString.bulk_noitems_advice, trigger:'manual'}).popover('toggle');
$('#'+elId).data('popover').options.content = vufindString.bulk_noitems_advice;
}
$('#'+elId).popover('toggle');
clearTimeout(cartNotificationTimeout);
cartNotificationTimeout = setTimeout(function() {
$('#'+elId).popover('hide');
}, 5000);
return false;
});
}
......@@ -195,6 +201,7 @@ $(document).ready(function() {
$('#cartItems').click(function() {
return Lightbox.get('Cart','Cart');
});
$("#updateCart,#bottom_updateCart").popover({content:'error', html:true, trigger:'manual'});
// Overwrite new account form to return to cart
Lightbox.addFormCallback('accountForm', function() {
updatePageForLogin();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment