papagino Posted October 8, 2012 Share Posted October 8, 2012 Hi, I am new here, I recently setup my shop and would like for a visitor to see all the description text (3 line max) under the categories without having to click on the "More" button. Please see here: http://www.miraxsupp...9-250ml-bottles (Some of my categories have only 2 lines description and when you click on the "More" botton, only one or two more words show up... Also, how can I see all of the product Name without the "..." on the main page? Please see example here: http://www.miraxsupplements.com/en/ Cheers Dan Link to comment Share on other sites More sharing options...
Soupyrik Posted October 9, 2012 Share Posted October 9, 2012 Hi, I am new here, I recently setup my shop and would like for a visitor to see all the description text (3 line max) under the categories without having to click on the "More" button. Please see here: http://www.miraxsupp...9-250ml-bottles (Some of my categories have only 2 lines description and when you click on the "More" botton, only one or two more words show up... Also, how can I see all of the product Name without the "..." on the main page? Please see example here: http://www.miraxsupplements.com/en/ Cheers Dan For the categories you could try replacing the following in your category.tpl file: {if $category->description} <div class="cat_desc"> <p>{$category->description}</p> <a href="#" class="lnk_more">{l s='More'}</a> </div> {/if} With {if $category->description} <div class="cat_desc"> <p>{$category->description}</p> </div> {/if} However, create a backup of this file as i'm not 100% sure. To do the product ... find the following in your product.tpl <span class="product_desc">{$product.description_short|truncate:360:'…'}</span> And you can either choose to change the Truncate value <span class="product_desc">{$product.description_short|truncate:480:'…'}</span> Or adjust the code replacing product.description_short <span class="product_desc">{$product.description}</span> That should do the trick! 1 Link to comment Share on other sites More sharing options...
papagino Posted October 9, 2012 Author Share Posted October 9, 2012 Thanks, forgot to mentioned that I have Prestashop version: 1.5.1.0. I figured how to fix the problem with the Categories description showing the "..." at the ends. Here are the actual lines that I changed in category.tpl in the default Theme. It was: {if $category->description} <div class="cat_desc"> {if strlen($category->description) > 120} <p id="category_description_short">{$category->description|truncate:120}</p> <p id="category_description_full" style="display:none">{$category->description}</p> <a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a> And I changed to {if $category->description} <div class="cat_desc"> {if strlen($category->description) > 300} <p id="category_description_short">{$category->description|truncate:300}</p> <p id="category_description_full" style="display:none">{$category->description}</p> <a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a> But I have yet to figure out how to fix the product name that shows "..." at the end on the home page or when viewing via a category tab or links. Any help would be appreciated. Cheers Dan 2 Link to comment Share on other sites More sharing options...
papagino Posted October 9, 2012 Author Share Posted October 9, 2012 Update: I fixed the product name showing "..." when viewing via a Category tab but still haven't figured out how to fix on the main "Featured products" page ;o(. Here's the line I modified under "product-list.tpl": Changed: <h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name| escape:'htmlall':'UTF-8'|truncate:35:'...'} to <h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name| escape:'htmlall':'UTF-8'|truncate:55:'...'} Still have to fix the problem with "Featured products" page showing "..." on certain product names. Any help would be appreciated. Cheers Dan 1 Link to comment Share on other sites More sharing options...
tekkon Posted April 11, 2013 Share Posted April 11, 2013 Thanks for this it works perfectly! Link to comment Share on other sites More sharing options...
vekia Posted April 11, 2013 Share Posted April 11, 2013 now i can mark this thread as solved thanks for solutions and information that everything works fine Link to comment Share on other sites More sharing options...
totallighting.sk Posted November 27, 2013 Share Posted November 27, 2013 Just setup: {if $category->description} <div class="cat_desc"> {if strlen($category->description) > 10000} <p id="category_description_short">{$category->description|truncate:10000}</p> And u will see only full description... Link to comment Share on other sites More sharing options...
kadapawn Posted March 11, 2014 Share Posted March 11, 2014 any ideea on how to add read more to full product description? Link to comment Share on other sites More sharing options...
vekia Posted March 11, 2014 Share Posted March 11, 2014 any ideea on how to add read more to full product description? you mean that you just want to add button? Link to comment Share on other sites More sharing options...
kadapawn Posted March 11, 2014 Share Posted March 11, 2014 to be more exact, i want to add a truncate the long description after the 3000 characters so then i can have a "read more" I've manage to add the truncate, but when i add the "read more" code, the link in front-end is not working... i know is not correct, but as i am not a programer i try to do my best. here is the code this is mod.code <div id="idTab1" class="rte content_hide_show" data-animate="fadeInDown" data-delay="200">{$product->description | truncate:3000}</div> <a href="#" onclick="$('#product_description').hide(); $('#product_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a> this is the original code {if $product->description}<div class="title_hide_show" style="display:none">{l s='More info'}</div>{/if} {if isset($product) && $product->description} <!-- full description --> <div id="idTab1" class="rte content_hide_show" data-animate="fadeInDown" data-delay="200">{$product->description}</div> {/if} and this is the link of the website Link to comment Share on other sites More sharing options...
Recommended Posts