Post by liamteystee » Mon Sep 05, 2011 11:51 pm

Is it possible to use a code like this $product['price'] in the featured products template (featured.tpl) so that it displays the description along with the price and title of the product.

I've tried using this function but it comes up with a fatal error. I'm sure that there must be a simple solution to my problem.

Helps much appreciated.
liamteystee

New member

Posts

Joined
Thu Aug 11, 2011 11:27 am

Post by florinsith » Tue Sep 06, 2011 1:12 am

Yes it is. But first you need to to modify the controller of the featured products.

Open catalog/controller/module/featured.php

After the line:
'name' => $product_info['name'],
Add the following line
'description' => substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
You can modify it's size by raisng the number of characters (as you see now is 100).

Image
My Extensions - SuperTheme - Opencart templates - Opencart modules


User avatar
Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am


Post by liamteystee » Tue Sep 06, 2011 8:10 am

Thanks alot!

New member

Posts

Joined
Thu Aug 11, 2011 11:27 am
Who is online

Users browsing this forum: Bing [Bot] and 24 guests