Ubercart AJAX Cart

Component ID

301116

Component name

Ubercart AJAX Cart

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

46947

Component created

Component changed

Component body

What is Ubercart AJAX Cart?

This module provides a drop-in replacement for the default Ubercart cart block that is entirely AJAX enabled, allowing users to add, update or remove items from their cart without needing to refresh the page.

Branches

7.x-1.x

Current maintainers do not currently have the resources to port Ubercart AJAX Cart to Drupal 7, although there are some people involved in the port. Help/patches are welcome! See #1120590: Ubercart Ajax Cart upgrade for Drupal 7 . Please send a message if you are interested in becoming maintainer for the 7.x branch.

For Drupal 7 users moving to Commerce, a new module commerce_ajax_cart is being written. You can find the first development version here.

6.x-2.x (recommended for all Drupal 6 users)

This is the recommended release series for all users. Bugfixes and new features are being implemented here. Below is a list of current features:

  • AJAX operations on cart (add to cart, remove, update) for registered and anonymous users (incl. with anonymous caching enabled).
  • CSS class to include/exclude products from this AJAX functionality.
  • Falls back gracefully for users without JavaScript support.
  • Supports product kits (also restrictions for the single products in a product kit).
  • Supports Ubercart's Cart Links module.
  • No extra theming required (this module takes theming of normal cart, although you are free to implement your own customizations).
  • Products will not be added to cart unless all of their required attributes are filled out by the user
  • Collapsible cart block (optionally, with a animation effect).
  • On screen themeable notifications (centered with overlay, Growl-like).

Roadmap for future development of this branch:

  • Refactor JavaScript (or at least, comment it better).
  • Better handling of caching.
  • A documentation for developers.

6.x-1.x

This branch has been deprecated in favour of the 2.x branch and is only accepting security fixes.

Known Issues

UC Ajax Cart seems to be very stable, but there are some issues when used with other modules:

Use with Boost (or other caching modules)

If your caching module has an ignore list, be sure to add uc_ajax_cart* as well as the Ubercart checkout pages (cart as well as checkout*) to the cache-less page list.

In Boost, you can do so by setting the 'Statically cache specific pages' Boost option to 'Cache every page except the listed pages' and then adding uc_ajax_cart* to the list.

If you are using authacache, see here.

Use with Ubercart Cart Links

If you want to use Cart Links, uc_ajax_cart needs to know which links are cart links. Do this simply by adding the ajax-cart-link class to all your cart links.

Using cart block with anonymous page caching enabled

If just want a cart block for anonymous users with cache enabled but you don't want the AJAX cart, go settings page and:

  • Enable 'Ajax Support for anonymous users'
  • Disable 'Ajaxify cart page'
  • Select 'Ajaxify only products that have the specified CSS class' in 'Apply Ajax Cart functionality to specified products', and use a nonexistent CSS class.

Use with Secure Pages (or other SSL modules)

Add uc_ajax_cart* to the ignore settings of secure pages module to ensure that the AJAX callbacks complete successfully. Otherwise, you may experience problems due to the browser's same origin policy.

Credits

chellman help with the initial set up this project. Original development of the module was sponsored by Erik Seifert of b-connect. Recent development of this module is sponsored by Metadrop and Grindflow Management LLC.