[英]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. 我刚刚开始接触magento,并且我正在尝试找出如何执行以下操作。
This is what i have currently 这是我目前所拥有的
This is what i need to do 这是我需要做的
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. 因此,总而言之,我需要传递作为onepage.phtml的一部分生成的unique_order_url,以便在下订单后将其包含在数据库中。
I have created the coloumn in sales_flat_order as a varchar but i am struggling on where to go from here 我已经在sales_flat_order中创建了一个varchar作为varchar,但是我在努力从这里去
Any help / advice would be much appreciated 任何帮助/建议将不胜感激
If I were you, I would NOT change the default magento schema! 如果您是我,则不会更改默认的magento模式! What happens when you have to update your magento install? 当您必须更新magento安装时会发生什么? Trouble! 麻烦! Instead I would add 1:1 related tables for magento tables where you want to store additional information. 相反,我将为要存储其他信息的magento表添加1:1相关表。
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. 您的主要问题:覆盖存储订单的方法,并添加一个将URL保存到扩展表的查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.