diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 45a37b4..bebfa47 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -10,8 +10,12 @@ class HomeController extends Controller
public function index(Request $request)
{
-
-
return view('home.fashion-v1');
}
+
+
+ public function store(Request $request)
+ {
+ return view('home.grocery');
+ }
}
diff --git a/app/Models/Items.php b/app/Models/Items.php
index c768d64..06e3e2c 100644
--- a/app/Models/Items.php
+++ b/app/Models/Items.php
@@ -338,6 +338,11 @@ class Items extends Model
}
}
+ public function getDisplayPriceCurrencyAttribute()
+ {
+ return 'Rp ' . number_format($this->display_price, 0, ',', '.');
+ }
+
public function getDisplayDiscountPriceAttribute()
{
try {
diff --git a/app/Models/StoreCategory.php b/app/Models/StoreCategory.php
index 4fdf316..4d572f9 100644
--- a/app/Models/StoreCategory.php
+++ b/app/Models/StoreCategory.php
@@ -23,5 +23,13 @@ class StoreCategory extends Model
return $this->hasMany(StoreCapacity::class);
}
+ public function items()
+ {
+ return $this->hasMany(Items::class, 'category_id', 'id');
+ }
+ public function productCount()
+ {
+ return $this->items()->count();
+ }
}
diff --git a/app/Models/User.php b/app/Models/User.php
index c8dd1a8..872cdf2 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -62,6 +62,10 @@ class User extends Authenticatable
{
return $this->hasMany(Address::class);
}
+ public function primary_address()
+ {
+ return $this->hasOne(Address::class)->where('is_primary', true);
+ }
public function getPhotoUrlAttribute()
{
diff --git a/app/View/Components/Grocery/DeliveryOptions.php b/app/View/Components/Grocery/DeliveryOptions.php
new file mode 100644
index 0000000..c9bf51c
--- /dev/null
+++ b/app/View/Components/Grocery/DeliveryOptions.php
@@ -0,0 +1,29 @@
+categories = $categoryRepository->getList([]);
+ $this->genders = $genderRepository->getList([]);
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+
+ return view('components.grocery.header-category-dropdown', [
+ 'categories' => $this->categories,
+ 'genders' => $this->genders,
+ ]);
+ }
+}
diff --git a/app/View/Components/Grocery/HomeSlider.php b/app/View/Components/Grocery/HomeSlider.php
new file mode 100644
index 0000000..f41f5d0
--- /dev/null
+++ b/app/View/Components/Grocery/HomeSlider.php
@@ -0,0 +1,29 @@
+items = $repository->getList([]);
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.grocery.home-slider', [
+ 'items' => $this->items
+ ]);
+ }
+}
diff --git a/app/View/Components/Grocery/PopularProducts.php b/app/View/Components/Grocery/PopularProducts.php
new file mode 100644
index 0000000..ed159dc
--- /dev/null
+++ b/app/View/Components/Grocery/PopularProducts.php
@@ -0,0 +1,40 @@
+categories = $categoryRepository->getList([]);
+ $this->products = $productRepository->getList([
+ 'limit' => 12,
+ ]);
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.grocery.popular-products', [
+ 'categories' => $this->categories,
+ 'products' => $this->products,
+ ]);
+ }
+}
diff --git a/app/View/Components/Grocery/ShopByLifestyle.php b/app/View/Components/Grocery/ShopByLifestyle.php
new file mode 100644
index 0000000..e8cda21
--- /dev/null
+++ b/app/View/Components/Grocery/ShopByLifestyle.php
@@ -0,0 +1,34 @@
+brands = $brandRepository->getList([]);
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.grocery.shop-by-lifestyle', [
+ 'brands' => $this->brands,
+ ]);
+ }
+}
diff --git a/app/View/Components/Grocery/SpecialProducts.php b/app/View/Components/Grocery/SpecialProducts.php
new file mode 100644
index 0000000..f102889
--- /dev/null
+++ b/app/View/Components/Grocery/SpecialProducts.php
@@ -0,0 +1,32 @@
+products = $productRepository->getList([
+
+ ]);
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.grocery.special-products',[
+ 'products' => $this->products,
+ ]);
+ }
+}
diff --git a/app/View/Components/Grocery/TopHeader.php b/app/View/Components/Grocery/TopHeader.php
new file mode 100644
index 0000000..5d5bde9
--- /dev/null
+++ b/app/View/Components/Grocery/TopHeader.php
@@ -0,0 +1,28 @@
+getList([]);
+
+ return view('components.grocery.top-header', compact('brands'));
+ }
+}
diff --git a/lang/en/grocery.php b/lang/en/grocery.php
new file mode 100644
index 0000000..0225857
--- /dev/null
+++ b/lang/en/grocery.php
@@ -0,0 +1,34 @@
+ 'Delivery options',
+ 'delivery_tab' => 'Delivery',
+ 'pickup_tab' => 'Pickup',
+
+ // Addresses
+ 'address_1' => '567 Cherry Lane Apt B12 Sacramento, 95829',
+ 'address_2' => '1901 Thornridge Cir. Shiloh, Hawaii, 81063',
+ 'address_3' => '3517 W. Gray St. Utica, Pennsylvania, 57867',
+ 'pickup_address_1' => '123 Main St. Downtown, New York, 10001',
+ 'pickup_address_2' => '456 Oak Avenue Midtown, New York, 10002',
+
+ // Actions
+ 'remove' => 'Remove',
+ 'back_to_addresses' => 'Back to my addresses',
+ 'add_address_title' => 'Add an address to start ordering',
+ 'add_pickup_address_title' => 'Add a pickup address',
+ 'find_on_map' => 'Find on map',
+ 'add_delivery_address' => 'Add delivery address',
+ 'add_pickup_address' => 'Add pickup address',
+
+ // Form Labels
+ 'state_label' => 'State',
+ 'postcode_label' => 'Postcode',
+ 'city_label' => 'City',
+ 'street_address_label' => 'Street address',
+
+ // Form Placeholders
+ 'select_state' => 'Select state',
+ 'select_city' => 'Select city',
+];
diff --git a/lang/id/grocery.php b/lang/id/grocery.php
new file mode 100644
index 0000000..6a8944f
--- /dev/null
+++ b/lang/id/grocery.php
@@ -0,0 +1,34 @@
+ 'Opsi pengiriman',
+ 'delivery_tab' => 'Pengiriman',
+ 'pickup_tab' => 'Ambil sendiri',
+
+ // Addresses
+ 'address_1' => '567 Cherry Lane Apt B12 Sacramento, 95829',
+ 'address_2' => '1901 Thornridge Cir. Shiloh, Hawaii, 81063',
+ 'address_3' => '3517 W. Gray St. Utica, Pennsylvania, 57867',
+ 'pickup_address_1' => '123 Main St. Downtown, New York, 10001',
+ 'pickup_address_2' => '456 Oak Avenue Midtown, New York, 10002',
+
+ // Actions
+ 'remove' => 'Hapus',
+ 'back_to_addresses' => 'Kembali ke alamat saya',
+ 'add_address_title' => 'Tambahkan alamat untuk mulai memesan',
+ 'add_pickup_address_title' => 'Tambahkan alamat pengambilan',
+ 'find_on_map' => 'Cari di peta',
+ 'add_delivery_address' => 'Tambah alamat pengiriman',
+ 'add_pickup_address' => 'Tambah alamat pengambilan',
+
+ // Form Labels
+ 'state_label' => 'Provinsi',
+ 'postcode_label' => 'Kode pos',
+ 'city_label' => 'Kota',
+ 'street_address_label' => 'Alamat jalan',
+
+ // Form Placeholders
+ 'select_state' => 'Pilih provinsi',
+ 'select_city' => 'Pilih kota',
+];
diff --git a/resources/views/components/grocery/delivery-options.blade.php b/resources/views/components/grocery/delivery-options.blade.php
new file mode 100644
index 0000000..531de46
--- /dev/null
+++ b/resources/views/components/grocery/delivery-options.blade.php
@@ -0,0 +1,222 @@
+
+
+
+
+
+
{{ __('grocery.delivery_options_title') }}
+
+
+
+ -
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ __('grocery.add_address_title') }}
+
+
+ {{ __('grocery.find_on_map') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ __('grocery.add_pickup_address_title') }}
+
+
+ {{ __('grocery.find_on_map') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/components/grocery/featured-categories.blade.php b/resources/views/components/grocery/featured-categories.blade.php
new file mode 100644
index 0000000..0f647eb
--- /dev/null
+++ b/resources/views/components/grocery/featured-categories.blade.php
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
124 products
+
Only fresh fish to your table
+
+
+
+

+
+
+
+
+
+
+
+
+
97 products
+
Products for Easter table
+
+
+
+

+
+
+
+
+
+
+
+
+
28 products
+
Berries from the garden
+
+
+
+

+
+
+
+
+
+
+
+
+
diff --git a/resources/views/components/grocery/header-category-dropdown.blade.php b/resources/views/components/grocery/header-category-dropdown.blade.php
new file mode 100644
index 0000000..4ff419f
--- /dev/null
+++ b/resources/views/components/grocery/header-category-dropdown.blade.php
@@ -0,0 +1,40 @@
+
+
+
+
diff --git a/resources/views/components/grocery/home-slider.blade.php b/resources/views/components/grocery/home-slider.blade.php
new file mode 100644
index 0000000..c147b4e
--- /dev/null
+++ b/resources/views/components/grocery/home-slider.blade.php
@@ -0,0 +1,50 @@
+
+
+
+
+ @foreach ($items as $item)
+
+ {{--
+
+
+
+
🔥 Free shipping - order over
+ 50$
+
+
Healthy Food Available to Everyone
+
Shop now
+
+
+
+
--}}
+
 . '/' . $item->filename }})
