如何删除magento中的保存和继续按钮

时间:2015-08-21 08:36:30

标签: php magento magento-1.9

我不知道如何删除Magento中的保存和继续按钮..

在构造中,其他按钮正在正确删除,但单独保存并继续按钮而不是删除..

我试过这些代码

            $this->_removeButton('save_and_continue');
            $this->_removeButton('saveAndContinueEdit');
            $this->_removeButton('save_and_edit_button');

但不工作..

public function __construct()
    {
        $this->_objectId = 'id';
        $this->_controller = 'customer';


        parent::__construct();

        $this->_updateButton('save', 'label', Mage::helper('customer')->__('Save Customer'));
        $this->_updateButton('delete', 'label', Mage::helper('customer')->__('Delete Customer'));

        if (Mage::registry('current_customer')->isReadonly() ) {
            $this->_removeButton('save');
            $this->_removeButton('reset');
        }
        if (Mage::registry("new_job")) {
//            $this->_removeButton('save');
            $this->_updateButton('save_and_continue', 'class', 'new_job_save_btn');
//            $this->_updateButton('save', 'label', Mage::helper('customer')->__('Save Customer and Add Job'));
            $this->_updateButton('save', 'label', Mage::helper('customer')->__('Save And Exit'));

            $this->_removeButton('reset');
            $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getBackJobUrl() . '\')');
        }
        else{
            $this->_updateButton('save', 'label', Mage::helper('customer')->__('Save And Exit'));
        }

        $this->_addButton('addorder', array(
            'label' => Mage::helper('customer')->__('Save and Create New Job'),
            'class' => 'save create-new-job',
            'onclick' => 'saveAndContinueEdit(\'' . $this->getSaveAndAddJobUrl() . '\')',
        ), 100);

        $this->_addButton('addcomplaint', array(
            'label' => Mage::helper('customer')->__('Save and Create New Complaint'),
            'class' => 'save create-new-complaint',
            'onclick' => 'saveAndContinueEdit(\'' . $this->getSaveAndAddComplaintUrl() . '\')',
        ), 101);

        if (!Mage::registry('current_customer')->isDeleteable()) {
            $this->_removeButton('delete');
        }

        $admin_user = Mage::helper('sales')->getCurrentAdmin(true);

        if($admin_user && $admin_user->getRoleInfo() && $admin_user->getRoleInfo()->getId() != 7){
            $this->_removeButton('addorder');
            $this->_removeButton('addcomplaint');
            $this->_removeButton('delete');
            $this->_removeButton('save');

            $this->_removeButton('save_and_continue');
            $this->_removeButton('saveAndContinueEdit');
            $this->_removeButton('save_and_edit_button');
        }
    }

    protected function _prepareLayout()
    {

        if (!Mage::registry('current_customer')->isReadonly()) {
            $this->_addButton('save_and_continue', array(
                'label'     => Mage::helper('customer')->__('Save and Continue Edit'),
                'onclick'   => 'saveAndContinueEdit(\''.$this->_getSaveAndContinueUrl().'\')',
                'class'     => 'save'
            ), 10);
        }

        return parent::_prepareLayout();
    }

    protected function _getSaveAndContinueUrl()
    {
        return $this->getUrl('*/*/save', array(
            '_current'  => true,
            'back'      => 'edit',
            'tab'       => '{{tab_id}}'
        ));
    }

提前致谢..

2 个答案:

答案 0 :(得分:1)

在__construct函数中添加此代码。

$this->_removeButton("saveandcontinue");

答案 1 :(得分:0)

只需删除

plotOptions.series.dataLabels.allowOverlap

从你的_prepareLayout函数开始工作。