我正在寻找包含“继续结帐”按钮实现的文件名。
我发现单击按钮时正在填充sales_flat_quote_item
表。我添加了一个名为fld_data
的字段,现在我需要在同一个插入语句中单击“继续检出”按钮时插入当前保存在会话中的字段数据。
很抱歉误解我实际上想要添加一个自定义选项文本字段,该文本字段对用户是隐藏的并处理它直到提交订单,并且该值可以在管理端与订单一起访问。
答案 0 :(得分:0)
嗨Khaleel如果我正确地读了你的名字......你应该在
获得模板/app/design/frontend/base/default/template/checkout/onepage
以及模板的布局:
/app/design/frontend/base/default/layout/checkout.xml
和阻止在:
/app/code/core/Mage/Checkout/Block/Onepage/Link.php
确保您不会覆盖这些核心文件,但拥有本地版本。
答案 1 :(得分:0)
此处不需要将核心文件覆盖或复制到本地文件夹(如果附加数据与产品相关)
只需创建一个自定义模块,然后在mysql安装文件中,将自定义列添加到所需的表中以保存属性值:
$installer->getConnection()->addColumn($installer->getTable('sales/quote_item'), 'your_attribute', "decimal(12,4) DEFAULT NULL AFTER `price`");
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'your_attribute', "decimal(12,4) DEFAULT NULL AFTER `price`");
$installer->getConnection()->addColumn($installer->getTable('sales/invoice_item'), 'your_attribute', "decimal(12,4) DEFAULT NULL AFTER `price`");
$installer->getConnection()->addColumn($installer->getTable('sales/shipment_item'), 'your_attribute', "decimal(12,4) DEFAULT NULL AFTER `price`");
$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo_item'), 'your_attribute', "decimal(12,4) DEFAULT NULL AFTER `price`");
然后,在自定义模块config.xml文件中,在全局标记内放置以下内容
<fieldsets>
<sales_convert_quote_item>
<your_attribute><to_order_item>*</to_order_item></your_attribute>
</sales_convert_quote_item>
<sales_convert_order_item>
<your_attribute>
<to_invoice_item>*</to_invoice_item>
<to_shipment_item>*</to_shipment_item>
<to_cm_item>*</to_cm_item>
</your_attribute>
</sales_convert_order_item>
</fieldsets>
<sales>
<quote>
<item>
<product_attributes>
<your_attribute/>
</product_attributes>
</item>
</quote>
</sales>
这应该可以在不修改核心代码的情况下完成。