News:

AbanteCart v1.4.2 is released.

Main Menu

Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

Get Sub-Categories Problem in API

Started by ahmad-sabra, April 11, 2016, 10:04:02 AM

Previous topic - Next topic

ahmad-sabra

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)

abantecart

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.

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

ahmad-sabra

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 ?

Forum Rules Code of conduct
AbanteCart.com 2010 -