我有所谓的自由航运自定义属性的Magento商店的顶部 眼下这使产品本身把图像放在另一个PHP和HTML
下方的免费送货图标,但我想让它通过在产品本身上放置一个新按钮更具吸引力。
下面是Magento的页面的PHP代码:
的页面是如何呈现的样例: http://www.theprinterdepo.com/lexmark-optra-t640-printer-20g0100
我需要修改代码gallery.phtml穿上顶部的图标产品,右上角。 我将修改图像为透明。
这是gallery.phtml文件:
<?php $_width=$this->getImageWidth() ?>
<div class="product-image-popup" style="width:<?php echo $_width; ?>px;">
<p class="a-right"><a href="#" onclick="window.close(); return false;"><?php echo $this->__('Close Window') ?></a></p>
<?php if($this->getPreviusImageUrl() || $this->getNextImageUrl()): ?>
<div class="nav">
<?php if($_prevUrl = $this->getPreviusImageUrl()): ?>
<a href="<?php echo $_prevUrl ?>">« <?php echo $this->__('Prev') ?></a>
<?php endif; ?>
<?php if($_nextUrl = $this->getNextImageUrl()): ?>
<a href="<?php echo $_nextUrl ?>"><?php echo $this->__('Next') ?> »</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if($_imageTitle = $this->htmlEscape($this->getCurrentImage()->getLabel())): ?>
<h1 class="image-label"><?php echo $_imageTitle ?></h1>
<?php endif; ?>
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $this->getImageFile()); ?>"<?php if($_width): ?> width="<?php echo $_width ?>"<?php endif; ?> alt="<?php echo $this->htmlEscape($this->getCurrentImage()->getLabel()) ?>" title="<?php echo $this->htmlEscape($this->getCurrentImage()->getLabel()) ?>" id="product-gallery-image" class="image" />
<?php if($this->getPreviusImageUrl() || $this->getNextImageUrl()): ?>
<div class="nav">
<?php if($_prevUrl = $this->getPreviusImageUrl()): ?>
<a href="<?php echo $_prevUrl ?>">« <?php echo $this->__('Prev') ?></a>
<?php endif; ?>
<?php if($_nextUrl = $this->getNextImageUrl()): ?>
<a href="<?php echo $_nextUrl ?>"><?php echo $this->__('Next') ?> »</a>
<?php endif; ?>
</div>
<?php endif; ?>
<p class="a-right"><a href="#" onclick="window.close(); return false;"><?php echo $this->__('Close Window') ?></a></p>
</div>
<script type="text/javascript">
//<![CDATA[
Event.observe(window, 'load', function(){
var demensions = $('product-gallery-image').getDimensions();
window.resizeTo(demensions.width+90, demensions.height+210);
});
//]]>
</script>
这是view.phtml
<?php $Deal = $_product->getResource()->getAttribute('deal')->getFrontend()->getValue($_product);?>
<?php $onSale = $_product->getResource()->getAttribute('on_sale')->getFrontend()->getValue($_product);?>
<?php $hotItem = $_product->getResource()->getAttribute('hot_item')->getFrontend()->getValue($_product);?>
<?php $freeShip = $_product->getResource()->getAttribute('free_shipping')->getFrontend()->getValue($_product);?>
<?php if($Deal == 'Yes'){ ?>
<img src="<?php echo $this->getSkinUrl('images/depot/icon-deal.gif') ?>" >
<?php } ?>
<?php if($onSale == 'Yes'){ ?>
<img src="<?php echo $this->getSkinUrl('images/depot/icon-sale.gif') ?>" >
<?php } ?>
<?php if($hotItem == 'Yes'){ ?>
<img src="<?php echo $this->getSkinUrl('images/depot/icon-hot.gif') ?>" >
<?php } ?>
<?php if($freeShip == 'Yes'){ ?>
<img src="<?php echo $this->getSkinUrl('images/depot/icon-freeship.gif') ?>" >
<?php }?>
[你尝试过什么(http://mattgemmell.com/2008/12/08/what-have-you-tried/),为什么没有它的工作?真正的问题是什么,“你能为我做好吗?” –
PHP =服务器端。你的问题是客户端大小,所以这与PHP无关。 –