0

I am working in the view.phtml file at the moment. In this file, I am using a custom .phtml file called product.info.phtml. I called it like this:

<?php echo $this->getChildHtml('product_additional_data') ?>

And in the local.xml I called the file like this:

<reference name="product.info.additional">
 <block type="core/template" template="custom/product.info.phtml" name="productInfoTabs" after="-"/>
</reference>

Which works just fine. In this file, I call the upsell.phtml file like this:

<?php echo $this->getChildHtml('upsell_products') ?>

But that doesn't work. If I call it in the view.phtml, it works. But when I call it in the product.info.phtml file, it fails to work.

Here is the code I am using inside the product.info.phtml file:

<dl class="product-collateral">
 <dt class="tab"><span>Test text</span></dt>
 <dd class="tab-container">
  <?php echo $_product->getInfo(); ?>
 </dd>
 <dt class="tab"><span>Test text</span></dt>
 <dd class="tab-container">
  <?php echo $_product->getService(); ?>
 </dd>
 <dt class="tab"><span>Test text</span></dt>
 <dd class="tab-container">
  <?php echo $_product->getInsurance(); ?>
 </dd>
 <dt class="tab"><span>Test text</span></dt>
 <dd class="tab-container">
  <?php echo $_product->getTerms(); ?>
 </dd>
 <?php echo $this->getChildHtml('upsell_products') ?>
</dl>

EXTRA INFO

I did not make this myself, someone else did. I am just here to solve the bug, so there might be missing some information

  • How did you call your product.info.phtml file. can you share that code too? – saravanavelu Sep 15 '16 at 12:16
  • Ofcourse, just a sec – Maarten Wolfsen Sep 15 '16 at 12:19
1

Try This

            <?php  echo $this->getLayout()->createBlock('catalog/product_list_upsell')->setTemplate('catalog/product/list/upsell.phtml')->toHtml();?>
  • I can't believe I forgot about that... Thanks so much! – Maarten Wolfsen Sep 15 '16 at 12:24
  • Hahaha, I will, but I couldn't at first. So I went doing something else first :p – Maarten Wolfsen Sep 15 '16 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.