i don't know how to describe it exactly so i added a video from a website that foodomaa also uses.
as you can see on the video, the prices of the ingredients change as soon as you select the size. what you can see that the size is not added but what the big pizza costs. As an example, a small pizza costs $ 5 and a large one $ 9 dollars and if you choose large, for example, + $ 4 is not added, but $ 9 is displayed when you select it.
Such a function would be very helpful because there are, for example, xxxl pizzas where the restaurant owner uses more ingredients than with a small pizza.
so we don't have to enter every ingredient 5 times because there are 5 different sizes. just adjust the prices to the sizes. and that saves the database from having several identical ingredients and junk datas.
as you can see in the video, this is feasible.