Magento从产品图像中删除缩放
我不是很熟悉Magento,我需要从产品图像中删除缩放效果。 这是模板目录中/catalog/product/view/media.phtml中的代码 我试图玩弄if-else语句,但似乎我遗漏了一些东西,因为我遇到了错误 有谁更熟悉这个吗? 非常感谢Magento从产品图像中删除缩放,magento,zooming,Magento,Zooming,我不是很熟悉Magento,我需要从产品图像中删除缩放效果。 这是模板目录中/catalog/product/view/media.phtml中的代码 我试图玩弄if-else语句,但似乎我遗漏了一些东西,因为我遇到了错误 有谁更熟悉这个吗? 非常感谢 <div class="product-image"> <?php if ($scrollStatus): ?> <div id="jp-container" class="jp-container"
<div class="product-image">
<?php if ($scrollStatus): ?>
<div id="jp-container" class="jp-container" style="height:500px;">
<a href="javascript:void(0);"><?php
$_img = '<img src="'.$helpImg->getImg($_product, 'image', $imgSize, null).'" alt="'.$this->escapeHtml($this->getImageLabel()).'" title="'.$this->escapeHtml($this->getImageLabel()).'" />';
echo $_img;
?></a>
<?php foreach ($this->getGalleryImages() as $_image): ?>
<a href="javascript:void(0);" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
<?php endforeach; ?>
</div>
<script type="text/javascript">
jQuery(window).load(function(){
function jspaneStart(){
setTimeout(function(){
maxHeight = 0;
jQuery('#jp-container a').each(function(){
if(jQuery(this).height() > maxHeight){
maxHeight = jQuery(this).height();
}
});
maxHeight = maxHeight+(maxHeight/100)*<?php echo $scrollimagesHeight; ?>;
jQuery('#jp-container').css('height', maxHeight);
jQuery('#jp-container').jScrollPane();
}, 500);
}
jspaneStart();
jQuery(window).resize(function(){
jspaneStart();
});
});
</script>
<?php else: ?>
<a id='zoom' class="cloud-zoom" data-zoom="showTitle: false, adjustX: -5, adjustY:-5, tint: '#fff', tintOpacity:0.6, position:'inside'" href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>"><?php
$_img = '<img id="image" src="'.$helpImg->getImg($_product, 'image', $imgSize, null).'" alt="'.$this->escapeHtml($this->getImageLabel()).'" title="'.$this->escapeHtml($this->getImageLabel()).'" />';
echo $_helper->productAttribute($_product, $_img, 'image');
?></a>
<?php /* Label New */ echo MAGE::helper('ThemeOptionsMinimalism')->getProductLabels($_product); ?>
<?php if (count($this->getGalleryImages()) > 0): ?>
<div class="more-views-container">
<div class="more-views<?php if ($productpage_moreviews == 'moreviews_slider' && count($this->getGalleryImages()) > 3){echo ' slider-on';} ?>">
<h2><?php echo $this->__('More Views') ?></h2>
<?php if ($productpage_moreviews == 'moreviews_slider' && count($this->getGalleryImages()) > 3): ?>
<div id="more-views-slider" class="es-carousel-wrapper">
<ul class="carousel-ul">
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li>
<a class='cloud-zoom-gallery' data-zoom="useZoom: 'zoom', smallImage: '<?php echo $helpImg->getImg($_product, 'thumbnail', $imgSize, null, $_image->getFile()); ?>' " href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img <?php echo $helpImg->getImgSources($_product, 'thumbnail', 200, null, $_image->getFile()); ?> alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class = 'next'><i class="fa fa-angle-right"></i></div>
<div class = 'prev unselectable'><i class="fa fa-angle-left"></i></div>
<?php else: ?>
<ul class="no-slider">
<?php foreach ($this->getGalleryImages() as $_image): ?>
<li>
<a class='cloud-zoom-gallery' data-zoom="useZoom: 'zoom', smallImage: '<?php echo $helpImg->getImg($_product, 'thumbnail', $imgSize, null, $_image->getFile()); ?>' " href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img <?php echo $helpImg->getImgSources($_product, 'thumbnail', 200, null, $_image->getFile()); ?> alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->displayProductStockStatus()): ?>
<?php if ($_product->isAvailable()): ?>
<p class="availability in-stock"><i class="fa fa-check"></i><?php echo $this->__('In stock') ?></p>
<?php else: ?>
<p class="availability out-of-stock"><i class="fa fa-times"></i><?php echo $this->__('Out of stock') ?></p>
<?php endif; ?>
<?php endif; ?>
</div>
jQuery(window).load(函数(){
函数jspaneStart(){
setTimeout(函数(){
最大高度=0;
jQuery('#jp container a')。每个(函数(){
if(jQuery(this).height()>maxHeight){
maxHeight=jQuery(this).height();
}
});
maxHeight=maxHeight+(maxHeight/100)*;
jQuery('#jp container').css('height',maxHeight);
jQuery('#jp container').jScrollPane();
}, 500);
}
jspaneStart();
jQuery(窗口).resize(函数(){
jspaneStart();
});
});
您可以禁用magento js的缩放功能。
只需找到这个文件js\varien\product.js并注释这一行
Event.observe(this.imageEl, 'dblclick', this.toggleFull.bind(this));
默认情况下,此行负责图像缩放。转到管理
,然后转到系统->配置
。然后转到管理->高级->禁用模块输出->电子商务团队云缩放->禁用
。单击保存Config
然后去
System -> Configuration ->Catalog
在下一页的云图像缩放
下,您将找到配置模块的选项列表。
启用云缩放
–当选择了否
时,该选项将禁用产品图像中的云缩放
完成后,单击右上角的“保存配置”
。您始终可以尝试通过app/etc/modules中的模块xml文件完全禁用模块
与缩放模块相关的xml文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<module_name>
<active>true</active>
<codePool>community</codePool>
</module_name>
</modules>
</config>
真的
社区
只需将active设置为false这个答案对我很有用:
将JS添加到主题的media.phtml中
// ProductMediaManager is outside document.read scope
if (typeof ProductMediaManager !== 'undefined') {
// Override image zoom in /skin/frontend/rwd/default/js/app.js
// and prevent the zooming of images on hover
ProductMediaManager.createZoom = function(image) { return; }
}
我已经找到了答案
感谢“Patrick Ward”提供了出色而简单的解决方案……您使用的是magento默认缩放还是任何其他扩展?这段代码是在magento clean Version上测试的。我没有使用默认的magento主题,这是我的主题()我很确定可以在上面的附加代码中完成修复,但是无论我尝试了什么,我都会出错。这也删除了此事件下面的行。感谢Anju的帮助,但这在我这方面不起作用(没有电子商务Team_CloudZoom in Advanced),System Conf Catalog中也有同样的内容,但感谢您在任何情况下的帮助:)在配置下的管理员中是否有任何与云缩放相关的内容?请在管理员中检查。系统->配置/主题选项/产品页面/使用产品图像缩放浏览,无需:(不用担心,不会让您忙,谢谢您的帮助:)