Jump to content

Info regarding group description


Recommended Posts

Hi all...

 

I wasn't really sure where to post this - it's just a "heads-up". I'm new to prestashop and therefore encounters a lot of "abnormalities" (which are propably normalities afterall) but one thing that was bothering me was:
When creating or editing a group.. the description (which is important in my shop) was "repeating" itself.
By that i mean - not all of it - just the few first words.

It seemed fine in the BO editor and the HTML - but "Live" the first few words was repeated on 2 lines.

 

The decription started with:
"It's important to choose the correct cables - or the installation may damage your vehicle"

 

"Live" it looked like this:

 

It's important....

 

It's important to choose the correct cables - or the installation may damage your vehicle"

 

After a few trials and errors (newbie way of solving problems) i realised that the empty META description was causing this. After i entered a value in the META-fiels -Puff... repetition was gone.

 

I couldn't find anything online describing the problem and it's solution so i thought i'd better share it :o)

 

Have a great day and best regards from Denmark :o)

  • Like 2
Link to comment
Share on other sites

Leave it to the great and wise Danes! 

 

A huge thank you for sharing that.  I was having the same, very frustrating result.

 

I definitely think this is a bug but I am happy to know there is a work around.

 

16 thumbs up man!

 

Brian

 

[edit: okay, I added some text to just the meta description. That did not solve the problem! :(   Should I add text to all the meta fields?

Edited by surferboy (see edit history)
Link to comment
Share on other sites

Leave it to the great and wise Danes! 

 

A huge thank you for sharing that.  I was having the same, very frustrating result.

 

I definitely think this is a bug but I am happy to know there is a work around.

 

16 thumbs up man!

 

Brian

 

[edit: okay, I added some text to just the meta description. That did not solve the problem! :(   Should I add text to all the meta fields?

Sorry to say it man.... the problem is "back".

Allthough i have 1 group with perfect description - the one i created today has the same annoying problem. Regardless of the META-descriptions.

 

But to answer your question - yes - i had to fill in all the "blanks" in META-fields.

Edited by digitallife (see edit history)
Link to comment
Share on other sites

Sorry to say it man.... the problem is "back".

Allthough i have 1 group with perfect description - the one i created today has the same annoying problem. Regardless of the META-descriptions.

 

But to answer your question - yes - i had to fill in all the "blanks" in META-fields.

And an update... it seems to be som sort of formatting problem. If i copy the text (cmd C) and simply past it into a new group - everything is fine. I can change the text - still fine. But if i delete the text i just copied - and write something new. Tadaaa... repetition of the first few words are back... what!!!

 

I'm pretty sure this must be a bug of some sort and not just my lack of skills... was hoping for the last one though :)

Link to comment
Share on other sites

And an update... it seems to be som sort of formatting problem. If i copy the text (cmd C) and simply past it into a new group - everything is fine. I can change the text - still fine. But if i delete the text i just copied - and write something new. Tadaaa... repetition of the first few words are back... what!!!

 

I'm pretty sure this must be a bug of some sort and not just my lack of skills... was hoping for the last one though :)

Allright.. had to find a workaround since it seems like there's no "real" solution...

After writing the description - saving it - checking that it's been "repeated" on the FO. Just copy the text - from the FO - paste it into (and overwrite) the description... And voila... it's not repeated anymore. I've done this with 3 groups now and it seems to worl everytime ;)

Link to comment
Share on other sites

Whoops, looks like it only works if you have no carriage returns.  It was working for everything but on the next category, I had two sentences and then a carriage return and then another sentence.

 

When I copied and pasted that from the Front Office to the Back Office, I am back to the double repeating!  :(

 

Wow, this is such a bug.

Link to comment
Share on other sites

Hi Digitallife, Surferboy,

 

 

"Live" it looked like this:

 

It's important....

 

It's important to choose the correct cables - or the installation may damage your vehicle"

 

 

 

Probably a new Prestashop 'feature': Semantics . It knows you can't say this often enough... ;-)

 

First a quick check: With 'groups', do you mean categories?

Do you have a link to a page where it goes wrong? It may be easier to debug if we can see the problem occur.

 

Just a wild guess: Can you check if the ones that go wrong have a " (double quote) or a ' (single quote) character in the text?

If so, can you

1)remove the all the ' (quotes) in the text, and see if that fixes it for that one?

2) if not, also delete any " (double quotes) and see if that fixes it for that one? 

 

If so, It may be a php setting...

 

My 2 cents,

pascal

Link to comment
Share on other sites

Hi Pascal,

 

Sending you a PM with our site's url.  Prefer not to have it listed publicly here.

 

In my posts, I do hope I always used the word 'categories.'  This is an issue with category description. 

 

I tend to be overly wordy and you can see, by clicking on the categories, that I like to be descriptive and start new paragraphs at the drop of a pin.

 

If you click on the category that says 'Headgear,' you will see (2) paragraphs.  I did have a single quote character in the second paragraph, and I removed it to see if that might help. Nope!

 

There are two issues from my vantage point:

 

#1 - Even with the copy and paste suggested by the Most Excellent Dane, and even though in the subcategory for Shirts, in the Women's Cut tshirt, the category description does not repeat itself, you still see the blue letters below that read "more."

 

#2 - With or without the single apostrophe characters, I still have the double category description if I hit a carriage return and create a second paragraph.

 

Thank you so much for trying to sort this out, and hopefully passing this issue along to the developers. 

 

Brian

Link to comment
Share on other sites

Hi Digitallife, Surferboy,

 

 

Probably a new Prestashop 'feature': Semantics . It knows you can't say this often enough... ;-)

 

First a quick check: With 'groups', do you mean categories?

Do you have a link to a page where it goes wrong? It may be easier to debug if we can see the problem occur.

 

Just a wild guess: Can you check if the ones that go wrong have a " (double quote) or a ' (single quote) character in the text?

If so, can you

1)remove the all the ' (quotes) in the text, and see if that fixes it for that one?

2) if not, also delete any " (double quotes) and see if that fixes it for that one? 

 

If so, It may be a php setting...

 

My 2 cents,

pascal

Here's a URL : Parrotshoppen.dk - Bærbar lyd

 

I just tested again... when first creating the "category" (yes your'e right - that's the name - damn translations ;)) - it seems fine. BUT...when i change the font size to e.g. 8px - THAT'S when it goes wrong.

