Answer the question
In order to leave comments, you need to log in
Kohana, output of goods, how to display titles once?
Hello, I have a question, the goods go in the form of a table, the table where the goods go has headings, these headings should be displayed once from the top, right now, when adding goods, each product has the output of this table.
Please tell me how can I make the table headers displayed once.
The fact that this is the headings.
<?php foreach ($productsFound as $product): ?>
<? if ($product->moshnostkvt): ?>
<center>
<div class="yovarka">
<div class="yovarka1">
<b>Фото</b></div>
<div class="yovarka2">
<b>Модель</b></div>
<div class="yovarka3">
<b>Мощность, квт</b></div>
<div class="yovarka4">
<b>Габариты, Д (База) x Ш x В, мм</b></div>
<div class="yovarka5">
<b>Сухой вес (рабочий вес), кг</b></div>
<div class="yovarka6">
<b>Подробная информация о товаре</b></div>
</div>
</center>
тут код вывода товаров
<?php endif; ?>
<?php endforeach; ?>
<center>
<div class="yovarka">
<div class="yovarka1">
<b>Фото</b></div>
<div class="yovarka2">
<b>Модель</b></div>
<div class="yovarka3">
<b>Мощность, квт</b></div>
<div class="yovarka4">
<b>Габариты, Д (База) x Ш x В, мм</b></div>
<div class="yovarka5">
<b>Сухой вес (рабочий вес), кг</b></div>
<div class="yovarka6">
<b>Подробная информация о товаре</b></div>
</div>
</center>
Answer the question
In order to leave comments, you need to log in
Here is the whole code, and two product display templates with fields !
Here's the error: c2n.me/3BUoHos
<?php
//разделили на группы
$productsGroups = array(
array_filter($productsFound, function($p){
return $p->moshnostkvt;
}),
array_filter($productsFound, function($p){
return $p->proizvoditm3;
})
);
?>
<?php if (count($productsGroups)>0) : ?>
<div class="allcentr">
<div class="allcentrc">
<div class="akciifullinfo">
<div class="akciifullinfot">
<h2><?= $cat->name ?></h2>
<?php foreach($productsGroups as $key => $productsGroup): ?>
<?php if($key == 0): ?>
<center>
<div class="yovarka">
<div class="yovarka1">
<b>Фото</b></div>
<div class="yovarka2">
<b>Модель</b></div>
<div class="yovarka3">
<b>Мощность, квт</b></div>
<div class="yovarka4">
<b>Габариты, Д (База) x Ш x В, мм</b></div>
<div class="yovarka5">
<b>Сухой вес (рабочий вес), кг</b></div>
<div class="yovarka6">
<b>Подробная информация о товаре</b></div>
</div>
</center>
<?php elseif($key == 1): ?>
<center>
<div class="yovarka">
<div class="yovarka1">
<b>Фото</b></div>
<div class="yovarka2">
<b>Модель</b></div>
<div class="yovarka3">
<b>Производит., м3/мин</b></div>
<div class="yovarka4">
<b>Давления, МПа</b></div>
<div class="yovarka5">
<b>Мощность, кВт</b></div>
<div class="yovarka6">
<b>Подробная информация о товаре</b></div>
</div>
</center>
<?php endif;?>
<center>
<a href="/product/<?= $product->alias ?>" title="<?= $product->prname ?>">
<div class="yovarkat anim">
<div class="yovarkat1">
<b><?php if ($product->getImage()): ?>
<img src="/media/uploads/small/small_<?php echo($product->getImage(
)) ?>" alt="<?= $product->prname ?>" title="<?= $product->prname ?>"/>
<?php else: ?>
<img src="/media/uploads/noimage.png" alt="нет фото" title="нет фото"/>
<?php endif; ?></b>
</div>
<div class="yovarkat2">
<h2><?= $product->prname ?></h2></div>
<div class="yovarkat3">
<b><?= $product->moshnostkvt ?></b></div>
<div class="yovarkat4">
<b><?= $product->gabarity ?></b></div>
<div class="yovarkat5">
<b><?= $product->cyzoybec ?></b></div>
<div class="yovarkat6">
<b>Подробнее</b></div>
<div style="clear:both"></div>
</div>
</a>
</center>
<?php foreach ($productsFound1 as $product): ?>
<center>
<a href="/product/<?= $product->alias ?>" title="<?= $product->prname ?>">
<div class="yovarkat anim">
<div class="yovarkat1">
<b><?php if ($product->getImage()): ?>
<img src="/media/uploads/small/small_<?php echo($product->getImage(
)) ?>" alt="<?= $product->prname ?>" title="<?= $product->prname ?>"/>
<?php else: ?>
<img src="/media/uploads/noimage.png" alt="нет фото" title="нет фото"/>
<?php endif; ?></b>
</div>
<div class="yovarkat2">
<h2><?= $product->prname ?></h2></div>
<div class="yovarkat3">
<b><?= $product->proizvoditm3 ?></b></div>
<div class="yovarkat4">
<b><?= $product->davlenyempa ?></b></div>
<div class="yovarkat5">
<b><?= $product->moshnostkvt1 ?></b></div>
<div class="yovarkat6">
<b>Подробнее</b></div>
<div style="clear:both"></div>
</div>
</a>
</center>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question