Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Any way to get product desc styles to show in index listing?

Any way to get product desc styles to show in index listing?

Locked
This thread is locked. New replies are disabled.
1 May 2009, 3:40 AM
#1
aly22 avatar

aly22

Zen Follower

Join Date:
Feb 2008
Posts:
174
Plugin Contributions:
0

Post #1 by aly22

Client wants complete product description to show in the full category listing page so customers don't "have to" click to product page for more info.

Problem is, any paragraph breaks, styles (italics, bold) are lost and so it all runs together.

Is there any trick to get the styles to stick from the individual product page to the product listing?

1 May 2009, 7:30 AM
#2
igor56 avatar

igor56

New Zenner

Join Date:
Apr 2009
Posts:
29
Plugin Contributions:
0

Post #2 by igor56

I'm so glad that perhaps I am able to help somebody! You need to find this code:

$products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);

and comment out the zen_clean_html thus:

$products_description = zen_trunc_string(/zen_clean_html/(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION);

Beware of a few problems though: I have found that some html code may screw up the alignment on the page. Also, if the description is too long, it gets cut off in funny ways; the other way around is also a problem: if you only want the first say 80 words of the description on the front page but there is a longer description on the product page, you have to add either page or line breaks to force that text out of the main page. If you find another solution, please let me know! See http://www.zen-cart.com/forum/showthread.php?t=38313

1 May 2009, 3:33 PM
#3
aly22 avatar

aly22

Zen Follower

Join Date:
Feb 2008
Posts:
174
Plugin Contributions:
0

Post #3 by aly22

I'm excited that you may be helping me with this, too ;)

But which file am I looking for that in?

1 May 2009, 3:45 PM
#4
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Post #4 by bunyip

you need to edit an override copy of includes/modules/product_listing.php

at about lines 98 and 100 you will see two long lines of code beginning with $lc_text = '<h3

Near the end of each of those lines you will see this segment of code:```php
zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)

To make if display the entire product description as you entered it for the product, replace that segment with```php
zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])

Neville
An assumption is what you arrive at when you get tired of thinking...

1 May 2009, 4:32 PM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #5 by stevesh

Depending on how long the complete description is, the Short Description mod might work, too.

1 May 2009, 4:38 PM
#6
aly22 avatar

aly22

Zen Follower

Join Date:
Feb 2008
Posts:
174
Plugin Contributions:
0

Post #6 by aly22

I changed the file in includes/modules/classic
and in templates/modules/MYTHEME

Woops, sorry, ok it does work if I edit the straight includes/modules/product_listing.php
But yea, it messes stuff up, so I gotta fix my html in product descriptions now ;)

THANK YOU