Marion Muszynski 2b3210de36 pack modif
2015-09-29 11:21:12 +02:00

52 lines
1.7 KiB
JavaScript

$(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);
}
}
});
if($('#layer_cart_pack').hasClass('open') == false)
$('#layer_cart_pack').addClass('open');
$('.layer_cart_overlay_pack').show();
});
$('#add_pack_bottom').on('click', function(e){
var addProducts = [];
$(".checkbox_add_bottom").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);
}
}
});
if($('#layer_cart_pack').hasClass('open') == false)
$('#layer_cart_pack').addClass('open');
$('.layer_cart_overlay_pack').show();
});
$('#layer_cart_pack .cross').on('click',function(){
if($('#layer_cart_pack').hasClass('open') == true)
$('#layer_cart_pack').removeClass('open');
$('.layer_cart_overlay_pack').hide();
});
$('.layer_cart_overlay_pack').on('click',function(){
if($('#layer_cart_pack').hasClass('open') == true)
$('#layer_cart_pack').removeClass('open');
$('.layer_cart_overlay_pack').hide();
});
$('#layer_cart_pack .continue.link').on('click',function(){
if($('#layer_cart_pack').hasClass('open') == true)
$('#layer_cart_pack').removeClass('open');
$('.layer_cart_overlay_pack').hide();
});
});