Post by Univest » Thu Jan 12, 2012 11:47 pm

Hi guys

Im wondering how to limit the name of the product to for example 20 charachters and show ... at the end of the name.

how do I recode this to do the above for example:

<div class="productname_custom"><?php echo $product['name']; ?></div >

Thank you in advance

Newbie

Posts

Joined
Fri May 13, 2011 1:18 am

Post by OpenCart Addons » Fri Jan 13, 2012 12:43 am

Hey,

In catalog / controller / product / category.php
Find:

Code: Select all

'name'        => $result['name'],
Replace With:

Code: Select all

'name'        =>  substr($result['name'],0,20) . '&hellip;',

Cheers,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by Univest » Fri Jan 13, 2012 1:49 am

Thanks a lot Joel

Works like a charm! :-)

Cheers mate

Newbie

Posts

Joined
Fri May 13, 2011 1:18 am

Post by tingwing » Mon Aug 27, 2018 8:37 pm

for the product's name of latest,featured,special,bestseller module
go to /public_html/catalog/controller/extension/module/latest.php,featured.php,special.php,bestseller.php
find
'name' => $result['name'],

and change to
//'name' => $result['name'],
'name' => substr($result['name'],0,50) . '&hellip;',

my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com


Active Member

Posts

Joined
Tue Aug 02, 2016 9:01 pm
Who is online

Users browsing this forum: No registered users and 21 guests