Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

SOAP > Get all products of a category
 
Georg Ringer
Member
 
Avatar
Total Posts:  63
Joined:  2008-07-04
Linz, Austria
 

Hi,

i am trying to get all products of a category using the SOAP service

It works with this code

$filters = array(
            
'category_ids' => array('like'=> intval($this->vars['category']))
        );    
$this->call('product.list', array($filters));

but there a 2 problems:
1.) What about products with multiple categories? Is there something like addCategoryFilter ?

2.) If I got a category tree like this
- a
-- aa
-- ab
- b

I would like to see all products of categories aa + ab if I use the category_id of ‘a’. Currently I get no products at ‘a’ but only at ‘aa’ and ‘ab’.

THanks a lot for helping
Georg

 
Magento Community Magento Community
Magento Community
Magento Community
 
JKwan13
Member
 
Total Posts:  63
Joined:  2008-06-12
 

Do you know exactly how the fitlers work, like what “like” means exactly and what you can put in as a filter.

Also, what is “$this->vars[’category’]”?

Anyone else have a solution to this, I’m curious as I want to know how to get the product count of a category?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JKwan13
Member
 
Total Posts:  63
Joined:  2008-06-12
 

bump. Anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JKwan13
Member
 
Total Posts:  63
Joined:  2008-06-12
 

Alright, I guess I had to look more carefully.  There is a ‘category.assignedProducts’ method that will retrieve all the products of a category.  You can just use count() method of the return array to get a product count.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mfoillard
Member
 
Total Posts:  67
Joined:  2008-08-04
 

It seems category.assignedProducts does not work here since the 1.3.0 Magento update. Anyone experience the same problem ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top