Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd two different blocks on same tab magento
    text
    copied!<p>I need to add two different blocks on same tab for product description on magento, what is the best way to achieve this?</p> <p>in my catalog.xml I have this:</p> <pre><code> &lt;block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" &gt; &lt;action method="addTab" translate="title" module="catalog"&gt;&lt;alias&gt;description&lt;/alias&gt;&lt;title&gt;Product Description&lt;/title&gt;&lt;block&gt;catalog/product_view_description&lt;/block&gt;&lt;template&gt;catalog/product/view/description.phtml&lt;/template&gt;&lt;/action&gt; &lt;action method="addTab" translate="title" module="catalog"&gt;&lt;alias&gt;upsell_products&lt;/alias&gt;&lt;title&gt;We Also Recommend&lt;/title&gt;&lt;block&gt;catalog/product_list_upsell&lt;/block&gt;&lt;template&gt;catalog/product/list/upsell.phtml&lt;/template&gt;&lt;/action&gt; &lt;action method="addTab" translate="title" module="catalog"&gt;&lt;alias&gt;additional&lt;/alias&gt;&lt;title&gt;Additional Information&lt;/title&gt;&lt;block&gt;catalog/product_view_attributes&lt;/block&gt;&lt;template&gt;catalog/product/view/attributes.phtml&lt;/template&gt;&lt;/action&gt; &lt;/block&gt; </code></pre> <p>I need the upsell block below the description on the same tab. Thanks!</p> <p>EDIT: added content of upsell.phtml</p> <pre><code>&lt;?php if(count($this-&gt;getItemCollection()-&gt;getItems())): ?&gt; &lt;div class="box-collateral box-up-sell"&gt; &lt;h2&gt;&lt;?php echo $this-&gt;__('You may also be interested in the following product(s)') ?&gt;&lt;/h2&gt; &lt;table class="mini-products-grid" id="upsell-product-table"&gt; &lt;?php // $this-&gt;setColumnCount(5); // uncomment this line if you want to have another number of columns. also can be changed in layout ?&gt; &lt;?php $this-&gt;resetItemsIterator() ?&gt; &lt;?php for($_i=0;$_i&lt;$this-&gt;getRowCount();$_i++): ?&gt; &lt;tr&gt; &lt;?php for($_j=0;$_j&lt;$this-&gt;getColumnCount();$_j++): ?&gt; &lt;?php if($_link=$this-&gt;getIterableItem()): ?&gt; &lt;td&gt; &lt;a href="&lt;?php echo $_link-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_link-&gt;getName()) ?&gt;" class="product-image"&gt;&lt;img src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_link, 'small_image')-&gt;resize(125) ?&gt;" width="125" height="125" alt="&lt;?php echo $this-&gt;htmlEscape($_link-&gt;getName()) ?&gt;" /&gt;&lt;/a&gt; &lt;h3 class="product-name"&gt;&lt;a href="&lt;?php echo $_link-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_link-&gt;getName()) ?&gt;"&gt;&lt;?php echo $this-&gt;htmlEscape($_link-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/h3&gt; &lt;?php echo $this-&gt;getPriceHtml($_link, true, '-upsell') ?&gt; &lt;?php echo $this-&gt;getReviewsSummaryHtml($_link) ?&gt; &lt;/td&gt; &lt;?php else: ?&gt; &lt;td class="empty"&gt;&amp;nbsp;&lt;/td&gt; &lt;?php endif; ?&gt; &lt;?php endfor; ?&gt; &lt;/tr&gt; &lt;?php endfor; ?&gt; &lt;/table&gt; &lt;script type="text/javascript"&gt;decorateTable('upsell-product-table')&lt;/script&gt; &lt;/div&gt; &lt;?php endif ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload