Magento export orders at the same time export product information, according to business expansion, Magento own function also more and more not meet our needs. Today Hicoogle to improve the batch export orders according to demand, but also to bring the product information of the order. Took a little time to find some information on the Internet to complete this function. Today Hicoogle to share it. The following is part of the code, because the code is longer, attached to the code tail to download the code file.
This feature requires plug-in Webshopapps to support, http://www.magentocommerce.com/magento-connect/webshopapps-orderexport.html
After the installation, find app\code\community\webshopapps\ordermanager\model\export\csv.php, is modified.
Put a portion of the code first:
<?phpclass Webshopapps_ordermanager_model_export_csv extends Webshopapps_ordermanager_model_export_abstractcsv { Const ENCLOSURE = ' "'; const DELIMITER = ', '; /** * C Oncrete implementation of abstract method to export given orders to CSV file in var/export. *  ; * @param ers List of orders of type Mage_sales_model_order or Order IDs to Export. &nbs p; * @return String The name of the written CSV file in var/export */ publ IC function Exportorders (ers) { $fileName = ' Magento _ '. Date ("Ymd"). CSV '; $fp = fopen (Mage::getbasedir (' Export '). ' /'. $fileName, ' W '); fwrite ($fp, "\XEF\XBB\XBF"); $this->writeheadrow ($fp); $record = Array (); foreach (ers as er) { er = Mage::getmodel (' Sales/order ')->load ($ Order); //$this->writeorder (er, $fp); $common = $this->getcommonordervalues (er); erItems = er->getitemscollection (); $common 2 = $this->getcommonordervalues2 (er); $ITEMINC = 0; foreach ($ OrderItems as $item) { & nbsp; if (! $item->isdummy ()) { $record [] = Array_merge ($common, $this Getorderitemvalues ($item, er, + + $itemInc), $common 2); } } } $this->writeorder ($this->mergesamekey ($record), $fp); fclose ($fp); return $fileName; }
Since the code is longer, it may be incomplete to post, so download the file as an attachment.
This feature requires you to select an order to export in the background to export properly.
Click to download: Csv.zip
Reprint Please specify: Hey cool elder brother, have you more cool! »[Original]magento export order and export product information
Magento Export orders and export product information