How can I limit the quantity of a single product in a cart?

For a simple feature like this Shopify should code it in the backend instead of store owners having to do the heavy lifting, please pull up your socks Shopify and make this a basic offering.