The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
Closed Thread
 
Thread Tools Display Modes
  #1  
Old 05-13-2015, 07:24 PM
Tara T's Avatar
Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default


I am trying to add a custom attributes to my email notification system.

Specifically, I have created a custom attribute called PLU that I would like to be displayed on the admin notifications.

Here's what I have:
Code:
<#list product.visibleAttributes as visibleAttribute>                                                                                                           <tr>
   <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
   ${visibleAttribute.name}: ${visibleAttribute.value}
   </td>
</tr>
<#/list>
But it isn't displaying on my test order.

Please advise.

Jeremy
>>>
Just wanted to add a couple of screenshots for further clarification on this. Is there a way to list out the custom attributes on the notification email?
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2015-05-19 at 2.52.51 PM2.png
Views:	399
Size:	136.6 KB
ID:	3017   Click image for larger version

Name:	Screen Shot 2015-05-19 at 2.59.50 PM2.png
Views:	144
Size:	69.3 KB
ID:	3018  

Last edited by river; 05-20-2015 at 01:57 PM.
  #2  
Old 05-20-2015, 02:01 PM
river's Avatar
river river is offline
Ecwid Team
 
Join Date: Feb 2015
Posts: 452
Default

Quote:
Originally Posted by Jeremy C View Post
I am trying to add a custom attributes to my email notification system.

Specifically, I have created a custom attribute called PLU that I would like to be displayed on the admin notifications.

Here's what I have:
Code:
<#list product.visibleAttributes as visibleAttribute>                                                                                                           <tr>
   <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
   ${visibleAttribute.name}: ${visibleAttribute.value}
   </td>
</tr>
<#/list>
But it isn't displaying on my test order.

Please advise.

Jeremy
>>>
Just wanted to add a couple of screenshots for further clarification on this. Is there a way to list out the custom attributes on the notification email?
Hello,

Sorry for the delay with reply.

The product.visibleAttributes variable is only available in the "Low in Stock" notifications, so the right code for the "New order" admin notification should be the following:

Code:
<#list orderItem.visibleAttributes as visibleAttribute>                                                                                                        <tr>
   <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
   ${visibleAttribute.name}: ${visibleAttribute.value}
   </td>
</tr>
<#/list>
Please, try this one and see if it starts working.

Looking forward to your reply.
__________________
Roman I.
Ecwid Customer Care Team

More tips and hints on Ecwid use in our Help Center

⬇ Please click Thanks if my reply helped you.
  #3  
Old 05-20-2015, 08:28 PM
Tara T's Avatar
Tara T Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default

Thanks for the reply. Unfortunately, when I add the code you gave and hit "preview" the whole screen is blank. I also did a test order and confirm that the email that was sent was completely blank.

Is there an error in the code that's causing this?
>>>
I figured it out. I had the "#" sign and the "/" sign mixed up on the closing tag.

Code:
<#/list>
Should be:

Code:
</#list>
Here's my final code:

Code:
<#list orderItem.visibleAttributes as visibleAttribute>
 <tr>
  <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
    ${visibleAttribute.name}: ${visibleAttribute.value}
  </td>
 </tr>
</#list>
And here it is in context (between the SKU and Options)
Code:
 <tr>
  <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
    SKU: #${orderItem.sku}<br/>
  </td>
 </tr>
<#list orderItem.visibleAttributes as visibleAttribute>
 <tr>
  <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
    ${visibleAttribute.name}: ${visibleAttribute.value}
  </td>
 </tr>
</#list>
<#list orderItem.options as option>
 <tr>
   <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
     ${option.name}: ${option.value}
  </td>
 </tr>
</#list>
And finally, I thought it might also be helpful to throw an "if" statement in there just in case not all items need to use the attributes.

*You should also hide the default global attributes in the "Manage Attributes" area if you're not using them.

You can wrap the code with this statement.
Code:
<#if visibleAttribute.value?has_content>
...content...
</#if>
Here it is with the code wrapped in an if statement:
Code:
<#list orderItem.visibleAttributes as visibleAttribute>
 <#if visibleAttribute.value?has_content>
 <tr>
  <td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
    ${visibleAttribute.name}: ${visibleAttribute.value}
  </td>
 </tr>
 </#if>
</#list>
I've attached a screenshot of how the email notification now looks.
Attached Images
File Type: jpg attributeWithIF.jpg (101.0 KB, 118 views)

Last edited by river; 05-21-2015 at 08:08 AM.
The Following User Says Thank You to Tara T For This Useful Post:
Daria Sh. (07-07-2015)
  #4  
