Author Topic: Get Sub-Categories Problem in API  (Read 10574 times)

Offline ahmad-sabra

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Get Sub-Categories Problem in API
« on: April 11, 2016, 10:04:02 AM »
hello;

im trying to retrieve sub-categories for a specific category. this request '?rt=a/product/category&category_id=84' is
returning
{
   "category_id": "84",
   "parent_id": "0",
   "sort_order": "0",
   "status": "1",
   "date_added": "2016-04-08 14:43:46",
   "date_modified": "2016-04-11 16:33:50",
   "language_id": "1",
   "name": "Car Rental",
   "meta_keywords": "",
   "meta_description": "",
   "description": "",
   "store_id": "0",
   "products_count": "0",
   "tumbnail":"",
   "total_products": "0",
   "total_subcategories": "3"
}

No sub-categories are shown...please any help(i have create sub categories under this category with id=84).
is their any problem or i have made some wrong step on creating these sub-categories(i have made 3 sub-categories)
« Last Edit: April 14, 2016, 09:14:53 AM by abantecart »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Get Sub-Categories Problem in API
« Reply #1 on: April 14, 2016, 09:29:55 AM »
This request  '?rt=a/product/category&category_id=84' should work

1. Check that your subcategories are enabled and have products, and finally in the right store (if you have multiple)

2. If #1 is correct, check in the file
storefront/controller/api/product/category.php

Check if you get to line #77 then you request. Below code should be executed.
Code: [Select]
if ($category_info['total_products']) {
        $category_info['subcategories'] = $this->getCategories( $category_id );

}
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline ahmad-sabra

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Get Sub-Categories Problem in API
« Reply #2 on: April 28, 2016, 07:25:13 AM »
hello,
i have tried what you have mention,but i cant find the problem.
i have 3 categories and every category have sub-categories and every sub-category has sub-categries and every subcategory have products...all thes sub categories are enabled and all final sub-categories have products.
so where i can find the problem ?

 

Powered by SMFPacks Social Login Mod