View Single Post
  #1  
Old 12-12-2019, 11:08 PM
 
siddharth.puri@wheelandba siddharth.puri@wheelandba is offline
 

Advanced Member
  
Join Date: Nov 2019
Posts: 66
 

Question Adding Subcategories on Home page

Hi i want to add sub categories on home page. I have a category Promotions which has sub categories.

How can I add sub categories of this category on the home page.

{% if this.getSubcategories() %}
<div class="subcategories-container overide">
<div class="subcategory-heading">
<span class="category-name">{{ t('Subcategories') }}</span>
</div>
<ul class="subcategory-view-icons subcategory-list grid-list clearfix">
{% for subcategory in this.getSubcategories() %}
{% if subcategory.hasAvailableMembership() %}
<li>
<a href="{{ url('category', '', {'category_id': subcategory.category_id}) }}">
<span class="subcategory-icon" style="width:100%; height:100%;">
{{ widget('\\XLite\\View\\Image', image=subcategory.image, maxWidth=this.getIconWidth(), maxHeight=this.getIconHeight(), centerImage='1', alt=this.getAlt(subcategory.image)) }}
</span>
<span class="subcategory-name" style=" width:100%; font-size: 18px !important; font-weight:bold;">{{ subcategory.name }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% for item in this.getNestedViewList('children') %}
<li>{{ item.display() }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{{ widget_list('subcategories.base') }}


----


Below this I want to display the sub categories of one of these categories.


I can catch that specific category by using subcategory.category_id == 10

Now I am struggling to display its sub categories


__________________
- X-Cart Version 5.3.6.1
__________________
Version 5.3.6.6
Reply With Quote