Output categories with goods.

07.03.2019 11:50
#1
dev325
Joomshopping forum user no avatar
Name: Grigorii
27.02.2019
Posts: 1
Quote
Output categories with goods.

I use the od jshopping categories module to display categories. And here the question arose.
I need next to the category to display all the products that are in it. With php I'm not very, and Joomla recently.
Please tell me.

Here is the category output code:

<?php
defined('_JEXEC') or die('Restricted access');
error_reporting(E_ALL & ~E_NOTICE);

if (!empty($arResult)):
?>
<ul class="odcat <?php if($class){ echo $class;}?>">
<?php
$previousLevel = 0;
foreach($arResult as $arItem):
?>
<?php if ($previousLevel && $arItem["DEPTH"] < $previousLevel):?>
<?php echo str_repeat("</ul></li>", ($previousLevel - $arItem["DEPTH"]));?>
<?php endif?>
<?php if ($arItem["IS_PARENT"]):?>
<?php if ($arItem["DEPTH"] == 1):?>
<li>
<a href="<?php echo $arItem["LINK"]?>" class="root parent<?php if ($arItem["SELECTED"]):?> selected<?php endif?>">
<?if(($display_img == 1) and $arItem["IMG"]):?>
<img src="<?php echo $jshopConfig->image_category_live_path."/".$arItem["IMG"]?>">
<?endif?>
<?php echo $arItem["NAME"]?><?php if($count){echo ' ('.$arItem["COUNT"].')';}?>
</a>
<ul class="odsubcat-<?php echo $arItem["DEPTH"]?>">
<?php else:?>
<li>
<a href="<?php echo $arItem["LINK"]?>" class="parent<?php if ($arItem["SELECTED"]):?> selected<?php endif?>">
<?if(($display_img == 1) and $arItem["IMG"]):?>
<img src="<?php echo $jshopConfig->image_category_live_path."/".$arItem["IMG"]?>">
<?endif?>
<?php echo $arItem["NAME"]?><?php if($count){echo ' ('.$arItem["COUNT"].')';}?>
</a>
<ul class="odsubcat-<?php echo $arItem["DEPTH"]?>">
<?php endif?>
<?php else:?>
<?php if ($arItem["DEPTH"] == 1):?>
<li class="catalog-card">
<div class="card__img-wrapper">
<?if(($display_img == 1) and $arItem["IMG"]):?>
<img class="card__img" src="<?php echo $jshopConfig->image_category_live_path."/".$arItem["IMG"]?>">
<?endif?>
</div>
<div class="card-hover-wrapper">
<h3 class="card__h3">
<a href="<?php echo $arItem["LINK"]?>" class="root<?php if ($arItem["SELECTED"]):?> selected<?php endif?>">

<?php echo $arItem["NAME"]?><?php if($count){echo ' ('.$arItem["COUNT"].')';}?>
</a>
</h3>

</div>

</li>
<?php else:?>
<li>
<a href="<?php echo $arItem["LINK"]?>" <?php if ($arItem["SELECTED"]):?>class="selected"<?php endif?>>
<?if(($display_img == 1) and $arItem["IMG"]):?>
<img src="<?php echo $jshopConfig->image_category_live_path."/".$arItem["IMG"]?>">
<?endif?>
<?php echo $arItem["NAME"]?><?php if($count){echo ' ('.$arItem["COUNT"].')';}?>
</a>
</li>
<?php endif?>
<?php endif?>
<?php $previousLevel = $arItem["DEPTH"];?>
<?php endforeach?>
<?php if ($previousLevel > 1)://close last item tags?>
<?php echo str_repeat("</ul></li>", ($previousLevel-1) );?>
<?php endif?>
</ul>
<?php endif?>

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.