Пример #1
0
 protected function doDataFilter($data)
 {
     parent::doDataFilter($data);
     $this->convertData($data, $this->__dataBeSaved, array('name' => 'name', 'meta_keyword' => 'keyword', 'description' => 'caption', 'price' => 'price', 'manufacturer' => 'brand', 'description' => 'description', 'short_description' => 'short_description', 'image' => 'image', 'small_image' => 'image', 'thumbnail' => 'image', 'gallery' => 'gallery', 'color' => 'color', 'size' => 'size', 'associated' => 'associated', 'visibility' => 'visibility', 'config_attributes' => 'config_attributes', 'type' => 'type', 'product_type_id' => 'product_type_id'));
     // process custom option
     return $this->__dataBeSaved;
 }
Пример #2
0
 public function finish()
 {
     parent::finish();
     $batchModel = Mage::getSingleton('dataflow/batch');
     $params = $batchModel->getParams();
     $filename = 'inventory' . $this->getRunDate() . '.csv';
     $path = Mage::getBaseDir('var') . DS . 'log' . DS . 'import' . DS . $this->__vendorName . DS . 'inventory';
     if (file_exists($path . DS . $filename)) {
         if (!empty($params['log_path'])) {
             $resource = $this->getInventoryLogResource();
             $resource->write($filename, $path . DS . $filename);
         }
         if (!empty($params['log_email'])) {
             $this->sendEmail('Attached is the inventory update reporting or download <a href="{file}">here</a>', $path . DS . $filename, $filename);
         }
         @unlink($path . DS . $filename);
     } else {
         if (!empty($params['log_email'])) {
             $this->sendEmail('There is nothing that can be changed');
         }
     }
     //$batchId = $batchModel->getId();
     //Mage::getSingleton('core/session')->unsetData('import_date_'. $batchId);
 }