added search filter by tags
This commit is contained in:
@@ -125,7 +125,7 @@ def find_related_products_v3(keyword):
|
||||
return set(products_qs)
|
||||
|
||||
|
||||
def find_related_products_v6(keyword, shipping_cost=None, discount=None, category=None):
|
||||
def find_related_products_v6(keyword, shipping_cost=None, discount=None, category=None, tags=None):
|
||||
"""
|
||||
Ranked product search
|
||||
|
||||
@@ -147,6 +147,10 @@ def find_related_products_v6(keyword, shipping_cost=None, discount=None, categor
|
||||
if category is not None:
|
||||
products_qs = products_qs.filter(category=category)
|
||||
|
||||
# filter by tags
|
||||
if tags is not None:
|
||||
products_qs = products_qs.filter(tags=tags)
|
||||
|
||||
# filter for shipping cost
|
||||
if shipping_cost is True:
|
||||
# only instances with shipping costs
|
||||
|
||||
Reference in New Issue
Block a user