Nikki22 Posted January 23, 2012 Share Posted January 23, 2012 Hello all: I'm new here, and in the processing of setting up my PrestaShop for launch next month. Love the software, but I have a number of questions I'll be seeking help with over the next couple of weeks. For reference, I have extensive experience working with WordPress code, so I can handle fairly advanced issues and modifications. However, I don't consider myself a coder and I especially don't understand the ins and outs of how PrestaShop works. The Question: I would like to stop the truncation of item titles in the product list. (For example, when a users clicks on a category.) I have read on this forum that to do this, I just need to modify product_list.tpl in coremanager. However, I cannot find coremanager--has it been removed from the current version? I tried to go to: modules/coremanager/modules as direction, but it doesn't seem to exist. I did edit the product_list.tpl file in the theme directory, but it didn't affect any change on the item names. They were still truncated. Any help or advice on this is appreciated. - Nikki Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 23, 2012 Share Posted January 23, 2012 Hi Nikki, First of all, welcome to PrestaShop! As for your issue, can you post a screenshot of a spot on your site having this issue? Is it just the character limit or something beyond that? -Mike Link to comment Share on other sites More sharing options...
Nikki22 Posted January 23, 2012 Author Share Posted January 23, 2012 Hi Nikki, First of all, welcome to PrestaShop! As for your issue, can you post a screenshot of a spot on your site having this issue? Is it just the character limit or something beyond that? -Mike Hey Mike, thanks for the quick reply. I have attached a screenshot as requested. You'll see what I mean on the second item in the list, "Angel of Flight Alabaster." Whereas the other items with shorter titles feature the full name (including "Innistrad X/YZ), the case of "Angel of Flight," the title truncates because it exceeds the character limit. I did try modifying the character limit in the theme's product_list.tpl file, but it didn't make any change. Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 23, 2012 Share Posted January 23, 2012 Hi Nikki, In your theme's product-list.tpl file, locate the following line (should be around line 42 in v1.4.6.2) {$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} and increase the truncate value from 35 to whatever you would like it to be. Once you do so, please be sure to go to your Back Office under Preferences > Performance and turn on Force Compile turn off Caching to ensure that you are seeing the latest version of your updates. Please let me know if this works for you. -Mike 1 Link to comment Share on other sites More sharing options...
Nikki22 Posted January 23, 2012 Author Share Posted January 23, 2012 That fixed it. Thanks! I didn't understand about needing to Force Compile. I appreciate the help! I'm sure you'll be hearing more from me.... ;-) Link to comment Share on other sites More sharing options...
Mike Kranzler Posted January 23, 2012 Share Posted January 23, 2012 Great, I'm glad I could help! What Force Compile does is require the site to load from scratch each time rather than drawing from your browser cache. It's not recommended for a live environment because it will noticeably slow down your site, but when it comes to debugging or making changes, it's a huge time-saver. I'll go ahead and mark this thread as solved for you, and once again, welcome to PrestaShop! -Mike Link to comment Share on other sites More sharing options...
lgk49 Posted April 22, 2012 Share Posted April 22, 2012 Hi,Mike,It works. thanks. Link to comment Share on other sites More sharing options...
josal Posted November 16, 2012 Share Posted November 16, 2012 Hi, and do you know how to do the same but regarding the subcategory names? I've looked for something similar than truncate:... in the source code, concretely in /modules/productscategory/productscategory.tpl, but it doesn't change anything (with recompilation). {$categoryProduct.name|truncate:15:'...'|escape:'htmlall':'UTF-8'} Thanks in advance!! Link to comment Share on other sites More sharing options...
ienabellamy Posted February 18, 2014 Share Posted February 18, 2014 and do you know how to do the same but regarding the subcategory names? I've looked for something similar than truncate:... in the source code, concretely in /modules/productscategory/productscategory.tpl, but it doesn't change anything (with recompilation). {$categoryProduct.name|truncate:15:'...'|escape:'htmlall':'UTF-8'} Thanks in advance!! UP ! this is super interesting thing ! i tried also to check category.tpl : title="{$subcategory.name|escape:'htmlall':'UTF-8'}" >{$subcategory.name|escape:'htmlall':'UTF-8'}</a> but here no truncate appear..why ? i tried also to modify /modules/productscategory/productscategory.tpl ({$categoryProduct.name|truncate:15:'...'|escape:'htmlall':'UTF-8'}) but with no success ! (after deleting cache/ compile/ of course) needing help !! Link to comment Share on other sites More sharing options...
vipier Posted November 8, 2016 Share Posted November 8, 2016 Great, I'm glad I could help! What Force Compile does is require the site to load from scratch each time rather than drawing from your browser cache. It's not recommended for a live environment because it will noticeably slow down your site, but when it comes to debugging or making changes, it's a huge time-saver. I'll go ahead and mark this thread as solved for you, and once again, welcome to PrestaShop! -Mike Hello Mike, I know this is an old post, but I was wondering if you know if there's a way to have different truncate values for mobile? thanks!! Link to comment Share on other sites More sharing options...
itcfig Posted October 11, 2019 Share Posted October 11, 2019 I just found a way to NEVER truncate by just removing part of the code, changing part of the code of our friend Infor-All. 1. Go to /public_html/themes/YourTheme/templates/catalog/_partials/miniatures/product.tpl 2. Change <div class="product-description"> {block name='product_name'} {if $page.page_name == 'index'} <h3 class="h3 product-title" itemprop="name"><a href="{$product.canonical_url}">{$product.name|truncate:30:'...'}</a></h3> {else} <h2 class="h3 product-title" itemprop="name"><a href="{$product.canonical_url}">{$product.name|truncate:30:'...'}</a></h2> {/if} {/block} To: <div class="product-description"> {block name='product_name'} {if $product.name|count_characters > 35} {if $page.page_name == 'index'} <h3 class="h3 product-title" style="margin-top: -0.1rem;" itemprop="name"> <a href="{$product.url}">{$product.name}</a> </h3> {else} <h2 class="h3 product-title" style="margin-top: -0.1rem;" itemprop="name"> <a href="{$product.url}">{$product.name}</a> </h2> {/if} {else} {if $page.page_name == 'index'} <h3 class="h3 product-title" itemprop="name"> <a href="{$product.url}">{$product.name}</a> </h3> {else} <h2 class="h3 product-title" itemprop="name"> <a href="{$product.url}">{$product.name}</a> </h2> {/if} {/if} {/block} Basically I just removed the truncate, changing "{$product.name|truncate:30:'...'}" to "{$product.name}" Then Recompile your files (Advanced Parameters - Performance - Smarty Change "never recompile" to"recompile files", clear cache, change back to never recompile I use Prestashop 1.7.0 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now