diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index a59d878..e143976 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -234,21 +234,21 @@ class ProductController extends Controller { // Static announcements for now - can be moved to database later $announcements = [ - [ - 'icon' => '🎉', - 'message' => 'Free Shipping on orders over $250', - 'detail' => "Don't miss a discount!", - ], - [ - 'icon' => '💰', - 'message' => 'Money back guarantee', - 'detail' => 'We return money within 30 days', - ], - [ - 'icon' => '💪', - 'message' => 'Friendly 24/7 customer support', - 'detail' => "We've got you covered!", - ], + // [ + // 'icon' => '🎉', + // 'message' => 'Free Shipping on orders over $250', + // 'detail' => "Don't miss a discount!", + // ], + // [ + // 'icon' => '💰', + // 'message' => 'Money back guarantee', + // 'detail' => 'We return money within 30 days', + // ], + // [ + // 'icon' => '💪', + // 'message' => 'Friendly 24/7 customer support', + // 'detail' => "We've got you covered!", + // ], ]; // Render announcement slides HTML diff --git a/app/Models/Gender.php b/app/Models/Gender.php index ed50549..7f9e4ab 100644 --- a/app/Models/Gender.php +++ b/app/Models/Gender.php @@ -21,4 +21,16 @@ class Gender extends Model protected $primaryKey = 'id'; protected $fillable = ['name', 'image']; + + + + public function items() + { + return $this->hasMany(Items::class, 'gender_id', 'id'); + } + + public function productCount() + { + return $this->items()->count(); + } } diff --git a/app/Repositories/Catalog/GenderRepository.php b/app/Repositories/Catalog/GenderRepository.php index 16d5a8d..8846d75 100644 --- a/app/Repositories/Catalog/GenderRepository.php +++ b/app/Repositories/Catalog/GenderRepository.php @@ -30,6 +30,7 @@ class GenderRepository $ids = collect($ids)->pluck("gender"); return Gender::whereIn("name",$ids)->get(); } + return Gender::get(); } } diff --git a/app/View/Components/Grocery/FeaturedCategories.php b/app/View/Components/Grocery/FeaturedCategories.php index 2835797..f036638 100644 --- a/app/View/Components/Grocery/FeaturedCategories.php +++ b/app/View/Components/Grocery/FeaturedCategories.php @@ -5,15 +5,18 @@ namespace App\View\Components\Grocery; use Closure; use Illuminate\Contracts\View\View; use Illuminate\View\Component; +use App\Repositories\Catalog\GenderRepository; class FeaturedCategories extends Component { + protected $genders = []; + /** * Create a new component instance. */ - public function __construct() + public function __construct(GenderRepository $genderRepository) { - // + $this->genders = $genderRepository->getList([]); } /** @@ -21,6 +24,8 @@ class FeaturedCategories extends Component */ public function render(): View|Closure|string { - return view('components.grocery.featured-categories'); + return view('components.grocery.featured-categories',[ + "genders" => $this->genders, + ]); } } diff --git a/public/img/banner01.png b/public/img/banner01.png new file mode 100644 index 0000000..7d56255 Binary files /dev/null and b/public/img/banner01.png differ diff --git a/public/img/banner02.png b/public/img/banner02.png new file mode 100644 index 0000000..37aa72c Binary files /dev/null and b/public/img/banner02.png differ diff --git a/public/img/thumbnail_demo.png b/public/img/thumbnail_demo.png new file mode 100644 index 0000000..b098b32 Binary files /dev/null and b/public/img/thumbnail_demo.png differ diff --git a/resources/views/components/grocery/featured-categories.blade.php b/resources/views/components/grocery/featured-categories.blade.php index 0f647eb..cbccf6e 100644 --- a/resources/views/components/grocery/featured-categories.blade.php +++ b/resources/views/components/grocery/featured-categories.blade.php @@ -18,71 +18,29 @@ }'>
- -
-
-
-

124 products

-

Only fresh fish to your table

- +
+ @endforeach - -
-
-
-

97 products

-

Products for Easter table

- -
-
- Image -
-
-
- - -
-
-
-

28 products

-

Berries from the garden

- -
-
- Image -
-
-
diff --git a/resources/views/components/grocery/home-slider.blade.php b/resources/views/components/grocery/home-slider.blade.php index c147b4e..d945102 100644 --- a/resources/views/components/grocery/home-slider.blade.php +++ b/resources/views/components/grocery/home-slider.blade.php @@ -44,7 +44,7 @@
-
-
-
+
+
+
diff --git a/resources/views/components/grocery/popular-products.blade.php b/resources/views/components/grocery/popular-products.blade.php index fd7ee72..a7070f0 100644 --- a/resources/views/components/grocery/popular-products.blade.php +++ b/resources/views/components/grocery/popular-products.blade.php @@ -18,13 +18,14 @@ href="{{ route('product.index', ['filter[category]' => $value->id]) }}"> {{ $value->name ?? '' }} -
{{ $value->productCount() }} products
+
{{ $value->productCount() }} products +
@endforeach - - + + @@ -32,8 +33,7 @@

Popular products

diff --git a/resources/views/components/grocery/shop-by-lifestyle.blade.php b/resources/views/components/grocery/shop-by-lifestyle.blade.php index e10cd05..373233b 100644 --- a/resources/views/components/grocery/shop-by-lifestyle.blade.php +++ b/resources/views/components/grocery/shop-by-lifestyle.blade.php @@ -22,21 +22,23 @@ }'>
- @foreach($brands as $brand) - -
-
- {{ $brand->name }} -
-

