0

My SOAP api script should list products that are in one or none categories. I don't know how filter works with category_ids:

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

$products = $proxy->call($sessionId, 'product.list', array($filters));
1

If there are 2 category ids there should be a comma between them. So you can try this:

$filters = array(
    'category_ids' => array('nlike'=>'%,%')
);

$products = $proxy->call($sessionId, 'product.list', array($filters));

But I'm not sure this will work since the category_ids attribute was dropped in the upgrade file app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.4.0.0.33-1.4.0.0.34.php.

$installer->removeAttribute('catalog_product', 'category_ids');

It may depend on the version you have.

0

category_ids doesn't work with product.list from magento 1.4 anymore. Try to use 'catalog_category.assignedProducts'.

$productList = $proxy->call($sessionId, ‘catalog_category.assignedProducts’, array(’4’)); 

And after you will have all product ids use 'catalog_product.list'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.