Todor Inchovski Posted January 7, 2019 Share Posted January 7, 2019 I need to make it so that when an order is placed, the data of the order is stored in a different table in the database. As I read here I have to make changes to PaymentModule class, but it has no INSERT INTO sql commands. What do I need to do, so that the override works as I want it to (so order data is stored in a different (custom) table)? Link to comment Share on other sites More sharing options...
cristic Posted January 7, 2019 Share Posted January 7, 2019 You want to store the order only in the custom table or to store in in ps_orders AND in a custom table too? Link to comment Share on other sites More sharing options...
Todor Inchovski Posted January 7, 2019 Author Share Posted January 7, 2019 1 hour ago, cristic said: You want to store the order only in the custom table or to store in in ps_orders AND in a custom table too? I need it to be in both (ps_orders AND a custom table). Link to comment Share on other sites More sharing options...
cristic Posted January 7, 2019 Share Posted January 7, 2019 The best and safest way for this is to use MySQL triggers: on insert/update/delete on ps_orders table - make modifications in the custom table too. This will ensure that in future updates you don't have to check for any other code changes (just table design changes will be of interest). 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