Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to set Suburb to a mandatory field


syatm

Recommended Posts

admin/configuration.php?gID=5

 

or yoursite.com/admin --->configuration ---> customer details ---> suburb

 

HTH

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

admin/configuration.php?gID=5

 

or yoursite.com/admin --->configuration ---> customer details ---> suburb

 

HTH

 

Thanks your comments, but it does not seem to solve the problem.

Customer Details has five fields: gender, date of birth, company, suburb and state.

The value for these fields can be set to true or false. It looks like these true or false

values are used to display in the customers account and not used to make them mandatory.

 

Brian

Link to comment
Share on other sites

try this I haven't tested it but I might work.

 

create_account.php

 

Find

$messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}

 

Add below it

$messageStack->add('create_account', ENTRY_SUBURB_ERROR);
}

 

Go to includes/languages/english.php

 

Find

define('ENTRY_SUBURB_ERROR', '');

 

between the single quotes ' ' add your error text.

 

Like I said I haven't tested this but it might work. Make sure you have suburb set to true in your Admin.

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

Never mind the above, I tested it and it didn't work.

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

A. You would have to modify \includes\form_check.js

You may add a check point as shown below..

 

check_input("suburb", <?php echo ENTRY_SUBURB_MIN_LENGTH; ?>, "<?php echo ENTRY_SUBURB_ERROR; ?>");

 

B. \includes\languages\english.php - you would have to define text for error etc.

define('ENTRY_SUBURB', 'SUBURB');
define('ENTRY_SUBURB_ERROR', 'Your Suburb Address must contain a minimum of ' . ENTRY_SUBURB_MIN_LENGTH . ' characters.');
define('ENTRY_SUBURB_TEXT', '*');
define('JS_SUBURB', '* The \'Suburb\' entry must have at least ' . ENTRY_SUBURB_MIN_LENGTH . ' characters.\n');

 

C. Condition check has to be incorporated in following files

1. create_account.php

AND

2. address_book_process.php

AND

3. checkout_payment_address.php

AND

4. checkout_shipping_address.php

	if (strlen($suburb) < ENTRY_SUBURB_MIN_LENGTH ) {
  $error = true;

  $messageStack->add('create_account', ENTRY_SUBURB_ERROR);
}

 

D. \admin\customers.php

  if (entry_suburb == "" || entry_suburb.length < <?php echo ENTRY_SUBURB_MIN_LENGTH; ?>) {
error_message = error_message + "<?php echo JS_SUBURB; ?>";
error = 1;
 }

 

E. Finally in TABLE configuration, you would have to define column and insert appropriate values that would be used to define minimum values.

 

Disclaimer

- I have not run the code mentioned above

- this is the logical flow for all fields that are being tested by script.

- shortcuts could be to hardcode - suburb check only in form_check.js (but not recommended)

Best Regards,
Gaurav

Link to comment
Share on other sites

[E. Finally in TABLE configuration, you would have to define column and insert appropriate values that would be used to define minimum values. ]

 

Thanks for your help.

I have changed all you suggested. One last thing I need to do is "How can I add the minimum value for Suburb to TABLE".

In admin -> Configuration -> Minimum Values, "Suburb" does not exist.

So I need to add Suburb to this table. Do you know which table do I have to modify?

 

Brian

Link to comment
Share on other sites

[E. Finally in TABLE configuration, you would have to define column and insert appropriate values that would be used to define minimum values. ]

 

Thanks for your help.

I have changed all you suggested. One last thing I need to do is "How can I add the minimum value for Suburb to TABLE".

In admin -> Configuration -> Minimum Values, "Suburb" does not exist.

So I need to add Suburb to this table. Do you know which table do I have to modify?

 

Brian

Brian,

Use phpmyadmin to view tables in your database.

You would find a table by the name configuration (which has existing data for address / email etc)

Add one more column - populate the data - and that should be it.

 

cheers,

Best Regards,
Gaurav

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...