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 - Multiple categories ignored
 
luco
Jr. Member
 
Total Posts:  10
Joined:  2009-04-07
 

Hey,
i try to get a list of products trough Magento API.
Everything works fine except filtering by category. When i use:

$filters = array(
    
'category_ids' => array('like'=>'16')
);

or

$filters = array(
    
'category_ids' => array('in'=>'16')
);

or

$filters = array(
    
'category_ids' => array('in'=>array('16'))
);

i receive only these products with one category.
Products with multiple categories doesn´t appear. Is there any way to get them by filter?
Additionally there are some products which are not reffered to any category. Possible to get these products?

Thanks a lot for your help
luco

 
Magento Community Magento Community
Magento Community
Magento Community
 
talmor
Member
 
Avatar
Total Posts:  43
Joined:  2008-11-14
Israel
 

I join this question, have been going crazy for the last 4 hours trying to understand this filter.

 
Magento Community Magento Community
Magento Community
Magento Community
 
k5
Jr. Member
 
Total Posts:  10
Joined:  2009-04-16
Germany
 

the best i came up with is

$filters = array(
    
'category_ids' => array('like'=>'% 16%')
);
(remove space between % and 16, the forum screws up 

with the disadvantage that is matches category_ids “116” or “160”
but at least it reduces the amount of transmitted data, you can always make a manual sort after the call

for products without category

$filters = array(
    
'category_ids' => array('eq'=>'')
);
works quite fine
 
Magento Community Magento Community
Magento Community
Magento Community
 
k5
Jr. Member
 
Total Posts:  10
Joined:  2009-04-16
Germany
 

removed double post (connection problems)

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