Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    email error Text email not displaying custom payment footer

    Howdies!

    I have a custom purchase order payment module, and I have configured the email order to display the additional data: account name, account number, PO number. It is working for HTML but not working for text emails.

    In HTML the email looks like this:
    Payment Method
    Purchase Order with the following information:
    Account name: test acct name
    Account number: test acct number
    PO Number: test order number
    in a text email, it looks like this:
    [FONT=Courier New]Payment Method
    ------------------------------------------------------
    Purchase Order

    with the following information:
    Account name: %s
    Account number: %s
    PO Number: %s[/FONT]
    I was unable to use Dr. Byte's updated email footer detail, it just wasn't printing the info in the HTML email. I had once had a discussion with Dr. Byte about this, and he had proposed the following code, but it did not work:
    PHP Code:
    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) && $GLOBALS[$payment_class]->email_footer != '') ? nl2br($GLOBALS[$payment_class]->email_footer) : $this->info['cc_type']; 
    This is what's working for HTML email:

    includes/languages/english/modules/payment/po.php
    PHP Code:
     define('MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER''with the following information:<br>
     Account name:&nbsp; %s<br>
     Account number:&nbsp; %s<br>
      PO Number:&nbsp; %s'
    ); 
    includes/classes/order.php around line 992
    PHP Code:
    // This is for purchaseorder module email info
        
    $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) ? sprintf($GLOBALS[$payment_class]->email_footer$this->info['account_name'], $this->info['account_number'], $this->info['po_number']) : ' '); 
    I guess the $html_msg means that this is excluded from a TEXT email. I'm wondering how to deliver the info to a text email?

    thanks!!! I love you guys.

    ---Diana

  2. #2
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Text email not displaying custom payment footer

    I guess the $html_msg means that this is excluded from a TEXT email. I'm wondering how to deliver the info to a text email?
    The $html_msg array is for the HTML emails. The $email_order would the variable you would look for. The $html_msg['TEXT'] is the global usage for text emails and the $html_msg['HTML'] is for the global usage of the HTML emails.

  3. #3
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Text email not displaying custom payment footer

    Additionally to the above, there's also a correction posted by DrByte from this topic:

    http://www.zen-cart.com/forum/showthread.php?t=54819

  4. #4
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: Text email not displaying custom payment footer

    Thanks for reply, Oracle!

    I did use Dr. Byte's fixed version, that didn't work for me at all.

    I've tried adding this to includes/classes/order.php

    PHP Code:
          $email_order .= EMAIL_TEXT_PAYMENT_METHOD "\n" .
          
    $email_order .= (is_object($GLOBALS[$_SESSION['payment']]) ? sprintf($GLOBALS[$payment_class]->email_footer$this->info['account_name'], $this->info['account_number'], $this->info['po_number']) : ' ');
          
    EMAIL_SEPARATOR "\n";
          
    $email_order .= PAYMENT_METHOD_GV "\n\n"
    and made this change to includes/languages/english/modules/payment/po.php
    PHP Code:
     define('MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER''with the following information:' "\n" .
     
    'Account name: ' $this->info['account_name'] . "\n" .
     
    'Account number: ' $this->info['account_number'] . "\n" .
     
    'PO Number: ' $this->info['po_number']); 
    The &#37;s was not being interpreted for the text email, although it was working for HTML email. This is, of course, not the right way to handle a define, but I just don't know how to get the info out there.

    The one "good" result is that the text email and the HTML email look the same now:

    Payment Method
    ------------------------------------------------------
    Purchase Order

    with the following information:
    Account name:
    Account number:
    PO Number:
    the problem is how to push the data out to the email.

    It is showing correctly in the invoice and checkout screens.

    Ideas? (I am unfortunately not a programmer, I can write a little code, but definitely not an accomplished programmer in any language.)
    Last edited by dbrewster; 30 May 2007 at 08:46 PM.

  5. #5
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Text email not displaying custom payment footer

    In that case, I'd call this a bug.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Text email not displaying custom payment footer

    Diana, can you post a zip of your custom po module and its language file?
    .

    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. #7
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: Text email not displaying custom payment footer

    thanks, Dr. Byte!!!!

    I'm including classes/order.php because it has some related modifications.

    (I've included the % handling module for USPS too, in case you want to include that feature in a future release. Flat fee handling for a large order can be costly. Just ignore the shipping bits if you're not interested.)

    ---Diana
    Attached Files Attached Files

  8. #8
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Text email not displaying custom payment footer

    Two things I noticed:

    1 -

    PHP Code:
    $this->email_footer MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER
    seems to be the one line using that definition - not too sure why ...

    2 -

    PHP Code:
    global $HTTP_POST_VARS
    I wonder why this is being used since Zen-Cart does not use VARS anywhere ...

  9. #9
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: Text email not displaying custom payment footer

    Oracle,

    Since I'm just a PHP hack, could you please explain your comments to me?

    what is the problem with one line using the PO footer definition? (was that in order.php?)

    what's the problem with
    PHP Code:
    global $HTTP_POST_VARS
    ?

    As you can see, the PO module is built on an old OSCommerce module. It does work, except for the email footer. The email footer works in HTML email, but not in text email.

    ---Diana

  10. #10
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Text email not displaying custom payment footer

    I'm guessing that this might take care of it:

    In the po.php payment module, around line 98, you have the before_process() function. Try inserting this line, as shown:
    Code:
        function before_process() {
          $this->email_footer = sprintf($this->email_footer, $_POST['account_name'], $_POST['account_number'], $_POST['po_number']);
          return false;
        }
    And then make sure your order.php class file has these two lines set back to the defaults, like this:
    Code:
          $email_order .= ($GLOBALS[$payment_class]->email_footer) ? $GLOBALS[$payment_class]->email_footer . "\n\n" : '';
    and this:
    Code:
        $html_msg['PAYMENT_METHOD_FOOTER'] = (is_object($GLOBALS[$_SESSION['payment']]) && $GLOBALS[$payment_class]->email_footer != '') ? nl2br($GLOBALS[$payment_class]->email_footer) : $this->info['cc_type'];
    I also suggest that you convert the <br> tags in your language file to \n carriage returns so that your text-only emails show up properly:
    Code:
     define('MODULE_PAYMENT_PO_TEXT_EMAIL_FOOTER', 'with the following information: ' . "\n" . ' Account name:&nbsp; %s ' . "\n" . ' Account number:&nbsp; %s' . "\n" . ' PO Number:&nbsp; %s' . "\n");
    .

    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 1 of 2 12 LastLast

Similar Threads

  1. v155 Ezpages not displaying footer
    By anderson6230 in forum General Questions
    Replies: 1
    Last Post: 11 Apr 2016, 11:16 PM
  2. v152 Custom Email Invoice - can I email just a payment link?
    By mdawg in forum General Questions
    Replies: 7
    Last Post: 4 Mar 2014, 08:25 PM
  3. Footer not Displaying EZpages
    By cinbou in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 6 Mar 2010, 08:33 PM
  4. Replies: 3
    Last Post: 28 Mar 2007, 02:39 AM
  5. Footer not displaying?
    By projectet in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Aug 2006, 05:29 PM

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