Jump to content

Allow user to change order status [delivered]


Recommended Posts

you can have a link button in customer order details, you need to add the button in order-detail.tpl file in theme directory and on the order-detail controller you need to add the code so that the customer clicks the button the stautus of the particular order can be changed to delivered.

Link to comment
Share on other sites

Well, the most common sense place would be to look at the AdminOrdersController.php, since that is what handles the order status change in the back office.


There is a function called postProcess, which handles a submit type called 'submitState'.  This is the code that deals with updating the order status.


You would need to 2 do things

1) You need to include your front office code that would allow the customer to say "delivered".  You could update the theme file directly, or you create a module that hooks "order detail displayed".  The module would be better so that you don't have to maintain the theme changes whenever you upgrade PS or change to a new theme.


2) Then you need to include coding to handle when the customer clicks that button.  If you build a module, then you would handle the status change in the module.  If you don't build a module, then you need to figure out the best place to put this code.  Perhaps an override of the OrderDetailController.php


Just keep in mind that you should protect your code so that only a logged in customer associated to this order can change the status.

Link to comment
Share on other sites

  • 6 months 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...