Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Automatically emailing supplier when a new order comes in.

I am currently using Zen Cart and when a new order is placed you simply click a button and an email is sent to the supplier notifying them of the new order along with an attached invoice. I haven’t been able to find anything like this in Magento. Am I missing something or is this just not supported?

RSS comments feed for this entry

User Comments

|3 comments
  1. MonoMachines

    1MonoMachines posted Mon, June 9, 2008

    I am actually looking for the same feature.  Any luck with this @mikefifeld?  Also, is there any way export this “Purchase Order” information as a CSV?

  2. barrmy

    2barrmy posted Fri, June 27, 2008

    For a company I worked with would have a cron job running on 15min intervals that pulled all new orders (since the last report) straight from the db (in magento’s case thats in mag_sales_order) and sent emails with the csv file to the different distributors based on a distributor attribute - very similar to the one below.  Technically one could write an intermediary script after purchase confirmation that would trigger a php function that could do the same thing...i’m pretty sure php mail supports sending attachments

    monomachines - you can either write a script to do it via SQL or have php handle the export....here’ s a CSV export script:
    create a file called export_orders.php, insert the following code:

    <?php
    $host = ‘localhost’;
    $user = ‘ENTER YOUR MYSQL DB USERNAME’;
    $pass = ‘ENTER YOUR MYSQL DB PASSWORD’;
    $db = ‘ENTER YOUR MAGENTO DB NAME’;
    $table = ‘mag_sales_order’;
    $file = ‘export’;

    $link = mysql_connect($host, $user, $pass) or die("Can not connect.” . mysql_error());
    mysql_select_db($db) or die("Can not connect.");

    $result = mysql_query("SHOW COLUMNS FROM “.$table."");
    $i = 0;
    if (mysql_num_rows($result) > 0) {
    while ($row = mysql_fetch_assoc($result)) {
    $csv_output .= $row[’Field’].”, “;
    $i++;
    }
    }
    $csv_output .= “n”;

    $values = mysql_query("SELECT * FROM “.$table."");
    while ($rowr = mysql_fetch_row($values)) {
    for ($j=0;$j<$i;$j++) {
    $csv_output .= $rowr[$j].”, “;
    }
    $csv_output .= “n”;
    }

    $filename = $file."_”.date("Y-m-d_H-i",time());
    header("Content-ty

  3. barrmy

    3barrmy posted Fri, June 27, 2008

    it cut the code - starting from one line up

    $filename $file."_".date("Y-m-d_H-i",time());
    header("Content-type: application/vnd.ms-excel");
    header("Content-disposition: csv" date("Y-m-d") . ".csv");
    header"Content-disposition: filename=".$filename.".csv");
    print 
    $csv_output;
    exit;
    ?>

    2. run the file by going to http://www.yourwebsite.com/export_orders.php


Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
52349 users|664 users currently online|105695 forum posts