diff --git a/app/Http/Controllers/Shop/CategoryController.php b/app/Http/Controllers/Shop/CategoryController.php index 3ac9e12e..9fdcac4d 100644 --- a/app/Http/Controllers/Shop/CategoryController.php +++ b/app/Http/Controllers/Shop/CategoryController.php @@ -16,8 +16,6 @@ class CategoryController extends Controller $tags = $request->input('tags') ?? []; $data = Shelves::getOffersByCategoryAndNature($categoryId, $articleNatureId, $tags, $articleNature, $displayByRows); - // dump($data); - // exit; return view('Shop.Shelves.shelve', $data); } diff --git a/app/Repositories/Core/Medias.php b/app/Repositories/Core/Medias.php index 74ade427..fb7ca0f9 100644 --- a/app/Repositories/Core/Medias.php +++ b/app/Repositories/Core/Medias.php @@ -103,6 +103,11 @@ class Medias return self::getSrcByType($image, 'normal'); } + public static function getZoomSrc($image) + { + return self::getSrcByType($image, 'zoom'); + } + public static function getSrcByType($image, $type) { return $image ? '/storage/'.$image['id'].'/conversions/'.self::getFilename($image, $type) : false; diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index d282af91..66ca6259 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -81,7 +81,7 @@ class Articles $images = ArticleImages::getFullImagesByArticle($article); $data['image'] = self::getPreviewSrc($images[0] ?? false); $data['images'] = count($images) ? $images : false; - $data['image_big'] = self::getImageSrc($images[0] ?? false); + $data['image_big'] = self::getZoomSrc($images[0] ?? false); $data['inherited'] = ArticleInherited::getInherited($id); $data['categories'] = ArticleCategories::getCategoriesNameByArticle($article); $data['tags'] = ArticleTags::getFullTagsSlugByArticle($article); @@ -143,7 +143,7 @@ class Articles public static function getArticlesToSell($options) { $articles = self::getArticlesWithOffers($options); - $searchOrder = array_flip($options['ids']->toArray() ?? []); + $searchOrder = $options['ids'] ?? false ? array_flip($options['ids']->toArray()) : false; foreach ($articles as $article) { $price_lists = $article->offers[0]->tariff->price_lists->toArray(); if (! count($price_lists)) { @@ -151,7 +151,9 @@ class Articles } if (! is_array($data[$article->name] ?? false)) { $data[$article->name] = self::getDataForSale($article); - $data[$article->name]['searchOrder'] = $searchOrder[$article->id]; + if ($searchOrder) { + $data[$article->name]['searchOrder'] = $searchOrder[$article->id]; + } } $prices = $price_lists[0]['price_list_values'][0]; $article_nature_name = strtolower($article->article_nature->name); diff --git a/app/Repositories/Shop/Shelves.php b/app/Repositories/Shop/Shelves.php index 0e028208..80c100af 100644 --- a/app/Repositories/Shop/Shelves.php +++ b/app/Repositories/Shop/Shelves.php @@ -7,7 +7,7 @@ class Shelves public static function getOffersByCategoryAndNature($categoryId, $articleNatureId = false, $tags = [], $articleNature = false, $displayByRows = false) { $articleNatures = Articles::getArticleNaturesWithOffers(['category_id' => $categoryId]); - $productType = self::getProductType($articleNature, $articleNatures); + $productType = self::getProductType($articleNatureId, $articleNature, $articleNatures); $articleNatureId = $articleNatureId ? $articleNatureId : self::getArticleNatureId($articleNature, $articleNatures); diff --git a/app/Traits/Model/Imageable.php b/app/Traits/Model/Imageable.php index f6ec69e3..72815e10 100644 --- a/app/Traits/Model/Imageable.php +++ b/app/Traits/Model/Imageable.php @@ -44,6 +44,12 @@ trait Imageable ->watermarkHeight(100, Manipulations::UNIT_PERCENT) ->watermarkWidth(100, Manipulations::UNIT_PERCENT) ->watermarkFit(Manipulations::FIT_FILL); + $this->addMediaConversion('zoom')->fit(Manipulations::FIT_CROP, 1200, 1200) + ->watermark($watermark) + ->watermarkHeight(100, Manipulations::UNIT_PERCENT) + ->watermarkWidth(100, Manipulations::UNIT_PERCENT) + ->watermarkFit(Manipulations::FIT_FILL); + // $this->addMediaConversion('zoom')->fit(Manipulations::FIT_CROP, 1200, 1200)->withResponsiveImages(); } } diff --git a/app/Traits/Repository/Imageable.php b/app/Traits/Repository/Imageable.php index 6b67458d..c1e7e6fb 100644 --- a/app/Traits/Repository/Imageable.php +++ b/app/Traits/Repository/Imageable.php @@ -16,52 +16,57 @@ trait Imageable return Medias::getImages(self::get($id)); } - public static function getThumb($image, $with_undefined = true) + public static function getThumb($image, $undefined = true) { - $src = self::getThumbSrc($image, $with_undefined); + $src = self::getThumbSrc($image, $undefined); return $src ? "" : ''; } - public static function getThumbSrc($image, $with_undefined = true) + public static function getThumbSrc($image, $undefined = true) { - return $image ? Medias::getThumbSrc($image) : ($with_undefined ? '/img/visuel-non-disponible.jpg' : ''); + return $image ? Medias::getThumbSrc($image) : ($undefined ? '/img/visuel-non-disponible.jpg' : ''); } - public static function getPreview($image, $with_undefined = true) + public static function getPreview($image, $undefined = true) { - $src = self::getPreviewSrc($image, $with_undefined); + $src = self::getPreviewSrc($image, $undefined); return $src ? "" : ''; } - public static function getPreviewSrc($image, $with_undefined = true) + public static function getPreviewSrc($image, $undefined = true) { - return $image ? Medias::getPreviewSrc($image) : ($with_undefined ? self::getUnknown() : ''); + return $image ? Medias::getPreviewSrc($image) : ($undefined ? self::getUnknown() : ''); } - public static function getNormal($image, $with_undefined = true) + public static function getNormal($image, $undefined = true) { - $src = self::getNormalSrc($image, $with_undefined); + $src = self::getNormalSrc($image, $undefined); return $src ? "" : ''; } - public static function getNormalSrc($image, $with_undefined = true) + public static function getNormalSrc($image, $undefined = true) { - return $image ? Medias::getNormalSrc($image) : ($with_undefined ? self::getUnknown() : ''); + return $image ? Medias::getNormalSrc($image) : ($undefined ? self::getUnknown() : ''); } - public static function getImage($image, $with_undefined = true) + public static function getZoomSrc($image, $undefined = true) { - $src = self::getImageSrc($image, $with_undefined); + return $image ? Medias::getZoomSrc($image) : ($undefined ? self::getUnknown() : ''); + } + + public static function getImage($image, $undefined = true) + { + $src = self::getImageSrc($image, $undefined); return $src ? "" : ''; } - public static function getImageSrc($image, $with_undefined = true) + public static function getImageSrc($image, $undefined = true) { - return $image ? Medias::getImageSrc($image) : ($with_undefined ? self::getUnknown() : ''); + return $image ? Medias::getImageSrc($image) : ($undefined ? self::getUnknown() : ''); } public static function getUnknown() diff --git a/build/css/site.css b/build/css/site.css index 8bea8338..86060568 100644 --- a/build/css/site.css +++ b/build/css/site.css @@ -305,6 +305,10 @@ div.megamenu ul.megamenu li.megamenu.level1 font-size: 0.8em } +.sp-lightbox { + z-index: 1300; +} + @font-face { font-family: 'noto_sanscondensed'; diff --git a/resources/views/Shop/Shelves/partials/category_add.blade.php b/resources/views/Shop/Shelves/partials/category_add.blade.php index ef935dbc..3f1a40bb 100644 --- a/resources/views/Shop/Shelves/partials/category_add.blade.php +++ b/resources/views/Shop/Shelves/partials/category_add.blade.php @@ -1,26 +1,41 @@ @foreach ($article_natures as $nature) -
- @if ($article_nature == $nature) - - @else - - @endif -
+
+ @if ($article_nature == $nature) + @php + $iconType = 'icon_selection'; + $iconClass = 'badge-success'; + @endphp + @else + @php + $iconType = 'icon'; + $iconClass = 'badge-secondary'; + @endphp + @endif + + @php + $icon = App\Repositories\Shop\ArticleNatures::getIconBySlug($nature, 'normal', $iconType); + @endphp + @if ($icon) + {{ $nature }} + @else + {{ $nature }} + @endif +
@endforeach @push('js') - -@endpush \ No newline at end of file + +@endpush diff --git a/resources/views/components/multi-images.blade.php b/resources/views/components/multi-images.blade.php index 59d096b1..a5f1b95c 100644 --- a/resources/views/components/multi-images.blade.php +++ b/resources/views/components/multi-images.blade.php @@ -1,20 +1,20 @@

LOADING IMAGES
- @if ($images) - @foreach ($images as $image) - - - - @endforeach - @else - - @endif + @if ($images) + @foreach ($images as $image) + + + + @endforeach + @else + + @endif
@push('js') - + @endpush