christian23 Posted December 28, 2020 Share Posted December 28, 2020 Hi, 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: - https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/work-with-row-actions/ - https://devdocs.prestashop.com/1.7/development/components/grid/actions-reference/ - https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/work-with-grid-actions/ 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']; $gridDefinition->getGridActions() ->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 ->setOptions([ '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. Link to comment Share on other sites More sharing options...
dakkafx Posted February 21, 2021 Share Posted February 21, 2021 bump Link to comment Share on other sites More sharing options...
rajiv kumar Posted July 20, 2021 Share Posted July 20, 2021 On 2/22/2021 at 1:44 AM, dakkafx said: bump How to create order row action in admin Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now