简体   繁体   English

在sales_flat_quote和sales_flat_order_item表中添加额外信息

[英]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 这是我目前所拥有的

  1. When a customer loads the onepage.phtml file an include is made to a script that checks the items in the basket and calls an api which generates a unique order url for the customer. 当客户加载onepage.phtml文件时,将在脚本中包含一个内容,该脚本检查购物篮中的物品并调用api,该api为客户生成唯一的订单网址。

This is what i need to do 这是我需要做的

  1. I then need to store this unique order url in the database sales_flat_order table. 然后,我需要将此唯一的订单URL存储在数据库sales_flat_order表中。 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. 进行第二次api调用,该API将这个unique_order_url传递回去,以最终确定订单并完成付款。

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 任何帮助/建议将不胜感激

  1. 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相关表。

  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. 您的主要问题:覆盖存储订单的方法,并添加一个将URL保存到扩展表的查询。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Magento - 向sales_flat_quote_item和sales_flat_order_item添加新列 - Magento - Adding a new column to sales_flat_quote_item and sales_flat_order_item Magento-更新sales_flat_order_item表中发票的数量 - Magento - update the qty invoiced in sales_flat_order_item table 带有sales_flat_order_item的product_options的_prepareCollection - _prepareCollection with product_options of sales_flat_order_item 从magento中的自定义模块在sales_flat_order_item表中添加新字段 - Adding new field in sales_flat_order_item table from custom module in magento 如何将产品特定的属性列添加到sales_flat_order_item表? - How to add product specific attribute column to sales_flat_order_item table? 未完成Magento订单创建sales_flat_quote_item - Magento Order creation sales_flat_quote_item not being made Magento-客户地址中的自定义属性,在结帐时未复制到sales_flat_order_address和sales_flat_quote_address - Magento - Custom attribute in customer address, not copied to sales_flat_order_address and sales_flat_quote_address on checkout 为什么core_write在Magento CE 1.9.1中的sales_flat_quote_item上不起作用 - Why core_write is not working on sales_flat_quote_item in Magento CE 1.9.1 Magento V1.9 在事件观察器中的 sales_flat_quote_item 更新后超时运行 - Magento V1.9 is running in timeout after sales_flat_quote_item update in event observer **更新**如何在表sales_flat_quote_item中创建新列并使用$ cart-> addProduct添加数据 - **update** How i can create new column in table sales_flat_quote_item and add data with $cart->addProduct
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM