Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: placing upsells in the product view page

Tags:

php

magento

Hi I have a custom template that I want to add upsells into. I've successfully done it with related items but am having trouble with my upsells.

Here's my catalog.xml:

<catalog_product_view translate="label">
...
...
<reference name="content">
...
...

<block type="catalog/product_list_related" name="catalog.product.related" template="catalog/product/list/related.phtml"/>

<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
      <action method="setColumnCount"><columns>4</columns></action>
      <action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
</block>

And here is my view.phtml file:

<div id="tabs-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom" style="">
     <?php echo $this->getChildHtml('catalog.product.related'); ?>
</div>


<div id="tabs-2" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" style="">
     <?php echo $this->getChildHtml('upsell_products'); ?>
</div>

This seems as though it should be straight forward and work but it hasn't.

I've also remembered to create upsell products ;)

Any help most appreciated,

Billy

like image 450
iamjonesy Avatar asked Jan 25 '26 09:01

iamjonesy


1 Answers

Try to move

<block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
      <action method="setColumnCount"><columns>4</columns></action>
      <action method="setItemLimit"><type>upsell</type><limit>4</limit></action>
</block>

inside

<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

for example:

<catalog_product_view translate="label">
    <reference name="content">
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
                YOUR_BLOCK_HERE
like image 110
Pawel Wodzicki Avatar answered Jan 27 '26 21:01

Pawel Wodzicki