fix: Consider Website Item Groups in Item group page product listing

- Passed an argument to query engine to know when query is for item group page
- If for item group page, get data with regards to website item group table
- This query should be fast since there's one filter and that shortens the table beforehand
- This data is merged with the results from the Item master (results only considering item attributes and field filters)
- The combined data is then sorted as per weightage

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
This commit is contained in:
marination
2021-06-23 14:08:07 +05:30
parent 44815393b3
commit d802d73973
2 changed files with 25 additions and 9 deletions

View File

@@ -91,7 +91,7 @@ class ItemGroup(NestedSet, WebsiteGenerator):
field_filters['item_group'] = self.name
engine = ProductQuery()
context.items = engine.query(attribute_filters, field_filters, search, start)
context.items = engine.query(attribute_filters, field_filters, search, start, item_group=self.name)
filter_engine = ProductFiltersBuilder(self.name)