-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is a way to disable nested collection inheritance from parents #1382
Labels
Comments
BTW private async applyCollectionFiltersInternal(
collection: Collection,
applyToChangedVariantsOnly = true,
): Promise<ID[]> {
const ancestorFilters = await this.getAncestors(collection.id).then(ancestors =>
ancestors.reduce(
(filters, c) => [...filters, ...(c.filters || [])],
[] as ConfigurableOperation[],
),
);
const preIds = await this.getCollectionProductVariantIds(collection);
collection.productVariants = await this.getFilteredProductVariants([
...ancestorFilters,
...(collection.filters || []),
]); If inherits filters from ancestors, we should remove duplicated filters(parent has A, child always defined A) this will generated two duplicated sql |
michaelbromley
added a commit
that referenced
this issue
Mar 3, 2022
Relates to #1382. This commit introduces a new property on the Collection entity & GraphQL type - `inheritFilters`. When set to `true` (the default), behaviour is the same as before - a Collection's filters will be composed of its own filters, plus those of all ancestors up to the root. Setting to `false` allows you to nest a Collection and set up filters which act completely independently of the parent filters. This allows much more flexibility in setting up category hierarchies. BREAKING CHANGE: The new `inheritFilters` property on the Collection entity will require a DB migration.
michaelbromley
added a commit
that referenced
this issue
Mar 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
for vendure@1.4.5 i saw the nested collection, the children collection will inherits it's parents products, in fact in most case , for parent collection it should contains more products than children, i think we need give
configuration
option todisable
nest collection inherits ability should be better.Describe the solution you'd like
configuration
option todisable
nest collection inherits ability should be better.Describe alternatives you've considered
no
Additional context
vendur@1.4.5
The text was updated successfully, but these errors were encountered: