Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7505435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:54:39+00:00 2026-05-29T21:54:39+00:00

I have created several custom attributes for my products. I have some that need

  • 0

I have created several custom attributes for my products.
I have some that need to be added to the email that the costumer receives when he places an order.
Currently I found that I can edit the mail template in the backend and ‘app/design/frontend/base/default/template/email/order/items.phtml’.

How to access object variables in e-mail templates and what is the proper syntax for item custom attributes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:54:41+00:00Added an answer on May 29, 2026 at 9:54 pm

    There are several possibilities (this being Magento).

    The template app/design/frontend/base/default/template/email/order/items.phtml you mentioned is the wrapper for all the items in the order. The individual items are rendered by separate templates. Most of the time that is app/design/frontend/base/default/template/email/order/items/order/default.phtml, but other product types can use different ones, e.g. order items for bundled products use …template/bundle/email/order/items/order/default.phtml.

    Inside the templates you are not working with Mage_Catalog_Model_Product model instances, but with Mage_Sales_Model_Order_Item instances. These items have different attributes then product attributes.
    If you want to have your custom product attributes always to be available on the sales/order_item instances, you will need to add them to the entity.
    During the checkout process, also set them on the sales/quote_item entity and them copy them over to the order items using the appropriate fieldsets in the configuration (see global/fieldsetsin Mage/Sales/etc/config.xml for an example.

    If the products still exist in the catalog, they can be loaded including all attributes using

    $product = Mage::getModel('catalog/product')->load($orderItem->getProductId();
    

    Or, to fetch all product models for all order items at once (slightly more efficient):

    $products = Mage::getResourceModel('catalog/product_collection')
        ->addIdFilter($orderItems->getColumnValues('product_id'))
        ->addAttributeToSelect(array('list', 'of', 'your', 'custom', 'attributes'));
    

    Of course, this will mean additional queries as compared to the first solution of adding the same attributes to the order item entity.
    Also be aware that once a product is deleted it won’t be loadable in this way any more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an editable UITableView that supports several custom UITableViewCells of my own
I have several spinners that I have created a custom ArrayAdapter for so I
I have created login page forced login in several pages. Now i need to
I have dynamically created WrapPanel (_wp) with several Borders. And I need create handler
I have several buttons on my app that are being created dynamically. They are
I have a listview with several items that are created dynamically, each has two
I created a custom object that has a Bitmap field. I'm drawing several of
I have a custom composite control that contains a text box, some validators, as
Suppose I created a custom web application that consists of: several assembly DLLs: web
I have created a custom component that I am using, more conveniently, as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.