60 lines
3.0 KiB
PHP
60 lines
3.0 KiB
PHP
<?php $this->template_load("head.php"); ?>
|
|
<?php $this->template_load("header.php"); ?>
|
|
<?php
|
|
|
|
$search = $_GET["s"];
|
|
$page = $_GET["page"] ?? 1;
|
|
$category_id = $_GET["c_id"] ?? 56780;
|
|
$products_per_page = 30;
|
|
|
|
$product_params = array(
|
|
"search_phrase" => $search,
|
|
"category_id" => $category_id,
|
|
"attributes" => array(),
|
|
"page" => $page,
|
|
"products_per_page" => $products_per_page,
|
|
"ranges" => array(),
|
|
"sale_price" => $_GET["price_sale"] ?? 0
|
|
);
|
|
|
|
$products = category_search($product_params);
|
|
$product_count = category_search_count($product_params);
|
|
|
|
?>
|
|
<section class="section first-other search">
|
|
<div class="container">
|
|
<h1 class="little vacancy__heading">Поиск</h1>
|
|
<h2 class="reviews-block__subheading reviews__subheading search__subheading">
|
|
Результат поиска по “<?= $b->get_view($search); ?>”<span><b><?= $b->pluralize($product_count, array("Найден", "Найдено", "Найдено")); ?> <?= $product_count; ?> <?= $b->pluralize($product_count, array("товар", "товара", "товаров")); ?></b></span>
|
|
</h2>
|
|
<div>
|
|
<ul class="generator-params__list variants-list">
|
|
<li class="generator-params__item <?= $category_id == 56780 ? "active" : ""; ?>">
|
|
<a href="<?= $b->router_format_get_params(array("c_id" => 56780), true); ?>" class="generator-params__link">Дизельные</a>
|
|
</li>
|
|
<li class="generator-params__item <?= $category_id == 56736 ? "active" : ""; ?>">
|
|
<a href="<?= $b->router_format_get_params(array("c_id" => 56736), true); ?>" class="generator-params__link">Бензиновые</a>
|
|
</li>
|
|
<li class="generator-params__item <?= $category_id == 56888 ? "active" : ""; ?>">
|
|
<a href="<?= $b->router_format_get_params(array("c_id" => 56888), true); ?>" class="generator-params__link">Газовые</a>
|
|
</li>
|
|
<li class="generator-params__item <?= $category_id == 56940 ? "active" : ""; ?>">
|
|
<a href="<?= $b->router_format_get_params(array("c_id" => 56940), true); ?>" class="generator-params__link">Сварочные</a>
|
|
</li>
|
|
</ul>
|
|
<article class="variants__products product-list">
|
|
<h2 class="reviews-block__subheading visually-hidden">[Дизельные]</h2>
|
|
<?php
|
|
foreach ($products as $key => $product) {
|
|
$b->template_load("productCategory/product_row.php", array("product" => $product));
|
|
}
|
|
?>
|
|
</article>
|
|
<div class="posts-pagination">
|
|
<?php $b->template_load("productCategory/pagination.php", array("current_page" => $page, "items_per_page" => $products_per_page, "items_count" => $product_count)); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<?php $this->template_load("main/questions.php"); ?>
|
|
<?php $this->template_load("footer.php"); ?>
|