How To Create A New Action For Cscart Admin

Under the orders section I need to create a new action that would take all selected addons and find the optimal route. I have sign up with companies for the relevant api's. How can I add a new action to the admin panel. The advanced addon guide doesnt really show how to get the addon to show there.

You can use hook from Quickbooks addon as example

design/backend/templates/addons/quickbooks/hooks/orders/export_tools_list_for_selected.post.tpl

Thank for the reply I tried doing as you suggested and created an actions.post.tpl file in this location

/var/www/html/cart/design/backend/templates/addons/pnp_routes_optimizer/hooks/orders

I then populated actions.post.tpl with this code


  • {btn type="list" text={__("view_purchased_products")} dispatch="dispatch[orders.products_range]" form="orders_list_form"}
  • {hook name="orders:view_tools_list_for_selected"} {/hook}

    My expected result is that under Orders when multiple items are selected there are now 4 items available as actions but I still get the default 3 actions and my newly created one doesnt show up. Any ideas where I went wrong ?

    Thank for the reply I tried doing as you suggested and created an actions.post.tpl file in this location

    /var/www/html/cart/design/backend/templates/addons/pnp_routes_optimizer/hooks/orders

    I then populated actions.post.tpl with this code

    
    
  • {btn type="list" text={__("view_purchased_products")} dispatch="dispatch[orders.products_range]" form="orders_list_form"}
  • {hook name="orders:view_tools_list_for_selected"} {/hook}

    My expected result is that under Orders when multiple items are selected there are now 4 items available as actions but I still get the default 3 actions and my newly created one doesnt show up. Any ideas where I went wrong ?

    Turns out I had to name it as export_tools_list_for_selected.post.tpl or it wouldnt show up. Anyone know why it needs this name for it to work.

    You should use the export_tools_list_for_selected hook to add new action so the file should be named accordingly