Age Limit?
- twhcreations
-
Topic Author
- Offline
Does anyone know how this could be done?
mcgrathwines.com.au/index.php/online-shop
Please Log in or Create an account to join the conversation.
You can create custom fields via the menu Display->Custom fields to ask more information to your customers.
If you create custom fields of the table "order", it will display on the checkout as additional information.
If it's of the table "address", it will be in the address form. If it's of the table "user", it will be as user information.
Please Log in or Create an account to join the conversation.
- twhcreations
-
Topic Author
- Offline
Please Log in or Create an account to join the conversation.
Suppose that your custom field is called "user_age", you would have that:
Please Log in or Create an account to join the conversation.
(It's not at the end of the file anyways, just tried that.)
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Could you give a link to that so that we can see what you have ?
Please Log in or Create an account to join the conversation.
Still doesn't work. Don't know why.
Please Log in or Create an account to join the conversation.
Also a screenshot of inside edit fields. I changed "Only old dates" and set it to "All dates"/"Alla datum".
Please Log in or Create an account to join the conversation.
YYYYMMDD-NNNZ
The Z is a checkssumnumber.
What codechanges would I need to do to convert YYYYMMDD to a regular date and then use that date to check the age limit?
I would also change the field length to 13 and the name to user_personal_identity_number and the type to text.
Please Log in or Create an account to join the conversation.
That's why I asked for a link. A screenshot won't do.
But I think you didn't understand the initial messages of that thread.
You have to create a custom field of the type "dropdown" with the age of the person, not with the birthday. Otherwise, the javascript I gave you won't work.
You can't change the name field column name. You can however create a new field with that column name and unpublish the default name field.
If you want to check the age based on the personal identidy number, that will require more complex javascript.
You would have first to cut the string and then compare the year.
This is already far outside regular support, I would recommend that you seek the help of a developer if you want to do these customization or stick with the initial customization of having a dropdown where the user select his age.
Please Log in or Create an account to join the conversation.
When I tried entering just 18 in the field instead of 2010-12-20 (which is way larger than 19), then I got the expected behaviour. So it works as advertised, even with a text field instead of a menu.
I also understand about the limits of regular support, and would like to say thank you for the help! I will ask a friend with the rest. Maybe that will result in some code I can post here for others with the same problem.
Please Log in or Create an account to join the conversation.