Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Fetching nested categories

    General Discussion
    2
    2
    339
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dsharma last edited by

      Hello,

      I have used your function getVisibleCategoryTree() which gives nested arrays in tree form and which is being used using vue js for fetching categories.

      We are not using vue js so can you tell us how to fetch tree form array in javascript. I know there is function getAllChildren() but it gives one level children only.

      Please reply

      Regards
      Deepak Sharma

      1 Reply Last reply Reply Quote 1
      • R
        rahul last edited by

        Hi @dsharma

        getVisibleCategoryTree() is returning all category in nested form, so you can create a recursive function which check each category whether they have children or not & this function will be run until they don't have children & store result.

        Thanks

        1 Reply Last reply Reply Quote 0
        • First post
          Last post