Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing a field to be required


dace

Recommended Posts

Hi, I'm having problems changing a field to be required. I have searched the forum for articles relating to this, however they all seem to refer to

catalog/includes/account_details.php

 

If there is an article that I've missed, I do apologise in advance.

 

which doesn't exist, the install works fine, nothing is breaking I wonder if its due to a difference in osCommerce versions. I am using MS 2.2.

 

I am trying to set Company to be a required field, I have checked the Configuration settings and have Company set to Enable (this appears to only show the field). Also minimum characters set to 3. However it still does not seem to be a required field.

 

Any help would be gratefully appreciated,

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

I've been dealing with making those fields NOT required, but here's what I did to accomplish that.

 

1. commented out the section of code that checks:

if($address<ADDRESS_STRING_MIN_LENGTH){
$error = true;

2. changed the fields in the database from "not null" to "null"

3. set the string minimums to 0

 

So...maybe you could reverse those steps for whatever field you want to make mandatory. Set up a definition for the minimum length of whatever field you want, add a brief if{} statement to check it, and change the settings in the database to "not null." The red * next to the field is located in includes/languages/english.php as

define (ADDRESS_TEXT, '*');

or something like that.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...