VAT & zero-rated for takeaway UK

Hi all! Looking for a solution to managing VAT in the UK - context is the ability to charge regular VAT on products consumed in store, and have them zero-rated if they buy them to go. Any ideas? I was wondering if I could do something with Shopify functions?