Follow up on Prestashop Doubling description question.

Avatar
  • Answered
Please refer to my question yesterday below as follows:

YESTERDAY..
"Please have a look at the following:
http://pawsandclawspetsupply.com/prestashop/22-fabric-dog-toys

Note that Prestashop is doubling the category descriptions. However, it is not doing it to every category. So far it has done it to two parent categories and now to a subcategory. I can not find what the problem is.

pawsandclawspetsupply.com/prestashop/admin0875"

and the answer received back:

"This is because you have defined the same content for both the short and long description within the category. Remove or change one of these and you will see it reflected within the category. "

I think we are talking about two different things. The answer would make sense if we were talking about PRODUCT PAGES. But, in the case of CATEGORY PAGES, there is only one description, not a long and short.

As I said, when I type in the description in the back end for a category, the Prestashop software doubles it. But it has not done it on every category, just two parent and now the one subcategory of DOG TOYS>FABRIC TOYS. Please take a look again for me. I think I remember maybe reading about a bug like this but now I can't find the reference again. Please have another look at your answer.

Thanks guys.
Avatar
Scott
Hello, You are correct that the PrestaShop database only stores a single description as opposed to a short and long one for the products. I took a look at a category page that has double description and see that it appears to be emulating a short and long description. Inspecting the code shows that is indeed the case, the code has space for a 'category-description-short' and a 'category-desciption-long'. You can see that in the source code from the site in the image below.
As this is not a common problem for default PrestaShop setups, I assumed it may be the theme you are using. I did a search for all files on the site that referenced 'category-description-short' and it returned a single file. This file is your '/themes/buddie/category.tpl file' As you can see, the code checks the length of the description. If that description is longer than 120 characters, it prints both a short and a long description. The short description is creted by truncating the description to the first 120 characters. You can see that section of code below:
The fix is very simple. All you need to do is to edit that line of code and either a) remove it altogether or b) simply add <!-- to the front of the line and --&gt to the end of the line. It should then appear as so:
<!--<p id="category_description_short">{$category->description|truncate:120}</p>-->
I tested the solution and it does indeed work. Please let us know if you encounter any further issues with it. Kindest Regards, Scott M