Commit 529726e
authored
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](#14765)
and the related discussion
[#14764](#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
1 parent 67cc734 commit 529726e
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
255 | 264 | | |
256 | 265 | | |
257 | 266 | | |
| |||
898 | 907 | | |
899 | 908 | | |
900 | 909 | | |
| 910 | + | |
901 | 911 | | |
902 | 912 | | |
903 | 913 | | |
| |||
960 | 970 | | |
961 | 971 | | |
962 | 972 | | |
963 | | - | |
964 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
965 | 983 | | |
966 | 984 | | |
967 | 985 | | |
| |||
974 | 992 | | |
975 | 993 | | |
976 | 994 | | |
| 995 | + | |
977 | 996 | | |
978 | 997 | | |
979 | 998 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
885 | 889 | | |
886 | 890 | | |
887 | 891 | | |
| |||
0 commit comments