如何使用数据流配置文件导出前100个产品

时间:2014-04-03 06:29:38

标签: php magento magento-1.8

我如何使用magento内置数据流配置文件功能仅从magento导出前100个产品。我想出口第一批产品,但我的商店有20000种产品,所以我想出口1000件产品。等待建议。

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以通过重写Mage_Dataflow_Model_Batch_Abstract类中的核心函数getIdCollection()来实现。

返回所有id集合,您可以根据需要自定义代码。

目前返回代码如下:

return $ this-> getResource() - > getIdCollection($ this),您可以按照以下内容替换代码

//return $this->getResource()->getIdCollection($this);
        $idArray = array();
        foreach($this->getResource()->getIdCollection($this) as $key => $val){
            if($key < 100){
                $idArray[] = $val;
            }
        }
        return $idArray;

请检查下载的csv后,不要在弹出窗口中看到加载的记录希望这会对你有帮助!..