To Disable/Remove “ship” Button from sales->order->view (click) -> Ship I commented in core file vendor\magento\module-sales\Block\Adminhtml\Order\View.php below code .

if ($this->_isAllowedAction(
) && $order->canShip() && !$order->getForcedShipmentWithInvoice()
) {
                 'label' => __('Ship'),
                 'onclick' => 'setLocation(\'' . $this->getShipUrl() . '\')',
                 'class' => 'ship'

now how can i ovveride block to remove this function


Please try to create your custom module to override sales block. also, please check with below url which is very helpful to you how to override


and add block with extends

namespace Vendorname\Modulename\Block\Adminhtml\Order;
use Magento\Framework\View\Element\Template;
class View extends Magento\Sales\Block\Adminhtml\Order\View {

public function functionname()  // which have default in Magento\Sales\Block\Adminhtml\Order\View
return "Override Text"; 
  • please vote my question or answer .. I have less reputation score to ask important and complicated question. – irshad Oct 5 at 7:21
  • thanks to you support ... please have a look this link if you submit your effort magento.stackexchange.com/questions/291115/… – irshad Oct 5 at 7:39

To remove ship button in admin order view page


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <type name="Magento\Backend\Block\Widget\Button\Toolbar">
        <plugin name="remove_ship_button" type="Vendor\Module\Plugin\RemoveButton" />


namespace Vendor\Module\Plugin;

class RemoveButton
    public function beforePushButtons(
        \Magento\Backend\Block\Widget\Button\Toolbar\Interceptor $subject,
        \Magento\Framework\View\Element\AbstractBlock $context,
        \Magento\Backend\Block\Widget\Button\ButtonList $buttonList
    ) {

        $this->_request = $context->getRequest();
        if($this->_request->getFullActionName() == 'sales_order_view'){
            $buttonList->remove('order_ship');//Button id
  • di.xml will be in app/code/Vendor/Module/etc/di.xml...? – irshad Oct 5 at 6:48
  • Yes.....It either be in any one folder... – Ranganathan Oct 5 at 6:49
  • it is area specific, you wanted to hide button in admin panel so I added di.xml in adminhtml area....If you add di.xml in etc folder it will take this as global area. So it will work both frontend and adminhtml. – Ranganathan Oct 5 at 6:51
  • thanks its work nicely – irshad Oct 5 at 7:19
  • please have a look below link ... magento.stackexchange.com/questions/291115/… – irshad Oct 5 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.