我想在Magento的購物車頁面上顯示產品的自定義圖像。如何在magento的購物車頁面上顯示自定義圖像
的Config.xml文件
<checkout>
<rewrite>
<cart_item_renderer>ProductCustomizer_ProductCustomizer_Block_Checkout_Cart_Item_Renderer</cart_item_renderer>
</rewrite>
</checkout>
我在座/結帳/車/項目/ Renderer.php文件
<?php
class ProductCustomizer_ProductCustomizer_Block_Checkout_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_Item_Renderer{
public function getProductThumbnail()
{
$item = $this->_item;
$customize_data = $item->getData('customize_data');
$customize_image = $item->getData('customize_image');
$results_data = $item->getOptionByCode("customizer_data")->getValue();
if(!is_null($results_data)){
$results = unserialize($results_data);
$path = Mage::getBaseDir()."/skin/";
$_product = $item->getProduct()->load();
$customize_image = $this->helper('catalog/image')->init($_product, 'thumbnail',$path.'adminhtml/default/default/images/logo.gif');
//$customize_image = $this->helper('catalog/image')->init($_product, 'thumbnail',$results['image']);
}
if (!empty($customize_image)) {
return $customize_image;
} else {
return parent::getProductThumbnail();
}
}
}
我已經試過$添加以下代碼customize_image帶圖像「URL」,「路徑」和「數據(data:image/png;base64,iVBORw0KG....
)」但它不工作。
我正在開發的擴展顯示,所以我不能在'應用程序/設計/前端/ RWD修改自定義圖像路徑/缺省的/模板/結帳/車/項目/ default.phtml'。如果您有任何其他方式,請讓我知道。 –