please visit this link :
http://kidsdial.com/chair.html, you can see there is a zoom option on the products images
if we upload smaller images as like here :
http://kidsdial.com/microsoft-wireless-optical-mouse-5061.html
the product image is not zooming properly.
so i want to hide the zooming option for images with less than 400 * 400 pixels.
media.phtml => this may be the code for this : http://pastebin.com/gAwfdtw7
please help me to find solution.
thanks in advance.
1 Answer 1
Given your code pastebin.com/gAwfdtw7, here's what I'd do on line 59 :
replace
<a id="zoom-btn" rel="lightbox[em_lightbox]" href="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>" title="<?php echo $this->escapeHtml($this->getImageLabel());?>">Zoom</a>
with
<?php if($w < 400 && $h < 400): ?>
<a id="zoom-btn" rel="lightbox[em_lightbox]" href="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>" title="<?php echo $this->escapeHtml($this->getImageLabel());?>">Zoom</a>
<?php endif; ?>
If you read the code you give me, you'll see that $w is the width of the image and $h is its height.
Hope this helps.
-
hi, thanks a lot for reply. i followed your changes, but it's displaying like this : kidsdial.com/microsoft-wireless-optical-mouse-5062.html image is not properly zooming.[394 * 334 ] is the image size. so i want to hide the zooming. is there anything else i have to do for this..?... please help me to find solution. thanks in advanceBaby in Magento– Baby in Magento2015年01月09日 04:44:28 +00:00Commented Jan 9, 2015 at 4:44
-
1mmm :/ can you edit your question with the bit of code modified?Julien Lachal– Julien Lachal2015年01月09日 08:18:57 +00:00Commented Jan 9, 2015 at 8:18
-
hi, please visit this : pastebin.com/stapPArp please check line number : 60, 61 , 62 i changed only three lines. please tell me what else changes i have to do..?... or can you please reedit the entire code and post here.... thanks in advanceBaby in Magento– Baby in Magento2015年01月09日 09:15:37 +00:00Commented Jan 9, 2015 at 9:15
-
1just dump the values of $w and $h and see what's wrong.Julien Lachal– Julien Lachal2015年01月09日 09:20:14 +00:00Commented Jan 9, 2015 at 9:20
-
hi, i changed like this : <?php if($w < 100000 && $h < 100000): ?> <a id="zoom-btn" rel="lightbox[em_lightbox]" href="<?php echo $this->helper('catalog/image')->init($_product, 'image') ?>" title="<?php echo $this->escapeHtml($this->getImageLabel());?>">Zoom</a> <?php endif; ?> but zooming option is still there less pixels. what else i have to do..?...Baby in Magento– Baby in Magento2015年01月09日 09:26:04 +00:00Commented Jan 9, 2015 at 9:26
/template/catalog/product/view/media.phtmlunless you're using an extension to display the product images in which case it should stand in its respective folder.