How can I get image "label" to print/output under the main image??

enter image description here

Need to display the Image label change according to the selection of the thumbnail image.

(e.g Front, Rear, Side etc)


For main image : in media.phtml template file:

<span><?= $this->escapeHtml($this->getImageLabel()) ?></span>

also see https://github.com/OpenMage/magento-lts/blob/1.9.4.x/app/design/frontend/rwd/default/template/catalog/product/view/media.phtml


You can use this code-

<?php echo (Mage::app()->getLayout()->checkVersion('1.7.x.x') ? $this->htmlEscape : $this->escapeHtml).($_image->getImage()->getLabel()) ?>

This one getting image label and you can save that into any data attribute and show that title or text with jquery.

  • Why are you using checkVersion ?
    – Priyank
    Jul 11 '17 at 8:51

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.