I also tried with and without "qoutes" - doesn't matter. Works right until the change of font.

 

Thanx for taking your time to look into this ;)

Edited by digitallife (see edit history)
Link to comment
Share on other sites

Yeah I have to agree with @digitallife.  All of this happens when you change the font size.  I didn't even realize what was going on until I realized one of our category descriptions had smaller font (default) and it looked fine.  But as soon as I changed the font to what I would describe as our site's standard,  instant duplication of the category description.

Link to comment
Share on other sites

OK, to fix this, we comment-out some code:

 

login to your host. then (with FTP or cPanel->File manager):

edit the file: themes/<your theme folder>/category.tpl   (make BACKUP first!):

 

here you see the code: (about 1 screen down from the top)

			{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>
				{else}
*}
					<p>{$category->description}</p>
{*
				{/if}   
*}
				</div>
			{/if}

and add the {* ....code... *}  (2x)

 

save the file and reload your category page.

 

N.B. You may need to (TEMPORARILY!!): 

- turn OFF your cache and

- 'Template cache' set to "Recompile templates if the files have been updated"

in Advanced Parameters->Performance

to see the changes. (Don't forget to turn cache back ON afterwards!)

 

 

What it does:

It takes out some silly code that truncates the description of your category if it is very long. It let's the user then click on the text to see the whole description. Apparently this gives problems when using layout-decoration code like font size etc.

So let's just take the code out and always present the whole description from the beginning.

 

Hope this helps,

pascal

 

 

EDIT: Nadie posted a real fix, with keeping this 'truncation' intact in post number 15.

In short, change <p... into <div...

See here:

http://www.prestashop.com/forums/topic/273022-info-regarding-group-description/?view=findpost&p=1401600

 

Thanks Nadie for the update!

 

EDIT 2: Nadie's suggested solution may need some CSS modification, to solve some wrapping in the new div's

  • Like 3
Link to comment
Share on other sites

Hi Pascal,

 

I started to do what you said, and of course, I made a mistake with the commenting.  So I undid the code changes but then I started to reread the code.  The 'if' statement basically says that if the description in the category is greater than 120 characters, then create a short description that is truncated to 120 characters and then display the full description with a 'More' link. 

 

The only problem is the way the code seems to have a bug which still displays the full description directly below. 

 

So all I did was just change the code to a larger number of characters in the if statement (for my purposes, I changed it to 1200 characters). 

 

That solved everything instantly.

 

Either way, this is a workaround and there is still a BUG (hello developers ... attention attention attention ...).  I know, they have many bug reports and they will get to it but it would be great if they could post a temporary fix in this topic! :huh:

 

Brian

  • Like 2
Link to comment
Share on other sites

Hi Surferboy,

Changing the number to something high is also a possibility, but it's just moving the problem. My 'solution' eliminates it, by just taking away the cause.

 

Either way will work, as long as you take the number high enough, so that you never reach the amount of characters in your description.

 

pascal

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

well, I've tried everything on this thread and it's sure not working for me...

 

1) I tried changing the <p> tags to <div>  - nope.

 

