Premsig.com Posted May 1, 2013 Share Posted May 1, 2013 Hi My products don't have very long descriptions anyway, and with the formatting of the product page (I have 'other items in this category' displayed), I realise that I would be better off having my product details in the 'short description'. Unfortunately, I only realised this after entering them all in the 'long description', for 350+ products. Soooo, is there an easy way of swapping the short description for the long description on the product page with some nifty bit of code? TIA Mark Prestashop version: 1.5.3.1 Shop URL: http://www.premsig.com/ Current theme in use: default Link to comment Share on other sites More sharing options...
vekia Posted May 1, 2013 Share Posted May 1, 2013 code below is for default prestashop template - but it works also for non-default themes you should edit the product.tpl file located in your theme. {$product->description} this is variable for product description, put it there: {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short} ------HERE------</div> {/if} final code: {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description_short} {$product->description}</div> {/if} you can also use {$product->description} instead the {$product->description_short} Link to comment Share on other sites More sharing options...
Premsig.com Posted May 1, 2013 Author Share Posted May 1, 2013 Thanks very much for the help, but neither solutions worked. I edited the product.tpl file in the default theme folder with the code you gave, and then just using {$product->description} but nothing changed when I checked my product pages, even when reloading. Link to comment Share on other sites More sharing options...
Premsig.com Posted May 1, 2013 Author Share Posted May 1, 2013 Ahh, I've figured out that it has worked for products that already had a short description, but most of my products don't have a short description.... Link to comment Share on other sites More sharing options...
vekia Posted May 1, 2013 Share Posted May 1, 2013 you probably need to turn force compilation on Link to comment Share on other sites More sharing options...
Premsig.com Posted May 1, 2013 Author Share Posted May 1, 2013 Uh, it did sort of work, see my message #4. Is there a way of making it work even if there is no short description for the product? Link to comment Share on other sites More sharing options...
vekia Posted May 1, 2013 Share Posted May 1, 2013 {$product->description} - this is variable with full description {$product->description_short} - this is variable with short description so, which one works for you? You said that you haven't got short_description - so in this case {$product->description_short} won't work. But you've got normal description use the {$product->description} variable instead the description_short Link to comment Share on other sites More sharing options...
Premsig.com Posted May 1, 2013 Author Share Posted May 1, 2013 I used <div id="short_description_content" class="rte align_justify">{$product->description}</div> And this works for products that already have a short description. For these products, the long description is now where the short description was. For products that didn't have a short description, nothing has changed. The short description is still blank, with the long description under "other info". Link to comment Share on other sites More sharing options...
vekia Posted May 1, 2013 Share Posted May 1, 2013 ahh thanks for the info, now i know what you mean. it's because in product.tpl you've got {if} condition: {if $product->description_short OR $packItems|@count > 0} you should remove it, after that description will appear properly. If you remove it - dont forget to remove the {/if} closing tag 1 Link to comment Share on other sites More sharing options...
Premsig.com Posted May 2, 2013 Author Share Posted May 2, 2013 Thanks again for your help, I'll try that. Just to be clear, do I remove that entire line of code, and the {/if}? Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 Thanks again for your help, I'll try that. Just to be clear, do I remove that entire line of code, and the {/if}? exactly, after that everything should work fine waiting for your reply regards Link to comment Share on other sites More sharing options...
Premsig.com Posted May 2, 2013 Author Share Posted May 2, 2013 That didn't help, I'm afraid. Is it just that line I need to delete, or that entire section? Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 can you please attach the product.tpl file here? I will check it in my shop Link to comment Share on other sites More sharing options...
Premsig.com Posted May 2, 2013 Author Share Posted May 2, 2013 It says I'm not allowed to attach this type of file, but I guess you can download it from http://www.premsig.com/themes/default/product.tpl Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 thanks for the url i checked it on my shop and you've got there: {if $product->description_short} <div id="short_description_content" class="rte align_justify">{$product->description}</div> {/if} so as you can see, the: {if $product->description_short} {/if} use code below only: <div id="short_description_block"> <div id="short_description_content" class="rte align_justify">{$product->description}</div> {if $product->description} <p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p> {/if} {if $packItems|@count > 0} <div class="short_description_pack"> <h3>{l s='Pack content'}</h3> {foreach from=$packItems item=packItem} <div class="pack_content"> {$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a> <p>{$packItem.description_short}</p> </div> {/foreach} </div> {/if} </div> still appears in this file. You should remove it 1 Link to comment Share on other sites More sharing options...
Premsig.com Posted May 2, 2013 Author Share Posted May 2, 2013 Brilliant! That works, thanks so much for your expertise and patience. Mark Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2013 Share Posted May 2, 2013 you're welcome im happy that I could help you now i can ho ahead and mark this thread as solved regards 1 Link to comment Share on other sites More sharing options...
DRMasterChief Posted February 8, 2019 Share Posted February 8, 2019 (edited) Hello, i have a similar problem and hopefully @vekia can help: I have to include the 'long description' (the normal description for the items, also named 'full description') in the shopping cart (shop version 1.6.1.x). I can not figure it out, i have tried various code but nothing works. I already show the short description in the shopping cart using the following code: {if isset($product.description_short) && $product.description_short}<div id="short_description_block"><div id="short_description_content" class="rte align_justify" itemprop="description"><small>{str_replace("<br />", "", $product.description_short)}</small></div></div>{/if} --- but i also need to do this with the normal, full description. Is there any idea how to do this? Thank you, would be great! Edited February 8, 2019 by DRMasterChief (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now