sapalymahabat/themes/sapaly2stop/pages/search.htm

75 lines
2.5 KiB
HTML

title = "search"
url = "/search"
layout = "master-new-inside"
meta_title = "Search"
is_hidden = 0
[ProductList]
sorting = "no"
==
<?php
function onStart(){
$this['q'] = trim(post('search'));
if(strlen($this['q'])){
$this['obProductList'] = Lovata\Shopaholic\Models\Product::with(['offer'])
->where('slug', 'LIKE', '%'.$this['q'].'%')
->orWhere('name', 'LIKE', '%'.$this['q'].'%')
->where('active', 1)
->get();
//dd($this['obProductList']);
}
//lovata_shopaholic_products
}
?>
==
{% partial 'new/breadcrumb' secondPage=this.page.meta_title catName = q %}
<section class="category">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="product-box">
<div class="cat-box d-flex justify-content-between">
<h1>{{q}}</h1>
</div>
<!-- <h1>{{obProductList}}</h1> -->
<div class="tab-content">
<div class="tab-pane fade show active" id="grid" role="tabpanel">
<div class="row">
{% if obProductList.isNotEmpty() %}
{% for obProduct in obProductList %}
<div class="col-lg-4 col-md-6 col-xs-6">
{% partial 'product/category-item-inside' obProduct = obProduct class = "tab" sale = obProduct.featured %}
</div>
{% endfor %}
{%else%}
<div class="col-sm-12">
<h3 style="text-align: center;color: #4e75ff;">Пусто</h3>
</div>
{%endif%}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>