Skip to content
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

ParentID not added to ProductCategories Manymany #804

Open
wernerkrauss opened this issue Oct 31, 2023 · 0 comments
Open

ParentID not added to ProductCategories Manymany #804

wernerkrauss opened this issue Oct 31, 2023 · 0 comments

Comments

@wernerkrauss
Copy link
Contributor

I think it's bad practice, that the main category (aka ParentID) isn't added to ProductCategories manymany relation. This makes it harder to find e.g. all products of a given category programatically or when you want to export data to other data stores like SOLR for searching.

Proposal:

  • add ParentID and ancestors' IDs to ProductCategories in onAfterWrite() if not already added
  • write a task that checks if those IDs are added to ProductCategories and add them if not

getCategories() is a workaround for this right now, but having the data stored in DB is better IMHO

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

No branches or pull requests

1 participant