Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

addinge new fields as "minimum values"


keyser_soze

Recommended Posts

hi,

 

i need to collect more information from my customers. we're selling health plans online and will require customers to include information about the beneficiary, basically name, address and phone number. how will i do that? thanks for any help.

 

regards,

 

vik

Link to comment
Share on other sites

hi,

 

i need to collect more information from my customers. we're selling health plans online and will require customers to include information about the beneficiary, basically name, address and phone number. how will i do that? thanks for any help.

 

regards,

 

vik

 

Hello,

 

I'm not sure from your post where you intend to add these things but the process should be pretty much the same. You will want to take some time to study the code. Obviously its going to help if you are familiar with PHP.

 

You are going to need to add some new columns to the database to start with. Then when you look at the code, you will want to look with the eye of modeling your new fields after the existing ones. There are a few different things going on. There is the code that makes a field required and that looks something like this:

 

 if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;

     $messageStack->add('addressbook', ENTRY_FIRST_NAME_ERROR);
   }

 

There is the code that collects the field infomation from the post which looks like this:

 

$city = tep_db_prepare_input($HTTP_POST_VARS['city']);

 

There is the code the creates the actual input box, like this:

 

<td class="main"><?php echo tep_draw_input_field('firstname', $account['customers_firstname']) . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>

 

Then there is the part that inserts into the database:

 

 tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

 

Now bear in mind that these are just random code snipets I've included here. The goal being just to give you some idea of the scope of the task and the type of things to look for. In addition to adding a new record you will most certainly also want to provide functionality to update them as well. There are also likely to be multiple files involved.

 

Best advice if you decide to tackle it is to take it slow. Be certain to make a backup before you change anything. For someone well versed in OSC this sort of task would probably take them at least an hour. The first time I had to do it, took me a couple of hours.

 

Be well,

 

Tina

If you're not having fun you're not doing it right

 

Teach a person to fish rather than give them a loaf of bread or however that saying goes.

Link to comment
Share on other sites

hi tina,

 

thanks for the reply. sorry for not being clear in my first post. i think i asked it wrongly.

 

actually this question is one of a few that i would like to ask. if they are possible with oscommerce.

 

as i've mentioned, we are selling health plans, which is categorized by chapter (i.e. which local hospital you are buying the health plan) and package.

 

1. i would want to get extra information after a customer (or sponsor) selects a health package. primarily the contact details of the beneficiary, e.g. name, address, phone, and probably e-mail.

 

2. i would like to skip the customer sign up process. instead, i would ask them to enter their contact details after they select a health package.

 

3. there is no delivery information needed. i want to skip that process too.

 

4. the payment service will be verisign payflow link.

 

i know they are a lot and probably have been answered already. thanks for any help.

 

regards,

 

vik

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...