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

  • Home
  • SEARCH
  • 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 8300451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:33:56+00:00 2026-06-08T16:33:56+00:00

Extending core functionality, adding new column. Grid gets built, query builds w/ data but

  • 0

Extending core functionality, adding new column. Grid gets built, query builds w/ data but the when the row is generated it fails to add populate the ‘visibility’ cell in the row. Thoughts?

EDIT: For clarity.

output of zend_debug($row)

class Mage_Catalog_Model_Product#751 (28) {
  protected $_cacheTag =>  string(15) "catalog_product"
  protected $_eventPrefix =>  string(15) "catalog_product"
  protected $_eventObject =>  string(7) "product"
  protected $_canAffectOptions =>  bool(false)
  protected $_typeInstance =>  NULL
  protected $_typeInstanceSingleton =>  NULL
  protected $_linkInstance =>  NULL
  protected $_customOptions =>  array(0) {
  }
  protected $_urlModel =>  NULL
  protected $_errors =>  array(0) {
  }
  protected $_optionInstance =>  NULL
  protected $_options =>  array(0) {
  }
  protected $_reservedAttributes =>  NULL
  protected $_isDuplicable =>  bool(true)
  protected $_defaultValues =>  array(0) {
  }
  protected $_lockedAttributes =>  array(0) {
  }
  protected $_isDeleteable =>  bool(true)
  protected $_isReadonly =>  bool(false)
  protected $_resourceName =>  string(15) "catalog/product"
  protected $_resource =>  NULL
  protected $_resourceCollectionName =>  string(26) "catalog/product_collection"
  protected $_dataSaveAllowed =>  bool(true)
  protected $_isObjectNew =>  NULL
  protected $_data =>  array(13) {
    'entity_id' =>    string(4) "2384"
    'entity_type_id' =>    string(1) "4"
    'attribute_set_id' =>    string(1) "4"
    'type_id' =>    string(6) "simple"
    'sku' =>    string(0) ""
    'has_options' =>    string(1) "0"
    'required_options' =>    string(1) "0"
    'created_at' =>    string(19) "2012-06-22 16:19:32"
    'updated_at' =>    string(19) "2012-07-03 14:06:08"
    'position' =>    NULL
    'name' =>    string(25) "Games Site Test Product 4"
    'price' =>    string(8) "100.0000"
    'stock_item' =>    class Varien_Object#792 (5) {
      protected $_data =>      array(1) {
        ...
      }
      protected $_hasDataChanges =>      bool(false)
      protected $_origData =>      NULL
      protected $_idFieldName =>      NULL
      protected $_isDeleted =>      bool(false)
    }
  }
  protected $_hasDataChanges =>  bool(true)
  protected $_origData =>  array(12) {
    'entity_id' =>    string(4) "2384"
    'entity_type_id' =>    string(1) "4"
    'attribute_set_id' =>    string(1) "4"
    'type_id' =>    string(6) "simple"
    'sku' =>    string(0) ""
    'has_options' =>    string(1) "0"
    'required_options' =>    string(1) "0"
    'created_at' =>    string(19) "2012-06-22 16:19:32"
    'updated_at' =>    string(19) "2012-07-03 14:06:08"
    'position' =>    NULL
    'name' =>    string(25) "Games Site Test Product 4"
    'price' =>    string(8) "100.0000"
  }
  protected $_idFieldName =>  string(9) "entity_id"
  protected $_isDeleted =>  bool(false)
}
,

sqdump (i added LIMIT 10)

