I am now using the using the Commerce Ajax Add to Cart 7.x-2.11 mod, which is going quite well, but the add to cart button for the first listing on any given listing page doesn’t respect the new function of the module. The first add to cart button on any listing page functions as it did prior to installing the module. All the subsequent add to cart buttons on any listing page respect the new function of the module, and work properly.
The first add to cart button on any listing page is using this class:
<input type="submit" id="edit-submit" name="op" value="Add to cart" class="form-submit">
The second add to cart button on that same listing page is using this class:
<input type="submit" id="edit-submit--2" name="op" value="Add to cart" class="form-submit ajax-processed">
Is this possibly an error in our custom theme or environment that is causing this, or has anyone else encountered this? Not sure where to begin. Thanks for any help!
Comments
Comment #2
tonytheferg commentedComment #3
subhojit777`ajax-processed` class is added by the Drupal ajax api. Is the ajax working for first button? If not, then its a bug in the module, and needs investigation.
adds the ajax functionality to the button. I haven't added any checks for first or second button. It is weird that the `ajax-processed` class is not added.
Comment #4
tonytheferg commentedThe Ajax is not working for the first button of every listing page. The first button functions like it did before the module, every other button on the page but the first works properly.
Comment #5
tonytheferg commentedIt's also adding ajax-processed to my search bar only at the listing pages level causing an ajax error: here is the submit class BEFORE clicking:
<button type="submit" id="edit-submit" name="op" value="Search" class="form-submit search-button ajax-processed"><svg class="icon" data-icon="search"><use xlink:href="#icon-search">search</use></svg></button>all the rest of the pages the search button only picks up ajax processed after submitting.
Comment #6
tonytheferg commentedTurns out this was bad custom search block form that was causing the trouble.
Comment #7
rastabout commentedActually, this is still an issue with the standard search form. * Anything that uses the "edit-submit" ID may have issues with ajax, the commerce add to cart button is conflicting.
Here's the solution (Paste this into template.php)