Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a new admin-only product field


Guest

Recommended Posts

Posted

Client/friend's oscommerce store is almost perfect.

 

Problem is, the physical store has inventory control numbers related to the shelves the items are held on in her warehouse. Changing the numbers to the primary key osc's database assigns is not an option.

 

All we want is to add a field to product add screen (category.php I think) and have that link to any table in which the product ID number is also added, so that I can use exported data more easily in Access/Excel.

 

Make sense? I can't find a contribution specifically for adding fields that isn't written in french. The one I did find had an english translation, but was not *fully* translated and I didn't want to risk eliminating the french stuff in favor of english because I don't know enough about PHP.

 

Thanks in advance.

 

Oh, and here's a portion of the instructions that were translated, you can see right away there's a flaw in the translation ;)

 

################################################################################
#####
# New_Field_Everywhere v1.2.1 by Laigle - Under GPL
# Add a new field in the product page, product listing, advance search, and in 
# easypopulate if you have it installed.
# The easypopulate part is inspired from the contribution "New Fields" by 
# [email protected] et [email protected]
#
# Last update : 7 may 2005  
#
# Design for MS2
################################################################################
#####
#
# Add a new field in the product page, product listing, advance search, and in 
# easypopulate if you have it installed.
# This field can be managed in admin area in configuration ---> Product listing
#
# In this exemple, we choose the field "ref_const" to be able to add this field next 
# to the "Model" field, but of course, you can manged this code to put this field where 
# you want and give it the name you choose.
# Just replace "ref_const" by your field's name.
#
# BEFORE ALL THING, MAKE A BACKUP OF YOU FILES AND YOU SQL BASE !!!!
#
#
# THEN, MAKE A BACKUP OF YOU FILES AND YOU SQL BASE, WE NEVER KNOW;-))))
################################################################################
#####
#
################################################################################
#####
# SQL.
#
# Insert this line into your SQL base : 
#
INSERT INTO configuration VALUES ('', 'Affichage de la r?f?rence constructeur', 'PRODUCT_LIST_REF_CONST', 2, 'Afficher la r?f?rence constructeur dans la liste des produits (0 ou ordre de tri).', 8, 11, '', '', NULL, NULL);
ALTER TABLE `products` ADD `products_ref_const` VARCHAR( 25 ) DEFAULT NULL AFTER `products_model`

################################################################################
#####
# -----> Open catalog/admin/categories.php
#
# Find :
#

Posted

Assuming you have some PHP and mySQL experience. This really isn't that hard to do without a contribution. Simply add a column to the products table for your new field. Then edit the admin/categories.php file to allow the user to input the new field and then save it to the database. You can look at how the other fields are setup to do this. Then do the same thing for all the files you need that field to show on, for example, if you want it to show on the invoice or packing slip add it to those files appropriately. That's all there is to it. Hope that helps.

Posted
Assuming you have some PHP and mySQL experience. This really isn't that hard to do without a contribution. Simply add a column to the products table for your new field. Then edit the admin/categories.php file to allow the user to input the new field and then save it to the database. You can look at how the other fields are setup to do this. Then do the same thing for all the files you need that field to show on, for example, if you want it to show on the invoice or packing slip add it to those files appropriately. That's all there is to it. Hope that helps.

 

PHP and mySQL novice, but I've got a good learning curve because I know the basics of programming languages and database structure in several obsolete formats plus Access.

 

just categories.php to have an admin-only field? That's all I need to know, thanks. Perfect. Actually saves me a lot of energy putting in a contrib with features I don't come close to needing.

Posted

Ok, the php is maybe not as easy as I thought. If anyone wants to tell me what and where to add to categories.php to get a field called inventory_id to product add screen, that would be awesome. I can handle the SQL part.

Archived

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

×
×
  • Create New...