Page 1 of 1
[1.2.8] Cart not properly refreshed
Posted: Thu Jun 18, 2009 7:19 pm
by JNeuhoff
When using the enabled flying-animation during an Add-to-Cart, the shopping cart is not always refreshed, especially not for the first time it is done. Has someone solved this issue yet? Is it a bug in the way Ajax is used for this?
Re: [1.2.8] Cart not properly refreshed
Posted: Thu Jun 18, 2009 9:34 pm
by phpuk
Hi JNeuhoff,
phpuk wrote:
AJAX Script update:
Script: catalog/view/theme/default/template/module/cart.tpl
The current fix is:
Code: Select all
$(document).ready(function () {
$('#add_to_cart').replaceWith('<a onclick="" id="add_to_cart" class="button">' + $('#add_to_cart').html() + '</a>');
$('#add_to_cart').click(function () {
$.ajax({
type: 'post',
url: 'index.php?route=checkout/cart',
data: $('#product :input'),
success: function(){
$('#module_cart .middle').load('index.php?route=module/cart/callback');
}
});
var image = $('#image').offset();
var cart = $('#module_cart').offset();
$('#image').before('<img src="' + $('#image').attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />');
params = {
top : cart.top + 'px',
left : cart.left + 'px',
opacity : 0.0,
width : $('#module_cart').width(),
heigth : $('#module_cart').height()
};
$('#temp').animate(params, 'slow', false, function () {
$('#temp').remove();
});
});
});
This however has not been acknowledged by Daniel as the final solution as is therefore simply an option at the moment.
With the speed of development at the moment release candidates would not be very beneficial. Daniel updates the version number so that should be enough for now. You should view them all as BETA release candidates although the product is stable.
A version number displayed in the Admin section would be useful though.
Phil.
Phil.
Re: [1.2.8] Cart not properly refreshed
Posted: Thu Jun 18, 2009 9:45 pm
by JNeuhoff
Thanks, I'll try your updated Ajax script and let know how it works.