I'm trying to find a way to call Magento with SOAP v1 and return a list of products with the price and special price of the same category but every function I found doesn't return this values, I would need to make a call for each product and it takes a long time.
Until now I tried:
$category = $client->call($session, 'catalog_category.assignedProducts', '31');
and:
$category = $client->call($session, 'catalog_product.list');
Is there a way?
you have to extend the api method in Mage_Catalog_Model_Category_Api
public function assignedProducts($categoryId, $store = null)
{
$category = $this->_initCategory($categoryId);
$storeId = $this->_getStoreId($store);
$collection = $category->setStoreId($storeId)->getProductCollection()->addAttributeToSelect(array('price', 'special_price'));
($storeId == 0)? $collection->addOrder('position', 'asc') : $collection->setOrder('position', 'asc');;
$result = array();
foreach ($collection as $product) {
$result[] = array(
'product_id' => $product->getId(),
'type' => $product->getTypeId(),
'set' => $product->getAttributeSetId(),
'sku' => $product->getSku(),
'position' => $product->getCatIndexPosition(),
'price' => $product->getPrice(),
'special_price' => $product->getSepcialPrice()
);
}
return $result;
}and then modify wsdl.xml in catalog module
<complexType name="catalogAssignedProduct">
<all>
<element name="product_id" type="xsd:int"/>
<element name="type" type="xsd:string"/>
<element name="set" type="xsd:int"/>
<element name="sku" type="xsd:string"/>
<element name="position" type="xsd:int"/>
<element name="price" type="xsd:decimal" />
<element name="special_price" type="xsd:decimal" />
</all>
</complexType>
hi, it can add grouprice to $collection in array?, thanks