2) I tried commenting out the code (2x)  - nope

 

3) I increased the truncation from 120 to 1200 (2x) - nope.

 

and I've turned off the Smary cache and re-enabled it each time.

 

Now, prestashop is throwing (3) errors regarding Smary cache. It says I need to install Memcached, APC PECL and Xcache...

 

All this just to get my category descriptions from repeating and adding a "More" link?

 

Here's the way the code looks now:

 

{if $category->description}
 
<div class="cat_desc">
{if strlen($category->description) > 1200}
<div id="category_description_short">{$category->description|truncate:1200}</div>
<div id="category_description_full" style="display:none">{$category->description}</div>
<a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
 
{else}
 
<div>{$category->description}</div>
 
 
very frustrating.
  • Like 2
Link to comment
Share on other sites

well at least I [sOLVED] the caching errors... (this comes under the doh! heading)

 

at the bottom of the Advanced Parameters>Performance page is a dropdown that includes Memcached, APC, Xcache and File System. By selecting File System (instead of the Memcached default) the errors were all cleared.

 

Now, Bluehost has told me this wouldn't work on a VPS. So if your site is hosted on a dedicated server you probably need to install the php repository extensions. But for my purposes, on a shared server, "File System" fixed the problem.

 

Now all I need to do is get rid of that duplicating text!  grrrrrrrrrrr....

 

 

Link to comment
Share on other sites

Hi Andrea,

 

About the smarty cache. Just turn it off while testing your shop.

About the file system cache. Just turn it off while testing your shop.

In Advanced Preferences ->Performance, set

- 'Template cache' set to "Recompile templates if the files have been updated"

- go to your files and go inside the /cache folder. there you will see a file class_index.php Rename this file to class_indexBACKUP.php

- Try one more time to change the <p into <div in the file themes/<your theme folder>/category.tpl

 

then go again to your shop and try to show the category page again. Any better?

 

If all this doesn't help:

did you have a look at my alternative 'solution', by just taking out the ... feature. It will then always show the full category description.

Will that work for you??

 

Make sure you edit the file in your theme folder!

so, in /themes/<your theme folder>/category.tpl

 

Let us know if it works.

 

pascal

 

P.S.:

- What PrestaShop version do you use?

- Do you have a link to your shop?

  • Like 1
Link to comment
Share on other sites

It worked!!! OMG, thank you for taking the time to explain it!  [sOLVED] [sOLVED]

 

All the time I was in the themes>default folder - not the themes>youtheme> folder. The previous posts all mentioned the "default" folder. So I assumed I had to make changes to that folder which would somehow be inherited by mytheme.

 

You just made my week  :)

 

Thanks, PrestaShop Fanatic!!


(you rock, Pascal)  :)

Link to comment
Share on other sites

