开发者

Adding extra information in sales_flat_quote and sales_flat_order_item tables

开发者 https://www.devze.com 2023-03-29 12:26 出处:网络
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

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

  1. 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

  1. 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


  1. 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.

  2. Furthermore I would NOT change the original code either. Same reason. Instead I would extend the respective class and add the additional functionality there!

  3. Your main question: Override the method that stores the order and add a query that saves the url to your extended table.

0

精彩评论

暂无评论...
验证码 换一张
取 消