Why do shopkeepers shout but then ignore you when you enter?

The short answer

The shout gets you in the door. The ignoring gets you to stay.

Of a hundred tourists passing the stall, perhaps five slow down, two enter, one might buy. The call has to be loud, personal, and relentless because the conversion rate is low.

Once you've entered — crossed from the street into his territory — the dynamic inverts. The shopkeeper who chased you in the street becomes the man who couldn't care less whether you buy. He drinks his tea. He lets you touch things. He waits for you to ask a price, because the person who asks first has already conceded interest.