Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Geek wanting HTML in product description

Geek wanting HTML in product description

Views: 1,316

Results 1 to 18 of 18
13 Aug 2015, 6:46 PM
#1
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Geek wanting HTML in product description

I've combed through too many posts to count, and each one is either for old versions of Zen Cart or requires plug-ins...

I want to enter raw HTML into product descriptions and have it show up on the product page. I don't want WYSIWYG, since I don't want more plug-ins to manage and troubleshoot.

I'm looking for where Zen Cart 1.5.4 strips HTML tags...K.I.S.S. :smile:

13 Aug 2015, 9:02 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

Try looking in \includes\modules\product_listing.php
About line 186
Make any alterations in a copy for your template

13 Aug 2015, 9:35 PM
#3
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Re: Geek wanting HTML in product description

kobra:

Try looking in \includes\modules\product_listing.php
About line 186
Make any alterations in a copy for your template

I saw a recommendation in a previous post, which appears to be where you're pointing and tried it to no avail...

Any references to product_description are on line 97

 
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . 
(($_GET['manufacturers_id'] > 0 and $_GET['filter_id'] > 0) ?  zen_get_generated_category_path_rev($_GET['filter_id']) : 
($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : 
zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . 
'">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . 
[B]zen_trunc_string(zen_clean_html(stripslashes([/B][B]zen_get_products_description[/B][B]($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)[/B] . '</div>';

or lines 175 to 187, which are all commented out.

Line 97

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

changed to

 
zen_trunc_string(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']), PRODUCT_LIST_DESCRIPTION)
``` -to permit the truncating descriptions that are too long

or

zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']

14 Aug 2015, 12:36 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

Do you know who and why they were commented out?

14 Aug 2015, 12:45 AM
#5
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Re: Geek wanting HTML in product description

No I don't...
Zen Cart 1.5.4
Products with attributes stock
CEON URI mapping
alien stemware template

All installed < 2 weeks ago

...of course, this is one of 40 active updates on my bullet list since this is a new site and the owner wants it up yesterday...

14 Aug 2015, 12:49 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

Were you looking at a ZenCart core file?
Or a copy of it in your template override folder?

14 Aug 2015, 12:51 AM
#7
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Re: Geek wanting HTML in product description

Core file. product_listing.php isn't in the template directory tree.

14 Aug 2015, 12:58 AM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

Core file. product_listing.php isn't in the template directory tree
Suggest that you create a folder named for your template under "modules"
This is allowed because out of the box there exists a "classic" folder under "modules"

Reload a clean copy of the file back to /modules
Check the 3rd party addons you have installed for this file - maybe one of them overwrote the original
If so, compare the dates at the top of the file or better yet, use a file comparison program and compare it to an original

Make a copy of the original file and upload it to the created template folder
Make your edits to this file

14 Aug 2015, 1:02 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

and have it show up on the product page
What page are you trying to get html to display
a producting listing page or a product info page?
A listing page will have the url similar to this

index.php?main_page=index&cPath=1

A product info page will look similar to this

index.php?main_page=index&cPath=1_4

Can you post a link??

14 Aug 2015, 1:11 AM
#10
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Re: Geek wanting HTML in product description

kobra:

Suggest that you create a folder named for your template under "modules"
This is allowed because out of the box there exists a "classic" folder under "modules"

Reload a clean copy of the file back to /modules
Check the 3rd party addons you have installed for this file - maybe one of them overwrote the original
If so, compare the dates at the top of the file or better yet, use a file comparison program and compare it to an original

Make a copy of the original file and upload it to the created template folder
Make your edits to this file

product_listing.php only exists at /includes/modules/product_listing.php. I'm not able to copy from "classic" to my "current" template folder since it doesn't exist in the "classic" directory structure. It doesn't exist in the current (altered by template/mod installation) directory structure or that of the zen-cart-v1.5.4-12302014 ZIP file I used for the base install...

14 Aug 2015, 1:16 AM
#11
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Re: Geek wanting HTML in product description

kobra:

What page are you trying to get html to display
a producting listing page or a product info page?
A listing page will have the url similar to this

index.php?main_page=index&cPath=1

> A product info page will look similar to this
> ```
index.php?main_page=index&cPath=1_4

Can you post a link??

I want the product info page.

Sorry, I can't post a link since I'm developing in a local Sandbox. The destination domain is serving an active web store which is a POS (but generally functional), and I've been brought in to completely replace the site engine...I can only post links once we go live after the bulk of the other items on my bullet list are addressed to satisfaction.

14 Aug 2015, 1:21 AM
#13
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

I want the product info page
That is totally another file - but html should not be stripped from that description at all

14 Aug 2015, 1:33 AM
#14
michael_rebreathe avatar

michael_rebreathe

New Zenner

Join Date:
Jul 2015
Posts:
43
Plugin Contributions:
0

Re: Geek wanting HTML in product description

kobra:

that is totally another file - but html should not be stripped from that description at all

michael_rebreathe:

i've combed through too many posts to count, and each one is either for old versions of zen cart or requires plug-ins...

i want to enter raw html into product descriptions and have it show up on the product page. I don't want wysiwyg, since i don't want more plug-ins to manage and troubleshoot.

I'm looking for where zen cart 1.5.4 strips html tags...k.i.s.s. :smile:

aaaargh! Walking in one direction when I should have been walking in another.

kobra:

You do not understand the override system
https://www.zen-cart.com/content.php?228-understanding-the-override-system
https://www.zen-cart.com/content.php?78-how-do-i-set-up-the-template-overrides
https://www.zen-cart.com/content.php?181

Clearly. The authors (bless them for their work) have been working with this too long, in that there is too much tribal ingrained knowledge they now view as obvious, which is in no way obvious to someone just starting.

14 Aug 2015, 4:05 AM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Geek wanting HTML in product description

too much tribal ingrained knowledge they now view as obvious, which is in no way obvious to someone just starting.
That is the intention of the FAQ's

14 Aug 2015, 11:48 AM
#16
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Geek wanting HTML in product description

There's also the Zen Cart Overrides Cheatsheet (https://www.zen-cart.com/downloads.php?do=file&id=1393) to aid you.

Just note that the reason that the listing files (which you were looking at) strip the HTML to ensure that the listing pages generate valid HTML; given that only xxx characters of a product's description are displayed, you can't guarantee that you're not breaking in the middle of a tag, e.g. <p>Some stuff ....

14 Aug 2015, 12:56 PM
#17
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Geek wanting HTML in product description

Also, if the tags come through, additional CSS formatting associated with the applicable listings page would more than likely be needed if classes and other similar tag attributes were included.

19 Aug 2015, 9:22 PM
#18
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Geek wanting HTML in product description

lat and mc are correct... Because it's possible in admin setting to customise the number of characters displayed in a product listing, you could end up splitting your opening and closing HTML tags, which can render havoc on-screen. The only way to ensure this does not happen is to ensure that your HTML is EXACTLY the same number of characters as the setting in admin - for every product...

But let's move away from geek-stuff and look at how ***customers ***are behaving when they browse eCommerce sites... With the increasing use of hand-helds, it is now more important to have as little stuff on-screen as possible. Images are now far more important than whether a string of text is bold, or italic, or green, or in caps... A really good product image in the listing will prompt drill-down to the product info screen - and that's where you provide the detail.

Look at the behaviour of your shoppers first... Do whatever is necessary to get them to checkout as quickly and as easily as possible. Nothing else matters.