Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

This module provides an add-to-cart form for individual Commerce Product Variation entities. The form is added to the Product Variation "manage display" tab as a field, and uses the standard Commerce add-to-cart form functionality.

Form elements may be configured via a form display mode, "Variation Cart Form", on the Commerce Order Item Type "manage form display" tab - similar to configuration for the standard Commerce Product add-to-cart form.

Typical use cases

  • The standard Commerce Product add-to-cart form needs to be replaced with the individual Product Variations as rendered entities, each with their own add-to-cart functionality
  • An individual Product Variation entity needs to be displayed standalone with its own add-to-cart functionality (including Views).
  • The add-to-cart form needs to be displayed among the Product Variation fields.

Requirements

Drupal Commerce modules:

  • Commerce Product
  • Commerce Order
  • Commerce Cart

Configuration

  • Configure Order Item Types in
    Administration >> Commerce >> Configuration >> OrderItem Types
    For each Order Item Type:
    1. Select Operations >> Manage form display.
    2. Select the "Variation Cart Form" form view mode.
    3. Show or hide and configure form fields as desired. Typically you will will either want only the "Quantity" field displayed, or no fields displayed (to show an "add to cart" button with default quantity 1).
    4. Click "Save" to save your changes.
  • Configure Product Variation Types in
    Administration >> Commerce >> Configuration >> Product Variation Types
    For each Product Variation:
    1. Select Operations >> Manage display.
    2. Select the appropriate view mode.
    3. Set the "Add to cart form" field to "visible".
    4. Check the "Combine order items containing the same product variation" checkbox if you want the added Product Variation to be combined with the same item if it already exists in the user's cart.
    5. Click "Save" to save your changes.
  • Configure Product Types in
    Administration >> Commerce >> Configuration >> Product Types
    For each Product Type:
    1. Select Operations >> Manage display.
    2. Select the appropriate display mode.
    3. For the "Variations" field, select "Rendered Entity" instead of "Add to cart form".
    4. Click the settings icon and select the view mode that you configured in the previous step.
    5. Click "Update" to update the settings, then click "Save" to save your changes.
    6. Click the product type "Edit" tab.
    7. Uncheck "Inject product variation fields into the rendered product." This prevents the default variation cart form being duplicated into the product fields.

Similar modules

Commerce Variation Add To Cart provides a field formatter for the Product's variation reference field that displays each Product Variation separately with configurable attributes.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Nov 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.5 Stable Nov 21, 2024