Skip to content

Commit

Permalink
Merge pull request #6394 from thierrymarianne/display-categories
Browse files Browse the repository at this point in the history
Displayed categories when product not found
  • Loading branch information
aleeks committed Sep 20, 2016
2 parents a7e80c2 + f62b690 commit 2f2d76b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
5 changes: 4 additions & 1 deletion classes/controller/ProductListingFrontController.php
Expand Up @@ -468,7 +468,10 @@ protected function doProductSearch($template, $params = array(), $locale = null)
die(json_encode($this->getAjaxProductSearchVariables()));
} else {
$variables = $this->getProductSearchVariables();
if (!empty($variables['products'])) {
if (
!empty($variables['products'])
|| $params['entity'] === 'category'
) {
$this->context->smarty->assign(array(
'listing' => $variables,
));
Expand Down
1 change: 1 addition & 0 deletions themes/classic/_dev/css/components/errors.scss
@@ -1,3 +1,4 @@
#products,
#pagenotfound {
#main {
.page-header {
Expand Down
6 changes: 6 additions & 0 deletions themes/classic/assets/css/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/classic/assets/css/theme.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions themes/classic/templates/catalog/_partials/products.tpl
Expand Up @@ -49,5 +49,7 @@
<i class="material-icons">&#xE316;</i>
</a>
</div>
{else}
{include file='errors/not-found.tpl'}
{/if}
</section>
11 changes: 1 addition & 10 deletions themes/classic/templates/errors/404.tpl
Expand Up @@ -5,14 +5,5 @@
{/block}

{block name='page_content_container'}
<section id="content" class="page-content page-not-found">
<h4>{l s='Sorry for the inconvenience.' d='Shop.Theme'}</h4>
<p>{l s='Search again what you are looking for' d='Shop.Theme'}</p>

{block name='search'}
{hook h='displaySearch'}
{/block}

{hook h='displayNotFound'}
</section>
{include file='errors/not-found.tpl'}
{/block}
10 changes: 10 additions & 0 deletions themes/classic/templates/errors/not-found.tpl
@@ -0,0 +1,10 @@
<section id="content" class="page-content page-not-found">
<h4>{l s='Sorry for the inconvenience.' d='Shop.Theme'}</h4>
<p>{l s='Search again what you are looking for' d='Shop.Theme'}</p>

{block name='search'}
{hook h='displaySearch'}
{/block}

{hook h='displayNotFound'}
</section>

0 comments on commit 2f2d76b

Please sign in to comment.