Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default No TEXT_OPTION_DIVIDER in email

    ZC v1.5.6c

    In the order confirmation email (email_template_checkout.html) there is no TEXT_OPTION_DIVIDER between the products attribute name and products attribute value as there is on pages such as tpl_shopping_cart_default.php & tpl_account_history_info_default.php

    in /includes/classes/order.php line #932 I would like to change
    Code:
    $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
    to
    Code:
     $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . TEXT_OPTION_DIVIDER . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
    whilst adding the following to the end of includes/languages/english/email_extras.php
    Code:
    // Attribute separator in emails
    define('TEXT_OPTION_DIVIDER', ' - ');
    If someone could confirm that this fix is appropriate I would be happy to submit a PR
    Simon

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: No TEXT_OPTION_DIVIDER in email

    Does it provide the results you are expecting for both text and html style emails?

    There may need to be some sort of substitution performed to support one or the other side as I suspect that a text only email will display that divider text as defined...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: No TEXT_OPTION_DIVIDER in email

    Quote Originally Posted by mc12345678 View Post
    Does it provide the results you are expecting for both text and html style emails?

    There may need to be some sort of substitution performed to support one or the other side as I suspect that a text only email will display that divider text as defined...
    Ah yes, I hadn't considered the text-only requirement. I had been just looking at the source of an HTML email - which seems to contain both a text and an html portion, both of which had the desired result.

    However, does not work in a text-only email. I'll look in to this some more.
    Simon

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

    Default Re: No TEXT_OPTION_DIVIDER in email

    I'd suggest that the language define be put into checkout_process.php instead of email_extras.php, to prevent warnings about duplicate defines.
    .

    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.

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: No TEXT_OPTION_DIVIDER in email

    Quote Originally Posted by DrByte View Post
    I'd suggest that the language define be put into checkout_process.php instead of email_extras.php, to prevent warnings about duplicate defines.
    Thank you, I was looking for a suitable language file - I'll try that.
    Simon

  6. #6
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: No TEXT_OPTION_DIVIDER in email

    Thanks to DrByte's suggestion to use a different language file the Divider now appears in both HTML and Text-only emails. To summarise:

    This is the new code in /includes/classes/order.php line #932
    Code:
     $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . EMAIL_TEXT_OPTION_DIVIDER . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
    and added to includes/languages/english/checkout_process.php

    Code:
    define('EMAIL_TEXT_OPTION_DIVIDER', '&nbsp;-&nbsp;');
    Simon

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

    Default Re: No TEXT_OPTION_DIVIDER in email

    I'd drop the EMAIL_ prefix from the constant, since the same definition is used in other places for the same purpose, so consistency is beneficial.
    .

    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.

  8. #8
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: No TEXT_OPTION_DIVIDER in email

    Quote Originally Posted by DrByte View Post
    I'd drop the EMAIL_ prefix from the constant, since the same definition is used in other places for the same purpose, so consistency is beneficial.
    Ok, will do.
    Simon

  9. #9
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: No TEXT_OPTION_DIVIDER in email

    Quote Originally Posted by simon1066 View Post
    Thanks to DrByte's suggestion to use a different language file the Divider now appears in both HTML and Text-only emails. To summarise:

    This is the new code in /includes/classes/order.php line #932
    Code:
     $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . EMAIL_TEXT_OPTION_DIVIDER . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
    and added to includes/languages/english/checkout_process.php

    Code:
    define('EMAIL_TEXT_OPTION_DIVIDER', '&nbsp;-&nbsp;');
    So in a text only email there is no visible: &nbsp;-&nbsp;, but instead it appears in the text only email as a space with a dash and another space?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #10
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,238
    Plugin Contributions
    1

    Default Re: No TEXT_OPTION_DIVIDER in email

    Quote Originally Posted by mc12345678 View Post
    So in a text only email there is no visible: &nbsp;-&nbsp;, but instead it appears in the text only email as a space with a dash and another space?
    Yes, that is so.
    Last edited by simon1066; 16 Sep 2019 at 07:20 PM. Reason: &nbsp; added manually
    Simon

 

 

Similar Threads

  1. Upgrade to re Captcha v2 - the email form does not send email
    By epilot in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Mar 2018, 08:15 PM
  2. Replies: 1
    Last Post: 6 Sep 2016, 03:31 AM
  3. Replies: 1
    Last Post: 23 Feb 2011, 03:57 PM
  4. Text_option_divider
    By Congerman in forum General Questions
    Replies: 4
    Last Post: 17 Jul 2009, 06:01 PM
  5. Replies: 3
    Last Post: 13 Nov 2007, 08:07 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR