Prestashop: blockcart refresh fix

If you have problem with your prestashop 1.5.something when adding product into cart and “blockcart.tpl” doesn’t refresh content, try my dirty hack.

If “block cart” is “empty”, then “cart ajax” doesn’t refresh “cart_block”.

Insert into your “blockcart.tpl” this code:

<script type=”text/javascript”>
jQuery(document).ready(function ($) {
$(‘#add_to_cart a, .ajax_cart_block_remove_link’).on(‘click’, function () {
var selector = “#cart_block”;
$(selector).load(“/ ” + selector);
});
});
</script>

 

Note: you may change jquery selector, if your “add to cart” button has different selector

Note2: and of cource, your cart block must be “id=cart_block”