Hi
1. Does any one know how to set Suburb to a mandatory field?
A few people queried this question previously, but no replies.
2. Where is ACCOUNT_SUBURB defined?
Thanks
Brian
Latest News: (loading..)
How to set Suburb to a mandatory field
Started by syatm, Aug 24 2007, 07:14
8 replies to this topic
#1
Posted 24 August 2007, 07:14
#2
Posted 24 August 2007, 07:17
admin/configuration.php?gID=5
or yoursite.com/admin --->configuration ---> customer details ---> suburb
HTH
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"
---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"
#3
Posted 24 August 2007, 07:57
rabbitseffort, on Aug 24 2007, 07:17 AM, said:
admin/configuration.php?gID=5
or yoursite.com/admin --->configuration ---> customer details ---> suburb
HTH
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
#4
Posted 24 August 2007, 08:19
try this I haven't tested it but I might work.
create_account.php
Find
Add below it
Go to includes/languages/english.php
Find
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.
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.
#5
Posted 24 August 2007, 08:25
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.
#6
Posted 24 August 2007, 09:25
A. You would have to modify \includes\form_check.js
You may add a check point as shown below..
B. \includes\languages\english.php - you would have to define text for error etc.
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
D. \admin\customers.php
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)
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)
Edited by pubdomains.com, 24 August 2007, 09:28.
Best Regards,
Gaurav India
Status: Not Online | Enjoy Weekend Fellows!!!
Gaurav India
Status: Not Online | Enjoy Weekend Fellows!!!
#7
Posted 24 August 2007, 11:37
[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
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
#8
Posted 24 August 2007, 11:47
syatm, on Aug 24 2007, 11:37 AM, said:
[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
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
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 India
Status: Not Online | Enjoy Weekend Fellows!!!
Gaurav India
Status: Not Online | Enjoy Weekend Fellows!!!
#9
Posted 24 August 2007, 12:01
I inserted "Suburb-related values" into the "Configuration" table.
It works now.
Thank you very much.
Brian
It works now.
Thank you very much.
Brian














