1.在Magento产品详细页中有时需要把SKU号调出来的方法:
[php]<?php echo $this->htmlEscape($_product->getSku()) ?>[/php]
2.Magento的产品属性,在catalog.xml中已经写进去了.你可以在product view中找到
[php]
<block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
[/php]
现在只要在产品详细页(view.phtml)中想要的位置插入
[php]<?php echo $this->getChildHtml(‘additional’) ?>[/php]
3.产品描述显示细节图
模板template\catalog\product\view\description.phtml中
找到[php]<?php echo $this->helper(‘catalog/output’)->productAttribute($this->getProduct(), $_description, ‘description’) ?>[/php]
在后面添加以下代码
[php]
<?php if(count($this->getProduct()->getMediaGalleryImages()) > 0): ?>
<ul>
<?php foreach ($this->getProduct()->getMediaGalleryImages() as $_image): ?>
<li>
<img src="<?php echo $this->helper(‘catalog/image’)->init($this->getProduct(), ‘thumbnail’, $_image->getFile())->resize(600); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" />
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
[/php]
发表评论