$(".add-to-cart-cust-update").click(function () {
if ($('.quantity-cust').val() >= 1) {
if($('.quantity-cust').val() % 1 == 0){
$('.error-message-qty').html("");
$('#bundleSummary .box-tocart #qty').val($('.quantity-cust').val());
var new_qty_cust = $('.quantity-cust').val();
//$("button.tocart").submit();
$('.page-product-bundle.catalog-product-view .modal-inner-wrap ').css({'width': '30% !important', 'height': 'auto', 'margin-top': '0px',
'background-color': '#666', 'text-align': 'center', 'color': '#fff'});
var post_url = $("#product_addtocart_form").attr("action"); //get form action url
var form_data = $("#product_addtocart_form").serialize(); //Encode form elements for submission
$.post( post_url, form_data, function( response ) {
/*For showing popup*/
var popup = $('
').html($('.page-title span').text() + '
was updated in your shopping cart..').modal({ //get product name from product view page only
modalClass: 'add-to-cart-popup',
buttons: []
});
popup.modal('openModal');
/* For qty update in mincart*/
//alert(old_qty_cust+'+++'+new_qty_cust);
var qty_to_add = new_qty_cust-old_qty_cust;
/*For image flying*/
var currentImg = $('.fotorama__stage__frame.fotorama__active img');
var cart = $('.changed_minicart');
var imgclone = currentImg.clone().offset({
top: currentImg.offset().top,
left: currentImg.offset().left
}).addClass('imgfly').css({
'opacity': '0.7',
'position': 'absolute',
'height': '180px',
'width': '180px',
'z-index': '1000'
}).appendTo(jQuery('body')).animate({
'top': cart.offset().top + 10,
'left': cart.offset().left + 10,
'width': 55,
'height': 55
}, 1000, 'easeInOutExpo');
imgclone.animate({
'width': 0,
'height': 0
});
setTimeout(function () {
jQuery(imgclone).remove();
}, 3000);
if ($('.total-quote-count').length) {
var total_qty = parseInt($('.totalitems').find('a').html())+parseInt(qty_to_add);
if ($('.quantity-cust').val() <= 1) {
$('.top-link-cart').html('My Cart (' + total_qty + ' item)');
}else{
$('.top-link-cart').html('My Cart (' + total_qty + ' items)');
}
$('.counter-number').html('('+total_qty+')');
} else {
if ($('.quantity-cust').val() <= 1) {
$('.top-link-cart').html('My Quote (' + $('.quantity-cust').val() + ' item)');
} else {
$('.top-link-cart').html('My Quote (' + $('.quantity-cust').val() + ' items)');
}
}
});
//});
/*setTimeout(function () {
//$("#popup-modal-cart").modal('openModal');
}, 2000);*/
}else{
$('.error-message-qty').html("The quantity can't be decimal!");
}
} else {
$('.error-message-qty').html("The quantity not zero!");
}
});
$(".tocompare").click(function(event) {
var popup = $('
').html($('.page-title span').text() +response ).modal({ //get product name from product view page only
modalClass: 'add-to-cart-popup',
buttons: []
});
popup.modal('openModal');
/*event.preventDefault();
var data_post = $.parseJSON($(this).attr('data-post'));
var post_url = data_post.action; //get form action url
var form_data = data_post.data;
alert(111);
$.post( post_url, form_data, function( response ) {
/*For showing popup*/
/* alert(response);
//alert(222);
});
return false; */
});
$("#product-options-wrapper .nested.options-list .field.choice").click(function () {
setTimeout(function () {
var con_val = $('#bundleSummary .price-as-configured span.price').html();
$('.price-to span span.price').html(con_val);
}, 500);
});
});
-->
$(".add-to-cart-cust-update").click(function () {
if ($('.quantity-cust').val() >= 1) {
if($('.quantity-cust').val() % 1 == 0){
$('.error-message-qty').html("");
$('#bundleSummary .box-tocart #qty').val($('.quantity-cust').val());
var new_qty_cust = $('.quantity-cust').val();
//$("button.tocart").submit();
$('.page-product-bundle.catalog-product-view .modal-inner-wrap ').css({'width': '30% !important', 'height': 'auto', 'margin-top': '0px',
'background-color': '#666', 'text-align': 'center', 'color': '#fff'});
var post_url = $("#product_addtocart_form").attr("action"); //get form action url
var form_data = $("#product_addtocart_form").serialize(); //Encode form elements for submission
$.post( post_url, form_data, function( response ) {
/*For showing popup*/
var popup = $('
').html($('.page-title span').text() + '
was updated in your shopping cart..').modal({ //get product name from product view page only
modalClass: 'add-to-cart-popup',
buttons: []
});
popup.modal('openModal');
/* For qty update in mincart*/
//alert(old_qty_cust+'+++'+new_qty_cust);
var qty_to_add = new_qty_cust-old_qty_cust;
/*For image flying*/
var currentImg = $('.fotorama__stage__frame.fotorama__active img');
var cart = $('.changed_minicart');
var imgclone = currentImg.clone().offset({
top: currentImg.offset().top,
left: currentImg.offset().left
}).addClass('imgfly').css({
'opacity': '0.7',
'position': 'absolute',
'height': '180px',
'width': '180px',
'z-index': '1000'
}).appendTo(jQuery('body')).animate({
'top': cart.offset().top + 10,
'left': cart.offset().left + 10,
'width': 55,
'height': 55
}, 1000, 'easeInOutExpo');
imgclone.animate({
'width': 0,
'height': 0
});
setTimeout(function () {
jQuery(imgclone).remove();
}, 3000);
if ($('.total-quote-count').length) {
var total_qty = parseInt($('.totalitems').find('a').html())+parseInt(qty_to_add);
if ($('.quantity-cust').val() <= 1) {
$('.top-link-cart').html('My Cart (' + total_qty + ' item)');
}else{
$('.top-link-cart').html('My Cart (' + total_qty + ' items)');
}
$('.counter-number').html('('+total_qty+')');
} else {
if ($('.quantity-cust').val() <= 1) {
$('.top-link-cart').html('My Quote (' + $('.quantity-cust').val() + ' item)');
} else {
$('.top-link-cart').html('My Quote (' + $('.quantity-cust').val() + ' items)');
}
}
});
//});
/*setTimeout(function () {
//$("#popup-modal-cart").modal('openModal');
}, 2000);*/
}else{
$('.error-message-qty').html("The quantity can't be decimal!");
}
} else {
$('.error-message-qty').html("The quantity not zero!");
}
});
$(".tocompare").click(function(event) {
var popup = $('
').html($('.page-title span').text() +response ).modal({ //get product name from product view page only
modalClass: 'add-to-cart-popup',
buttons: []
});
popup.modal('openModal');
/*event.preventDefault();
var data_post = $.parseJSON($(this).attr('data-post'));
var post_url = data_post.action; //get form action url
var form_data = data_post.data;
alert(111);
$.post( post_url, form_data, function( response ) {
/*For showing popup*/
/* alert(response);
//alert(222);
});
return false; */
});
$("#product-options-wrapper .nested.options-list .field.choice").click(function () {
setTimeout(function () {
var con_val = $('#bundleSummary .price-as-configured span.price').html();
$('.price-to span span.price').html(con_val);
}, 500);
});
});
-->