Skip to content

Commit 72aa5df

Browse files
Merge pull request #33 from shopperlabs/feature/sho-64-improve-store-page
Update store page and single page to modify product card , add css cl…
2 parents 66c071b + ced0892 commit 72aa5df

File tree

16 files changed

+516
-508
lines changed

16 files changed

+516
-508
lines changed

app/Livewire/Pages/SingleProduct.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use App\Models\Product;
88
use Illuminate\Contracts\View\View;
9+
use Livewire\Attributes\Computed;
910
use Livewire\Attributes\Url;
1011
use Livewire\Component;
1112

@@ -28,6 +29,12 @@ public function mount(Product $product): void
2829
]);
2930
}
3031

32+
#[Computed]
33+
public function getAverageRatingProperty(): float
34+
{
35+
return floatval($this->product->averageRating(1)->first());
36+
}
37+
3138
public function render(): View
3239
{
3340
return view('livewire.pages.single-product', [

composer.lock

Lines changed: 400 additions & 403 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/shopper/admin.php

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,26 @@
3232

3333
/*
3434
|--------------------------------------------------------------------------
35-
| Admin Brand Name
35+
| Pages
36+
|--------------------------------------------------------------------------
37+
|
38+
| This is the namespace and directory that Shopper save page components
39+
|
40+
*/
41+
42+
'pages' => [
43+
'namespace' => 'App\\Shopper',
44+
'view_path' => resource_path('views/shopper'),
45+
],
46+
47+
/*
48+
|--------------------------------------------------------------------------
49+
| Brand Logo
3650
|--------------------------------------------------------------------------
3751
|
3852
| This will be displayed on the login page and in the sidebar's header.
53+
| This is your site's logo. It will be loaded directly from the public folder
54+
| Ex: '/images/logo.svg'
3955
|
4056
*/
4157

@@ -83,10 +99,17 @@
8399

84100
/*
85101
|--------------------------------------------------------------------------
86-
| Shopper Resource
102+
| Additional Resources
87103
|--------------------------------------------------------------------------
88104
|
89-
| Automatically connect the stored links. For example js and css files.
105+
| Automatically load the assets links. For js and css files.
106+
|
107+
| Example:
108+
|
109+
| 'stylesheets' => [
110+
| asset('/my-script.css'),
111+
| 'https://example.com/my-style.css'
112+
| ]
90113
|
91114
*/
92115

@@ -97,17 +120,19 @@
97120

98121
/*
99122
|--------------------------------------------------------------------------
100-
| Shopper Inventory Limit
123+
| Inventory Limit
101124
|--------------------------------------------------------------------------
102125
|
126+
| Limits the number of inventories your store can manage, making it easier
127+
| to manage your stock.
103128
|
104129
*/
105130

106131
'inventory_limit' => 4,
107132

108133
/*
109134
|--------------------------------------------------------------------------
110-
| Caching
135+
| Caching Blade Icons
111136
|--------------------------------------------------------------------------
112137
|
113138
| This section lets you configure the caching option of the icon picker component.
@@ -116,9 +141,6 @@
116141
| searching through all of them can take quite a lot of time, which is
117142
| why the plugin caches each field with it's configuration and search queries.
118143
|
119-
| This section let's you configure how caching should be done or disable it
120-
| if you wish.
121-
|
122144
*/
123145

124146
'icon-picker' => [

config/shopper/core.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,6 @@
3636

3737
'table_prefix' => 'sh_',
3838

39-
/*
40-
|--------------------------------------------------------------------------
41-
| Storage Disk
42-
|--------------------------------------------------------------------------
43-
|
44-
| Specifies the configuration for resources storage, this will be to store
45-
| all media of your products, brands, categories, etc.
46-
|
47-
*/
48-
49-
'storage' => [
50-
'collection_name' => 'uploads',
51-
'thumbnail_collection' => 'thumbnail',
52-
'disk_name' => 'public',
53-
],
54-
5539
/*
5640
|--------------------------------------------------------------------------
5741
| Barcode type

config/shopper/media.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,28 @@
44

55
return [
66

7+
/*
8+
|--------------------------------------------------------------------------
9+
| Storage Disk
10+
|--------------------------------------------------------------------------
11+
|
12+
| Specifies the configuration for resources storage, this will be to store
13+
| all media of your products, brands, categories, etc.
14+
|
15+
*/
16+
17+
'storage' => [
18+
'collection_name' => 'uploads',
19+
'thumbnail_collection' => 'thumbnail',
20+
'disk_name' => 'public',
21+
],
22+
723
/*
824
|--------------------------------------------------------------------------
925
| Media Mine Types
1026
|--------------------------------------------------------------------------
1127
|
28+
| Spatie media-library mime types supported when you upload any image
1229
|
1330
*/
1431

@@ -18,11 +35,31 @@
1835
'image/png',
1936
],
2037

38+
/*
39+
|--------------------------------------------------------------------------
40+
| Media Filesize
41+
|--------------------------------------------------------------------------
42+
|
43+
| This setting allows you to define the maximum size of your images.
44+
|
45+
*/
46+
47+
'max_size' => [
48+
'thumbnail' => 1024, // Default size for thumbnail image (1MB). This config is the same for brand, category and collection thumbnail
49+
'images' => 2048, // Default size for individual collection image for product (2MB)
50+
],
51+
2152
/*
2253
|--------------------------------------------------------------------------
2354
| Media Conversion
2455
|--------------------------------------------------------------------------
2556
|
57+
| Image conversion lets you display images according to the dimensions of
58+
| the product photos you have in your store.
59+
|
60+
| This configuration allows you to customize each poster according to
61+
| the size on the desired section of your store and adapt it directly
62+
| to your design.
2663
|
2764
*/
2865

config/shopper/orders.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
| Order Number Generator
1010
|--------------------------------------------------------------------------
1111
|
12-
|
13-
|
1412
*/
1513

1614
'generator' => [

config/shopper/routes.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
| Shopper Custom backend route file
2323
|--------------------------------------------------------------------------
2424
|
25-
| This value sets the file to load for Shopper admin custom routes. This
26-
| depend of your application.
27-
| Eg.: base_path('routes/shopper.php')
25+
| This value sets the file to load for Shopper admin custom routes.
26+
| E.g.: base_path('routes/shopper.php')
2827
|
2928
*/
3029

resources/views/components/attributes/color.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class="sr-only"
2222
aria-hidden="true"
2323
style="background-color: {{ $value->key }} "
2424
class="h-8 w-8 rounded-full "
25-
:class="selectedColorAttributes.includes('{{ $value->id }}') ? ' border-double border-2 border-primary-600' : 'border-double border-2 border-black border-opacity-10 ' "
25+
:class="selectedColorAttributes.includes('{{ $value->id }}') ? 'ring-2 ring-primary-600 ring-offset-2' : 'border-double border-2 border-black border-opacity-10 ' "
2626
></span>
2727
</label>
2828
</div>

resources/views/components/attributes/size.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="grid grid-cols-3 gap-3 sm:grid-cols-5 mt-6">
77
@foreach ($attribute->values as $value)
88
<label
9-
class="flex items-center justify-center px-3 py-3 text-sm font-medium uppercase border cursor-pointer focus:outline-none sm:flex-1"
9+
class="flex items-center justify-center px-3 py-3 text-sm font-medium uppercase border cursor-pointer focus:outline-none sm:flex-1 rounded-md"
1010
:class="selectedAttributes.includes('{{ $value->id }}') ? 'border-transparent bg-primary-600 text-white hover:bg-primary-700' : 'border-gray-200 bg-white text-gray-900 hover:bg-gray-50'">
1111
<input id="{{ $attribute->slug }}-{{ $value->id }}"
1212
wire:model.live.debounce.350ms="selectedAttributes"

resources/views/components/categories/list.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
<div class="space-y-5">
66
<div class="overflow-hidden shadow-lg aspect-w-3 aspect-h-2 rounded-xl">
77
<img class="object-cover max-w-none size-full"
8-
src="{{ $category->getFirstMediaUrl(config('shopper.core.storage.thumbnail_collection')) }}"
8+
src="{{ $category->getFirstMediaUrl(config('shopper.media.storage.thumbnail_collection')) }}"
99
alt="{{ $category->name }}" />
1010
</div>
1111
<div class="px-4">
1212
<h3 class="text-base font-medium leading-6 transition ease-in text-gray-700 hover:text-gray-900">
13-
<x-link href="#" class="inline-flex items-center gap-2">
13+
<x-link :href="route('category.products', $category->slug)" class="inline-flex items-center gap-2">
1414
{{ $category->name }}
1515
<x-untitledui-arrow-narrow-right class="size-5" aria-hidden="true" />
1616
</x-link>
1717
</h3>
1818
<nav role="navigation" class="flex flex-col mt-3">
1919
@foreach ($category->children->take(6) as $child)
20-
<x-link href="#" class="inline-flex text-sm leading-5 py-1.5 text-gray-500 hover:text-gray-900 transition ease-in">
20+
<x-link :href="route('category.products', $child->slug)" class="inline-flex text-sm leading-5 py-1.5 text-gray-500 hover:text-gray-900 transition ease-in">
2121
{{ $child->name }}
2222
</x-link>
2323
@endforeach
2424
@if ($category->children->count() > 6)
25-
<x-link href="#" class="mt-4 text-sm font-medium text-gray-700 hover:text-gray-900 group group-link-underline">
25+
<x-link :href="route('category.products', $category->slug)" class="mt-4 text-sm font-medium text-gray-700 hover:text-gray-900 group group-link-underline">
2626
<span class="inline-flex items-center gap-2 link link-underline link-underline-black">
2727
<x-untitledui-plus class="size-4" aria-hidden="true" />
2828
{{ __('View All') }}

0 commit comments

Comments
 (0)