我需要在同一选项卡上为 magento 上的产品描述添加两个不同的块,实现此目的的最佳方法是什么?
在我的 catalog.xml 我有这个:
<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
<action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>upsell_products</alias><title>We Also Recommend</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
</block>
我需要同一选项卡上描述下方的追加销售块。谢谢!
编辑:添加 upsell.phtml 的内容
<?php if(count($this->getItemCollection()->getItems())): ?>
<div class="box-collateral box-up-sell">
<h2><?php echo $this->__('You may also be interested in the following product(s)') ?></h2>
<table class="mini-products-grid" id="upsell-product-table">
<?php // $this->setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?>
<?php $this->resetItemsIterator() ?>
<?php for($_i=0;$_i<$this->getRowCount();$_i++): ?>
<tr>
<?php for($_j=0;$_j<$this->getColumnCount();$_j++): ?>
<?php if($_link=$this->getIterableItem()): ?>
<td>
<a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_link, 'small_image')->resize(125) ?>" width="125" height="125" alt="<?php echo $this->htmlEscape($_link->getName()) ?>" /></a>
<h3 class="product-name"><a href="<?php echo $_link->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_link->getName()) ?>"><?php echo $this->htmlEscape($_link->getName()) ?></a></h3>
<?php echo $this->getPriceHtml($_link, true, '-upsell') ?>
<?php echo $this->getReviewsSummaryHtml($_link) ?>
</td>
<?php else: ?>
<td class="empty"> </td>
<?php endif; ?>
<?php endfor; ?>
</tr>
<?php endfor; ?>
</table>
<script type="text/javascript">decorateTable('upsell-product-table')</script>
</div>
<?php endif ?>