+
+ @endforeach
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/components/grocery/popular-products.blade.php b/resources/views/components/grocery/popular-products.blade.php
new file mode 100644
index 0000000..fd7ee72
--- /dev/null
+++ b/resources/views/components/grocery/popular-products.blade.php
@@ -0,0 +1,98 @@
+
+
+
+
+
+
Categories
+
+
+ @foreach ($categories as $key => $value)
+
+
+
+
 }})
+
+
+
+
+ @endforeach
+
+
+
+
+
+
+
+
+
+
+
+ @foreach ($products as $key => $value)
+
+
+
+
+
+
{{ $value->display_price_currency }}
+
+
+
{{ $value->unit }}
+
+
+ @endforeach
+
+
+
+
+
+
diff --git a/resources/views/components/grocery/shop-by-lifestyle.blade.php b/resources/views/components/grocery/shop-by-lifestyle.blade.php
new file mode 100644
index 0000000..e10cd05
--- /dev/null
+++ b/resources/views/components/grocery/shop-by-lifestyle.blade.php
@@ -0,0 +1,46 @@
+
+ Brands
+
+
+
+ @foreach($brands as $brand)
+
+
+
+

+
+
+ {{--
Foods that don't contain gluten
--}}
+
+ @endforeach
+
+
+
+
+
+
diff --git a/resources/views/components/grocery/special-products.blade.php b/resources/views/components/grocery/special-products.blade.php
new file mode 100644
index 0000000..923915a
--- /dev/null
+++ b/resources/views/components/grocery/special-products.blade.php
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
Make breakfast healthy and easy
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+ @foreach ($products as $key => $value)
+
+
+
+
+
{{ $value->display_price_currency }}
+
+
+ @if ($value->variants->count() > 1)
+
+ +{{ $value->variants->count() - 1 }} Varian
+ @endif
+
+
+ @endforeach
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/components/grocery/top-header.blade.php b/resources/views/components/grocery/top-header.blade.php
new file mode 100644
index 0000000..afd2d87
--- /dev/null
+++ b/resources/views/components/grocery/top-header.blade.php
@@ -0,0 +1,20 @@
+
diff --git a/resources/views/components/layout/header-grocery.blade.php b/resources/views/components/layout/header-grocery.blade.php
new file mode 100644
index 0000000..28a346a
--- /dev/null
+++ b/resources/views/components/layout/header-grocery.blade.php
@@ -0,0 +1,170 @@
+
+ @include('layouts.partials/offcanvas2')
+
+
+
+ @include('layouts.partials/menu-offcanvas')
+
+
+
+
+
+
+
+
+
+
AsiaGolf
+
+
+
+
+
+
+
+
+
+
+
+ {{--
--}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/home/grocery.blade.php b/resources/views/home/grocery.blade.php
index 65e1d8a..d16ebc9 100644
--- a/resources/views/home/grocery.blade.php
+++ b/resources/views/home/grocery.blade.php
@@ -1,1807 +1,32 @@
@extends('layouts.landing', ['title' => 'Grocery Store'])
@section('content')
- @include('layouts.partials/offcanvas2')
+
-
+
-
-
-
-
Delivery options
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Add an address to start ordering
-
-
- Find on map
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Select a suitable store
-
-
- Find on map
-
-
-
-
-
-
-
-
-
-
-
Found stores:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- @include('layouts.partials/menu-offcanvas')
-
-
-
-
-
-
-
-
-
AsiaGolf
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Account
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
🔥 Free shipping - order over
- 50$
-
-
Healthy Food Available to Everyone
-
Shop now
-
-
-
-
-

-
-
-
-
-
-
-
-
-
🥚 Organic products to your table
-
Organic eggs from home-grown chicken
-
-
Shop now
-
-
-
-
-

-
-
-
-
-
-
-
-
-
🥝 Only natural ingredients
-
Enjoy refreshing summer drink
-
Shop now
-
-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
124 products
-
Only fresh fish to your table
-
-
-
-

-
-
-
-
-
-
-
-
-
97 products
-
Products for Easter table
-
-
-
-

-
-
-
-
-
-
-
-
-
28 products
-
Berries from the garden
-
-
-
-

-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
Categories
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
- Shop by lifestyle
-
-
-
-
-
-
-
-
Foods that don't contain gluten
-
-
-
-
-
-
-
Vegetable based goodness
-
-
-
-
-
-
-
Based on herbal ingredients
-
-
-
-
-
-
-
Good fats served in food
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
Make breakfast healthy and easy
-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -1909,8 +134,7 @@
class="d-sm-flex align-items-start align-items-md-center align-items-lg-start align-items-xl-center p-md-2 p-lg-0 p-xl-2 p-xxl-3">
-
+
Cookbook
@@ -1944,7 +168,7 @@
Make online shop easier with our AsiaGolf App
-
-