Jump to content

[SOLVED] How to change the amount of displayed characters for item titles?


Recommended Posts

This is probably very simple and I haven't spent too much time attempting to figure it out but I figured someone could quickly point me in the right direction as I've been really busy with other aspects of this business.

 

What I would like is for the complete title to display or at least more of the title than currently displayed before displaying "..."

 

Example - http://www.mygearmon...4-acoustic-kits

 

As you can see it displays "TAYE DRUMS STUDIO MAPLE BEBOP...

"

rather than the complete title of "TAYE DRUMS STUDIO MAPLE BEBOP 4-PIECE SHELL PACK - WHITE PEARL"

 

How to fix? I appreciate the time of anyone willing to help!

Link to comment
Share on other sites

You can do this by making a minor modification to the product-list.tpl file for the theme that you use. To find the file go to the root PrestaShop folder on your hosting account, then to themes/your-current-theme/product-list.tpl. Open the file to edit it and find the following string of code:

 

{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}

 

Increase the number 35 that's after truncate to a higher one. For example:

 

{$product.name|truncate:100:'...'|escape:'htmlall':'UTF-8'}

 

When you edit template files, in order to be able to see the change on the frontend, you also have to enable the Force Compile option. You can do this from the back office (Preferences tab>Performance sub-tab). After you make the change and you're satisfied with the result on the frontend, be sure to disable the force compile option because enabling it will slow down your site significantly.

 

Hope this helps.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...