Jump to content

Create order grid/row actions - Prestashop 1.7.7

Recommended Posts


With the newest version of Prestashop both the order grid page & order page have been significantly updated. I have tried following the docs explaining how to add custom actions to the order grid, but I cannot for the life of me get it to work properly.

These are the docs I have been referring to:

What I basically want to achieve, which I had no problem with before, is to add to extra grid actions that generates an XML-file. To apply the functionality I have created a custom module which has a controller called AdminXmlController that generates the file. However that does not seem to be straight forward with the new way of implementing similar functionality.

I have attached an image where I have marked the place where I want to have two additional icons, that should call a method/action within my controller that is placed in mymodule/controllers/admin/AdminXmlController.php. Can someone point me in the direction of how I am going to achieve this?

I have tried something similar to this is my main module file:

  public function hookActionOrderGridDefinitionModifier(array $params) {
    /** @var \PrestaShop\PrestaShop\Core\Grid\Definition\GridDefinition */
    $gridDefinition = $params['definition'];
        ->add((new LinkGridAction('send_freight_xml'))
        ->setName($this->trans('Send shipping', [], 'FreightModule.Admin.Actions'))
        ->setIcon('send') // icon from https://materializecss.com/icons.html by default
            'route' => 'admin_xml_generate_order_xml',
            'route_params' => ['id_order']

With the code above I guess i need to register the route etc., but the docs seem to be very inadequate explaining how to achieve this.

Any help would be much appreciated.


Share this post

Link to post
Share on other sites
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More