sadaf Posted October 14, 2013 Share Posted October 14, 2013 After i made some change in the code the cart block does not change the quantity even after hitting the add to cart button.. but after refresh it shows 1 product in the cart... this is my demo site link>> http://exoticatrust.com/foodjama/index.php?id_category=7&controller=categorytry hitting the add to cart button.. there is no change... any help appreciated!! Link to comment Share on other sites More sharing options...
vekia Posted October 15, 2013 Share Posted October 15, 2013 it's probably because your script trying to "animate" add to cart button (image flyting to the cart) but you haven't got images there, so js script crashes whole js engine. what to do? from ajax-cart.js (from block cart module directory) remove this code: // add the picture to the cart var $element = $(callerElement).parent().parent().find('a.product_image img,a.product_img_link img'); if (!$element.length) $element = $('#bigpic'); var $picture = $element.clone(); var pictureOffsetOriginal = $element.offset(); pictureOffsetOriginal.right = $(window).innerWidth() - pictureOffsetOriginal.left - $element.width(); if ($picture.length) { $picture.css({ position: 'absolute', top: pictureOffsetOriginal.top, right: pictureOffsetOriginal.right }); } var pictureOffset = $picture.offset(); var cartBlock = $('#cart_block'); if (!$('#cart_block')[0] || !$('#cart_block').offset().top || !$('#cart_block').offset().left) cartBlock = $('#shopping_cart'); var cartBlockOffset = cartBlock.offset(); cartBlockOffset.right = $(window).innerWidth() - cartBlockOffset.left - cartBlock.width(); // Check if the block cart is activated for the animation if (cartBlockOffset != undefined && $picture.length) { $picture.appendTo('body'); $picture .css({ position: 'absolute', top: pictureOffsetOriginal.top, right: pictureOffsetOriginal.right, zIndex: 4242 }) .animate({ width: $element.attr('width')*0.66, height: $element.attr('height')*0.66, opacity: 0.2, top: cartBlockOffset.top + 30, right: cartBlockOffset.right + 15 }, 1000) .fadeOut(100, function() { ajaxCart.updateCartInformation(jsonData, addedFromProductPage); $(this).remove(); }); remember about backups! Link to comment Share on other sites More sharing options...
sadaf Posted October 15, 2013 Author Share Posted October 15, 2013 i did what you said.. now the problem is>> 1.when i click add to cart button it takes me directly to check out page. 2.The cart block on hover doesn't show the drop down. Link to comment Share on other sites More sharing options...
vekia Posted October 15, 2013 Share Posted October 15, 2013 ok so put this code back please. are you able for test purposes put back image on product list (no worries, only for test purposes) Link to comment Share on other sites More sharing options...
sadaf Posted October 15, 2013 Author Share Posted October 15, 2013 yup i did vekia... it working all fine.. okay then just give a tip on how to hide the image without killing any features... i will be glad Link to comment Share on other sites More sharing options...
Recommended Posts