Rain_xx Posted September 17, 2014 Share Posted September 17, 2014 Hello, I developed a payment module that create a new order status during its installation. I would like to know how to make automatically delete that order status when the user unistall the module. Thanks a lot. Link to comment Share on other sites More sharing options...
bellini13 Posted September 17, 2014 Share Posted September 17, 2014 Have you considered what should happen if there are orders using this order status? Link to comment Share on other sites More sharing options...
Rain_xx Posted September 17, 2014 Author Share Posted September 17, 2014 I would like to delete the order status that the module created (recognizable by "module_name" value on the "ps_order_state" table), not just "an order status" or the last created. But now I see that the module works properly even if unistalled and re-installed. I had some problem before reinstalling, and I thougth it may depends on the alreay existing "order status".. I'll never know what happened Link to comment Share on other sites More sharing options...
bellini13 Posted September 17, 2014 Share Posted September 17, 2014 (edited) In your install function, you should check to confirm that the order status you are trying to create already exists, then skip creating it. There is no reason to delete the order status, in fact you shouldn't, because there are likely orders using that status (current or history). Edited September 17, 2014 by bellini13 (see edit history) 1 Link to comment Share on other sites More sharing options...
Rain_xx Posted September 17, 2014 Author Share Posted September 17, 2014 There is no reason to delete the order status, in fact you shouldn't, because there are likely orders using that status (current or history). That's correct, thanks for your advise. 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