Custom Customer Fields
Custom Customer Fields
I would like to display some of the custom customer fields in the shipment information of the shipping confirmation email.
The default shows variables like $orderItem.SKU, $orderItem.Name, etc... What variable would the custom fields be?
Thanks in advance!
Bruce.
The default shows variables like $orderItem.SKU, $orderItem.Name, etc... What variable would the custom fields be?
Thanks in advance!
Bruce.
You mean custom fields you defined for products?
Here is how you can access them
Here is how you can access them
Code: Select all
#foreach($customField in $orderItem.Product.CustomFields )
$customField.FieldName : $customField.FieldValue </br>
#end
Last edited by sohaib on Mon Mar 17, 2008 9:19 am, edited 1 time in total.
Thanks Sohai.
The custom fields are customer fields I had defined in the Product Templates.
I made a modification to the customer notification email template to replace the $orderItem.Name with just the custom fields to see if it would work.
After entering a dummy order and putting some values in the custom fields on the order to ensure some values, the email notification just shows a blank in the description column. See script...
#foreach($orderItem in $order.Items.FilterByShipmentAndSort($shipment.OrderShipmentId))
#beforeall
<tr>
<td><strong>SKU</strong></td>
<td><strong>Description</strong></td>
<td><strong>Quantity</strong></td>
<td><strong>Price</strong></td>
</tr>
#each
#if ($orderItem.OrderItemType == "Product")
<tr>
<td>$orderItem.Sku</td>
<!-- <td>$orderItem.Name</td> -->
<td>
#foreach($customField in $orderItem.Product.CustomFields )
$customField.Name : $customField.Value </br>
#end
</td>
<td>$orderItem.Quantity</td>
<td>$orderItem.ExtendedPrice.ToString("C")</td>
</tr>
#end
#end
The Sku and Quantity fields are populated but not the custom fields. If you see the problem, please inform.
Thanks,
Bruce.
I made a modification to the customer notification email template to replace the $orderItem.Name with just the custom fields to see if it would work.
After entering a dummy order and putting some values in the custom fields on the order to ensure some values, the email notification just shows a blank in the description column. See script...
#foreach($orderItem in $order.Items.FilterByShipmentAndSort($shipment.OrderShipmentId))
#beforeall
<tr>
<td><strong>SKU</strong></td>
<td><strong>Description</strong></td>
<td><strong>Quantity</strong></td>
<td><strong>Price</strong></td>
</tr>
#each
#if ($orderItem.OrderItemType == "Product")
<tr>
<td>$orderItem.Sku</td>
<!-- <td>$orderItem.Name</td> -->
<td>
#foreach($customField in $orderItem.Product.CustomFields )
$customField.Name : $customField.Value </br>
#end
</td>
<td>$orderItem.Quantity</td>
<td>$orderItem.ExtendedPrice.ToString("C")</td>
</tr>
#end
#end
The Sku and Quantity fields are populated but not the custom fields. If you see the problem, please inform.
Thanks,
Bruce.
oops I am sorry. $oderItem.Product.CustomFields will return the custom fields defined not the user specified values for the custom fields.
This should work ... although I haven't tested this either.
This should work ... although I haven't tested this either.
Code: Select all
#foreach($customInput in $orderItem.Inputs)
$customInput.Name : $customInput.InputValue </br>
#end
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 33
- Joined: Mon Mar 10, 2008 12:18 am
- Location: us
- Contact:
Re: Custom Customer Fields
sohaib,
This question is not related to the topic but ...
How do I use the ac_CustomFields table?
I cannot find anyplace in admin where I can work with this table.
This question is not related to the topic but ...
How do I use the ac_CustomFields table?
I cannot find anyplace in admin where I can work with this table.
Lab supplies, consumables & chemicals
http://www.espchemicals.com
http://www.espchemicals.com
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Custom Customer Fields
There isn't any place in the admin right now. Joe has an add-on on his site that adds them to the admin.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 33
- Joined: Mon Mar 10, 2008 12:18 am
- Location: us
- Contact:
Re: Custom Customer Fields
Thanks a bunch Judy.
Lab supplies, consumables & chemicals
http://www.espchemicals.com
http://www.espchemicals.com
Re: Custom Customer Fields
Thanks for the plug Judy
My add-on works with ac_Products custom fields though. I could probably adapt it to the ac_CustomFields, but it's not something I've explored in-depth at this point.

My add-on works with ac_Products custom fields though. I could probably adapt it to the ac_CustomFields, but it's not something I've explored in-depth at this point.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com