Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47
  1. #1
    Join Date
    Mar 2006
    Posts
    63
    Plugin Contributions
    0

    Default email order confirmation to third party

    I am trying to figure out how I can get orders placed by customers belonging to a certain company or group to receive an order confirmation when the customer places an order.

    Im a php newbie...
    Is there a way to get zencart to do the following... (if customer is from company "ACME , or belongs to the "ACME" group then ...send the order confirmation to "joe@acme.com")... All other orders email site admim

    Any help would be WONDERFUL!!!

  2. #2
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,958
    Plugin Contributions
    3

    Default Re: email order confirmation to third party

    Admin >>> Email...

    you can insert several addresses ( just follow the protocol shown ).

    HOWEVER... sorting the email by the manner you propose may not be possible without some heavy coding
    Our latest project is Pet Tags.

  3. #3
    Join Date
    Mar 2006
    Posts
    63
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Yes I know the Admin>Email Unfortunately that sends an email to as many emails as you want on EVERY order. What I need is only ACME customers to have an order notification sent to a third party.

  4. #4
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,958
    Plugin Contributions
    3

    Default Re: email order confirmation to third party

    What if an order consists of SEVERAL products, of which ONE is from ACME and the others are from somewhere else?
    Our latest project is Pet Tags.

  5. #5
    Join Date
    Mar 2006
    Posts
    63
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    No the customer is from the company/organization "ACME" they can order whatever they want but I have to have the orders placed for this company/organization "ACME" sent to an administrative email from the ACME company for approval they then email be back a P.O. Number .... (the company has multiple locations) but a single approval person that issues P.O's for the invoice.

    I just need the person who handle the P.O's to get the order when someone from that organization places an order.

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    19,732
    Plugin Contributions
    3

    Default Re: email order confirmation to third party

    I posted the same request (third-party email by customer) in the Commercial Help Wanted forum a while back and got a couple of replies that didn't seem unreasonable, cost-wise. I wasn't able to follow up, but you might try there.

  7. #7
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,958
    Plugin Contributions
    3

    Default Re: email order confirmation to third party

    Quote Originally Posted by valnoren View Post
    No the customer is from the company/organization "ACME" they can order whatever they want but I have to have the orders placed for this company/organization "ACME" sent to an administrative email from the ACME company for approval they then email be back a P.O. Number .... (the company has multiple locations) but a single approval person that issues P.O's for the invoice.

    I just need the person who handle the P.O's to get the order when someone from that organization places an order.
    Ah... that's a little more straightforward, and I would suggest a solution that has nothing to do with zencart.

    If you are using an email client (Outlook), build a RULE that will automatically forward YOUR receipt of the acme-specific confirmation, to the someone from Acme.

    So... you will be receiving ALL order confirmations, regardless of the customer... Just configure Outlook to have a rule that says:

    "If an order confirmation comes in with @acme.com in the whatever field, forward a copy to joe.bloggs@acme.com"

    I'm sure you will know how to set up rules in Outlook?
    Our latest project is Pet Tags.

  8. #8
    Join Date
    Mar 2006
    Posts
    63
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Quote Originally Posted by schoolboy View Post
    Ah... that's a little more straightforward, and I would suggest a solution that has nothing to do with zencart.

    If you are using an email client (Outlook), build a RULE that will automatically forward YOUR receipt of the acme-specific confirmation, to the someone from Acme.

    So... you will be receiving ALL order confirmations, regardless of the customer... Just configure Outlook to have a rule that says:

    "If an order confirmation comes in with @acme.com in the whatever field, forward a copy to joe.bloggs@acme.com"

    I'm sure you will know how to set up rules in Outlook?
    LOL schoolboy I thought of that myself but the client had this set up in an old OScommerce site and wants it the same way for the new zencart site...
    Its a long story. In short theres a special category of products which are password protected. for a certain group.
    this group adds an item to shopping cart.
    then clicks checkout and instead of continuing to the shipping /login page it goes to a special form page that sends the info to the main Org's headqurters that approve the order and send the order back to the client.

    Screwy I know...
    I have the old form page which will probably function in zencart but how to get from the shopping cart page to the special ordering page ????? so it sends the form to the Org's HQ is where Im stuck

  9. #9
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,958
    Plugin Contributions
    3

    Default Re: email order confirmation to third party

    Sounds like a Government Department in a Banana Republic.

    It may be an idea to get someone to look at the osCommerce code... while it will definitely NOT work in ZC, the functional parameters will be obvious to a knowledgeable coder and it may speed up the dev of a ZC version, and therefore be cheaper.
    Our latest project is Pet Tags.

  10. #10
    Join Date
    Jan 2004
    Posts
    60,588
    Blog Entries
    4
    Plugin Contributions
    145

    Default Re: email order confirmation to third party

    valnoren, using Zen Cart v1.3.9x, it's very simple.

    You could hard-code lotsa stuff into the orders class, or you could go with a more sophisticated approach using notifiers/observers as I've outlined below:

    1. Edit /includes/classes/order.php and change just one line near the very end of the file:
    Code:
        $this->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL');
    becomes this:
    Code:
        $this->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL', array($zf_insert_id, $email_order, $extra_info, $html_msg));
    2. Create a new file with the following content:
    /includes/classes/observers/class.sendGroupOrderNotices.php
    Code:
    <?php
    /**
     * observer class to send custom extra order emails to supplier based on customer group membership
     *
     * @package classes
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: class.sendGroupOrderNotices.php  2010-05-26 20:05:22Z drbyte $
     */
    class sendGroupOrderNotices extends base {
    
     /**  constructor method !
       *
       * Attach observer class to the global $zco_notifier and watch for a single notifier event.
       */
      function sendGroupOrderNotices() {
        $this->attach($this, array('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL'));
    
        /**
         * Set the specialGroupId to the number of the customer-group assigned in your admin
         */
        $this->specialGroupId = 1;
        /**
         * Set the proper email address for the additional copy of order confirmations to be sent to
         */
        $this->specialGroupEmailAddress = 'noreply@mail_domain.com';
        /**
         * Set the email subject line for the messages being sent to the external supplier
         * Use EMAIL_TEXT_SUBJECT for the default subject, or replace with 'My Custom Subject Line' instead.
         */
        $this->orderEmailSubjectPrefix = 'Order Fulfillment Request from ' . STORE_NAME;
      }
    
    
     /**   Actual Method that does the desired activity
       *
       * Called by observed class when any of the notifiable events occur
       *
       * @param object $class
       * @param string $eventID
       */
      function update(&$class, $eventID, $paramsArray = array()) {
        global $db;
        list($zf_insert_id, $email_order, $extra_info, $html_msg) = $paramsArray;
        $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
        if (!$group_query->EOF && $group_query->fields['customers_group_pricing'] == $this->specialGroupId) {
          zen_mail('', $this->specialGroupEmailAddress,
              $this->orderEmailSubjectPrefix . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,
              $email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray);
        }
      }
    }
    You can customize the section in red, as needed.


    3. Create a new file with the following content:
    /includes/auto_loaders/config.sendGroupOrderNotices.php
    Code:
    <?php
    /**
     * autoloader activation point for custom group order email notices
     *
     * @package initSystem
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: config.sendGroupOrderNotices.php  2010-05-26 20:05:22Z drbyte $
     */
    /**
     * Autoloader to instantiate observer class
     */
    $autoLoadConfig[90][] = array('autoType'=>'class',
                                  'loadFile'=>'observers/class.sendGroupOrderNotices.php');
    $autoLoadConfig[90][] = array('autoType'=>'classInstantiate',
                                  'className'=>'sendGroupOrderNotices',
                                  'objectName'=>'sendGroupOrderNotices');
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.



 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. welcome email problem and order confirmation email problems
    By oneelios in forum General Questions
    Replies: 1
    Last Post: 22 Jan 2010, 11:18 AM
  2. Replies: 4
    Last Post: 9 Jun 2009, 08:17 PM
  3. How do I Edit Order of Order Totals in Order Confirmation Email?
    By toussi in forum Managing Customers and Orders
    Replies: 1
    Last Post: 20 Mar 2009, 08:05 AM
  4. Replies: 0
    Last Post: 23 Jan 2009, 09:59 PM
  5. Did not recieve Order Confirmation email and no order exists in admin
    By gws76 in forum Managing Customers and Orders
    Replies: 4
    Last Post: 19 May 2008, 12:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •