View Single Post
  #2  
Old 07-05-2020, 05:23 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Adding Subcategories on Home page

  • Probably there is a way to find the set of all subcategories from the category. Basically if you get the properties of a category, you will get these, and from which you will find a way to loop over them.
  • This might be less elegant, but the relation "the category with id n is a subcategory of the category with id m" is stored in the xc_categories table in the entry for the category id m, the value n in the column "root category". So instead of looking for all subcategories of the category m, you can simply look for all categories whose root category is m, and you are done.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote