Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Keep formatting from Product info on category list

Keep formatting from Product info on category list

Locked

Views: 1,429

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
14 Nov 2009, 7:58 PM
#1
riscphree avatar

riscphree

New Zenner

Join Date:
Sep 2007
Posts:
19
Plugin Contributions:
0

Keep formatting from Product info on category list

How might I be able to keep my formatting from the product information page in my listings of the products? I can provide examples if I am not being clear.

14 Nov 2009, 8:49 PM
#3
riscphree avatar

riscphree

New Zenner

Join Date:
Sep 2007
Posts:
19
Plugin Contributions:
0

Re: Keep formatting from Product info on category list

The /includes/modules/<your_template>/product_listing.php file "cleans" html from the description. You can put it back by commenting out this bit (two places on adjacent lines) like this:

zen_trunc_string(/zen_clean_html/(stripslashes(zen_get_products_description(...

I do not have a /includes/modules/my template folder. Is there a common file for this? I checked the product_listing.php in /includes/modules but that did not have the code in there. Not sure why my template didnt have a folder in here.

I'll do some hacking to see what I can find in the code.

14 Nov 2009, 8:58 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Keep formatting from Product info on category list

  1. The "my template" folder would be the extra folder YOU created to match your template name, to differentiate files you've customized vs original core code
    Since you don't have such a folder, you have two options: (1) create it and put your edited version of the product_listing.php file in there, or (2) edit the product_listing.php file directly and deal with conflicts when you upgrade.

  2. Regardless, the zen_clean_html() call is what you're looking for. You could use the developers toolkit to find all instances where it's used and then pick the relevant file in which to make your edits.
    https://www.zen-cart.com/tutorials/index.php?article=38
    https://www.zen-cart.com/tutorials/index.php?article=39

14 Nov 2009, 9:25 PM
#5
riscphree avatar

riscphree

New Zenner

Join Date:
Sep 2007
Posts:
19
Plugin Contributions:
0

Re: Keep formatting from Product info on category list

Ok figured that out for the most part. Now it's still truncating the description. I've taken out the zen_trunc_string part and now my string is like this:

/zen_trunc_string(/zen_clean_html//(/stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))/)//, PRODUCT_LIST_DESCRIPTION)*/

or with the comments taken out: stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))

However it's still truncating the product description.