2

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)

2 Answers 2

1

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

0

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.

1
  • Why are you using checkVersion ?
    – Priyank
    Jul 11, 2017 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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