Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

adding field to catagories.php


Nancy

Recommended Posts

tep 2.1

Hey all. I'm trying to add an additional field to the products database. I added products_contact_id to the database with phpMyAdmin, and updated catagories.php as follows (all lines snipped):

Added: ss_id, products_contact_id) val on line 88

 

Added: ass_id'] . "', '" . $HTTP_POST_VARS['products_contact_id'] . "')" on line 88

 

Added: lass_id'] . "', products_contact_id = '" . $HTTP_POST_VARS['products_contact_id'] . "', prod on line 99

 

Added: ss_id, products_contact_id, manufacturers_ on line 199

 

Added: <tr>

<td nowrap><font face="<? echo TEXT_FONT_FACE; ?>" size="<? echo TEXT_FONT_SIZE; ?>" color="<? echo TEXT_FONT_COLOR; ?>"> <? echo TEXT_PRODUCTS_CONTACT_ID; ?> </font></td>

<td nowrap><font face="<? echo TEXT_FONT_FACE; ?>" size="<? echo TEXT_FONT_SIZE; ?>" color="<? echo TEXT_FONT_COLOR; ?>"> <input type="text" name="products_contact_id" value="<? echo @$pInfo->contact_id; ?>"> </font></td>

</tr> on line 262

 

Added: tus, p.products_contact_id, p.manufactur on line 318 (would have been 314 +/- befor addining the additional text box.

 

I also updated english.php to reflect the description. When I add a product, products_contact_id is written to the database (I can see it in phpMyAdmin) but when I go to edit the product, the products_contact_id text box is not populated with the info from the database (all of the other fields are properly populated). I added products_contact_id to the end of the 'products' table varchar(30), , null=yes, default=null.

 

Any Ideas on what I might have forgotten?

Link to comment
Share on other sites

Only a very quick glance over this,

 

but should

 

TEXT_FONT_COLOR; ?>"> <input type="text" name="products_contact_id" value="<? echo @$pInfo->contact_id; ?>"> </font></td>

 

not be

 

TEXT_FONT_COLOR; ?>"> <input type="text" name="products_contact_id" value="<? echo @$pInfo->products_contact_id; ?>"> </font></td>

Trust me, I'm an Accountant.

Link to comment
Share on other sites

Nope, I thought so also, but the posted code

 @$pInfo->contact_id;

is how all the other input fields are formated. I don't know enought about PHP to understand why, I figured just mimicking the existing code should work, but I b wrong. Either way on the @pInfo-> produces the same results. Field info is added to the table, but not retrieved on edit. Thanks for the look see though. :D

-nan

 

ps, sorry I didn't format my earlier code. Makes it much easier to read, so you did teach me something :!:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...