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 8123793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:16:59+00:00 2026-06-06T06:16:59+00:00

I’m creating a custom module for a specific function in the admin of Magento.

  • 0

I’m creating a custom module for a specific function in the admin of Magento. Within the Adminhtml grid, I am pulling in line order items, but also need to pull in data specific to each product as it currently stands in the database.

Attached is the screenshot of my current Adminhtml grid.
Adminhtml Grid
I need to add product attributes (brand, flavor, etc.) as additional columns to the grid. How would I go about doing this? I tried adding a

$collection->join()

on the

_prepareCollection()

function, but could not figure out which exact tables to join on (flat indexing is turned on).

Thanks!
Mark


Thanks for the tip. Not exactly what I was looking for as I’m dealing with EAV objects with select menus, but it is close (upvoting).

Here are the collection selects I’m going to wind up adding in:

$collection->getSelect()->join('catalog_product_index_eav', '`catalog_product_index_eav`.`entity_id` = `main_table`.`product_id` AND `catalog_product_index_eav`.`attribute_id` = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = "brand")', array('attribute_id'));
$collection->getSelect()->join('eav_attribute_option_value', '`eav_attribute_option_value`.`option_id` = `catalog_product_index_eav`.`value`', array('brand' => 'value'));

I don’t really need the search functionality in the input text box of this new Brand column, however does anyone know how to make this work? Receiving this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'brand' in 'where clause'

I can go in and diagnose, but figured someone might know off the top of their head.

  • 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-06-06T06:17:00+00:00Added an answer on June 6, 2026 at 6:17 am

    You’re going to have to figure out the tables to use in the join.

    $collection->getSelect()->join('sales_flat_order_item', '`sales_flat_order_item`.order_id=`main_table`.entity_id AND `sales_flat_order_item`.parent_item_id IS NULL  ', null);
    
    $collection->getSelect()->join('catalog_product_entity_varchar', '`catalog_product_entity_varchar`.attribute_id=144 AND `catalog_product_entity_varchar`.entity_id = `sales_flat_order_item`.`product_id`', array('models'  => new Zend_Db_Expr('group_concat(`catalog_product_entity_varchar`.value SEPARATOR ",")')))
    

    Source:
    http://www.atwix.com/magento/customize-orders-grid/

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
Thanks in advance for your help. I have a need within an application to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.