我正在运行Magento 1.7.
我正在尝试在sales_flat_quote_item_option中添加一个引用项选项,一个自定义选项.
我尝试过addOption和addCustomOption函数,但似乎没有向数据库启动查询.
这是我的代码(在自定义模块助手中):
public function assignDocumentToQuoteItem(Mage_Sales_Model_Quote_Item $quoteItem, $documentid)
{
if (is_numeric($documentid) && $documentid > 0) {
/** @var Mage_Catalog_Model_Product */
$product = $quoteItem->getProduct();
$quoteItem->addOption(array(
'product_id' => $product->getId(),
'product' => $product,
'code' => 'documentid',
'value' => $documentid
));
$quoteItem->save();
return true;
}
throw new Exception(__METHOD__.' - Document id has to be a numeric value.');
}
Run Code Online (Sandbox Code Playgroud) 在我的Magento管理员中,我想修改订单中订购商品的显示.
我发现该表在design/adminhtml/default/default/template/sales/order/view/items.phtml中
和设计中的数据/ adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml
我需要在第一列中添加一些数据:product.
我发现以下代码构建HTML :( Magento 1.4中default.phtml的第68行)
<?php echo $this->getColumnHtml($_item, 'name') ?>
Run Code Online (Sandbox Code Playgroud)
我搜索了很多,以找到html的构建位置,但我找不到.