나는 이것이 오래된 질문이라는 것을 알고 있지만 나는 이것으로 어려움을 겪었다. 필자는 기본 catalogProductList 함수와 정확히 동일하지만 추가 매개 변수를 가진 자체 SOAP API 끝점을 만들었습니다. 아래의 코드를 참조하십시오 :
$collection = Mage::getModel('catalog/product')->getCollection()
->addStoreFilter($this->_getStoreId($store))
->addAttributeToSelect('name');
if($limit) {
$collection->setOrder('updated_at', 'ASC');
$collection->setPageSize($limit);
}
/** @var $apiHelper Mage_Api_Helper_Data */
$apiHelper = Mage::helper('api');
$filters = $apiHelper->parseFilters($filters, $this->_filtersMap);
try {
foreach ($filters as $field => $value) {
$collection->addFieldToFilter($field, $value);
}
} catch (Mage_Core_Exception $e) {
$this->_fault('filters_invalid', $e->getMessage());
}
$result = array();
foreach ($collection as $product) {
$result[] = array(
'product_id' => $product->getId(),
'sku' => $product->getSku(),
'name' => $product->getName(),
'set' => $product->getAttributeSetId(),
'type' => $product->getTypeId(),
'category_ids' => $product->getCategoryIds(),
'website_ids' => $product->getWebsiteIds(),
'updated_at' => $product->getUpdatedAt(),
'created_at' => $product->getCreatedAt()
);
}
return $result;
을 그리고 거기에서 우리는 마지막 updated_at 값을 추적하고 필터로 다음 [LIMIT] 항목을 얻을 것을 사용합니다. 기본적으로 updated_at 및 created_at은 응답에 없으며 updated_at에 의해 목록이 정렬되지 않으므로 추가했습니다.