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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:52:41+00:00 2026-05-20T08:52:41+00:00

I’m trying to add select in my column Sources to allow filter, all this

  • 0

I’m trying to add select in my column “Sources” to allow filter, all this code works well, but I’m trying to add filter without any success, anyone can point me in the right direction?

Until know I have:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addNameToSelect()
        ->addAttributeToSelect('email')
        ->addAttributeToSelect('created_at')
        ->addAttributeToSelect('group_id')
        ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
        ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
        ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
        ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
        ->joinAttribute('source', 'customer/source', 'default_billing', null, 'left')
        ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');

    $this->setCollection($collection);

    return parent::_prepareCollection();
}

and

$this->addColumn('source', array(
        'header'    => Mage::helper('customer')->__('Source'),
        'type'      => 'source',
        'index'     => 'source'
    ));

Any help will be very apreciated
thanks

  • 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-20T08:52:41+00:00Added an answer on May 20, 2026 at 8:52 am

    I found the solution for transform in
    a Select option:

    $sql = 'SELECT distinct value FROM `....';
    $data = Mage::getSingleton('core/resource') ->getConnection('core_read')->fetchAll($sql);
    
    $soTypes=array();
    foreach($data as $array){
      foreach($array as $key => $value){
        if(!empty($value)){
          $so[$value]=$value;
        }
      }
    }
    
    $this->addColumn('invoice_so', array(
        'header'    => Mage::helper('sales')->__('SoTypes'),
        'index'     => 'value',
        'width'     => '100px',
        'type'      => 'options',
        'options' => $soTypes,
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to select all li elements at second level of the list add
I'm trying to write this transaction where I'm trying to add a column to
I'm trying to add column names to a numpy ndarray, then select columns by
I'm trying to add extra HTML attributes to some select options in a dropdown
I am trying to add a label in front of a select box, I
Trying to programmatically add options to a SELECT drop down in IE Windows Mobile.
I am trying add picture boxes dynamically. My code is as PictureBox picture =
Im new to asp.net mvc. I'm trying add new model class but it got
Trying to add a blank sample app for a rails tutorial to GitHub, but
i am trying to load r1,r2,r3 column to a checkboxlist, but the output is

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.