Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

commerce_ajax_atc

1,364 sites Security covered
View on drupal.org

The Commerce Ajax ATC (Add to cart) module provides a flexible way to add ajax functionality to the Drupal Commerce add to cart form. It provides a variety of ways to render the pop-up messages that can be configured through the UI.

The Commerce Ajax ATC (Add to cart) module differs from the other ajax add to cart modules in the following ways:

  1. The Commerce Ajax ATC (Add to cart) module targets add to cart forms specifically by their ID, so there is complete control over which add to cart forms use ajax.
  2. You enable ajax on the add to cart form through third party settings the same way the Combine order items containing the same product variation. setting is used. This means you can use ajax on one view mode display, and not use it on another display.
  3. We also swap all of the default commerce add to cart messages that implement ajax as described in this article, and as is done in the Commerce Ajax Cart Message module. This allows us to build and control our own custom messages.
  4. The messages that the Commerce Ajax ATC (Add to cart) module provides are configurable through the UI.
  5. Commerce Ajax ATC (Add to cart) module offers 3 types of add to cart confirmation messages.
    1. A configurable non-modal message above the add to cart form.
    2. A configurable modal message pop up.
    3. A configurable colorbox message pop up (requires Colorbox Load module).
  6. You can render the pop-up messages through a twig template, and render the product variation in a view mode.

To set up the module

  • Install the module then go to /admin/commerce/config/product-types/MY_PRODUCT/edit/display, and check Enable Ajax in the format settings for the Add to cart form that you want to have ajax on. Click update, and save.
  • Visit /admin/commerce/config/ajax-settings and configure it to your liking.
  • To enable the custom view mode to render the variation go to /admin/commerce/config/product-variation-types/MY_PRODUCT_VARIATION/edit/display and enable Ajax Add to Cart Popup under Custom display settings.

Developers notes:

  • You can theme the non-modal messages with css by using the .add-to-cart-message class before the .messages and .messages--status classes. For example: .add-to-cart-message .messages and .add-to-cart-message .messages--status.
  • The module ships with a setting to support the Commerce Variation Cart Form module. There are plans to add support for other add to cart forms in the near future.

Known Issues:

Doesn't play well when the quantity widget is missing from the add-to-cart form.#3417030: Quantity gets multiplied when there is no quantity widget on the add-to-cart form

Activity

Total releases
2
First release
Jan 2025
Latest release
1 year ago
Release cadence
48 days
Stability
0% stable

Releases

Version Type Release date
1.0.0-rc4 Pre-release Mar 16, 2025
1.0.0-rc3 Pre-release Jan 27, 2025