Forums / Setting Up Categories, Products, Attributes / Displaying new product fields on the Product Info Page

Displaying new product fields on the Product Info Page

Views: 1,463

Results 1 to 8 of 8
15 Apr 2010, 4:44 PM
#1
jdavidb0216 avatar

jdavidb0216

New Zenner

Join Date:
Dec 2009
Location:
Austin, Texas
Posts:
8
Plugin Contributions:
0

Displaying new product fields on the Product Info Page

Hello all,

I've added two new product descriptors to my database and am trying to output that data on my product info page (the same way as 'Product Description' is displayed.

I've attempted to just repilcate the code for product description:

<div id="productDescription" class="biggerText productGeneral"><?php echo stripslashes $products_description); ?></div>

and only changing the database feild name $products_descrition to my new feild name $product_ingredients and the desired out come is NOT acheived...

I'm certain there are other things that need to change i'm just not sure what they are (Even after reading the forums... :( )

If anyone can lend a hand or point me in the right direction that would be great!!

To Recap:

How do i display data from custom database fields on my product info page the same way the 'Product Description' is displayed?

<!--bof Product description -->
<?php if ($products_description != '') { ?>
<div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div>
<?php } ?>
<!--eof Product description -->
15 Apr 2010, 7:11 PM
#2
kobra avatar

kobra

Black Belt

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

Re: Displaying new product fields on the Product Info Page

Is this the detailed single product info page or the multiple product listing page?
The displays and the functional code is mostly seperated with displays in templates/templates/tpl_xxx.php files
Functional mostly in /modules/xxxx.php files
As in
/templates/tpl_modules_product_listing.php and modules/product_listing.php

Zen-Venom Get Bitten

15 Apr 2010, 9:08 PM
#3
jdavidb0216 avatar

jdavidb0216

New Zenner

Join Date:
Dec 2009
Location:
Austin, Texas
Posts:
8
Plugin Contributions:
0

Re: Displaying new product fields on the Product Info Page

kobra:

Is this the detailed single product info page or the multiple product listing page?
The displays and the functional code is mostly seperated with displays in templates/templates/tpl_xxx.php files
Functional mostly in /modules/xxxx.php files
As in
/templates/tpl_modules_product_listing.php and modules/product_listing.php

This is for the detailed single product info page. I have attempted to modify:
includes/templates/default_templates/templates/tpl_product_info_display.php

and replicate the call for $product_discription for my new database fields and it does not seem to work. So i figure i'm missing some other files that also need to be edited to allow me to call the new database fields from the database.

In your reply

16 Apr 2010, 12:14 PM
#4
kobra avatar

kobra

Black Belt

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

Re: Displaying new product fields on the Product Info Page

Have a look at adding to /includes/modules/pages/product_info/main_template_vars.php

Zen-Venom Get Bitten

16 Apr 2010, 2:27 PM
#5
jdavidb0216 avatar

jdavidb0216

New Zenner

Join Date:
Dec 2009
Location:
Austin, Texas
Posts:
8
Plugin Contributions:
0

Re: Displaying new product fields on the Product Info Page

kobra:

Have a look at adding to /includes/modules/pages/product_info/main_template_vars.php

I just took a look at the file mentioned above. That looks like it might be the right area to start!

Any tips on what i might need to add before i go in and start my trial and error after error phase :wink:

I'll probably just attempt to replicate whats there for, lets say, the products_description lines until i get something to work or i figure out a more direct approach...

16 Apr 2010, 2:38 PM
#6
kobra avatar

kobra

Black Belt

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

Re: Displaying new product fields on the Product Info Page

Any tips on what i might need to add before i go in and start my trial and error after error phase

$product_ingredients

Zen-Venom Get Bitten

19 Apr 2010, 9:39 PM
#7
jdavidb0216 avatar

jdavidb0216

New Zenner

Join Date:
Dec 2009
Location:
Austin, Texas
Posts:
8
Plugin Contributions:
0

Re: Displaying new product fields on the Product Info Page

kobra:

$product_ingredients

I just wanted to come back and say thank you for your assistance!!

It worked out great!!

Thanks Again! :clap:

18 Aug 2011, 2:20 PM
#8
jagall avatar

jagall

Zen Follower

Join Date:
Mar 2011
Location:
Ireland
Posts:
286
Plugin Contributions:
0

Re: Displaying new product fields on the Product Info Page

kobra:

Have a look at adding to /includes/modules/pages/product_info/main_template_vars.php

Hi Kobra, hope you can help me. I have two custom fields which display fine on the product info display that is until I installed tabbed products, now I like this feature but the custom fields do not appear now under the details tab. I have searched the forum and asked about this.
I have changed the tabbed_product file in modules to replicate other callouts but still doesn't called field in. The main_vars_template seems ok and the product info display field so don't know where to go from here. There must be someway of ensuring that custom fields are included in the global tabs. Please help! BTW i have been on the TPP contribution and it has been suggested that seek the answer elsewhere so here I am.