开发者

Hide a group in catalog product?

开发者 https://www.devze.com 2023-02-18 22:42 出处:网络
Please help me if anybody know how this work can be done. 开发者_如何学GoI want to hide the website tab in catalog Product, but its functionality should exist. That is, I have made all the check boxe

Please help me if anybody know how this work can be done.

开发者_如何学GoI want to hide the website tab in catalog Product, but its functionality should exist. That is, I have made all the check boxes automatically checked,so i dont want to show this tab anybody...but at the time of adding product..check boxes values would be saved.


Not exactly sure how you would do this, but basically you need to bind an Observer in the adminhtml render sequence that calls Mage_Adminhtml_Block_Widget_Tabs::removeTab($tabId) where $tabId is the Id of the websites tab (I think it's just "websites"). The trick is to find the right event to bind your Observer to, @Joseph's list of events should get you started. I would try something like adminhtml_block_html_before.

Your observer would also set the values on the product at the same time.

Good luck,
JD


In ProductController.php

  • Websites */

    if (!isset($productData['website_ids'])) {
        $productData['website_ids'] = array();
    }
    

$productData['website_ids']=$this->getStoreWebsiteId(); //newly added

//newly added

public function getStoreWebsiteId(){

    $selectWebsite="SELECT * from core_website WHERE website_id!=0";
    $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
    $value=$connection->fetchAll($selectWebsite);
    foreach($value as $websiteDetails){
        $websiteId[]=$websiteDetails['website_id'];
    }

    return $websiteId;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消