Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
356fbd73c5 | ||
|
|
fa137c9a79 |
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
||||||
|
|
||||||
|
## [0.5.1] - 2026-08-25
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `Modules\Core\Search\ProductIndexer` now indexes `channel_ids` (filterable) — Lunar's base indexer only marks `status` as filterable, not channel assignment, so storefront search couldn't otherwise scope results to products actually assigned and enabled on the current sales channel. Computed from `$product->channels()->wherePivot('enabled', true)`. Ported from an older `Products` branch whose remote had been deleted; the branch's other, now-superseded `ProductIndexer` changes were dropped in favor of the richer indexer already on `master` (collections, price, variants, reviews — see `0.5.0`).
|
||||||
|
|
||||||
## [0.5.0] - 2026-08-24
|
## [0.5.0] - 2026-08-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "boboko/core",
|
"name": "boboko/core",
|
||||||
"description": "Core module — authentication and shared panel behaviour",
|
"description": "Core module — authentication and shared panel behaviour",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"version": "0.5.0",
|
"version": "0.5.1",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Modules\\Core\\": "src/"
|
"Modules\\Core\\": "src/"
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
|||||||
* - reviews: public-safe fields only (see mapReview() — reviewer_email is deliberately
|
* - reviews: public-safe fields only (see mapReview() — reviewer_email is deliberately
|
||||||
* excluded, it's PII with no storefront use), including staff replies, plus an
|
* excluded, it's PII with no storefront use), including staff replies, plus an
|
||||||
* average rating
|
* average rating
|
||||||
|
* - channel_ids (filterable) — Lunar's base indexer only indexes "status" as
|
||||||
|
* filterable, not channel assignment, so search results can't otherwise be
|
||||||
|
* scoped to products actually assigned+enabled on the current sales channel
|
||||||
*
|
*
|
||||||
* A review is created/edited independently of its product (Modules\Core\Providers\
|
* A review is created/edited independently of its product (Modules\Core\Providers\
|
||||||
* ReviewServiceProvider re-indexes the product on review create/update/delete), so
|
* ReviewServiceProvider re-indexes the product on review create/update/delete), so
|
||||||
@@ -49,6 +52,7 @@ class ProductIndexer extends BaseProductIndexer
|
|||||||
'collections',
|
'collections',
|
||||||
'price',
|
'price',
|
||||||
'slugs',
|
'slugs',
|
||||||
|
'channel_ids',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +87,10 @@ class ProductIndexer extends BaseProductIndexer
|
|||||||
$data['reviews'] = $reviews->map(fn (ProductReview $review) => $this->mapReview($review))->all();
|
$data['reviews'] = $reviews->map(fn (ProductReview $review) => $this->mapReview($review))->all();
|
||||||
$data['review_count'] = $reviews->count();
|
$data['review_count'] = $reviews->count();
|
||||||
$data['average_rating'] = $reviews->isEmpty() ? null : round($reviews->avg('rating'), 1);
|
$data['average_rating'] = $reviews->isEmpty() ? null : round($reviews->avg('rating'), 1);
|
||||||
|
$data['channel_ids'] = $model->channels()
|
||||||
|
->wherePivot('enabled', true)
|
||||||
|
->pluck('id')
|
||||||
|
->toArray();
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user