well... I thought it fixed the problem but the duplicate text is still there. It just looked like it was fixed because I changed the length of the description to 1200. So I had 2 large, duplicate descriptions instead a short one at the top.

 

The <div> tags were also causing the text to wrap around my header images (no matter how wide I made them). So I reverted back to <p> tags.

 

The problem, I think, is the annoying "More" and "Hide" onclick events. Can I just delete the whole if/else statement? I really just want a single description - however long - under each category. No links. No More...

 

Here's my revised if/else statement:

 

 

{/if}
        {if $category->description}
 
{if strlen($category->description) > 1200}
 
<p class="cat_desc clearfix" id="category_description_short">{$category->description|truncate:120} <span onclick="$('#category_description_short').hide(); $('#category_description_full').show();" class="lnk_more_cat">{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">{l s='Hide'} </span></p>
 
{else}
<p class="cat_desc clearfix">{$category->description}</p>
{/if}
 
(you still rock, Pascal  ...no, really)   :)
Link to comment
Share on other sites

Hi Andrea,

 

In my solution in post #12, I also just took out the More.../click event etc. You can simplify your modification a little more if you want:

 

I wrote in #12:

		{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>
				{else}
*}
					<p>{$category->description}</p>
{*
				{/if}   
*}
				</div>
			{/if}

Which, if you just take out the text, instead of comment it out, simplifies to:

		{if $category->description}
			<div class="cat_desc">
				<p>{$category->description}</p>
			</div>
		{/if}

That's all. No truncation or anything to click on, just the category description text.

 

 

pascal.

 

P.S.

Just for my knowledge, did the double text show even when changing <p> to <div>, or did this indeed fix the initial problem, but you got other problems instead (as you mentioned: Text wrapping etc.)?

The text wrapping we can probably solve with some css code, but if it still showed the double text, that means it didn't fix the problem in the first place. Please let me know! Thx.

  • Like 2
Link to comment
Share on other sites

Pascal...

Sorry for the delay... weekend and all...  :)

 

The shortened code totally fixed the problem. Thank you! The problem was the 'More' link. As soon as shortened the code and got rid of it, the duplicate text disappeared.

 

The <div> tag solution was a step in the right direction, but the text kept wrapping around my images because (surprise, surprise) a new <div> had been created. 

 

That said, the text is still wrapping despite the width of my header images (I attached a screenshot). 

 

Time for a little CSS tweak?

post-693871-0-75431800-1383502720_thumb.jpg

Link to comment
Share on other sites

Ok, to summarise,  

After some checking we concluded this was needed to fix Andrea's wrapping:

 

Edit file: /themes/<your theme folder>/css/global.css (around line 952):

 

remove/add as said above:

 

.row_category .category_image {

   float: left;

   margin-right: 20px;         <- delete

   width: 100%;                <- add

}
 
 
pascal
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 month later...
  • 1 month later...

The other thing I would caution users about is not to use ® in any of the product descriptions either....your description will be abruptly truncated right before the ® mark if you are using the Import CSV function!  If you're entering it from the PrestaShop UI you're ok...but your gonna be in trouble with the CSV import.

Edited by Lone_Ranger (see edit history)
Link to comment
Share on other sites

  • 8 months later...

Sorry for brining up this post again, but I have this exact problem. I want to remove the doublt describtions - see here:

http://www.mallen.dk/6-fiskefoder

 

Now, Ive tried to change p to div in themes/default/category.tpl <-l i run only the default theme, no other themes installed.

 

I tried to outcomment it by using {* *] <-- still no luck

 

I tried to delete the text so youre down to just what is needed <-- still no reaction on the site.

 

I have enabled and siabled and cleared and renamed about every thing I can find in this tread, but the page still have the damn double describtions.

 

Anyone got a clue what I could be doing wrong?

Link to comment
Share on other sites

Hi silenthill,

Did you turn on force compilation in advanced parameters->performance and turn off cache/ccc etc here? Try that and reload the page. (don't forget to turn the options/values as before when everything works, to speed up the site again.)

 

see also post#22

 

pascal

Link to comment
Share on other sites

×
×
  • Create New...