Magento: placing upsells on the product review page

Hi I have a custom template that I want to add upsells. I have successfully done this with related items, but I have problems with my upsells.

Here is my .xml directory:

<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>

It seems that it should be straightforward and work, but it is not.

I also remembered that I created upsell products;)

Any help that I value most

Billy

+3
source share
2 answers

Try moving

<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">

eg:

<catalog_product_view translate="label">
    <reference name="content">
        <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
                YOUR_BLOCK_HERE
+2
source

cross-image sales code on the watch page

if it is still not understood by anyone, they can see a snapshot of the image of the catalog.xml file in order to have a clear idea of โ€‹โ€‹where to add the code.

0

Source: https://habr.com/ru/post/1784048/


All Articles