0

I'm trying to change the functionality of Ship button when you choose an order.

The only thing that I have found so far is this file under /vendor/magento/module-sales/Block/Adminhtml/Order/View.php:

I see this part where the button has an onclick method:

 $this->addButton(
                'order_ship',
                [
                    'label' => __('Ship'),
                    'onclick' => 'setLocation(\'' . $this->getShipUrl() . '\')',
                    'class' => 'ship'
                ]
            );

and then this is the URL

public function getShipUrl()
    {
        return $this->getUrl('adminhtml/order_shipment/start');
    }

I don't know if that url is a controller, I have not found a route with that id nor that exactly path. Or maybe it's an api? This is the url that is shown on backend when I inspect

admin/order_shipment/start/order_id/60/key/ec0160f0fda15ac0271c4a0e1e2115471f7535673cc0e69f5c3af11deaba9ddf/'

Hope someone can give me a hint!

thanks

3
  • what exactly are you trying to achieve here?
    – fmsthird
    Commented Nov 26, 2020 at 2:54
  • I wan't to change the status of the order when Ship button is clicked, to keep it in Processing or delivered Commented Nov 26, 2020 at 15:08
  • 1
    ah then maybe you can only do that using Observer, it's a backend process. try to look for events like sales_order_shipment_save_after
    – fmsthird
    Commented Nov 26, 2020 at 22:12

1 Answer 1

0

Url is correct. The related module is Magento_Shipping. Check the following class:

vendor/magento/module-shipping/Controller/Adminhtml/Order/Shipment/Start.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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