Skip to content

Conversation

@teastudiopl
Copy link

What?

This PR adds a new method refreshCart to the E-commerce plugin.

Why?

Currently, the standard addItem method enforces uniqueness validation for products in the cart. This conflicts with certain use cases where the same product should be added as a new line item.

By exposing refreshCart, developers can manually refresh the cart state after directly modifying cart items, ensuring the UI stays in sync without being blocked by addItem’s uniqueness validation.

This addresses the feature request described in #14765
and the related discussion #14764
.

How?

Added refreshCart method to the E-commerce context.

This allows programmatic updates to the cart state without triggering the uniqueness validation of addItem.

The method can be called after direct modifications to the cart (e.g., via fetch requests or custom logic).

Fixes

Fixes #14765

@teastudiopl teastudiopl changed the title #14765 - Ecommerce Plugin - Expose manual refreshCart in useCart #14765 - feat Ecommerce Plugin - Expose manual refreshCart in useCart Nov 30, 2025
@teastudiopl teastudiopl changed the title #14765 - feat Ecommerce Plugin - Expose manual refreshCart in useCart feat(plugin-ecommerce): expose manual refreshCart in useCart (#14765) Nov 30, 2025
@teastudiopl teastudiopl changed the title feat(plugin-ecommerce): expose manual refreshCart in useCart (#14765) feat(plugin-ecommerce): expose method refreshCart in useCart (#14765) Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ecommerce Plugin - Expose manual refreshCart and updateCart in useCart

1 participant