Jump to content

Truncate function doesn't work as expected.


Recommended Posts

Hi guys!

I haven't found the fix to this issue for a month already and beg for your help. 

 

PrestaShop™ 1.5.6.2

 

The case is that the short description text in categories is not substituted by a longer description when clicking on the "Show more" link (+Больше in this example). Screenshot: http://prntscr.com/86jlgk

In fact, the link doesn't work at all and both descriptions show up at the same time, which is not correct, of course. Please have a look down this link: http://mebelmassiv.by/902-mebel-dlja-vannoj

 

I've checked the code responsible for this part of the page and found nothing special.

<!-- Category image -->
			{if $category->id_image}
			<div class="align_center category_image ">
				<img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage"  />
			</div>
			{/if}

		{/if}
        		{if $category->description}
			{if strlen($category->description) > 480}
				<p class="cat_desc clearfix" id="category_description_short">{$category->description|truncate:480} <span onclick="$('#category_description_short').hide(); $('#category_description_full').show();" class="lnk_more_cat"><i class="icon-plus-sign"></i> {l s='More'}</span></p>
			<p class="cat_desc clearfix" id="category_description_full" style="display:none">{$category->description}<span onclick="$('#category_description_short').show(); $('#category_description_full').hide();" class="lnk_more_cat close_cat"><i class="icon-minus-sign"></i> {l s='Hide'}</span></p>
			{else}
			<p class="cat_desc clearfix">{$category->description}</p>
			{/if}
        
            		{/if}
                        </div>
		{if isset($subcategories)}
		<!-- Subcategories -->

I also reset cache several times.

 

Have any ideas where else should I look?

Edited by reezah (see edit history)
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...