Adding extra information in sales_flat_quote and sales_flat_order_item tables
I am just getting to grips with magento and i am trying to work out how to do the following.
This is what i have currently
- When a customer loads the onepage.phtml file an include is made to a script that checks the items in the b开发者_开发技巧asket and calls an api which generates a unique order url for the customer.
This is what i need to do
- I then need to store this unique order url in the database sales_flat_order table. The reason i need to do this is i have an observer i have created which once the order is paid . A second api call is made which passes this unique_order_url back to finalise the order and complete payment.
So to summarise i need to pass this unique_order_url that is generated as part of onepage.phtml so that it is included in the database once an order is placed.
I have created the coloumn in sales_flat_order as a varchar but i am struggling on where to go from here
Any help / advice would be much appreciated
If I were you, I would NOT change the default magento schema! What happens when you have to update your magento install? Trouble! Instead I would add 1:1 related tables for magento tables where you want to store additional information.
Furthermore I would NOT change the original code either. Same reason. Instead I would extend the respective class and add the additional functionality there!
Your main question: Override the method that stores the order and add a query that saves the url to your extended table.
精彩评论