I only display AJAX shopping cart teaser in my blocks. When I click on add to cart, I see the confirmation message but the AJAX shopping cart teaser does not update the number of items currently in the cart, you need to refresh the page to see the current cart content.
If you have both AJAX shopping cart & AJAX shopping cart teaser displaying, Teaser does update.
I use commerce_kickstart 7.x-2.28, dc_ajax_add_cart 7.x-2.1, jquery_update 7.x-3.0-alpha2
Default jQuery version 1.8
Thanks in advance for this new feature!
Comments
Comment #2
anybodyThank you very much for this separate issue after discussion in: #2388483: Ajax Shopping Cart Teaser not updates with Ajax
The reason seems to be that the AJAX changes are not applied to the teaser wrapper div if the main block is missing. As an UNCLEAN QUICKFIX / workaround you can add the main block but hide it by CSS.
For a final fix we should find out why the AJAX manipulations do not work. Perhaps the main block manipulation should simply be removed if the block is not used. That might fix it and make things cleaner.
Comment #3
mchamps commentedThanks for the quick dirty fix, didn't think of it!
I'll do that for now.
Comment #4
grougy commentedHi,
I had the same issue, this module is the best one even if you only need the shopping cart teaser.
The solution to have the teaser updating is to add the js include in the block view of the teaser.
(the js that adds a custom ajax command)
In dc_ajax_add_cart.module,
function dc_ajax_add_cart_block_view,
case 'ajax_shopping_cart_teaser' :
We still have useless ajax commands trying to update main block but it is cleaner than hidding the main block with css.
What do you think about that ?
Comment #5
grougy commentedMy proposal at #4 require a fix in the script dc_ajax_add_cart_html.js
We need to test if Drupal.ajax exists as with only Teaser block we may be on pages without ajax at all and it leads to a js error :
Comment #7
subhojit777I've used the solution as mentioned in #2388483-9: Ajax Shopping Cart Teaser not updates with Ajax, it is a lot cleaner. Even if you add the js multiple times, it is going to be included in the HTML only once. Drupal takes care of that. Also it makes sure that the two blocks are independent.