Jump to content

[solved] How to remove the "More" to see more text for the categories description?


Recommended Posts

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

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!

  • Like 1
Link to comment
Share on other sites

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

  • Like 2
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

  • 6 months later...
  • 7 months later...
  • 3 months later...

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

×
×
  • Create New...