R. Svinding Posted September 6, 2013 Share Posted September 6, 2013 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 ) Have a great day and best regards from Denmark ) 2 Link to comment Share on other sites More sharing options...
surferboy Posted September 9, 2013 Share Posted September 9, 2013 (edited) 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 September 9, 2013 by surferboy (see edit history) Link to comment Share on other sites More sharing options...
R. Svinding Posted September 9, 2013 Author Share Posted September 9, 2013 (edited) 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 September 9, 2013 by digitallife (see edit history) Link to comment Share on other sites More sharing options...
R. Svinding Posted September 10, 2013 Author Share Posted September 10, 2013 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 More sharing options...
R. Svinding Posted September 10, 2013 Author Share Posted September 10, 2013 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 More sharing options...
surferboy Posted September 10, 2013 Share Posted September 10, 2013 Yeah, you're right, that does seem to work although I still see the 'more >' but at least it isn't nearly as bad. I have no idea how you even imagined this work around. Thanks! Brian Link to comment Share on other sites More sharing options...
surferboy Posted September 10, 2013 Share Posted September 10, 2013 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 More sharing options...
PascalVG Posted September 11, 2013 Share Posted September 11, 2013 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 More sharing options...
surferboy Posted September 11, 2013 Share Posted September 11, 2013 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 More sharing options...
R. Svinding Posted September 11, 2013 Author Share Posted September 11, 2013 (edited) 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 September 11, 2013 by digitallife (see edit history) Link to comment Share on other sites More sharing options...
surferboy Posted September 11, 2013 Share Posted September 11, 2013 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 More sharing options...
PascalVG Posted September 11, 2013 Share Posted September 11, 2013 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->Performanceto 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 3 Link to comment Share on other sites More sharing options...
surferboy Posted September 11, 2013 Share Posted September 11, 2013 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! Brian 2 Link to comment Share on other sites More sharing options...
PascalVG Posted September 13, 2013 Share Posted September 13, 2013 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 More sharing options...
nadie Posted October 2, 2013 Share Posted October 2, 2013 https://github.com/PrestaShop/PrestaShop/commit/340f6cebe4572d269ca4d67331b2d67ae8169c3e 5 Link to comment Share on other sites More sharing options...
brm Posted October 19, 2013 Share Posted October 19, 2013 https://github.com/PrestaShop/PrestaShop/commit/340f6cebe4572d269ca4d67331b2d67ae8169c3e This works like a charm, cheers 1 Link to comment Share on other sites More sharing options...
maniva Posted October 22, 2013 Share Posted October 22, 2013 (edited) Thanks for the suggestion Edited October 22, 2013 by maniva (see edit history) Link to comment Share on other sites More sharing options...
JohnADK Posted October 22, 2013 Share Posted October 22, 2013 Thanks for the solution! I was having the same issue. Now works as desired. Link to comment Share on other sites More sharing options...
maximo88 Posted October 26, 2013 Share Posted October 26, 2013 (edited) Edited October 26, 2013 by maximo88 (see edit history) Link to comment Share on other sites More sharing options...
andreafed Posted October 30, 2013 Share Posted October 30, 2013 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. 2 Link to comment Share on other sites More sharing options...
andreafed Posted October 30, 2013 Share Posted October 30, 2013 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 More sharing options...
PascalVG Posted October 30, 2013 Share Posted October 30, 2013 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? 1 Link to comment Share on other sites More sharing options...
andreafed Posted November 2, 2013 Share Posted November 2, 2013 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 More sharing options...
andreafed Posted November 2, 2013 Share Posted November 2, 2013 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 More sharing options...
PascalVG Posted November 2, 2013 Share Posted November 2, 2013 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. 2 Link to comment Share on other sites More sharing options...
andreafed Posted November 3, 2013 Share Posted November 3, 2013 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? Link to comment Share on other sites More sharing options...
PascalVG Posted November 5, 2013 Share Posted November 5, 2013 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 More sharing options...
iuliann Posted December 6, 2013 Share Posted December 6, 2013 I had same problem too. Solved thanks to nadie and maximo. https://github.com/PrestaShop/PrestaShop/commit/340f6cebe4572d269ca4d67331b2d67ae8169c3e Thanks again! Link to comment Share on other sites More sharing options...
camahego Posted December 7, 2013 Share Posted December 7, 2013 Works for me Thank you Link to comment Share on other sites More sharing options...
Urbanfarmer Posted December 16, 2013 Share Posted December 16, 2013 Just wanted to let you know that Post #25 did the trick. I removed what Pascal said, and.....bingo! What a relief. Thanks for the fix. This is deep stuff. I don't know how you do it. Link to comment Share on other sites More sharing options...
PascalVG Posted December 17, 2013 Share Posted December 17, 2013 Hi urbanfarmer, Glad it works for you :-) Happy selling, Pascal Link to comment Share on other sites More sharing options...
tomvaneyck Posted January 25, 2014 Share Posted January 25, 2014 Nadie solution did it for me. Changed the <p to <div and nowit works like it should! Thanks a lot! Link to comment Share on other sites More sharing options...
Lone_Ranger Posted March 22, 2014 Share Posted March 22, 2014 (edited) 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 March 22, 2014 by Lone_Ranger (see edit history) Link to comment Share on other sites More sharing options...
silenthilldk Posted December 11, 2014 Share Posted December 11, 2014 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 More sharing options...
PascalVG Posted December 16, 2014 Share Posted December 16, 2014 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 More sharing options...
Recommended Posts