我最近在现有的magento网站上添加了一个新主题,一切都顺利完成了转换。但是,在尝试查看产品页面时,我会得到一长串错误:
There has been an error processing your request
Invalid method Mage_Catalog_Block_Product_View_Type_Simple::displayProductStockStatus(Array())
跟踪:
#0 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/design/frontend/smartwave/porto/template/catalog/product/view/type/default.phtml(5): Varien_Object->__call('displayProductS...', Array)
#1 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/design/frontend/smartwave/porto/template/catalog/product/view/type/default.phtml(5): Mage_Catalog_Block_Product_View_Type_Simple->displayProductStockStatus()
#2 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#3 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/smartw...')
#4 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#6 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#7 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('product_type_da...', true)
#8 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/design/frontend/smartwave/porto/template/catalog/product/view.phtml(83): Mage_Core_Block_Abstract->getChildHtml('product_type_da...')
#9 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#10 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/smartw...')
#11 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#12 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#13 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#14 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#15 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#16 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#17 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/design/frontend/smartwave/porto/template/page/1column.phtml(48): Mage_Core_Block_Abstract->getChildHtml('content')
#18 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/vhosts...')
#19 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/smartw...')
#20 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#21 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#22 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#23 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#24 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#25 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route-2')
#26 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route-2')
#27 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Cms_IndexController->noRouteAction()
#28 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#29 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#30 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#31 /var/www/vhosts/coastallinensupplies.co.uk/dev/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#32 /var/www/vhosts/coastallinensupplies.co.uk/dev/index.php(87): Mage::run('', 'store')
#33 {main}
有谁知道为什么会发生这种情况以及如何解决?
编辑:导致问题的代码是:
<?php /* $_product = $this->getProduct() ?>
<?php echo $this->getPriceHtml($_product) ?>
<?php if ($this->displayProductStockStatus()): ?>
<?php if ($_product->isAvailable()): ?>
<p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
<p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->getChildHtml('product_type_data_extra')
*/
?>
如果我发表评论,一切正常,只会很好地知道为什么它会破坏页面。