Magento Export orders and export product information

Source: Internet
Author: User

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.     *&nbsp ;    * @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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.