The nudge counts the cart, not the page
“Four for ten pounds” is scoped to a range of products, not to one product. So it is satisfied by any mix: two brownies and two blondies already make four.
Which means a prompt that counted only the product on screen would tell that shopper to add two more — misstating a price their checkout has already given them. That is worse than saying nothing, because it is the shop getting its own pricing wrong in front of a customer.
So the nudge totals the whole cart. The product-page plugin cannot read the cart itself — the storefront SDK offers navigation and a change event, but not its contents — yet it does not need to. The authenticated fetch carries the shopper’s own session, so the endpoint reads their cart directly.
That call is deliberately not elevated. Elevating it would ask for the app’s cart, which is nobody’s. The product lookups behind it are elevated, because reading the catalogue is not something a visitor may do. Two calls, two different permission stances, in the same request.
One more detail: the quantity in the page’s stepper is added on top of the cart, because the stepper is what the shopper is about to add. Two in the cart and one in the stepper is three, and a prompt that ignores the stepper is wrong for the entire moment somebody is deciding.
And when a different product from the range is added elsewhere on the page, the change event keeps the line honest. It returns nothing to unsubscribe from, so the callback checks the element is still mounted instead.