Merge conflict
This commit is contained in:
@@ -9,6 +9,13 @@
|
||||
<default key="_view">index</default>
|
||||
</route>
|
||||
|
||||
|
||||
<!-- Search routes -->
|
||||
<route id="search" path="/search">
|
||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
||||
<default key="_view">search</default>
|
||||
</route>
|
||||
|
||||
<!-- Customer routes : Register -->
|
||||
<route id="customer.create.process" path="/register" methods="post">
|
||||
<default key="_controller">Thelia\Controller\Front\CustomerController::createAction</default>
|
||||
|
||||
@@ -87,6 +87,7 @@ class Product extends BaseI18nLoop
|
||||
Argument::createIntTypeArgument('depth', 1),
|
||||
Argument::createBooleanOrBothTypeArgument('visible', 1),
|
||||
Argument::createIntTypeArgument('currency'),
|
||||
Argument::createAnyTypeArgument('title'),
|
||||
new Argument(
|
||||
'order',
|
||||
new TypeCollection(
|
||||
@@ -171,6 +172,17 @@ class Product extends BaseI18nLoop
|
||||
$search->filterByRef($ref, Criteria::IN);
|
||||
}
|
||||
|
||||
|
||||
$title = $this->getTitle();
|
||||
|
||||
if(!is_null($title)){
|
||||
|
||||
$search->where(" CASE WHEN NOT ISNULL(`requested_locale_i18n`.ID) THEN `requested_locale_i18n`.`TITLE` ELSE `default_locale_i18n`.`TITLE` END ".Criteria::LIKE." ?", "%".$title."%", \PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$category = $this->getCategory();
|
||||
$categoryDefault = $this->getCategoryDefault();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{$product_page={$smarty.get.page|default:1}}
|
||||
{$product_order={$smarty.get.order|default:'alpha'}}
|
||||
<article class="col-main {$smarty.get.mode|default:"grid"}" role="main">
|
||||
{include file="includes/category-toolbar.html" toolbar="top" limit=$limit order=$product_order}
|
||||
{include file="includes/toolbar.html" toolbar="top" limit=$limit order=$product_order}
|
||||
<div id="category-products">
|
||||
<div class="products-content">
|
||||
<ul class="product-col-4">
|
||||
@@ -28,7 +28,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- /#category-products -->
|
||||
{include file="includes/category-toolbar.html" toolbar="bottom"}
|
||||
{include file="includes/toolbar.html" toolbar="bottom"}
|
||||
</article>
|
||||
|
||||
<aside class="col-left" role="complementary" itemscope itemtype="http://schema.org/WPSideBar">
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<span class="limiter">
|
||||
<label for="limit-top">{intl l="Show"}</label>
|
||||
<select id="limit-top" name="limit">
|
||||
<option value="{url path="{category attr="url"}" limit="4"}" {if $limit==4}selected{/if}>4</option>
|
||||
<option value="{url path="{category attr="url"}" limit="8"}" {if $limit==8}selected{/if}>8</option>
|
||||
<option value="{url path="{category attr="url"}" limit="12"}" {if $limit==12}selected{/if}>12</option>
|
||||
<option value="{url path="{category attr="url"}" limit="50"}"{if $limit==50}selected{/if}>50</option>
|
||||
<option value="{url path="{category attr="url"}" limit="9999999999"}" {if $limit==9999999999}selected{/if}>All</option>
|
||||
<option value="{url path={navigate to="current"} limit="4"}" {if $limit==4}selected{/if}>4</option>
|
||||
<option value="{url path={navigate to="current"} limit="8"}" {if $limit==8}selected{/if}>8</option>
|
||||
<option value="{url path={navigate to="current"} limit="12"}" {if $limit==12}selected{/if}>12</option>
|
||||
<option value="{url path={navigate to="current"} limit="50"}"{if $limit==50}selected{/if}>50</option>
|
||||
<option value="{url path={navigate to="current"} limit="9999999999"}" {if $limit==9999999999}selected{/if}>All</option>
|
||||
</select>
|
||||
<span class="per-page">{intl l="per page"}</span>
|
||||
</span><!-- /.limiter -->
|
||||
@@ -19,10 +19,10 @@
|
||||
<label for="sortby-top">{intl l="Sort By"}</label>
|
||||
<select id="sortby-top" name="sortby">
|
||||
{*<option value="{url path="{category attr="url"}" order="manual"}">{intl l="Position"}</option>*}
|
||||
<option value="{url path="{category attr="url"}" limit=$limit order="alpha"}" {if $order=="alpha"}selected{/if}>{intl l="Name ascending"}</option>
|
||||
<option value="{url path="{category attr="url"}" limit=$limit order="alpha_reverse"}" {if $order=="alpha_reverse"}selected{/if}>{intl l="Name descending"}</option>
|
||||
<option value="{url path="{category attr="url"}" limit=$limit order="min_price"}" {if $order=="min_price"}selected{/if}>{intl l="Price ascending"}</option>
|
||||
<option value="{url path="{category attr="url"}" limit=$limit order="max_price"}" {if $order=="max_price"}selected{/if}>{intl l="Price descending"}</option>
|
||||
<option value="{url path={navigate to="current"} limit=$limit order="alpha"}" {if $order=="alpha"}selected{/if}>{intl l="Name ascending"}</option>
|
||||
<option value="{url path={navigate to="current"} limit=$limit order="alpha_reverse"}" {if $order=="alpha_reverse"}selected{/if}>{intl l="Name descending"}</option>
|
||||
<option value="{url path={navigate to="current"} limit=$limit order="min_price"}" {if $order=="min_price"}selected{/if}>{intl l="Price ascending"}</option>
|
||||
<option value="{url path={navigate to="current"} limit=$limit order="max_price"}" {if $order=="max_price"}selected{/if}>{intl l="Price descending"}</option>
|
||||
{*<option value="{url path="{category attr="url"}" order="rating"}">{intl l="Rating"}</option>*}
|
||||
</select>
|
||||
</span><!-- /.sort-by -->
|
||||
@@ -30,7 +30,7 @@
|
||||
<span class="view-mode">
|
||||
<span class="view-mode-label">{intl l="View as"}:</span>
|
||||
<span class="view-mode-btn">
|
||||
<a href="{url path="{navigate to="current"}" mode="grid"}" data-toggle="view" role="button" class="btn btn-grid"><i class="icon-grid"></i></a>
|
||||
<a href="{url path="{navigate to="current"}" mode='grid'}" data-toggle="view" role="button" class="btn btn-grid"><i class="icon-grid"></i></a>
|
||||
<a href="{url path="{navigate to="current"}" mode="list"}" data-toggle="view" role="button" class="btn btn-list "><i class="icon-list"></i></a>
|
||||
</span>
|
||||
</span><!-- /.view-mode -->
|
||||
47
templates/default/search.html
Normal file
47
templates/default/search.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
|
||||
{block name="body-class"}page-search{/block}
|
||||
|
||||
{* Breadcrumb *}
|
||||
{block name='no-return-functions' append}
|
||||
{$breadcrumbs = [
|
||||
['title' => {intl l="Search"}, 'url'=>{url path="/search"}]
|
||||
]}
|
||||
{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="main">
|
||||
|
||||
{$limit={$smarty.get.limit|default:8}}
|
||||
{$product_page={$smarty.get.page|default:1}}
|
||||
{$product_order={$smarty.get.order|default:'alpha'}}
|
||||
|
||||
<article class="col-main {$smarty.get.mode|default:"grid"}" role="main" aria-labelledby="main-label">
|
||||
|
||||
<h1 id="main-label" class="page-header">{intl l="Search Result for"} <small>{$smarty.get.q}</small></h1>
|
||||
{include file="includes/toolbar.html" toolbar="top" limit=$limit order=$product_order}
|
||||
<div id="category-products">
|
||||
<div class="products-content">
|
||||
{ifloop rel="product_list"}
|
||||
<ul class="product-col-3">
|
||||
{loop type="product" name="product_list" title="{$smarty.get.q}" limit=$limit page=$product_page order=$product_order}
|
||||
{include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="218" height="146"}
|
||||
{assign "products_count" $LOOP_TOTAL}
|
||||
{/loop}
|
||||
</ul>
|
||||
{/ifloop}
|
||||
{elseloop rel="product_list"}
|
||||
<h2 class="text-center">{intl l="No results found"} </h2>
|
||||
{/elseloop}
|
||||
</div>
|
||||
</div><!-- /#category-products -->
|
||||
{ifloop rel="product_list"}
|
||||
{include file="includes/toolbar.html" toolbar="bottom"}
|
||||
{/ifloop}
|
||||
</article>
|
||||
|
||||
</div><!-- /.layout -->
|
||||
{/block}
|
||||
|
||||
{block name="after-javascript-include"}{/block}
|
||||
Reference in New Issue
Block a user