Old 07-04-2015, 04:53 PM
Tara T's Avatar
Tara T Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default

My emails are suddenly not showing the custom attributes that I've targeted (see above thread). It was working successfully, but is no longer.

This is the code that I'm using:

Code:
<td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
                                                                        SKU: #${orderItem.sku} <#list orderItem.visibleAttributes as visibleAttribute>
                                                                 <#if visibleAttribute.value?has_content> - ${visibleAttribute.name}: ${visibleAttribute.value}</#if></#list>
                                                                    </td>
Please advise.
  #5  
Old 07-06-2015, 03:48 PM
Tara T's Avatar
Tara T Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default

Quote:
Originally Posted by Jeremy C View Post
My emails are suddenly not showing the custom attributes that I've targeted (see above thread). It was working successfully, but is no longer.

This is the code that I'm using:

Code:
<td style="font-family: Arial,Helvetica,sans-serif;font-size: 14px;line-height: 20px; color: #333333; padding-top: 5px;">
                                                                        SKU: #${orderItem.sku} <#list orderItem.visibleAttributes as visibleAttribute>
                                                                 <#if visibleAttribute.value?has_content> - ${visibleAttribute.name}: ${visibleAttribute.value}</#if></#list>
                                                                    </td>
Please advise.

Not sure what changed, but it is working now. I haven't made any changes, so not sure what it could be.
  #6  
Old 07-07-2015, 10:46 AM
Daria Sh.'s Avatar
Daria Sh. Daria Sh. is offline
Ecwid Team
 
Join Date: Feb 2015
Posts: 768
Default

Quote:
Originally Posted by Jeremy C View Post
Not sure what changed, but it is working now. I haven't made any changes, so not sure what it could be.
Hi,

Sorry for delay with reply and thank you for the update upon your issue.

I've checked your email template in the Preview and it really looks fine now. Also, I've tested the code you sent above in my store and it seems to function fine.

If the issue with templates happens again, please let us know and we will inspect it closer.
__________________
Daria
Ecwid Customer Care Team

More tips and hints on Ecwid use in our Help Center

⬇ Please click Thanks if my reply helped you.
  #7  
Old 07-07-2015, 01:41 PM
Tara T's Avatar
Tara T Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default

Quote:
Originally Posted by Daria Shmanatova View Post
Hi,

Sorry for delay with reply and thank you for the update upon your issue.

I've checked your email template in the Preview and it really looks fine now. Also, I've tested the code you sent above in my store and it seems to function fine.

If the issue with templates happens again, please let us know and we will inspect it closer.
It seems to be working intermittently now. I'll keep an eye on it for a few days.

Just for the sake of clarity though, when you view the preview mode, you're not going to see anything different since the example products don't seem to have any attributes active.

You'd have to actually place an order and receive the email to see the attribute. In my case I've added PLU as an attribute and have given each item a PLU number.
  #8  
Old 07-08-2015, 04:04 PM
Tara T's Avatar
Tara T Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default

It's not working again. Please advise.
  #9  
Old 07-09-2015, 03:00 PM
Tara T's Avatar
Tara T Tara T is offline
 
Join Date: Jun 2012
Location: Hudson Valley, NY
Posts: 28
Default

Just another update. Still not working. But I took off the "if has content" parameter and did a test order. When I did this, text in Russian appeared. See attached screenshot.

I've since put back the if statement.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2015-07-09 at 10.56.20 AM.png
Views:	120
Size:	77.9 KB
ID:	3082  
  #10  
Old 07-10-2015, 02:49 PM
Daria Sh.'s Avatar
Daria Sh. Daria Sh. is offline
Ecwid Team
 
Join Date: Feb 2015
Posts: 768
Default

Quote:
Originally Posted by Jeremy C View Post
Just another update. Still not working. But I took off the "if has content" parameter and did a test order. When I did this, text in Russian appeared. See attached screenshot.

I've since put back the if statement.
Hi Jeremy,

Thanks for keeping us informed.

As far as I understand, you want to display "PLU" attribute in "New order" admin email notifications. I've found another code for you, which can work for you
Code:
${orderItem.attributes[2].name} ${orderItem.attributes[2].value}
Please, try using this code instead of the previous one and see how that works. I've tested it in my store (placed an order and received the admin email) and it displayed fine, please see the screenshot http://take.ms/VmbpN

Feel free to write back about the results. Hope to hear from you.
__________________
Daria
Ecwid Customer Care Team

More tips and hints on Ecwid use in our Help Center

⬇ Please click Thanks if my reply helped you.
Closed Thread
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
attributes, email notification

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:23 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.