mysql> SELECT `e`.*, `_table_position`.`position`, `_table_visibility`.`value` AS `visibility` FROM `catalog_product_entity` AS `e` LEFT JOIN `catalog_category_product` AS `_table_position` ON (_table_position.product_id=e.entity_id) AND (category_id=0) INNER JOIN `catalog_product_entity_int` AS `_table_visibility` ON (_table_visibility.entity_id = e.entity_id) AND (_table_visibility.attribute_id='89') AND (_table_visibility.store_id=0) limit 10;
+-----------+----------------+------------------+---------+---------+-------------+------------------+---------------------+---------------------+----------+------------+
| entity_id | entity_type_id | attribute_set_id | type_id | sku     | has_options | required_options | created_at          | updated_at          | position | visibility |
+-----------+----------------+------------------+---------+---------+-------------+------------------+---------------------+---------------------+----------+------------+
|         2 |              4 |                9 | simple  | PWOPER  |           0 |                0 | 2010-06-09 20:14:44 | 2012-01-09 19:20:06 |     NULL |          1 |
|         3 |              4 |                9 | simple  | PW20WCB |           0 |                0 | 2010-06-10 14:36:04 | 2012-07-03 16:46:09 |     NULL |          4 |
|        20 |              4 |                9 | simple  | PW5TBW  |           0 |                0 | 2010-06-28 15:44:23 | 2011-04-08 21:35:02 |     NULL |          1 |
|        21 |              4 |                9 | simple  | PWBJACK |           0 |                0 | 2010-06-28 15:51:35 | 2011-10-27 15:26:21 |     NULL |          1 |
|        22 |              4 |                9 | simple  | YK32006 |           0 |                0 | 2010-06-28 16:22:25 | 2012-07-03 16:47:46 |     NULL |          4 |
|        23 |              4 |                9 | simple  | YK32008 |           0 |                0 | 2010-06-28 16:30:51 | 2012-07-03 16:48:55 |     NULL |          4 |
|        24 |              4 |                9 | simple  | RFBURG  |           0 |                0 | 2010-06-28 16:37:12 | 2011-09-16 14:03:04 |     NULL |          4 |
|        25 |              4 |                9 | simple  | PW10EWJ |           0 |                0 | 2010-06-28 17:34:15 | 2011-08-11 15:43:49 |     NULL |          1 |
|        26 |              4 |                9 | simple  | PW10WJ  |           0 |                0 | 2010-06-28 17:39:26 | 2011-08-11 16:04:37 |     NULL |          4 |
|        27 |              4 |                9 | simple  | HDNG10  |           0 |                0 | 2010-06-28 17:48:00 | 2012-07-03 17:00:07 |     NULL |          4 |
+-----------+----------------+------------------+---------+---------+-------------+------------------+---------------------+---------------------+----------+------------+
10 rows in set (0.00 sec)

mysql> 

_prepareCollection()

class My_CategoryFilters_Block_Adminhtml_Catalog_Category_Tab_Product extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product {
... 
protected function _prepareCollection()
{
    if ($this->getCategory()->getId()) {
        $this->setDefaultFilter(array('in_category'=>1));
    }
    #$store = $this->_getStore();
    $collection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('price')
        ->addAttributeToSelect('store_id')
        #->addAttributeToSelect('visibility')
        ->addStoreFilter($this->getRequest()->getParam('store'))
        ->joinField('position',
            'catalog/category_product',
            'position',
            'product_id=entity_id',
            'category_id='.(int) $this->getRequest()->getParam('id', 0),
            'left')
        ->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', 'entity_id', 'entity_id='.(int) $this->getRequest()->getParam('id', 0), 'inner')
        ;

    $this->setCollection($collection);

    $this->getCollection()->addWebsiteNamesToResult();

    if ($this->getCategory()->getProductsReadonly()) {
        $productIds = $this->_getSelectedProducts();
        if (empty($productIds)) {
            $productIds = 0;
        }
        $this->getCollection()->addFieldToFilter('entity_id', array('in'=>$productIds));
    }

    return parent::_prepareCollection();
}

_prepareColumns()

    $this->addColumn('visibility', array(
        'header'   => Mage::helper('catalog')->__('Visibility'),
        'width'    => '100',
        'sortable' => false,
        'index'    => 'visibility',
        'type'     => 'options',
        'options'  => Mage::getModel('catalog/product_visibility')->getOptionArray(),
    ));
  • 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-08T16:33:59+00:00Added an answer on June 8, 2026 at 4:33 pm

    Figured it out.

    My implementation extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product. Because it extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product, I am very restricted as to what I can do w/ the extended methods. The reason the new column’s data does not appear is because the parent method has no access to the data (->addAttribute(‘visibility’)).

    In order to handle the new data, I need to extend Mage_Adminhtml_Block_Widget_Grid instead. The widget provides more generalized methods for handling data.

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

Sidebar

Related Questions

I'm extending a constructor class' functionality via the prototype method, but I'm having trouble
I'm extending AbstractJavaSamplerClient and creating a custom Java Sampler. It's all working good but
I am looking to create some new functionality to Magento. I am going to
I'm trying to add a custom action to a core controller by extending it
I discovered a method of extending the core jQuery init function (which is what
I'm new to extending Drupal, though I've done similar kinds of things for other
Im extending the UIButton Class to be able to set the font and color
I have a ModalPopupExtender extending a panel and in the panel, there is a
I am extending the ActionResult class. In the ExecuteResult method I want to check
If you are extending UIComponent and you add a Label component to your custom

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.