Add fine-grained control for cart display on the /cart page

Created on 30 November 2024, 22 days ago

Description:

The current implementation of the /cart page in Commerce Cart displays all carts associated with a user or session. While this is suitable in some scenarios, it can create confusion for users when multiple carts (draft or abandoned) are shown.

This issue isn't limited to multi-store setups. A common scenario arises when a user creates a cart while logged in, logs out, creates a new cart anonymously, and then logs back in. In this case, both carts are displayed on the /cart page, which can disrupt the user experience.

Proposed Feature:

Provide fine-grained control over the display of carts on the /cart page via module settings or Views configuration. For instance:

A setting to restrict the /cart page to display only the active cart tied to the current session or the most recently created cart.
An option to determine how multiple carts (if present) are handled, such as merging them or hiding older carts.

Use Cases:

Single active cart: A common requirement for most e-commerce stores where displaying only the active cart avoids confusion for users.
Prevent duplicate carts: For users switching between logged-in and anonymous sessions, ensure only one cart is displayed after login.
Better UX for logged-in users: Prevent showing older abandoned carts when users log back into their account.

Possible Solutions:

Introduce a configuration in the Commerce Cart module settings to manage cart filtering on the /cart page.
Provide a configurable filter in Views for commerce_cart_form to allow displaying only the active cart (e.g., based on session or most recent cart).
Update the cart block logic to ensure the cart summary aligns with the active cart display.

Conclusion:

This enhancement would make the module more adaptable to a wider range of use cases while improving user experience on the /cart page.

Thank you for considering this proposal!

Feature request
Status

Active

Version

2.40

Component

Cart

Created by

🇫🇷France alexdezark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @alexdezark
  • 🇫🇷France alexdezark

    Thank you for your suggestion to use the Commerce Combine Carts module. While it’s an interesting approach, I believe it doesn’t fully solve the issue.

    The Combine Carts module merges all carts, which could confuse users. For example, if a user logs out, starts a new cart, and logs back in, merging items from an old cart into the new one might clutter their cart unnecessarily. This would require manual cleanup, leading to a less-than-ideal shopping experience.

    Our goal is to display only the most relevant cart (e.g., the active one tied to the session) without merging or altering its contents. If there are other approaches you think might work better for this scenario, I’d be happy to consider them.

Production build 0.71.5 2024