14 Django E Commerce Search Products English

preview_player
Показать описание
Search Products at the home page
Рекомендации по теме
Комментарии
Автор

13:27 for some reason this outgroup logic never works for me... instead I had to try and finally made it with this code
load mptt_tags %}
recursetree category%}
if node.level == 1 %}
value="{{ node.id }}">{{ node.title }}</option>
endif %}
if node.level == 0 %}
label="{{node.title }}">


endif %}
endrecursetree %}

DemonDraKe
Автор

this is so cool!! thanks so much for sharing!

franmed
Автор

my search is not working .when i search something it redirect to home page only please tell the solutions.

bhiss_maniraula
Автор

Hello Master, if you can, please explain to us how to create filters in Django.

mrcode
Автор

Thank you for this work! This is most full and detailed tutorial. I maded my first site with it. I have few problems, which i cannot resolve and will ask questions about it. First question based on subject of this video. I maded search and it work when i write my query inside a search field, but when i push search button without query my site is falling. How resolve this situation?

ИльяБаженов-жч
Автор

Thank you for your effort, we really learnt from you.

I Want to Add a product to cart from the search result page and Come back to the same page to add an other product, unfortunatly i recieved error .

How can i résolve this matter please ?

Thankx in advance

abdelsabor
Автор

I don't using 'catid'


def search(request):
if request.method == 'POST': # check post
form = SearchForm(request.POST)
print(form)
if form.is_valid():
query = form.cleaned_data['query'] # get form input dat
products = Product.objects.filter(
title__icontains=query)

category = Category.objects.all()
context = {'products': products, 'query': query,
'category': category}
return render(request, 'pages/search_products.html', context)

return HttpResponseRedirect('/')

peidraou