有没有办法呼应每个相关产品的简短描述?
我尝试使用此代码,但它不显示每个产品的描述:
<?php echo nl2br($this->getProduct()->getDescription()) ?>
还
<?php echo $_helper->productAttribute($_item, nl2br($_item->getShortDescription()), 'short_description') ?>
有没有办法为相关产品做到这一点?如果有人知道,请指出我正确的方向。
<?php if($this->getItems()->getSize()): ?>
<div class="block block-related">
<div class="block-title">
<strong><span><?php echo $this->__('Related Products') ?></span></strong>
</div>
<div class="block-content">
<p class="block-subtitle"><?php echo $this->__('Check items to add to the cart or add to your wishlist') ?> <br /></p>
<div class="form-horizontal">
<?php foreach($this->getItems() as $_item): ?>
<div class="control-group">
<label for="related-checkbox<?php echo $_item->getId() ?>" class="control-label">
<a class="fancybox static-thumbs pull-left" href="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(500, 450); ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" ><img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(135, 135) ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
</label>
<div class="controls">
<label class="checkbox">
<?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
<?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() ?>" />
<?php endif; ?>
<?php endif; ?>
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="pull-right" title="<?php echo $this->__('Add to Wishlist') ?>" rel="tooltip"><span class="icon-check"></span></a>
<p class="product-name span6">
<a href="<?php echo $_item->getProductUrl() ?>" class="product-title"><?php echo $this->htmlEscape($_item->getName()) ?></a>
<br />
<?php echo nl2br($this->getProduct($_item)->getDescription()) ?>
</p>
<form action="<?php echo $this->getAddToCartUrl($_item) ?>" method="post">
<fieldset>
<label class="product-name"><?php echo $this->__('Quantity:'); ?></label>
<select name="qty" class="span1">
<?php $i = 1 ?>
<?php do { ?>
<option value="<?php echo $i?>">
<?php echo $i?>
<?php $i++ ?>
</option>
<?php } while ($i <= (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_item)->getMaxSaleQty()) ?>
</select>
<div class="clearfix"></div>
<button class="btn btn-danger" data-loading-text="PLease wait..."><span><?php echo $this->__('Add to Cart') ?></span></button>
<span id='ajax_loader' style='display:none'><img src='<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif')?>'/></span>
</fieldset>
</form>
<?php endif; ?>
<?php echo $this->getPriceHtml($_item, true, '-related') ?>
</label>
</div>
</div>
<hr />
<?php endforeach ?>
</div>
</div>