The trouble is that they aren't allowed to give gum as change.

So a lot of major supermarkets will pick up a piece of gum or chocolate and scan it, so that it adds to the bill and rounds it up to an even number.

Therefore the gum isn't change, but another item of your shopping.

I always just pay with a card these days, that way you only pay for what you want, and not a dirham more.