Jump to content

[solved] Swap short and long description?


Recommended Posts

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

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

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

{$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

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

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

  • Like 1
Link to comment
Share on other sites

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

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

  • Like 1
Link to comment
Share on other sites

  • 5 years later...

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 by DRMasterChief (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...