2014-02-18 22 views
0

你好,Magento的車和結算頁面給錯誤500

我有一些奇怪的問題與我們的Magento店:

,研究我們的/index.php/得到500錯誤(空白頁)結帳/車/ index.php的和/結算/ onepage/

通過查看@錯誤日誌,我們得到如下:

ERR (3): Recoverable Error: Argument 1 passed to Mage_Catalog_Helper_Image::init() must be an instance of Mage_Catalog_Model_Product, null given, called in /home/headsh78/public_html/app/design/frontend/default/eon/template/catalog/product/featured.phtml on line 90 and defined in /home/headsh78/public_html/app/code/core/Mage/Catalog/Helper/Image.php on line 139 

ERR (3): Recoverable Error: Argument 1 passed to Mage_Catalog_Helper_Image::init() must be an instance of Mage_Catalog_Model_Product, null given, called in /home/***/public_html/app/design/frontend/default/eon/template/catalog/product/bestseller.phtml on line 82 and defined in /home/***/public_html/app/code/core/Mage/Catalog/Helper/Image.php on line 139 

相應的代碼如下:

<?php $product = Mage::getModel('catalog/product')->load($_product->getId()); 
     foreach ($product->getMediaGalleryImages() as $image) { 
     //echo var_export($image); ?> 
    <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(71, 65); ?>" width="71" height="65" alt=""/> 
    <?php } ?> 

public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null) 

是任何人都願意幫助我們嗎?

回答

1

你的代碼似乎有點不乾淨。您指的是同一產品,但在某些情況下,您可以調用$ product或$ _product或$ this-> getProduct()。

對於您的特定問題,請嘗試用$product替換$this->getProduct()並試一試。