Commit a2f6466
committed
Fix(button): Prevent WooCommerce notices leaking during cart simulation
WooCommerce stores notices in the global session, not on the cart instance.
During PayPal cart simulation, `add_to_cart()` may trigger notices (e.g. "Please choose product options")
which then persist and are shown to the user.
This change snapshots existing notices before simulation and restores them afterward,
ensuring simulation-generated notices do not leak into the user session while preserving
legitimate notices.1 parent 8ee5cd2 commit a2f6466
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
0 commit comments