skip to Main Content

I want to set custom height and width of fotorama fullscreen image popup/lightbox.
How to do that….please help.

enter image description here

2

Answers


  1. You have to edit the following file:

    app/design/vendor/Magento_Catalog/templates/product/view/gallery.phtml

    Here you can add your options:

    <script type="text/x-magento-init">
    {
        "[data-gallery-role=gallery-placeholder]": {
            "mage/gallery/gallery": {
                "mixins":["magnifier/magnify"],
                "magnifierOpts": <?php /* @escapeNotVerified */ echo $block->getMagnifier(); ?>,
                "data": <?php /* @escapeNotVerified */ echo $block->getGalleryImagesJson(); ?>,
                "options": {
                    "maxheight": "700", // Add your value here
               }
            }
        }
    }
    
    Login or Signup to reply.
  2. Check

    app/design/frontend/{package}/{theme}/template/catalog/product/view/media.phtml.

    If your theme is somehow similar with the default one you should find something like this:

    <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;"title="<?php echo $this->htmlEscape($_image->getLabel()) ?>">
    <img
       src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>"
       width="56"
       height="56"
       alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>"
       />
    </a>;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search