Closed (fixed)
Project:
Commerce Ajax Add to Cart
Version:
7.x-2.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2015 at 01:51 UTC
Updated:
20 Jun 2017 at 06:50 UTC
Jump to comment: Most recent
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.