1
想要在磁性购物车的页面中显示商品名后面的链接。如何在magento中的购物车的商品名后面显示链接
我试过使用“渲染器”,但它不工作。我在“Renderer”中添加了以下代码。
<?php
class ProductCustomizer_ProductCustomizer_Block_Checkout_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_Item_Renderer{
public function getProductName()
{
$name = parent::getProductName();
$item = $this->_item;
$results_data = $item->getOptionByCode("customizer_data");
if($results_data){
$results = unserialize($results_data);
$imagePathFull = $results['image']['url'];
return "Custom - ".$name." - <a target='_blank' href='{$imagePathFull}'>View Image</a>";
}else{
return $name;
}
}
}
现在我试图添加链接使用额外的信息块,但它不工作。我在的Config.xml文件
<catalog_product_view>
<reference name="product.info.additional">
<block type="catalog/product_view_additional" name="product.info.productcustomizer.additional" template="productcustomizer/checkout/cart/additional.phtml" />
</reference>
</catalog_product_view>
默认情况下,它在图像和名称上都有产品链接。另外,如果您已经做了任何更改,请参阅'Mage_Checkout_Block_Cart_Item_Renderer'类中的此函数'getProductUrl()'。你可以在'getProductName()'中调用它。 –
但我想要显示另一个(自定义图像)链接,当您点击链接时,图像将在新标签中打开。 –
哦..我觉得产品链接。我的错。 –