Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add a new product field


yakbuttertea

Recommended Posts

Posted

As the title of this topic states it <_< , I would like to add a field to products called Grade and some help would be greately appreciated.

How do I do this?

Thank you

Fred

Posted
As the title of this topic states it <_< , I would like to add a field to products called Grade and some help would be greately appreciated.

How do I do this?

Thank you

Fred

 

New field everywhere contrib will do this.

Posted

Sorry never used that contribution but you could use the Product Extra Field contribution.

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted
Does it matter in the database where I create the new product field?

 

The install instructions take you through the complete process of adding a field to the product's table. IIRC it adds the example field after the products_model field.

Posted

catalog/admin/includes/languages/english/categories.php

catalog/product_info.php

catalog/admin/categories.php

 

u need to modify the three pages to add a new field

 

1)catalog/admin/categories.php

 

Find this lines and add the line shown below with your fieldname

 

$sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),

'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

'products_date_available' => $products_date_available,

'products_weight' => (float)tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

'manufacturers_id' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

add this line to the finded lines.....

 

'products_yourfieldname' => tep_db_prepare_input($HTTP_POST_VARS['products_yourfieldname']),

 

1.1) Find this lines

 

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

 

Add this line

 

products_yourfieldname

 

within the querry

 

or Just Search for products_weight in the file and add the products_yourfieldname to as next one same as like products_weight

 

Note : dont replace just add as same as products_weight declared.

 

Repeat the same in all three file u can see your field in add form in adminm, and in output

 

Note: use this querry in phpmyadmin to alter the products table after adding the field or before then test it.

 

 

SQL:

 

ALTER TABLE `products` ADD `products_yourfieldname` VARCHAR( 24 ) NULL DEFAULT NULL;

 

Please use field type as per your need

 

P.Ram sankar

Posted

catalog/admin/includes/languages/english/categories.php

catalog/product_info.php

catalog/admin/categories.php

 

u need to modify the three pages to add a new field

 

1)catalog/admin/categories.php

 

Find this lines and add the line shown below with your fieldname

 

$sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),

'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

'products_date_available' => $products_date_available,

'products_weight' => (float)tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

'manufacturers_id' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

add this line to the finded lines.....

 

'products_yourfieldname' => tep_db_prepare_input($HTTP_POST_VARS['products_yourfieldname']),

 

1.1) Find this lines

 

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

 

Add this line

 

products_yourfieldname

 

within the querry

 

or Just Search for products_weight in the file and add the products_yourfieldname to as next one same as like products_weight

 

Note : dont replace just add as same as products_weight declared.

 

Repeat the same in all three file u can see your field in add form in adminm, and in output

 

Note: use this querry in phpmyadmin to alter the products table after adding the field or before then test it.

 

 

SQL:

 

ALTER TABLE `products` ADD `products_yourfieldname` VARCHAR( 24 ) NULL DEFAULT NULL;

 

Please use field type as per your need

 

P.Ram sankar

Posted
catalog/admin/includes/languages/english/categories.php

catalog/product_info.php

catalog/admin/categories.php

 

u need to modify the three pages to add a new field

 

1)catalog/admin/categories.php

 

Find this lines and add the line shown below with your fieldname

 

$sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),

'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

'products_date_available' => $products_date_available,

'products_weight' => (float)tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

'manufacturers_id' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

add this line to the finded lines.....

 

'products_yourfieldname' => tep_db_prepare_input($HTTP_POST_VARS['products_yourfieldname']),

 

1.1) Find this lines

 

$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

 

Add this line

 

products_yourfieldname

 

within the querry

 

or Just Search for products_weight in the file and add the products_yourfieldname to as next one same as like products_weight

 

Note : dont replace just add as same as products_weight declared.

 

Repeat the same in all three file u can see your field in add form in adminm, and in output

 

Note: use this querry in phpmyadmin to alter the products table after adding the field or before then test it.

 

 

SQL:

 

ALTER TABLE `products` ADD `products_yourfieldname` VARCHAR( 24 ) NULL DEFAULT NULL;

 

Please use field type as per your need

 

P.Ram sankar

 

Thanks, I used the contrib New Field and it worked great...

Archived

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

×
×
  • Create New...