double check closed

This commit is contained in:
arzynik 2012-07-19 08:53:45 -07:00
parent 961ad45808
commit f7e0ab4217

View File

@ -11,11 +11,15 @@ class Crunchbutton_Order extends Cana_Table {
case 'dishes': case 'dishes':
foreach ($typeItem as $item) { foreach ($typeItem as $item) {
$total += Dish::o($item['id'])->price; $total += Dish::o($item['id'])->price;
foreach ($item['toppings'] as $topping => $bleh) { if ($item['toppings']) {
$total += Topping::o($topping)->price; foreach ($item['toppings'] as $topping => $bleh) {
$total += Topping::o($topping)->price;
}
} }
foreach ($item['toppings'] as $topping => $bleh) { if ($item['substitutions']) {
$total += Substitution::o($topping)->price; foreach ($item['substitutions'] as $topping => $bleh) {
$total += Substitution::o($topping)->price;
}
} }
} }
break; break;
@ -75,6 +79,10 @@ class Crunchbutton_Order extends Cana_Table {
$this->name = c::user()->name; $this->name = c::user()->name;
} }
} }
if (!$this->restaurant()->open()) {
$errors[] = 'This restaurant is closed.';
}
if ($errors) { if ($errors) {
return $errors; return $errors;