Magento: placing upsells in the product view page
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->get开发者_StackOverflow社区ChildHtml('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
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
cross sell code image on view page
if it still it not clear to any one they can see the above image snapshot of catalog.xml file to have a clear idea where to add the code.
精彩评论