Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 47
  1. #31
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    In an ideal world, yes. But only for this specific category of product. But in the real world I could live with the possibility to have to give back the customer's money if the confirmation fails. And with a price over 100$ the customers will probably never buy the card if they have to select a club in the list without being a member of one of them. But I'll follow your idea and start a new thread on my needs. Thanks for all the help and hope you'll be able to help me with this.

  2. #32
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Sorry for bugging you with this DrBytes but I worked the idea and I think this addon could do the work with some little modification, but I will surely need your help... So lets simplify that.

    I added the double email confirmation addon (http://www.zen-cart.com/downloads.php?do=file&id=107), so that double check with the fact that it will be really clear in the product description that they have to be a member of the affiliated clubs listed + the fact that they will have to choose the club they are from in a list as an attribute to by the product + the fact that customers will have to pay like 100$ in the process for their member card... All that will certainly confirm that they take care of what they do. And if mistake happens we could refund them without any problem since we'll use Paypal, or have them becoming a member of one of the affiliated clubs. So, I consider the login confirmation fixed for now, I'll live with the result of this decision.

    Now, the other problem was to have the email send to the third party selected by the attribute. That's what I would like to have explained, if you have the time. I suspect it will all be done in the config.xxxxxx.php file, so could it be possible to also ad a condition which could be something like "If the product, or one of the products is in the category #x, send the xxxxxx email to (adress linked to the atribute of this product)".

    Also, in the same way the third email will have a specific subject, is it possible to have a specific email send to that third party? It could contain only the information that the club need, which would be the name, adress, phone and email.

    With these modifications it will be quite perfect for my needs. ;)

  3. #33
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: email order confirmation to third party

    Yes, adjust the class file (not the config file) and add the custom logic required, by determining the attributes on each product, and taking action accordingly. The $class variable contains many strings and arrays of all the information you need about the present order and its products and their associated attributes. You can change subject-line strings and destination email address strings based on your findings.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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.

  4. #34
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Ok, majority of the zencart layout problem was fixed (some still pending, posted elsewhere on the forum) so I'm now ready to work on this specific function to make it work. I will give time on this in the next few days and will try to make this to work before the weekend. I know I'll need help and I hope you'll be able to help me a little, through this. Regards.

  5. #35
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Well... I started from the start with this and from the moment I created the config.sendGroupOrderNotices.php file I get the blank page error an the main page. As soon as I remove this file Zencart came back. I retried this few times without any succes.

    Man I didn't even tried to change the code... Here's my link again. http://www.fc4x4q.com/boutique Any clue on why it does that?

    Thanks in advance for your time!

  6. #36
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: email order confirmation to third party

    Find out the actual error message and take action based on that. See: http://www.zen-cart.com/content.php?124-blank-page
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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.

  7. #37
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Thanks for the link. I found the issue. I misspelled the name of the file by forgetting the "s" at the end of config.sendGroupOrderNotices.php... what a dumb mistake. Had some difficulties ti fond time to work on this today... Now I'm back on the track. Took off at the job tomorrow so I'll work on this tonight and tomorrow like if my life was depending of it. I need to make this work for Sunday.

  8. #38
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Is there a way to get the exact table name in the DB? One of the frustration in this project is that I have to built this on a not fully accessible server... Since I don't have all the access I had to use some imagination. But first, here's the code I use in the file I called class.sendClubOrderNotices.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.sendClubsOrderNotices.php  2010-05-26 20:05:22Z drbyte $
     */
    class sendClubsOrderNotices extends base {
    
     /**  constructor method !
       *
       * Attach observer class to the global $zco_notifier and watch for a single notifier event.
       */
      function sendClubsOrderNotices() {
        $this->attach($this, array('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL'));
        /**
         * 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 = 'Demande de confirmation de membre par ' . 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 products_option_value_id from " . customers_basket_attributes . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
      if (!$group_query->EOF) {
          $this->ClubEmailAddress = '';
          switch($group_query->fields['products_option_value_id']) {
            case '6':
              $this->ClubEmailAddress = '[email protected]';
              $this->orderEmailSubjectPrefix = 'Demande de confirmation de membre par ' . STORE_NAME;
              break;
            case '9':
              $this->ClubEmailAddress = '[email protected]';
              $this->orderEmailSubjectPrefix = 'Demande de confirmation de membre par ' . STORE_NAME;
              break;
            case '10':
              $this->ClubEmailAddress = '[email protected]';
              $this->orderEmailSubjectPrefix = 'Demande de confirmation de membre par ' . STORE_NAME;
              break;
            case '12':
              $this->ClubEmailAddress = '[email protected]';
              $this->orderEmailSubjectPrefix = 'Demande de confirmation de membre par ' . STORE_NAME;
              break;
            default:
          }
          if ($this->ClubEmailAddress != '') 
            zen_mail('', $this->ClubEmailAddress,
              $this->orderEmailSubjectPrefix . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id,
              $email_order . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray);
        }
      }
    }
    Off course, I also corrected the name of the config. file and his content. Note also that the class. file currently on the server has real email addresses in the code to test the differents options.

    So, I was able to load the store without any blank page, which is great. I was also able to complete an order but after the payment on Paypal I get an error message on a blank page saying "WARNING: An Error occurred, please refresh the page and try again.". After a refresh the store loads up properly but I had this message in a red box:
    10415 Transaction refused because of an invalid argument. See additional error messages for details. - A successful transaction has already been completed for this token.
    With a quick search on the Forum I found a thread where you suggest a problem linked to a miscalled table : http://www.zen-cart.com/showthread.p...04#post1028104 This makes a lot of sens to me since I can't be sure about the table name. I suspected that the error was from this SQL query:
    Code:
    $group_query = $db->Execute("select products_option_value_id from " . customers_basket_attributes . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    By looking in the logs I found this error which confirm my thoughts:
    Code:
    PHP Fatal error:  1146:Table 'fc41320205382856.customers_basket_attributes' doesn't exist :: select products_option_value_id from customers_basket_attributes where customers_id = '10' in /home/content/06/8442606/html/boutique/includes/classes/db/mysql/query_factory.php on line 120
    The payment was received on the Paypal account but Paypal send an email about this 10415 error and didn't returned any info about the payment to ZenCart. So the order details of the admin stayed empty.

    So, the question is, is there a way to get the exact name of the table from distance?
    And off course, do you see any other error in that code?

  9. #39
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    I was able to get access to the DB this morning, the server owner gave me the access. There was 2 error in the names, customers_basket_attributes is suppose to be zen_customers_basket_attributes and products_option_value_id is products_optionS_value_id. So I fixed them and it's working!! Woohoo!!

    Now, i'm trying to set a specific email that could be send to the clubs. They do not need all the information send in the checkout confirmation. I'll see if I can use the existant template and work it a little.

  10. #40
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: email order confirmation to third party

    Quote Originally Posted by AlexThibo View Post
    There was 2 error in the names, customers_basket_attributes is suppose to be zen_customers_basket_attributes
    FYI, that's why in ZC core we use predefined constants, like TABLE_CUSTOMERS_BASKET_ATTRIBUTES which will automagically include the "zen_" prefix if the store uses that prefix, or "fred_" if that's what's being used, or even nothing if the store isn't using any prefixes.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. v153 When order is in "Processing" status send email to third party
    By jdlauletta in forum General Questions
    Replies: 0
    Last Post: 6 Nov 2014, 08:07 PM
  2. v150 Order confirmation to third party email - PROBLEM
    By MelodyW in forum Managing Customers and Orders
    Replies: 3
    Last Post: 23 Apr 2013, 03:11 PM
  3. Third party templates
    By travellers in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Jan 2009, 03:31 PM
  4. Third Party Gift Certificate
    By BazM in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 25 Nov 2008, 11:17 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR