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/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

+ +
+
+ Image +
+
+
+ + +
+
+
+

97 products

+

Products for Easter table

+ +
+
+ Image +
+
+
+ + +
+
+
+

28 products

+

Berries from the garden

+ +
+
+ Image +
+
+
+
+ + +
+
+
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 +
+
+
+
--}} + Image +
+ @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..9351f88 --- /dev/null +++ b/resources/views/components/grocery/popular-products.blade.php @@ -0,0 +1,98 @@ +
+
+ + +
+

Categories

+ +
+ +
+
+

Popular products

+ +
+ + +
+ + @foreach ($products as $key => $value) + +
+
+
+ + +
+ Image +
+
+
+
+ +
+
+
+
+
{{ $value->display_price_currency }}
+

+ {{ $value->name }} +

+
+
{{ $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) + +
+
+ {{ $brand->name }} +
+

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

+ {{--

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..090302c --- /dev/null +++ b/resources/views/components/grocery/special-products.blade.php @@ -0,0 +1,113 @@ +
+
+ + +
+
+
+
+

Make breakfast healthy and easy

+ +
+
+ Banner +
+
+
+
+ + +
+
+

Special products

+ +
+
+
+ + @foreach ($products as $key => $value) +
+
+
+ + +
+ Image +
+
+
+
+ +
+
+
+
+
{{ $value->display_price_currency }}
+

+ {{ $value->name }} +

+
+ @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..f1dfb2c --- /dev/null +++ b/resources/views/components/layout/header-grocery.blade.php @@ -0,0 +1,144 @@ +
+ @include('layouts.partials/offcanvas2') + + + + @include('layouts.partials/menu-offcanvas') + + + + + + + +
diff --git a/resources/views/home/grocery.blade.php b/resources/views/home/grocery.blade.php index 65e1d8a..50b594a 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 - -
-
- - -
-
- - -
-
- - -
- - -
- - - -
- - -
- - -
-
-
- -
-
- - -
-
8270 Delta Shores Cir S, Sacramento, CA 95832
-
Open: 07:00 - 22:00 -
-
-
-
- -
-
- - -
-
755 Riverpoint Ct, West Sacramento, CA 95605
-
Open: 07:00 - 21:00 -
-
-
-
- -
-
- - -
-
10655 Folsom Blvd, Rancho Cordova, CA 95670
-
Open: 08:00 - 23:00 -
-
-
-
-
- - -
- -
-
Select a suitable store
- - - Find on map - -
-
- - -
-
- - -
-
Found stores:
-
- -
- -
8270 Delta Shores Cir S, Sacramento, CA 95832
-
Open: 07:00 - 22:00 -
-
-
-
- -
- -
755 Riverpoint Ct, West Sacramento, CA 95605
-
Open: 07:00 - 21:00 -
-
-
-
- -
- -
10655 Folsom Blvd, Rancho Cordova, CA 95670
-
Open: 08:00 - 23:00 -
-
-
-
- - - -
-
- - -
- -
-
- - @include('layouts.partials/menu-offcanvas') - - - -
-
- -
-
-
-
-
- - -
-
-
-
-
-

🔥 Free shipping - order over - 50$ -

-

Healthy Food Available to Everyone

- Shop now -
-
-
-
- Image -
- - -
-
-
-
-
-

🥚 Organic products to your table

-

Organic eggs from home-grown chicken -

- Shop now -
-
-
-
- Image -
- - -
-
-
-
-
-

🥝 Only natural ingredients

-

Enjoy refreshing summer drink

- Shop now -
-
-
-
- Image -
-
- - -
-
-
-
-
-
-
-
+ -
-
-
- - -
-
-
-

124 products

-

Only fresh fish to your table

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

97 products

-

Products for Easter table

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

28 products

-

Berries from the garden

- -
-
- Image -
-
-
-
- - -
-
-
+ -
-
- - -
-

Categories

- -
- -
-
-

Popular products

- -
- - -
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
- -
500g
-
-
- - -
-
-
- -30% - - -
- Image -
-
-
-
- -
-
-
-
-
$3.12 $4.05
-

- Fresh orange Klementina, Spain -

-
-
1kg
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
-
-
$0.80
-

- Pepsi soda classic, can -

-
-
330ml
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
- -
250g
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
-
-
$1.24
-

- Coconut, Indonesia -

-
-
1 coconut
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
- -
200g
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
-
-
$1.99
-

- Fresh mango, Spain -

-
-
1 mango
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
- -
300g
-
-
-
-
-
-
+ -
-

Shop by lifestyle

-
-
- - -
-
- - - -
-

- - Gluten-Free - -

-

Foods that don't contain gluten

-
- - -
-
- - - - - - - - - -
-

- - Vegan - -

-

Vegetable based goodness

-
- - -
-
- - - - -
-

- - Plant based - -

-

Based on herbal ingredients

-
- - -
-
- - - - -
-

- - Keto - -

-

Good fats served in food

-
-
- - -
-
-
+ -
-
- - -
-
-
-
-

Make breakfast healthy and easy

- -
-
- Banner -
-
-
-
- - -
-
-

Special products

- -
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
-
-
$18.60
-

- Pure virgin olive oil Basso -

-
-
1000ml
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
- -
500g
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
-
-
$3.40
-

- Fresh red grapefruit -

-
-
1kg
-
-
- - -
-
-
- - -
- Image -
-
-
-
- -
-
-
- -
150g
-
-
-
- - -
-
-
-
-
+ @@ -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"> - Book cover + Book cover
Cookbook diff --git a/routes/web.php b/routes/web.php index 0ef1c3b..cf47e61 100644 --- a/routes/web.php +++ b/routes/web.php @@ -38,6 +38,7 @@ Route::post('/locale/switch', [LocaleController::class, 'switch'])->name('locale Route::get('/', [HomeController::class, 'index'])->name('home'); + Route::get('/products', [ProductController::class, 'index'])->name('product.index'); Route::get('/products/ajax', [ProductController::class, 'ajax'])->name('product.ajax'); Route::get('/products/ajax/populers', [ProductController::class, 'populers'])->name('product.ajax.populers'); @@ -50,6 +51,9 @@ Route::get('/products/ajax/genders', [ProductController::class, 'genders'])->nam Route::get('/products/ajax/announcements', [ProductController::class, 'announcements'])->name('product.ajax.announcements'); Route::get('/product/{slug}', [ProductController::class, 'detail'])->name('product.detail'); + +Route::get('/store', [HomeController::class, 'store'])->name('store'); + // Search routes Route::get('/search', [SearchController::class, 'search'])->name('search.ajax');