From 7b56164747ce5b2b89d747c132bb28247177b949 Mon Sep 17 00:00:00 2001 From: vilgefortzz Date: Mon, 19 Jun 2017 17:09:00 +0200 Subject: [PATCH] Simple recommendation system was added based on the 6 products with the best average rating. Final touches and improvements --- config/debugbar.php | 2 +- ...017_03_05_184755_create_products_table.php | 1 - resources/views/admin/orders/orders.blade.php | 6 +- resources/views/main_page.blade.php | 68 +++++++++---------- routes/web.php | 5 +- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/config/debugbar.php b/config/debugbar.php index b343d32..b52053d 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -12,7 +12,7 @@ | */ - 'enabled' => true, + 'enabled' => false, /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2017_03_05_184755_create_products_table.php b/database/migrations/2017_03_05_184755_create_products_table.php index 861c724..7f953d3 100644 --- a/database/migrations/2017_03_05_184755_create_products_table.php +++ b/database/migrations/2017_03_05_184755_create_products_table.php @@ -23,7 +23,6 @@ public function up() $table->integer('number_of_ratings')->unsigned()->nullable(); $table->float('ratings_sum')->unsigned()->nullable(); $table->float('average_rating')->unsigned()->nullable(); - $table->boolean('recommended')->default(false); $table->timestamps(); $table->integer('subcategory_id')->index()->unsigned(); diff --git a/resources/views/admin/orders/orders.blade.php b/resources/views/admin/orders/orders.blade.php index 185b93b..e980a49 100644 --- a/resources/views/admin/orders/orders.blade.php +++ b/resources/views/admin/orders/orders.blade.php @@ -51,7 +51,7 @@ - Made by: {{ $order->user->username }} + Made by: {{ $order->first_name }} {{ $order->last_name }}
See order details @@ -74,7 +74,9 @@
Payment method: {{ $order->payment->name }}
- Discount for having account: ${{ $order->user->discount }} + @if($order->user) + Discount for having account: ${{ $order->user->discount }} + @endif
Total paid: ${{number_format($order->total_paid, 2, '.', '')}}

diff --git a/resources/views/main_page.blade.php b/resources/views/main_page.blade.php index 3350de4..ad3675f 100644 --- a/resources/views/main_page.blade.php +++ b/resources/views/main_page.blade.php @@ -61,47 +61,45 @@ {{--Horizontal line--}}
- @if(count($recommendedProducts) > 0) -