Page 1 of 1

How Do I Add Descriptions to Related Tab in product.tpl?

Posted: Thu Mar 08, 2012 6:27 am
by iplayitofflegit
I would like to add the description for each product found in the related tab on the product page (product.tpl). How do I do this?

I attempted to add the following to line 327 in product.tpl inside the tab-related div for each product loop :

Code: Select all

 
<?php if ($product['description']) { ?>
        <div class="description"><?php echo $product['description']; ?></div>  
         <?php } ?>    
I get an undefined function error. I figure that description is not available wherever the tab-related functions are? Can someone help?

Re: How Do I Add Descriptions to Related Tab in product.tpl?

Posted: Thu Mar 08, 2012 2:27 pm
by florinsith
Besides that , you also need to edit the file catalog/controller/product/product.php and add the line

Code: Select all

					'description' => mb_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
below the line:

Code: Select all

					'name'    	 => $result['name'],

Re: How Do I Add Descriptions to Related Tab in product.tpl?

Posted: Fri Mar 09, 2012 7:55 am
by iplayitofflegit
Brilliant! It works! Thank you.

Re: How Do I Add Descriptions to Related Tab in product.tpl?

Posted: Mon May 21, 2012 4:19 pm
by speedy
Thumbs UP!!!! Bookmarked if my website messed up!