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 ?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityCheck 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.
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) -->
</var>
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>
</var>
</vars>
</view>