Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try with below custom module</p> <p><strong>1) config.xml</strong></p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;NameSpace_YourModulename&gt; &lt;version&gt;0.1.0&lt;/version&gt; &lt;/NameSpace_YourModulename&gt; &lt;/modules&gt; &lt;adminhtml&gt; &lt;events&gt; &lt;catalog_product_save_after&gt; &lt;observers&gt; &lt;NameSpace_YourModulename_Product_Update&gt; &lt;type&gt;singleton&lt;/type&gt; &lt;class&gt;NameSpace_YourModulename_Model_Observer&lt;/class&gt; &lt;method&gt;customApplyCategoryToGrouped&lt;/method&gt; &lt;/NameSpace_YourModulename_Product_Update&gt; &lt;/observers&gt; &lt;/catalog_product_save_after&gt; &lt;/events&gt; &lt;/adminhtml&gt; &lt;global&gt; &lt;models&gt; &lt;NameSpace_YourModulename&gt; &lt;class&gt;NameSpace_YourModulename_Model&lt;/class&gt; &lt;/NameSpace_YourModulename&gt; &lt;/models&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <p>2) Observer.php file inside model</p> <pre><code>&lt;?php class NameSpace_YourModulename_Model_Observer { public function customApplyCategoryToGrouped(Varien_Event_Observer $observer) { $currentProduct = Mage::getModel('catalog/product')-&gt;load($observer-&gt;getProduct()-&gt;getId()); $categoryIds = $currentProduct-&gt;getCategoryIds(); if($currentProduct-&gt;getTypeId() == 'grouped') $simpleProducts = $currentProduct-&gt;getTypeInstance(true)-&gt;getAssociatedProducts($currentProduct); if(count($simpleProducts) &gt; 0) foreach ($simpleProducts as $item) { $_simplePro = Mage::getModel('catalog/product')-&gt;load($item-&gt;getId()); $_simplePro-&gt;setCategoryIds($categoryIds); $_simplePro-&gt;save(); unset($_simplePro); } } } </code></pre> <p>3 ) etc/modules/NameSpace_YourModulename.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;NameSpace_YourModulename&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;/NameSpace_YourModulename&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <p>Hope this will help you..</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.
 

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