Reading list Switch to dark mode

    How to add more action buttons on create order page dropdown

    Updated 19 December 2022

    In this blog, we are about to learn, how to add more action buttons on create order page dropdown for extra actions.

    Usually, admin create an order for customers to improve the service. Sometime admin need some extra action other than usual creation of order like send the created order notification to the customers. So, they can easily make a checkout to complete an order.
    To achieve the above goal we add some extra action buttons to the create order page.

    Let’s start,

    First of all, we need to register a new hook named ‘displayAdminOrderCreateExtraButtons

    Note: This hook is available since PrestaShop version 1.7.8

    Searching for an experienced
    Prestashop Company ?
    Find out More

    We use this hook to display additional action buttons or links to the create orders page dropdown.

    Now we define the definition of hook functionality as follows:

    public function hookDisplayAdminOrderCreateExtraButtons()
        {
            // Create your logic here
            // assign smarty variables if needed
            
            return $this->context->smarty->fetch('module:wktestmodule/views/templates/hook/more_action.tpl');
        }

    Now, we have to create a template file as above mentioned more_action.tpl
    You can also replace the template file name according to your need.

    more_action.tpl

    <button class="dropdown-item btn-info" id="js-custom-action-button">
        {l s='Custom action button' mod='modulename'}
    </button>
    <a class="dropdown-item btn-warning" id="js-custom-action-link" target="_blank" href="http://yourshop.com/action-link">
        {l s='Custom action link' mod='modulename'}
    </a>

    In the above code, you can modify style, property, and action.

    Now you will get the result as follows:

    more action buttons
    Addition action buttons on create order page

    That’s all about this blog.

    If any issue or doubt in the above step, please feel free to let us know in the comment section.

    We would be happy to help.

    You can also learn How to add additional action buttons in the Admin Orders main buttons bar

    You can also explore our PrestaShop Development Services and a large range of quality PrestaShop Modules.

    For any doubt contact us at [email protected].

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home