Forums / Templates, Stylesheets, Page Layout / Help? product table on category page: 1 product per row with 7 columns giving specs

Help? product table on category page: 1 product per row with 7 columns giving specs

Locked

Started by wbmangy on 14 Feb 2009, 6:53 PM · Views: 1,951

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
14 Feb 2009, 6:53 PM
#1
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Help? product table on category page: 1 product per row with 7 columns giving specs

Any suggestions on how to get the following table rows and columns on the product listing page?
Attachment #5333 (click image to zoom it)
I can put the Part # in the product name field and the Port Type in the model field, but how might I add the other specifications and maintain the table format?

Thanks in advance for any help!

14 Feb 2009, 7:18 PM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

How will all this additional data be captured, stored and rendered?

14 Feb 2009, 7:47 PM
#3
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

Thanks for the offer of help - I suppose that is part of the question. I was imagining inputting it in the admin panel, but don't know the best method.

14 Feb 2009, 8:07 PM
#4
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

To store additional data, and then to have that data displayed in various places, you need to:

  1. Create storage tables/areas in the database.
  2. Write php script that enables the data to be captured.
  3. Write php script that enables the data to be displayed.

This will be quite a significant project, and you will need an above-average knowledge of the zencart database schema and the nature of the php code that drives all of it.

14 Feb 2009, 8:11 PM
#5
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

huh, so sounds like this type of thing is not foreseen - how about a hack where I'm putting it directly in as html?

14 Feb 2009, 8:15 PM
#6
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

Zencart does not use html as you probably know it. The pages are compiled dynamically using PHP, which calls in resources from files and from the database. A single page can have several hundred components called in this way.

These are dynamic pages - html "on-the-fly", and they "evaporate" when the viewer selects another link.

What you are asking for may be possible (I don't know as it's likely to be complex), but it cannot be achieved with flat HTML hacked into the templates.

14 Feb 2009, 8:18 PM
#7
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

yep - have been poking through the templates, and have a custom template 80% done - this was the stumper.

was hoping there was some way of co-opting options/attributes to store/retrieve the info and allow it to be accessed via the admin panel. do you see any potential in that route?

thanks again for your willingness to give a leg up.

14 Feb 2009, 8:23 PM
#8
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

alternatively, is there a way to allow html in the descriptions?

14 Feb 2009, 9:21 PM
#9
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

Yes, you can use html tags in the product descriptions.

14 Feb 2009, 9:43 PM
#10
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

hi Bobdog -

html is stripped from product descriptions in the version I'm using (1.3.8). is there a setting for allowing them? (fwiw, I notice they are allowed in category descriptions, and even product model....).

this seems like a worst-case approach to implementing. anyone have a better suggestion?

I'm an average-ability php coder but have no familiarity with the zen cart structure. Ideally it would be an approach that leverages existing php variables....

15 Feb 2009, 2:10 AM
#11
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

html is stripped from product descriptions in the version I'm using (1.3.8). is there a setting for allowing them?

It may be that they disappear when you next view the product description, because you're using the htmlArea editor maybe, but they should still be there in a sense. Try editing a product description, inserting a couple of <br /> tags in the middle of a paragraph. Does it work? If so, take those out and add a simple table structure - single row, single cell, ABC in the cell. Does that work? It does for me.

As stated by bobdog, you can use html (as long as you don't include anything other than what might go inside the body tag of a 'real' html page.)

Rob

Breakfast: the most important donut of the day.

15 Feb 2009, 5:17 AM
#12
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

Thanks for everyone's patience in their answers while I try to work this out. Being able to use HTML in the product description field would simplify things a lot.

Strangely, nothing I do makes HTML appear in that field: paragraph tags, bold tags, line breaks, horizontal lines, comments, standard table markup -- everything is just stripped out, and only the plain text comes through....

Is it possible that I'm trying to use a different description field than the one you mean? The one I'm trying is reached at Admin > Catalog > Categories/Products > My_subcategory > New Product. It's about 2/3 of the way down the page and is labeled Products Description. The textarea name="products_description[1]".

When I search Zen Cart's files for output of the variable products_description, it always undergoes stripslashes(), and in product_listing.php I note the following:

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

I'm stumped. Any thoughts? Am I looking in the wrong place? is there a setting somewhere?

Thanks again for the help!

15 Feb 2009, 5:34 AM
#13
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

It's worth noting that the tags are reproduced on the 'Preview' screen, and are entered into the products_description field of the products_description table. However, they don't make it to the listing of products on the category page.

16 Feb 2009, 10:25 AM
#14
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

As I said much earlier in this discussion, the only practical way to achieve what you need is to make the data part of the database. Any HTML you add to the product descriptions will be static, and will appear only in the description text display(s). To have your product data appear in various places and in various configurations, the data ought to be in the database - called up and parsed into the page(s) as required.

Product description text is stripped of all (html) formatting when it is parsed into pages other than product_info_display, so to configure a <table> will have no effect in the product_listing displays.

16 Feb 2009, 10:55 AM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

The ability to use HTML in product listing pages has been asked and answered many times. It is very easy - just comment out zen_clean_html in two places in your custom copy of product_listing.php. For example, see this thread: Trying to add line breaks into description.

As fairestcape says, this still won't let you use data the way you really want to.

16 Feb 2009, 11:17 AM
#16
wbmangy avatar

wbmangy

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

Re: Help? product table on category page: 1 product per row with 7 columns giving specs

thanks, all, for the help on this - and gjh42, thanks for the specifics on what to comment out.

In the end I have the required table of products - granted, not an elegant implementation, but visually clean. And the override system allowed for everything to be done without hacking core files.

Thanks!