Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is custom code for that</p> <p>call observer event in your config.xml</p> <pre><code> &lt;adminhtml&gt; &lt;events&gt; &lt;core_block_abstract_prepare_layout_before&gt; &lt;observers&gt; &lt;NameSpace_Modulename_configurable&gt; &lt;class&gt;NameSpace_Modulename_Model_Observer&lt;/class&gt; &lt;method&gt;addConfigureList&lt;/method&gt; &lt;/NameSpace_Modulename_configurable&gt; &lt;/observers&gt; &lt;/core_block_abstract_prepare_layout_before&gt; &lt;/events&gt; &lt;/adminhtml&gt; </code></pre> <p>here is Observer.php file inside your model folder</p> <pre><code>&lt;?php class NameSpace_Modulename_Model_Observer { public function addConfigureList(Varien_Event_Observer $observer) { $block = $observer-&gt;getEvent()-&gt;getBlock(); if( ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Grid) ) { $block-&gt;addColumnAfter('configure_list', array( 'header' =&gt; Mage::helper('modulename')-&gt;__('Associated Products'), 'index' =&gt; 'configure_list', 'sortable' =&gt; false, 'filter' =&gt; false, 'width' =&gt; '250px', 'options' =&gt; Mage::getSingleton('productsearchguide/system_config_source_category')-&gt;toOptionArrayForAssociated(), 'renderer' =&gt; 'productsearchguide/catalog_product_grid_render_product', 'filter_condition_callback' =&gt; array($this, 'customfilterCall'), ),'name'); } } public function customfilterCall($collection, $column) { $value = $column-&gt;getFilter()-&gt;getValue(); $_product = Mage::getModel('catalog/product')-&gt;load($value); return $collection; } } </code></pre> <p>and add this block file as per given class location</p> <pre><code>&lt;?php class Namespace_Modulename_Block_Catalog_Product_Grid_Render_Product extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { public function render(Varien_Object $row) { $product = Mage::getModel('catalog/product')-&gt;load($row-&gt;getEntityId()); if($product-&gt;getTypeId() == 'configurable') { $childProducts = Mage::getModel('catalog/product_type_configurable') -&gt;getUsedProducts(null,$product); $allCats = ''; foreach($childProducts as $key =&gt; $child) { $allCats .= $child-&gt;getName(); if($key &lt; count($childProducts)-1) $allCats.= ',&lt;br /&gt;'; } return $allCats; } return null; } } </code></pre> <p>after add model file as per given class locations</p> <pre><code>&lt;?php class Namespace_Modulename_Model_System_Config_Source_Product { public function toOptionArrayForAssociated($addEmpty = true) { $options = array(); foreach ($this-&gt;loadConfighurableProduct() as $product) { $options[$product['value']] = $product['label']; } return $options; } public function loadConfighurableProduct() { $store = Mage::app()-&gt;getFrontController()-&gt;getRequest()-&gt;getParam('store', 0); $collection = Mage::getModel('catalog/product')-&gt;getCollection() -&gt;addAttributeToSelect('sku') -&gt;addAttributeToSelect('name') -&gt;addAttributeToSelect('attribute_set_id') -&gt;addAttributeToSelect('type_id'); } } </code></pre> <p>enjoy!! cheers........</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload