Post by iplayitofflegit » Thu Mar 08, 2012 6:27 am

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?


Posts

Joined
Tue Dec 20, 2011 12:22 pm

Post by florinsith » Thu Mar 08, 2012 2:27 pm

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'],

Image
My Extensions - SuperTheme - Opencart templates - Opencart modules


User avatar
Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am


Post by iplayitofflegit » Fri Mar 09, 2012 7:55 am

Brilliant! It works! Thank you.


Posts

Joined
Tue Dec 20, 2011 12:22 pm

Post by speedy » Mon May 21, 2012 4:19 pm

Thumbs UP!!!! Bookmarked if my website messed up!

New member

Posts

Joined
Thu Jul 28, 2011 1:23 am
Who is online

Users browsing this forum: No registered users and 12 guests