Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Sep 2016
    Location
    Great Falls MT
    Posts
    5
    Plugin Contributions
    0

    Default How do I add a product attribute name and value to the order confirmation email

    Looking for the best way to add a product attribute name and value to the order confirmation email. We're doing a coffee store and I've added 5 different grind types with drop downs for each coffee flavor. I just need to include that info in the confirmation emails and packing slips. I can't seem to find a way to do it in the Administrative area so I assume it means adding a line or tow in orders.php.

    Any quick and simple suggestions would be greatly appreciated.

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

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Line 944 includes/classes/order.php is part of the variable assignment to display product information where specifically the attributes are "called out". It seems that if there are attributes associated with the product then they should be added to the products_ordered_html variable as part of the default code. If they are not, then that's curious.

    Beginning on line 939, the code used to display information specific to the product as part of say the email creation is:

    Code:
          $this->products_ordered_html .=
          '<tr>' . "\n" .
          '<td class="product-details" align="right" valign="top" width="30">' . $this->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
          '<td class="product-details" valign="top">' . nl2br($this->products[$i]['name']) . ($this->products[$i]['model'] != '' ? ' (' . nl2br($this->products[$i]['model']) . ') ' : '') . "\n" .
          '<nobr>' .
          '<small><em> '. nl2br($this->products_ordered_attributes) .'</em></small>' .
          '</nobr>' .
          '</td>' . "\n" .
          '<td class="product-details-num" valign="top" align="right">' .
          $currencies->display_price($this->products[$i]['final_price'], $this->products[$i]['tax'], $this->products[$i]['qty']) .
          ($this->products[$i]['onetime_charges'] !=0 ?
          '</td></tr>' . "\n" . '<tr><td class="product-details">' . nl2br(TEXT_ONETIME_CHARGES_EMAIL) . '</td>' . "\n" .
          '<td>' . $currencies->display_price($this->products[$i]['onetime_charges'], $this->products[$i]['tax'], 1) : '') .
          '</td></tr>' . "\n";
    I apologize in "advance" if there are #'s anywhere that a space should be. I copied the above from github which sometimes causes odd characters to appear in the pasted content. It would take me way too long to correct if it occurs, so providing warning that the # symbol would/should only remain in any reproduced text where syntactically required say as necessary for particular css.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2016
    Location
    Great Falls MT
    Posts
    5
    Plugin Contributions
    0

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Thanks - I'm trying to figure out how to get that attribute data on the order confirmation email sent to the customer.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Quote Originally Posted by ricktryon View Post
    Thanks - I'm trying to figure out how to get that attribute data on the order confirmation email sent to the customer.
    Well, the real question should be what has been changed about your includes/classes/order.php file to *NOT* send that information? It's in the default files to send it as part of the email, so what changed that operation?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2016
    Location
    Great Falls MT
    Posts
    5
    Plugin Contributions
    0

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Hey thanks - you are correct. All the information is already included. Small oversight on my part. Your input is much appreciated!

  6. #6
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Welcome, glad it got all sorted out.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Aug 2010
    Location
    Israel
    Posts
    285
    Plugin Contributions
    0

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Hi
    It seems that I do get the attributes details in the order email but the attributes are not in a Human language:
    e644e250cbc7557651e1dc4ad7d8f3ab
    e7ade4cb9337f358438100b7df7c6d94
    1bf9ee3b5966782a5489326d839e221b
    7a4b808ca7162684dc0fb982b67af211

    My site and attributues are in Hebrew language if this means something...

    ZC 1.5.4
    Sheffield blue 2
    Shipping_By_Quote module

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: How do I add a product attribute name and value to the order confirmation email

    @gunni, are your products' names displayed properly in the email? Does this issue occur with both TEXT and HTML emails?

  9. #9
    Join Date
    Aug 2010
    Location
    Israel
    Posts
    285
    Plugin Contributions
    0

    Default Re: How do I add a product attribute name and value to the order confirmation email

    Quote Originally Posted by lat9 View Post
    @gunni, are your products' names displayed properly in the email? Does this issue occur with both TEXT and HTML emails?
    Hi lat9
    Names are displayed well (Hebrew):

    1x פרחי סבון בכדור קרמיקה לבן - $185 - 0גרמים - #254:e644e250cbc7557651e1dc4ad7d8f3ab

    The email is received in TEXT format.
    When switched to HTML, no difference.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: How do I add a product attribute name and value to the order confirmation email

    @gunni, have you made any changes to the ZC 1.5.4 /includes/classes/order.php?

    With a quick review of the default code, I don't see anything "obvious" that could do that, but I'm wondering whether the tab-character (\t) inserted is causing issues with Hebrew.

    As a quick test, edit /includes/classes/order.php. Find (on line #893 in the as-shipped version):
    Code:
              $this->products_ordered_attributes .= "\n\t" . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
    and change that to
    Code:
              $this->products_ordered_attributes .= "\n   - " . $attributes_values->fields['products_options_name'] . ' ' . zen_decode_specialchars($this->products[$i]['attributes'][$j]['value']);
    Essentially, replacing that tab-character.

    Does that "do the trick"?

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v155 Add company name to order confirmation email
    By Ryder in forum General Questions
    Replies: 5
    Last Post: 17 Aug 2016, 01:13 AM
  2. Duplicate Item Name / Product name repeat Order Confirmation Email
    By jsarwar in forum Managing Customers and Orders
    Replies: 3
    Last Post: 21 Nov 2014, 02:57 PM
  3. I would like to add the Product photo to the email Order Confirmation
    By touchclothing in forum General Questions
    Replies: 0
    Last Post: 1 Sep 2009, 10:55 PM
  4. How do I add attribute settings with $ value to categories and not just 1 product
    By 24hourDomainer in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 29 Jul 2009, 12:17 AM
  5. Replies: 0
    Last Post: 28 Feb 2008, 03:42 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