Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / How can I add another description field?

How can I add another description field?

Locked

Started by jeffmic on 22 Sep 2006, 3:59 AM · Views: 2,792

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
22 Sep 2006, 3:59 AM
#1
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #1 by jeffmic

I would like to add another description field in my layout.
I attempted this by duplicating the following in
tpl_product_info_display.php:

<!--bof Product description --> <?php if ($products_description != '') { ?> <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div> <?php } ?> <!--eof Product description --> and changing the top one to: <!--bof Product description2 --> <?php if ($products_description2 != '') { ?> <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description2); ?></div> <?php } ?> <!--eof Product description2 -->

Then I added another field in table products_descriptions
and labeled it: products_descriptions2

Then I populated it with some data on the record I was viewing, but it didn't work.

I tried to figure out how to do this by also creating a new product type, but I couldn't even begin to complete that.

Any ideas how to do this with the first or second method?

thanks,
Jeff Michaels
Musical Creations Ltd.

Jeff Michaels,
pres of Musical Creations Ltd.

22 Sep 2006, 4:13 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

The fields are pulled in the /includes/modules/pages/something_page_name/header_php.php in most cases

You need to update the select statements and follow the patterns in there for setting the variables ...

NOTE: these files are not override files so backup your original and your changes for future upgrades ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Sep 2006, 12:12 PM
#3
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #3 by jeffmic

Thanks Linda,

I found very little info to change in:
/includes/modules/pages/product_info/header_php.php
so I changed nothing there...

Then I looked at and modified:

/includes/modules/pages/product_info/main_template_vars.php

and I added the following:

$sql = "select p.products_id, pd.products_name,
pd.products_description2, pd.products_description, p.products_model,
p.products_quantity, p.products_image,
pd.products_url, p.products_price,
p.products_tax_class_id, p.products_date_added,
p.products_date_available, p.manufacturers_id, p.products_quantity,
p.products_weight, p.products_priced_by_attribute, p.product_is_free,
p.products_qty_box_status,
p.products_quantity_order_max,
p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter

and

$products_name = $product_info->fields['products_name'];
$products_model = $product_info->fields['products_model'];
$products_description = $product_info->fields['products_description2'];
$products_description = $product_info->fields['products_description'];

But this didn't display the new field on my product info pages...

All I'm looking to do is display a new field: products_description2
on the Product Info pages, above the original products_description

Is there anything else I'm overlooking or doing wrong here?

thanks,
Jeff

:ohmy:

Jeff Michaels,
pres of Musical Creations Ltd.

22 Sep 2006, 1:16 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

What's wrong with this picture ... :eek:

 $products_description = $product_info->fields['products_description2'];
$products_description = $product_info->fields['products_description'];

Perhaps add a 2 to that first one? :lamo:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Sep 2006, 2:14 PM
#5
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #5 by jeffmic

duh!

so sorry I miss that easy one....

Anyway... IT WORKS!

thanks so much
I'll keep track of the file because of the "No overrides" problem on it too for future upgrading

Jeff

Jeff Michaels,
pres of Musical Creations Ltd.

22 Sep 2006, 2:26 PM
#6
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #6 by jeffmic

Linda....

One more problem has occurred now that the description2 field is appearing.

I added image code in that text field (is that wrong? or is my code below for an image incorrect?)
and here's what happens:
As I refresh the page, it draws for a split second and then disappears.
I put the word TEST after the image and it will display correctly.

here's the code:

<img src="MCimages/Back_Order.gif" Width=33 Height=26 Align=bottom>TEST

thanks,
Jeff

Jeff Michaels,
pres of Musical Creations Ltd.

22 Sep 2006, 3:07 PM
#7
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #7 by jeffmic

I forgot to add the double quotes around the width etc, but it still disappears when refeshing the page

<img src="MCimages/backorder.gif" width="33" height="26">test

Here's the link to view the test site:

http://64.40.85.238:84/index.php?main_page=product_info&cPath=3_109&products_id=40422178

the image is supposed to appear BEFORE the word TEST

Jeff Michaels,
pres of Musical Creations Ltd.

22 Sep 2006, 3:09 PM
#8
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #8 by jeffmic

And yes, I have checked and rechecked that the image is in fact in the folder.
Also, I replaced that image with one in the top level (not MCimages) and it won't work either

confused here

thanks,
Jeff

Jeff Michaels,
pres of Musical Creations Ltd.

22 Sep 2006, 7:31 PM
#9
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Post #9 by jeffmic

Never mind Linda,

I figured out that if you create a new field like this, the connections for the proper image folders were never linked yet.

So all I did was make the image link: images/MCimages/backordered.gif
by adding 'images/ to the statement and the image came up correctly.

thanks,
Jeff

Jeff Michaels,
pres of Musical Creations Ltd.

24 Sep 2006, 2:04 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #10 by ajeh

Thanks for the update and glad to hear that you have this working now ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 May 2007, 7:19 PM
#11
billywizz avatar

billywizz

New Zenner

Join Date:
May 2007
Posts:
2
Plugin Contributions:
0

Post #11 by billywizz

Dear All.

May I be so bold as to revive this post with an extention to this question...

How do I go about adding the extra description field to the admin form for editing a product record?

Any words of wisdom will be most welcome.

WM

24 May 2007, 6:10 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #12 by ajeh

Using the Developer's Tool Kit ... do a search of the Admin for:
products_description

And this should reveal all of the locations that this is used to give you a path or guideline to follow ...

NOTE: there are no overrides for the Admin ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!