Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2008
    Posts
    16
    Plugin Contributions
    0

    Default Send Gift Certificate - Your Message Loses 'carriage returns'

    It's a simple problem but I don't know the solution! The message entered by someone in the 'Your message' text area when they send a gift certificate loses any new lines:

    eg.

    Bob
    Here is your present
    Love Cindy


    becomes

    Bob Here is your present Love Cindy on both the preview and the final email.

    How can I retain the CRLF's/new lines/br's/paras or whatever you want to call them?

    Any help greatly appreciated, I've searched high and low for an answer to this.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    66,818
    Plugin Contributions
    6

    Default Re: Send Gift Certificate - Your Message Loses 'carriage returns'

    In the Catalog ... Option Name Manager ...

    On the Option Name for:
    Your message

    set the
    Rows to 5
    Maximum length: 500 (or however many characters)

    Now the customer can write what they want with enters on the new lines and you will see this on the Order ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Oct 2008
    Posts
    16
    Plugin Contributions
    0

    Default Re: Send Gift Certificate - Your Message Loses 'carriage returns'

    Thanks for the reply, understand but unfortunately it's not something I've personally setup (which is what you are pointing to) but a default php files that's used to send a gift certificate as part of the system files

    It's the form that creates $EMAIL_MESSAGE_HTML (used by the gv_send email template) from the send gift certifcate page. It strips the returns from the email preview and the actual email when you send it but interestingly if you go to re-edit the email message from the preview page it shows them in the multi line text area.

    There is a template 'tpl_gv_send_default.php' used to control how the send gift cert page looks which I guess uses this:

    stripslashes($_POST['message']);

    to preview the message.

    I guess it does something similar somewhere else when it send it which is also getting rid ot the returns.

    Am I making any sense?

  4. #4
    Join Date
    Aug 2011
    Posts
    1
    Plugin Contributions
    0

    Default Re: Send Gift Certificate - Your Message Loses 'carriage returns'

    the key I think is in $EMAIL_MESSAGE_HTML

    try forcing breaks in HTML format, not by simply hitting enter in the form field

    when you want a new line type
    Code:
    <br />
    to space a line use 2 in a row
    Code:
     <br /><br />
    Code:
     ipso lorum est bulldoodoo <br /> Nextus linus overis hereus
    <br /><br />The Management
    should give you:

    ipso lorum est bulldoodoo
    Nextus linus overis hereus

    The Management


    the problem is form data does this sort of thing from the textbox, if you don't manually break it you need some sort of scripting to turn windows carriage returns into HTML linebreaks since the windows /n (new line code) does not auto translate into html breaks. or you could specify in a string processing script to html break the string after x number of characters
    Last edited by swag-nyc; 1 Aug 2011 at 06:24 PM.

  5. #5
    Join Date
    Jan 2004
    Posts
    59,767
    Blog Entries
    4
    Plugin Contributions
    133

    Default Re: Send Gift Certificate - Your Message Loses 'carriage returns'

    swag-nyc might want to reconsider that suggestion. Adding <br /> tags will cause your text-only emails to contain <br /> text which is meaningless to recipients.
    .

    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.

 

 

Similar Threads

  1. Gift certificate decimal separator and required message field
    By jolion in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 19 Jul 2010, 09:49 PM
  2. Customer returns to step 2 of 3 after gift certificate purchase
    By dysfunctional in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 10 Jul 2010, 09:22 PM
  3. Want to use a printed gift certificate (with code) in the gift certificate process?
    By HelenSama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 9
    Last Post: 15 Apr 2008, 02:04 PM
  4. Stripping newlines and carriage returns.
    By Crin in forum General Questions
    Replies: 3
    Last Post: 1 Oct 2007, 03:00 PM
  5. Gift Certificate Order with no Gift Certificate?
    By Jeff_Mash in forum Bug Reports
    Replies: 20
    Last Post: 14 Oct 2006, 09:10 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
  •