4

I am facing a strange problem with my magento 1.7 installation. If I upload images for any product, save and check the product on the frontend, facing this error

a:5:{i:0;s:1203:"Invalid method Mage_Catalog_Block_Product_View_Media::isGalleryImageVisible(Array ( [0] => Varien_Object Object ( [_data:protected] => Array ( [value_id] => 8 [file] => /1/0/10425097_688517641274252_8269930450739102673_n.jpg [label] => [position] => 1 [disabled] => 0 [label_default] => [position_default] => 1 [disabled_default] => 0

Product works fine if no image is attached.

Any thoughts what is causing the issue?

  • If you are getting any error code, then check your error in var/report/[ERROR_CODE] from there you can get actual error – Shoaib Munir Jul 11 at 18:33
  • a:5:{i:0;s:1203:"Invalid method Mage_Catalog_Block_Product_View_Media::isGalleryImageVisible(Array ( [0] => Varien_Object Object ( [_data:protected] => Array ( [value_id] => 8 [file] => /1/0/10425097_688517641274252_8269930450739102673_n.jpg [label] => [position] => 1 [disabled] => 0 [label_default] => [position_default] => 1 [disabled_default] => 0 and other lines of code – kmax01 Jul 11 at 18:38
1

Mage_Catalog_Block_Product_View_Media::isGalleryImageVisible is a method in 1.9.1 and later

Probably you have used gallery plugin for compatible with Magento 1.9.1 and you are currently in Magento 1.7

in your theme file: app/design/frontend/YOUR_THEME/default/template/catalog/product/view/media.phtml comment out the condition where isGalleryImageVisible method is calling. Something like this:

    <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?>
        <?php //if ($this->isGalleryImageVisible($_image)): ?>
        <img id="image-<?php echo $i; ?>"
             class="gallery-image"
             src="<?php echo $this->getGalleryImageUrl($_image); ?>"
             data-zoom-image="<?php echo  $this->getGalleryImageUrl($_image); ?>" />
        <?php //endif; ?>
    <?php $i++; endforeach; ?>

This function would be calling 2 times in same file, make sure you remove both.

  • I haven't installed any plugin yet just relying on the default features. – kmax01 Jul 11 at 18:48
  • May be your theme is using gallery plugin from Magento 1.9, because isGalleryVisible function is from magento 1.9.1 – Shoaib Munir Jul 11 at 18:50
  • Let me update my answer – Shoaib Munir Jul 11 at 18:50
  • are you using rwd theme? – Shoaib Munir Jul 11 at 18:51
  • Please check updated answer – Shoaib Munir Jul 11 at 18:54

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.