Problem with showing long description in products.tpl


I want to show some description of the products in the product lists page ( which uses products.tpl ).

I have found the piece of smarty code which pulls the short description:


However: I don’t want to be forced to add a short description for thousands of products and I just want to use a trimmed version of the full description.

However, if I change the code to


Then nothing shows - I.E its like nothing is being stored in the $product.full_description variable.

Can anyone tell me how to get round this issue?



As above is what I use, I worked out if there is no short description, then it uses long description text. Try it.

[quote name=‘infamous_t’]{$product.short_description|truncate:280:"...

As above is what I use, I worked out if there is no short description, then it uses long description text. Try it.[/QUOTE]

Well, thats what I want to happen ( and your code is the default in the template ), but it doesn’t use the long description.

I tried the debug consol, and indeed there is no full_description variable being passed, and also (even though there is a full_description in the DB) the short_description variable remains empty.

Is there a setting somewhere that I haven’t checked which assigns full_description to short_description, if short_description is empty?

Here is my debug consol output:

1 => Array (18)
product_id => 29812
product => Blindfold Driving
tracking => B
feature_comparison => N
zero_price_action => R
product_type => empty
product_code => empty
amount => 1
price => 0.00
avail => Y
list_price => 0.00
[COLOR="Red"] short_description => empty[/COLOR]
is_edp => N
position => 0
main_pair => Array (4)
pair_id => 1653
image_id => 1469
detailed_id => 1471
icon => Array (5)
image_x => 150
image_y => 113
alt => thumbnail_01.jpg
image_type => image/pjpeg
image_path => /images/product_images/product_image_...
option_image_pairs => Array (0)
product_options => Array (0)
discounts =>

What version of CS are you using? My code is from 1.3.4sp3

Is this section of code in products_pages/product_details.tpl?

```php {*************** /configurator ****************}


{if $product.image_pairs}

{include file="products_pages/additional_images.tpl" product=$product show_detailed_link="Y"}
{/if} ```

Hi - I am running 1.3.4-sp2

But its not the products_pages/product_details.tpl, that is causing me problems it the products_pages/products.tpl

This is the template that shows all the products listed. But I can only access the short_description variable.

This is the complete products.tpl from sp3, try replacing (remember backup) this code with yours.

```php {* $Id: products.tpl 2719 2007-02-14 13:50:14Z zeke $ *}

{if $products}

{if $smarty.capture.js_loaded != “Y”}

{capture name=“js_loaded”}Y{/capture}


{capture name=“mainbox”}

{if !$no_pagination}

{include file=“common_templates/pagination.tpl”}


{if !$no_sorting}

{include file=“products_pages/sorting.tpl”}


{foreach from=$products item=product key=key}

{include file="common_templates/image.tpl" image_width=$settings.Appearance.thumbnail_width obj_id=$product.product_id images=$product.main_pair object_type="product"}
{$lang.view_details} ››


{if $product.product_code}
{$lang.sku}: {$product.product_code}


{$product.short_description|truncate:280:"... `$lang.more_link`"}

{************************************ Discount label ****************************}
{if $product.discounts && $product.price|floatval}

{* / Discount label *}
{else} {/if}

{if !($settings.Modules.product_configurator == 'Y' && $product.product_type == 'C')}
{******************************* List price, Old Price **************************}
{if $product.discounts && $product.price|floatval}
{$lang.old_price}: {include file="common_templates/price.tpl" value=$product.price span_id="original_price_`$product.product_id`" class="list-price"}

{if $product.list_price > $product.price && $product.price != 0}
{$lang.list_price}: {include file="common_templates/price.tpl" value=$product.list_price span_id="list_price_`$product.product_id`" class="list-price"}

{************************ Discounted Price, Our Price, Price ********************}

{if ($settings.Modules.product_configurator == 'Y' && $product.product_type == 'C')}
{elseif $product.price != 0 || $product.zero_price_action == 'P'}
{if $product.discounts && $product.price|floatval}{$lang.discounted_price}
{include file="common_templates/price.tpl" value=$product.discounted_price span_id="discounted_price_`$product.product_id`"}
{if $product.list_price > $product.price}{$lang.our_price}{else}{$lang.price}{/if}: {include file="common_templates/price.tpl" value=$product.price span_id="original_price_`$product.product_id`"}

{if !($settings.Modules.product_configurator == 'Y' && $product.product_type == 'C') && ($product.price != 0 || $product.zero_price_action == 'P') && $settings.Appearance.show_prices_taxed_clean == 'Y' && $product.taxed_price}
({include file="common_templates/price.tpl" value=$product.taxed_price span_id="price_includes_tax_`$product.product_id`" class='list-price'} {$lang.inc_tax})
{if $ != ""}
({$lang.including_tax} {include file="common_templates/price.tpl" value=$})
{************************************* You Save: *******************************}
{if $product.discounts && $product.price|floatval}
{$lang.you_save}: {include file="common_templates/price.tpl" value=$ span_id="save_`$product.product_id`" class="list-price"}

{if $product.list_price > $product.price && $product.price|floatval}
{$lang.you_save}: {include file="common_templates/price.tpl" value=$product.you_save_abs span_id="save_`$product.product_id`" class="list-price"} ({$product.you_save}%)


{include file="common_templates/modifier.tpl" mod_type="P" mod_value=$product.discount_amount non_zeros='Y' spanm_id="discount_label_`$product.product_id`" class="discount-label-text"}

{include file="products_pages/buy_now.tpl"}


{if !$no_pagination}
{include file="common_templates/pagination.tpl"}

{if !$title}
{include file="common_templates/mainbox.tpl" title=$title content=$smarty.capture.mainbox}

{/if} ```

Thanks - I’ll give it a go


I tried your template and it made no difference.

The problem is that there is definately no variable at all being passed to this template for product.full_description (as shown in my debug code).

Can any of the staff here tell me how I can try and fix this ?

I would also be really appreciative if anyone else can show me if in their debug report if they are recieving a variable for product.full_description being passed to the products_pages/product_details.tpl.

Thanks for the help in advance.

I seem to be having the same problem with 1.3.5 sp1