Forums / Templates, Stylesheets, Page Layout / Product Listing Ignoring formatting

Product Listing Ignoring formatting

Locked

Views: 2,395

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
15 Oct 2006, 3:35 AM
#1
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Product Listing Ignoring formatting

I have very short product listing descriptions but I have specific formatting in html in the description. The listing page totally ignores the formatting, but displays it on the details page. Is there a way to get the listing page to display the formatted text?

15 Oct 2006, 3:38 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Listing Ignoring formatting

Because the listing truncates the products_description based on length, everything is stripped out as it would make a real mess to cut off the end of the HTML code ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Oct 2006, 4:01 AM
#3
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

Ok, I was afraid of that... I need this formatting here... what can I do to fix this?

16 Oct 2006, 1:23 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Listing Ignoring formatting

You would need to change the code and how it handles the products_description so that it does not truncate any of your text ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Nov 2006, 5:12 AM
#5
ungeziefer avatar

ungeziefer

New Zenner

Join Date:
Mar 2006
Posts:
51
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

Ajeh:

You would need to change the code and how it handles the products_description so that it does not truncate any of your text ...

Which code should we be modifying here?

Is it just a matter of changing a setting so that the entire description shows on the Listing page (which is what I would prefer, in any case)? And, if so, where is that done? (Under Configuration > All Listing > Display Product Description, it says "Do you want to display the Product Description - First 150 characters?"; but I'm not clear on how to turn off the character limit, or if this will even make the HTML render properly?)

I need line breaks; when the description all runs together it looks really horrible...

Thanks in advance for your help.

9 Nov 2006, 5:22 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product Listing Ignoring formatting

You would need to customize the:
/includes/modules/product_listing.php

Copy that to your templates and overrides directory:
/includes/modules/your_template_dir/product_listing.php

Then change the products_description so that it does not alter the HTML that you have nor truncate it ...

NOTE: this can result in some very long listings as well as issues on the display depending on your HTML in the description ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Nov 2006, 5:45 AM
#7
ungeziefer avatar

ungeziefer

New Zenner

Join Date:
Mar 2006
Posts:
51
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

Yay! That worked! Thank you so much!

(I was actually on the right track, after reading another thread -- but I was trying to comment out the "zen_clean_html" part, which didn't work because I did not delete the closing parenthesis.)

Anyway, it looks the way I want it to now.

Hopefully this won't cause problems elsewhere. (All my descriptions are short, but one never knows . . .)

Thanks again -- I do appreciate it.

9 Nov 2006, 12:08 PM
#8
chrisian avatar

chrisian

New Zenner

Join Date:
Nov 2006
Posts:
2
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

can you tell me what changes you made to the product_listing.php because I need a solution for the same problem you have.

9 Nov 2006, 2:36 PM
#9
ungeziefer avatar

ungeziefer

New Zenner

Join Date:
Mar 2006
Posts:
51
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

Sorry -- I should have posted what lines needed to be changed.

Please make a backup copy of your "product_listing.php" file, in case I screw something up for you (or as long as you're using a custom/overrides folder you can just delete/replace the custom file if you need to).

In that file you want to look for "zen_clean_html" (no quotes). It appears in two places -- should be lines 98 and 100.

In line 98 where it says:

      $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;

you want to remove the "(zen_clean_html" (note the parenthesis at the beginning); then remove one of the three closing parentheses after "['languages_id'])))", so there will be two not three: "['languages_id']))"

Do the same thing on line 100.

Let me know if this was unclear at all, or if it doesn't work for you.

9 Nov 2006, 2:44 PM
#10
rwoody avatar

rwoody

Totally Zenned

Join Date:
Aug 2004
Location:
Fountain Hills, AZ
Posts:
476
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

Ah Ha!! I forgot to remove the extra bracket!! I knew it had to be something simple!!!

Thanks

20 Mar 2007, 8:05 PM
#11
freshp avatar

freshp

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Product Listing Ignoring formatting

Does anyone happen to know where to do this in 1.3.7?

I commented the following out on line 110 in > includes> templates> template_default> templates> tpl_modules_products_all_listing.php

    > $disp_text = zen_clean_html($disp_text);but it hasn't made any difference.

Any ideas would be much appreciated.

20 Mar 2007, 8:28 PM
#12
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: Product Listing Ignoring formatting

FreshP:

Does anyone happen to know where to do this in 1.3.7?

I commented the following out on line 110 in > includes> templates> template_default> templates> tpl_modules_products_all_listing.php

    but it hasn't made any difference.

Any ideas would be much appreciated.

Re-read the post on doing this, it directs you to includes/modules/product_listing.php, not the file you edited above.