我正在使用此代码在页面上显示相关产品
<?php
$product_id = Mage::registry('current_product')->getId();
$_product=Mage::getModel('catalog/product')->load($product_id);
$related_prods = $_product->getRelatedProductIds(); ?>
<div class="scroll-pane" style="height:350px;">
<ol class="mini-products-list " id="block-related">
<?php foreach($related_prods as $related):
$_item = Mage::getModel('catalog/product')->load($related); ?>
<li class="item">
<div class="product">
<a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(84, 81) ?>" width="84" height="81" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
<div class="product-details">
<p class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo strip_tags(substr($this->htmlEscape($_item->getName()), 0, 30).'...') ?></a></p>
<div class="releted-product-price">
<?php echo $this->getPriceHtml($_item, true,'-related') ?>
</div>
</div>
</div>
<?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
<?php endif; ?>
<?php if (!$_item->getRequiredOptions()): ?>
<input type="checkbox" class="checkbox related-checkbox" id="related-checkbox<?php echo $_item->getId() ?>" name="related_products[]" value="<?php echo $_item->getId() ?>" />
<label class="rel-label"><?php echo $this->__('Add to Cart') ?></label>
<?php endif; ?>
</li>
<?php endforeach ?>
</ol>
</div> ?>
但是产品来了,但当我有该产品的价格代码时,它的价格没有显示。
<?php echo $this->getPriceHtml($_item, true,'-related') ?>
但它没有显示价格。请帮我解决我的问题。