- - {{ $brand->name }} - -

- {{--

Foods that don't contain gluten

--}} -
+ @foreach ($brands as $brand) + @if ($brand->image_url) +
+
+ {{ $brand->name }} +
+

+ + {{ $brand->name }} + +

+ {{--

Foods that don't contain gluten

--}} +
+ @endif @endforeach
diff --git a/resources/views/components/grocery/special-products.blade.php b/resources/views/components/grocery/special-products.blade.php index 923915a..8e459e0 100644 --- a/resources/views/components/grocery/special-products.blade.php +++ b/resources/views/components/grocery/special-products.blade.php @@ -4,18 +4,18 @@
-
+
-

Make breakfast healthy and easy

+

Find your ways

-
- Banner +
+ Banner
@@ -56,17 +56,17 @@ style="width: 171.75px; margin-right: 24px;">
- + --}} -
+
Image
-
+ {{--
-
+
--}}
{{ $value->display_price_currency }}
diff --git a/resources/views/components/grocery/top-header.blade.php b/resources/views/components/grocery/top-header.blade.php index afd2d87..a37eeec 100644 --- a/resources/views/components/grocery/top-header.blade.php +++ b/resources/views/components/grocery/top-header.blade.php @@ -4,14 +4,16 @@ diff --git a/resources/views/components/layout/header-grocery.blade.php b/resources/views/components/layout/header-grocery.blade.php index 28a346a..1e8f2f8 100644 --- a/resources/views/components/layout/header-grocery.blade.php +++ b/resources/views/components/layout/header-grocery.blade.php @@ -17,7 +17,9 @@ - AsiaGolf + + Logo + diff --git a/resources/views/home/grocery.blade.php b/resources/views/home/grocery.blade.php index d16ebc9..9505fa1 100644 --- a/resources/views/home/grocery.blade.php +++ b/resources/views/home/grocery.blade.php @@ -30,7 +30,7 @@ -
+ {{--

Recipes

@@ -153,7 +153,7 @@
- + --}} @@ -204,7 +204,7 @@
- Image + Image
@@ -213,8 +213,8 @@
- Image + style="--cz-aspect-ratio: calc(244 / 244 * 100%); max-width: 244px"> + Image

We'd love to hear what you think!