Zen Cart Logo
Forums / General Questions / adding field to database for product listing

adding field to database for product listing

Locked

Views: 1,259

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
15 Jan 2008, 8:30 AM
#1
suman07 avatar

suman07

New Zenner

Join Date:
Dec 2007
Posts:
62
Plugin Contributions:
0

adding field to database for product listing

Hello to all
I have added a field name 'product_ref' into the table 'product' and 'product_description'. The field is a reference number which references a part of the category image. I don't know to which table I should add that field. So I added that field to both the table, because I wanted to display the reference number in the product listing. I don't find the SQL statement which is used to fetch the data fields in the product listing. Any suggestion is appreciable
Thank you

15 Jan 2008, 9:28 AM
#2
kobra avatar

kobra

Black Belt

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

Re: adding field to database for product listing

Try includes/modules/product_listing.php

15 Jan 2008, 10:12 AM
#3
suman07 avatar

suman07

New Zenner

Join Date:
Dec 2007
Posts:
62
Plugin Contributions:
0

Re: adding field to database for product listing

I have added
case 'PRODUCT_REF_NO':
$lc_text = TABLE_HEADING_REF; //TABLE_HEADING_REF="Ref No."
$lc_align = '';
$zc_col_count_description++;
break;
at line no. 29

case 'PRODUCT_REF_NO':
$lc_align= '';
$lc_text = $listing->fields['products_ref'];
break;
at line no. 100

But could not display the reference no. on product listing

15 Jan 2008, 10:17 AM
#4
kobra avatar

kobra

Black Belt

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

Re: adding field to database for product listing

Look to the tpl files for display...

the file you edited only makes the info available

22 Jan 2008, 5:54 AM
#5
thekanyon avatar

thekanyon

New Zenner

Join Date:
May 2007
Location:
San Diego, CA
Posts:
4
Plugin Contributions:
0

Re: adding field to database for product listing

I'm having a similar problem. (note: I am using the "Column Layout Grid for Product Listing" module.) I tried to reverse engineer the product listing but I couldn't figure out how to display my new field.

The "tpl_columnar_display.php" page appears to get all the content from the $list_box_contents array.

$list_box_contests array appears to get the field list from $column_list.

$column_list created from "includes/modules/pages/index/main_template_vars.php"

And finally, I added a "case" statement under the "switch ($column_list[$col])" in
"includes/modules/CUSTOM/product_listing.php"

I was able to hack my way through but I did it by modifying some of the core files and hardcoded some values. (Not the best way to run things.)

If someone has a cleaner process, please post your results!

Thank you in advance.