Filters collapsed, customer auth and register, fix on basket recalculation

This commit is contained in:
Ludovic CANDELLIER
2022-04-20 00:16:16 +02:00
parent a12dd0c653
commit 94234218d6
31 changed files with 218 additions and 251 deletions

View File

@@ -195,7 +195,7 @@ class Articles
$model = ($options['homepage'] ?? false) ? Article::homepage()->visible() : Article::visible();
// exit;
$data = $model->byCategory($category_id)->byTags($tags)->withAvailableOffers($sale_channel_id)->with([
$data = $model->byCategoryParent($category_id)->byTags($tags)->withAvailableOffers($sale_channel_id)->with([
'image',
'product',
'article_nature',

View File

@@ -31,7 +31,8 @@ class Offers
'tariff.price_lists.price_list_values',
'variation',
])->find($id);
$offer->article->image = Articles::getFullImageByArticle($offer->article);
$images = Articles::getFullImagesByArticle($offer->article);
$offer->article->image = Articles::getPreviewSrc($images[0] ?? false);
return $offer;
}

View File

@@ -14,7 +14,7 @@ class TagGroups
return TagGroup::get()->SortBy('name')->pluck('name', 'id')->toArray();
}
public static function getWithTagsAndCountOffers()
public static function getWithTagsAndCountOffers($category_id = false)
{
$tags = Tag::withCount(['articles'])->get()->toArray();
$tag_groups = TagGroup::pluck('name', 'id')->toArray();