How can I create this functionality

I have a new client - a bakery - that wants an ecommerce functionality like this site https://www.lolascupcakes.co.uk/Ordering/121/Cupcake-Box-Builder-.htm

Effectively, you can order a box of their delicious baked goods in boxes of 4, 8 or 12, and then you choose which cakes you would like to put in the box.

My first thought was to create the box’s as individual products and then use the product variant to choose which cakes you would like, but that feels too messy for me,
So am trying to think of a more elegant solution, that both works, and has good UX design.

I really am stuck on this, so any help will be greatly appreciated.

Thanks