//JS Object : update the cart by ajax actions
var ajaxCart = {
nb_total_products: 0,
//override every button in the page in relation to the cart
overrideButtonsInThePage : function(){
//for every 'add' buttons...
$(document).off('click', '.ajax_add_to_cart_button').on('click', '.ajax_add_to_cart_button', function(e){
e.preventDefault();
var idProduct = parseInt($(this).data('id-product'));
var idProductAttribute = parseInt($(this).data('id-product-attribute'));
var minimalQuantity = parseInt($(this).data('minimal_quantity'));
if (!minimalQuantity)
minimalQuantity = 1;
if ($(this).prop('disabled') != 'disabled')
//changes
// ajaxCart.add(idProduct, null, false, this, minimalQuantity);
ajaxCart.add(idProduct, null, false, this, $('#quantity_to_cart_'+idProduct+'').val());
});
//for product page 'add' button...
if ($('.cart_block').length || contentOnly) {
$(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e){
e.preventDefault();
// ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);
});
}