Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Require search query
Pacu2e4c32110abeb
diff --git a/saleor/core/context_processors.py b/saleor/core/context_processors.pyindex 0ce9b28122..7caae02ded 100644--- a/saleor/core/context_processors.py+++ b/saleor/core/context_processors.py@@ -52,6 +52,6 @@ def webpage_schema(request):search_url = urljoin(url, reverse('search:search'))data['potentialAction'] = {'@type': 'SearchAction',- 'target': '%s?q={search_term}' % search_url,- 'query-input': 'required name=search_term'}+ 'target': '%s?q={q}' % search_url,+ 'query-input': 'required name=q'}return {'webpage_schema': json.dumps(data)}diff --git a/templates/base.html b/templates/base.htmlindex d21157bb8d..78eb4c849e 100644--- a/templates/base.html+++ b/templates/base.html@@ -100,7 +100,8 @@</div><input class="form-control" type="text" name="q"value="{% if query %}{{ query }}{% endif %}"- placeholder="{% trans "Search for product" %}">+ placeholder="{% trans "Search for product" %}"+ required><button class="btn btn-link" type="submit"><svg data-src="{% static "images/search.svg" %}" width="30" height="30"/></button>diff --git a/templates/dashboard/base.html b/templates/dashboard/base.htmlindex e0b1797917..2ab1ca36e6 100644--- a/templates/dashboard/base.html+++ b/templates/dashboard/base.html@@ -75,8 +75,8 @@<form method="get" action="{% url "dashboard:search" %}"><a class="hide-on-med-and-up" id="btn-search-close"></a><div class="input-field d-inline">- <input id="search" type="search" placeholder="{% trans "Search" context "Dashboard search" %}" name="q" value="{% if query %}{{ query }}{% endif %}">- <label class="hide-on-small-only">+ <input id="search" type="search" placeholder="{% trans "Search" context "Dashboard search" %}" name="q" required value="{% if query %}{{ query }}{% endif %}">+ <label><svg data-src="{% static "dashboard/images/search.svg" %}" width="24" height="24" fill="#fff" /></label></div>diff --git a/templates/styleguide.html b/templates/styleguide.htmlindex f93f90d22b..7161b7157c 100644--- a/templates/styleguide.html+++ b/templates/styleguide.html@@ -483,7 +483,7 @@<div class="row"><div class="col-md-6"><form class="form-inline search-form" action="{% url "search:search" %}">- <input class="form-control" type="text" name="q" value="{% if query %}{{ query }}{% endif %}" placeholder="Search for product">+ <input class="form-control" type="text" name="q" required value="{% if query %}{{ query }}{% endif %}" placeholder="Search for product"><button class="btn btn-link" type="submit"><svg data-src="{% static "images/search.svg" %}" width="19" height="19" /></button>