Skip to content

[5.x] Support multiple categories in indexer#1320

Open
Jade-GG wants to merge 2 commits into
masterfrom
bugfix/multiple-categories
Open

[5.x] Support multiple categories in indexer#1320
Jade-GG wants to merge 2 commits into
masterfrom
bugfix/multiple-categories

Conversation

@Jade-GG

@Jade-GG Jade-GG commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This was written wrong, using breadcrumbCategories which only uses the longest path. I've added an attribute that can be used to get the same data in a collection from not just the longest path. Flattening this gives us the same data in the indexer, but then for all categories.

Comment thread src/Models/Product.php

$categories = $this->categoryProducts
->where('category_id', '!=', config('rapidez.root_category_id'))
->pluck('category')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the whole category? We do have all the category info here:

$categories = Cache::driver('array')->rememberForever('categories-' . config('rapidez.store'), function () {
so maybe an ID is enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants