toutpratique/modules/cms_pack/pack.js

26 lines
827 B
JavaScript
Raw Normal View History

2015-08-20 11:28:09 +02:00
$(document).ready(function() {
$('#add_pack_right').on('click', function(e){
var addProducts = [];
$(".checkbox_add_right").each(function( index ) {
if ($(this).is(':checked')) {
var idProduct = $(this).attr('name');
var quantity = $('input[name="quantity_'+idProduct+'"]').val();
if (result = ajaxCart.addMultiple(idProduct, null, quantity)) {
addProducts.push(idProduct);
}
}
});
2015-09-28 11:11:58 +02:00
if($('.pack_lightbox').hasClass('shown') == false)
$('.pack_lightbox').addClass('shown');
if($('.pack_overlay').hasClass('shown') == false)
$('.pack_overlay').addClass('shown');
2015-08-20 11:28:09 +02:00
});
2015-09-28 11:11:58 +02:00
$('.pack_overlay').click(function(){
if($('.pack_lightbox.shown').length>0)
$('.pack_lightbox').removeClass('shown');
if($('.pack_overlay.shown').length>0)
$('.pack_overlay').removeClass('shown');
})
2015-08-20 11:28:09 +02:00
});