1

I have issue in image height calculation in fotorama in Magento EE 2.2.4. The image div(fotorama__stage)height is assigning by Script as inline css.

It is happens in some products only.

<div class="fotorama__stage" data-fotorama-stage="fotorama__stage" style="width: XXXpx; height: XXXpx;">

This is the perfect height assigned to the div as per image size. enter image description here

This is the imperfect height assigned to the div as per image size. enter image description here

Sometimes it displays perfect image as per actual image size but sometimes it displaying incorrectly.

I'm using Magento EE 2.2.4 with production mode. I have only configurable products in this project.

Anyone know about such kind of issue?

1 Answer 1

1
app/design/frontend/Custom/mytheme/Magento_Catalog/templates/product/view/gallery.phtml

add "maxheight": "550", // Add your value here

<script type="text/x-magento-init">
    {
        "[data-gallery-role=gallery-placeholder]": {
            "mage/gallery/gallery": {
                "mixins":["magnifier/magnify"],
                "magnifierOpts": <?= /* @escapeNotVerified */ $block->getMagnifier() ?>,
                "data": <?= /* @escapeNotVerified */ $block->getGalleryImagesJson() ?>,
                "options": <?= /* @noEscape */ $block->getGalleryOptions()->getOptionsJson() ?>,
                "fullscreen": <?= /* @noEscape */ $block->getGalleryOptions()->getFSOptionsJson() ?>,
                "breakpoints": <?= /* @escapeNotVerified */ $block->getBreakpoints() ?>,
                "maxheight": "550"  //Add your value here
            }
        }
    }
</script>
1
  • 1
    Thanks for answer but it is not working... I want to change height of <div class="fotorama__stage"></div> which is assigned from fotorama.js .
    – KKR
    Commented Sep 25, 2019 at 14:02

Your Answer

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

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