diff --git a/include/library/Crunchbutton/Restaurant.php b/include/library/Crunchbutton/Restaurant.php index 4f18b77e7..3f1fddd00 100644 --- a/include/library/Crunchbutton/Restaurant.php +++ b/include/library/Crunchbutton/Restaurant.php @@ -429,6 +429,27 @@ class Crunchbutton_Restaurant extends Cana_Table { return $out; } + public function priceRange() { + if (!isset($this->_priceRange)) { + $price = 0; + foreach ($this->dishes() as $dish) { + $price += $dish->price; + } + $price = $price / $this->dishes()->count(); + + if ($price > 60) { + $this->_priceRange = '$$$$'; + } elseif ($price > 30) { + $this->_priceRange = '$$$'; + } elseif ($price > 10) { + $this->_priceRange = '$$'; + } else { + $this->_priceRange = '$'; + } + } + return $this->_priceRange; + } + public function save() { if (!$this->timezone) { $this->timezone = 'America/New_York'; diff --git a/include/views/default/crunchbutton/home/index.phtml b/include/views/default/crunchbutton/home/index.phtml index e2718dfc3..7bc588907 100644 --- a/include/views/default/crunchbutton/home/index.phtml +++ b/include/views/default/crunchbutton/home/index.phtml @@ -1,6 +1,6 @@ restaurant->id_restaurant) : ?> title = $this->restaurant->name.' Delivery | '.$this->restaurant->community()->name.' | Food Delivery | Order from Local Restaurants | Crunchbutton'; + $this->title = $this->restaurant->name.' | '.$this->community->name.' Food Delivery | Order from '.($this->community->name_alt ? $this->community->name_alt : 'Local').' Restaurants | Crunchbutton'; ?> isBot()) : ?> @@ -10,38 +10,38 @@
- - + -
- -

restaurant->name?>

-
-
-
- -
-
-

Add to your order

- restaurant->categories() as $category) : ?> -
name()?>
- - + + + +

restaurant->name?>

+
+
+
+ +
+
+

Add to your order

+ restaurant->categories() as $category) : ?> +
name()?>
+ + +
- community->id_community) : ?> title = $this->community->name.($this->community->name_alt ? ' | '.$this->community->name_alt : '').' Food Delivery | Order Food from Local Restaurants | Crunchbutton'; + $this->title = $this->community->name.' Food Delivery | Order Food from '.($this->community->name_alt ? $this->community->name_alt : 'Local').' Restaurants | Crunchbutton'; ?> isBot()) : ?>
diff --git a/www/assets/js/app.js b/www/assets/js/app.js index 89d0e669f..2abefb7fd 100644 --- a/www/assets/js/app.js +++ b/www/assets/js/app.js @@ -180,7 +180,7 @@ App.page.community = function(id) { App.track('Community page loaded', {community: App.community.name}); - document.title = App.community.name + (App.community.name_alt ? ' | ' + App.community.name_alt : '') + ' Food Delivery | Order Food from Local Restaurants | Crunchbutton'; + document.title = App.community.name + ' Food Delivery | Order Food from ' + (App.community.name_alt ? App.community.name_alt : 'Local') + ' Restaurants | Crunchbutton'; var slogan = App.slogans[Math.floor(Math.random()*App.slogans.length)]; var sloganReplace = App.community.prep + ' ' + App.community.name; @@ -231,7 +231,6 @@ App.page.community = function(id) { }; App.page.restaurant = function(id) { - App.currentPage = 'restaurant'; App.cartHighlightEnabled = false; @@ -246,8 +245,7 @@ App.page.restaurant = function(id) { App.restaurant = this; App.track('Restaurant page loaded', {restaurant: App.restaurant.name}); - - document.title = 'Crunchbutton - ' + App.restaurant.name; + document.title = App.restaurant.name + ' | ' + App.community.name + ' Food Delivery | Order from ' + (App.community.name_alt ? App.community.name_alt : 'Local') + ' Restaurants | Crunchbutton'; $('.main-content').html( '
' +