well? will it be able to keep the door shut on carpets?
yes it will at the proper size it's physics
It will work better because a door wedge uses friction in order to hold a door in place and it would have much better grip on most carpet types, depending on the material the wedge is made of. Any wedge with a bit of a rough surface or made of rubber will work as well or better on most carpets than it would on a smooth floor, whether it's concrete or wood. The key is to have the proper size, slope, and texture, so a little experimentation may be in order.