the attached code displays the menu, but has nothing to do with adding items to an order (cart), entering the customer information, or submitting/saving that information as an order.
some points about the posted code, most of which will greatly simplify it (eliminating more than half of the typing) -
use 'require' for things your code must have.
don't prepare and execute a query that doesn't have any dynamic value being supplied to it. just use the ->query() method.
the settings don't need elseif() logic, just if(), because the option_name can only be one value at any time.
Don't Repeat Yourself (DRY.) there are only a few small things different between the corresponding if/else code blocks. the conditional logic should only setup the values for the different things in variables, then simply output them in one instance of the code.
don't run queries inside of loops. use a single LEFT JOIN query to get the menu categories and menu items all at once. when you fetch the data, index/pivot it using the category id as the main array index. you can then simply loop over the data using two nested foreach(){} loops to produce the output.
don't create unused variables/code.
when embedding a php echo statement in html markup, use php's short-open-echo tag <?= and you can leave out the closing ; right before a closing ?> tag, for example - <?=$source?>
SELECT queries that can return more than one row need an ORDER BY ... term to insure that the rows are in an expected order.