在目录产品中隐藏组?
如果有人知道如何完成这项工作,请帮助我。
我想隐藏目录产品中的网站选项卡,但其功能应该存在。也就是说,我已自动选中所有复选框,因此我不想向任何人显示此选项卡...但在添加产品时...复选框值将被保存。
Please help me if anybody know how this work can be done.
I 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不完全确定你会如何做到这一点,但基本上你需要在 adminhtml 渲染序列中绑定一个观察者,调用
Mage_Adminhtml_Block_Widget_Tabs::removeTab($tabId)
其中$tabId
是网站选项卡的 ID(我认为这只是“网站”)。诀窍是找到正确的事件来绑定你的观察者,@Joseph 的 事件列表应该可以帮助您开始。我会尝试类似adminhtml_block_html_before
的方法。您的观察者也会同时设置产品的值。
祝你好运,
京东
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 likeadminhtml_block_html_before
.Your observer would also set the values on the product at the same time.
Good luck,
JD
在 ProductController.php
网站 中
*/
$productData['website_ids']=$this->getStoreWebsiteId(); //新增
//新增
public function getStoreWebsiteId(){
In ProductController.php
Websites
*/
$productData['website_ids']=$this->getStoreWebsiteId(); //newly added
//newly added
public function getStoreWebsiteId(){