---
title: "How to Add Split Button on Admin Sales Order View Page in Magento 2"
url: "https://magecomp.com/blog/how-to-add-split-button-on-admin-sales-order-view-page-in-magento-2/"
date: "2020-07-27T17:00:58+00:00"
modified: "2025-02-20T07:20:34+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 457
reading_time: "3 min read"
summary: "Hello Magento Friends ?,"
description: "The split button provides the default option and the drop-down list. Learn How to Add Split Button on Admin Sales Order View Page in Magento 2."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Pre-select Default Payment Method at the Checkout Page in Magento 2?"
    url: "https://magecomp.com/blog/pre-select-default-payment-method-at-the-checkout-page-magento-2/"
  - title: "How to set Base Image Instead of Thumbnail Image in Minicart of Magento 2"
    url: "https://magecomp.com/blog/set-base-image-instead-of-thumbnail-image-in-minicart-of-magento-2/"
  - title: "Magento 2: How to Get System Configurations Value in Email Templates"
    url: "https://magecomp.com/blog/magento-2-how-to-get-system-configurations-value-in-email-templates/"
---

# How to Add Split Button on Admin Sales Order View Page in Magento 2

_Published: July 27, 2020_  
_Author: Dhiren Vasoya_  

![How to Add Split Button on Admin Sales Order View Page in Magento 2](https://magecomp.com/blog/wp-content/uploads/2020/07/How-to-Add-Split-Button-on-Admin-Sales-Order-View-Page-in-Magento-2-1024x512.webp)

**Hello Magento Friends ?,**

How are you guys doing? It’s a new week, a new day and hereby I am with a new subject, How to Add Split Button on Admin Sales Order View Page in Magento 2. Let’s not miss our formerly published blog, [Magento 2: How to Display Categories in Alphabetical order Programmatically in Frontend](https://magecomp.com/blog/magento-2-how-to-display-categories-in-alphabetical-order-programmatically-in-frontend/).
## [![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-5.webp)](https://magecomp.com/services/hire-magento-programmer/)

## Start Up
A split button is a UI component where the user can select the displayed option or any other option from the drop-down list. The displayed option is the one that is frequently used by most of the users. The drop-down list shows the options that are very rarely used. The admin sales order view page is where the store owner can see all the details of the orders placed by the customers. Sometimes, the Magento 2 store has a need to add a split button in the admin sales order view page. It is possible with the help of the below code. Here we go ?
## Steps to Add Split Button on Admin Sales Order View Page in Magento 2
**Step 1**: Firstly, navigate to the following path
**app\code\Vendor\Extension\etc\adminhtml\**

Now, create a file named **“di.xml”** and add the following code
```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="MagentoSalesBlockAdminhtmlOrderView">
        <plugin name="addSplitButton" type="VendorExtensionPluginBlockAdminhtmlOrderView"/>
    </type>
</config>
```

**Step 2:** Now, navigate to the following path
**app\code\Vendor\Extension\Plugin\Block\Adminhtm\Order**

And create a file named **“View.php”**

Lastly, add the following code
```
<?php

namespace VendorExtensionPluginBlockAdminhtmlOrder;
use MagentoSalesBlockAdminhtmlOrderView as OrderView;

class View
{
    public function beforeSetLayout(OrderView $subject)
    {
        $addButtonProps = [
            'id' => 'test',
            'label' => __('Test'),
            'class' => 'add',
            'button_class' => '',
            'class_name' => 'MagentoBackendBlockWidgetButtonSplitButton',
            'options' => $this->getCustomActionListOptions(),
        ];
        $subject->addButton('test',$addButtonProps);
    }
    protected function getCustomActionListOptions()
    {
        $splitButtonOptions=[
            'action_1'=>['label'=>__('Action 1'),'onclick'=>'setLocation("ACTION 1")'],
            'action_2'=>['label'=>__('Action 2'),'onclick'=>'setLocation("ACTION 2")'],
            'action_3'=>['label'=>__('Action 3'),'onclick'=>'setLocation("ACTION 3")']
        ];
        return $splitButtonOptions;
    }
}
?>
```

## [![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

## Sum Up
That’s it for today! You have successfully implemented How to Add Split Button on Admin Sales Order View Page in Magento 2 and you are free to customize this code according to your need for fetching data. Lastly, if you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends and let us know if you are facing any issue while implementing this code by commenting below.
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-4.webp)](https://magecomp.com/magento-malware-removal.html)

**Happy Coding ?**


---

_View the original post at: [https://magecomp.com/blog/how-to-add-split-button-on-admin-sales-order-view-page-in-magento-2/](https://magecomp.com/blog/how-to-add-split-button-on-admin-sales-order-view-page-in-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-26 03:59:27 UTC_  
