Answer the question
In order to leave comments, you need to log in
opencart 2 manufacturers list?
Who fumbles in php, tell me how to correctly display the manufacturers in a single list
now the list is displayed alphabetically
here is the template
<div id="content" >
<h1><?php echo $heading_title; ?></h1>
<?php if ($categories) { ?>
<?php foreach ($categories as $category) { ?>
<div class="manufaklist">
<?php foreach (array_chunk($category['manufacturer'], 4) as $manufacturers) { ?>
<?php foreach ($manufacturers as $manufacturer) { ?>
<div class="item">
<a href="<?php echo $manufacturer['href']; ?>"><?php echo $manufacturer['name']; ?></a>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
<?php } else { ?>
<?php } ?>
</div>
<div class="manufaklist">
<div class="item"><a href="">AIC</a></div>
<div class="item"><a href="">Airdog</a></div>
<div class="item"><a href="">AirFree</a></div>
</div>
<!--тут контейнер закрывается, и открывается такой же блок на другую букву-->
<div class="manufaklist">
<div class="item"><a href="">Boneco</a></div>
<div class="item"><a href="">Brune</a></div>
</div>
<!--Не могу понять как сделать что бы выводилось единым списком так--->
<div class="manufaklist">
<div class="item"><a href="">AIC</a></div>
<div class="item"><a href="">Airdog</a></div>
<div class="item"><a href="">AirFree</a></div>
<div class="item"><a href="">Boneco</a></div>
<div class="item"><a href="">Brune</a></div>
</div>
Answer the question
In order to leave comments, you need to log in
По идее сделать так:
<div id="content" >
<h1><?php echo $heading_title; ?></h1>
<?php if ($categories) { ?>
<div class="manufaklist">
<?php foreach ($categories as $category) { ?>
<?php foreach (array_chunk($category['manufacturer'], 4) as $manufacturers) { ?>
<?php foreach ($manufacturers as $manufacturer) { ?>
<div class="item">
<a href="<?php echo $manufacturer['href']; ?>"><?php echo $manufacturer['name']; ?></a>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
</div>
<?php } else { ?>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question