parent
6842e20bd5
commit
1ba45562b8
2 changed files with 15 additions and 6 deletions
@ -1,11 +1,16 @@ |
||||
|
||||
from products.forms import ProductSearchForm |
||||
from products.models import ProductCategory |
||||
|
||||
|
||||
def product_search_form(request): |
||||
return {'product_search_form': ProductSearchForm()} |
||||
left_product_search_form = ProductSearchForm(submit_css_class='left-menu__search-btn') |
||||
content_product_search_form = ProductSearchForm(submit_css_class='content__search-btn') |
||||
if ProductSearchForm.form_action.__str__() in request.path and request.GET.get('name'): |
||||
left_product_search_form.initial = {'name': request.GET.get('name')} |
||||
return { |
||||
'left_product_search_form': left_product_search_form, |
||||
'content_product_search_form': content_product_search_form |
||||
} |
||||
|
||||
def product_root_categories(request): |
||||
categories = {'product_root_categories': ProductCategory.objects.get_root_categories()} |
||||
return categories |
||||
return {'product_root_categories': ProductCategory.objects.get_root_categories()} |
||||
|
||||
Loading…
Reference in new issue