Mohit Sharma
Mohit Sharma

Reputation: 19

How to parse Magento SOAP V1 Php Category Tree

I'm building a mobile app on Magento using Soap API V1. On calling Category tree api, i get a response as shown below. I want to be able to convert it to JSON but I'm not able to parse it at all. Any suggestions from experienced PHP/Magento developers will be of great help. Thanks in advance.

Response:

array
'category_id' => string '1' (length=1)
'parent_id' => string '0' (length=1)
'name' => string 'Root Catalog' (length=12)
'is_active' => null
'position' => string '0' (length=1)
'level' => string '0' (length=1)
'children' =>
 array
  0 =>
    array
      'category_id' => string '2' (length=1)
      'parent_id' => string '1' (length=1)
      'name' => string 'Default Category' (length=16)
      'is_active' => string '1' (length=1)
      'position' => string '1' (length=1)
      'level' => string '1' (length=1)
      'children' =>
        array
          ...
  1 =>
    array
      'category_id' => string '3' (length=1)
      'parent_id' => string '1' (length=1)
      'name' => string 'root_category' (length=13)
      'is_active' => string '1' (length=1)
      'position' => string '2' (length=1)
      'level' => string '1' (length=1)
      'children' =>
        array

Upvotes: 1

Views: 210

Answers (0)

Related Questions