<?php if (__sub($id) == 1) : ?>
    <?php foreach ($all_items as $key => $type) : ?>
        <?php if (count($type['items']) > 0) : ?>
            <?php if (isset($type['sub_categories']) && sizeof($type['sub_categories']) > 0) : ?>
                <ul class="subcategories subcat_1 subCategory_<?= $type['category_id']; ?> " style="display:none;">
                    <li class="allSubcategory"><a href="javascript:;" class="active"><?= __('all'); ?></a></li>
                    <?php foreach ($type['sub_categories'] as  $key => $subcat) : ?>
                        <li class="subcategorieslist"><a href="javascript:;" id="<?= html_escape($subcat->id); ?>" data-name="<?= $subcat->sub_category_name; ?>">
                            <img src="<?= get_img($subcat->thumb, '', 1); ?>" alt="subcat_img">
                            <span><?= $subcat->sub_category_name; ?></span></a>
                        </li>
                    <?php endforeach; ?>
                </ul>
            <?php endif; ?>
        <?php endif; ?>
    <?php endforeach; ?>
<?php endif; ?>