In my product detail page, My product image can be Zoom/in and Popup(large image).

I only want product image to be "zoom/in" option.

How can I disable the popup image ?


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>

Focus on the popWin. That one opens the image in a new page.
Remove this link and insert your logic for zoom in the same file.

  • i removed those line, stil showing exactly the same window popup. – sorioff Sep 8 '14 at 7:58
  • Maybe you modified the wrong file. Enable template path hints to see what you need to modify: – Marius Sep 8 '14 at 7:59

To disable the popup of product image, etc/view.xml and change this code.

<var name="gallery">
    <var name="allowfullscreen">false</var> <!-- Turn on/off fullscreen (true/false) -->

Add this code in app\design\frontend\VENDOR\YOUR_THEME\etc\view.xml

<?xml version="1.0"?>

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <vars module="Magento_Catalog">
        <var name="gallery">
            <var name="allowfullscreen">false</var>

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.