说明:我的magento版本是1.4.2
第一步:添加获取产品 Url 的 Block
位置:
/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php
public function getProductUrl() { $productData = $this->getItem()->getData(); $productId = $productData['product_id']; $productSource = Mage::getModel('catalog/product'); $pdata = $productSource->load($productId)->getData(); $pUrlPath = Mage::getUrl($pdata['url_path']); return $pUrlPath; }
第二步:调用此方法
位置:
/app/design/adminhtml/default/default/template/sales/items/column/name.phtml
<h5 class="title"> <a target="_blank" href="<?php echo rtrim(str_replace("index.php/","",$this->getProductUrl()),"/")?>"> <?php echo $this->htmlEscape($_item->getName()) ?> </a> </h5>