0

so a couple of days ago i bought a responsive theme for an old website that wanted to go mobile, running 1.4.1.1. It's all working as intended, the theme new responsive theme is only active when on mobile devices, and i can navigate through the page like before. However when i try to add a product to the shopping cart i get the /checkout/cart/ 500 (Internal Server Error). When trying to simply go to a products page i get

There has been an error processing your request
Exception printing is disabled by default for security reasons.

The following was in var/report:

a:5:{i:0;s:66:"Invalid method Mage_Catalog_Model_Product::isAvailable(Array
(
)
)";i:1;s:3469:"#0 app/design/frontend/rwd/glamour/template/catalog/product/view.phtml(81): Varien_Object->__call('isAvailable', Array)
#1 app/design/frontend/rwd/glamour/template/catalog/product/view.phtml(81): Mage_Catalog_Model_Product->isAvailable()
#2 app/code/core/Mage/Core/Block/Template.php(212): include('/var/www/efi-es...')
#3 app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/rwd/gl...')
#4 app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#5 app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#6 app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Text_List->_toHtml()
#8 app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#9 app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#10 app/design/frontend/rwd/glamour/template/page/1column-view.phtml(23): Mage_Core_Block_Abstract->getChildHtml('content')
#11 app/code/core/Mage/Core/Block/Template.php(212): include('/var/www/efi-es...')
#12 app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/rwd/gl...')
#13 app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#14 app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#15 app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#16 app/code/core/Mage/Core/Controller/Varien/Action.php(389): Mage_Core_Model_Layout->getOutput()
#17 app/code/core/Mage/Catalog/controllers/ProductController.php(153): Mage_Core_Controller_Varien_Action->renderLayout()
#18 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
#19 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(258): Mage_Core_Controller_Varien_Action->dispatch('view')
#20 app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 app/code/core/Mage/Core/Controller/Varien/Front.php(177): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#22 app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#23 app/Mage.php(596): Mage_Core_Model_App->run(Array)
#24 index.php(78): Mage::run('', 'store')
#25 {main}";s:3:"url";s:27:"/las-til-pahaengsmotor.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I tried increasing php_value memory_limit to 512mb in .htaccess, tried copying php.ini.sample to a php.ini file, i tried magento-cleanup and magento-check. Nothing gave me anything except magento-check was confused about my servers phpmyadmin version. I cleared caches a million times and so far, i got nothing.

1

I guess your theme is not 1.4 compatible.

As the others have already said, Magento complains that the method isAvailable() does not exist in the class Mage_Catalog_Model_Product, that is in the file app/code/core/Mage/Catalog/Model/Product.php.

A quick fix that could work: this is the method from a 1.9.2.1 Magento instance. Copy the file from ../core/.. to ../local/.. and add the method to the file.

/**
     * Check whether the product type or stock allows to purchase the product
     *
     * @return bool
     */
    public function isAvailable()
    {
        return $this->getTypeInstance(true)->isSalable($this)
            || Mage::helper('catalog/product')->getSkipSaleableCheck();
    }

Anyway, I do not recommend this solution for more than a hotfix. 1.4 is a very old version, and you should upgrade it. See here for more information on this: Upgrading from 1.4.1 to 1.9

| improve this answer | |
0

Magento is telling you "Invalid method Mage_Catalog_Model_Product::isAvailable " The function used doesn't exist or can't be used. Open the file in your template 'app/design/frontend/rwd/glamour/template/catalog/product/view.phtml' and try to delete the line which is using this method. We assume your website is in development.

| improve this answer | |
  • I have no idea how to find out where that call is made.. – LooseNoose Oct 6 '15 at 12:46
  • @matthieu you can't just advise people to delete lines from their template... – paj Oct 6 '15 at 12:55
  • @paj I suppose his website is in development. It's just in order to isolate the bug. – user29543 Oct 6 '15 at 13:25
0

The exception report is telling you the problem is in

app/design/frontend/rwd/glamour/template/catalog/product/view.phtml

on line 81 where a call to an array object called isAvailable is being made.

view.phtml is the template file that renders product html, so this is where your product view exception error is being thrown.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.