Guest Posted December 23, 2003 Share Posted December 23, 2003 If you need to make an age restricted area in your store, see below. In create_account.php (around lines 219-227), change $customer_first_name = $firstname; $customer_default_address_id = $address_id; $customer_country_id = $country; $customer_zone_id = $zone_id; tep_session_register('customer_id'); tep_session_register('customer_first_name'); tep_session_register('customer_default_address_id'); tep_session_register('customer_country_id'); tep_session_register('customer_zone_id'); to $customer_first_name = $firstname; $customer_default_address_id = $address_id; $customer_country_id = $country; $customer_zone_id = $zone_id; $customer_dob = tep_date_raw($dob); tep_session_register('customer_id'); tep_session_register('customer_first_name'); tep_session_register('customer_default_address_id'); tep_session_register('customer_country_id'); tep_session_register('customer_zone_id'); tep_session_register('customer_dob'); In login.php (around line 28), change $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); to $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id, customers_dob from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); Around lines 44-53, change $customer_id = $check_customer['customers_id']; $customer_default_address_id = $check_customer['customers_default_address_id']; $customer_first_name = $check_customer['customers_firstname']; $customer_country_id = $check_country['entry_country_id']; $customer_zone_id = $check_country['entry_zone_id']; tep_session_register('customer_id'); tep_session_register('customer_default_address_id'); tep_session_register('customer_first_name'); tep_session_register('customer_country_id'); tep_session_register('customer_zone_id'); to $customer_id = $check_customer['customers_id']; $customer_default_address_id = $check_customer['customers_default_address_id']; $customer_first_name = $check_customer['customers_firstname']; $customer_country_id = $check_country['entry_country_id']; $customer_zone_id = $check_country['entry_zone_id']; $customer_dob = $check_customer['customers_dob']; tep_session_register('customer_id'); tep_session_register('customer_default_address_id'); tep_session_register('customer_first_name'); tep_session_register('customer_country_id'); tep_session_register('customer_zone_id'); tep_session_register('customer_dob'); Set Restricted as one of the top level categories. Find out what the categories_id is (hint: when you click on the link, it will be the first number after cPath= in the URL). In includes/application_top.php, after (around lines 491-8) if (tep_not_null($cPath)) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; } else { $cPath_array = array(); $current_category_id = 0; } add if ($cPath_array[0] == '27') { if (!tep_session_is_registered('customer_dob')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } else { $year = (int)substr($customer_dob, 0, 4); $month = (int)substr($customer_dob, 4, 2); $day = (int)substr($customer_dob, 6, 2); $date_now = get_date(); if (!((($date_now['year'] - $year) > 18) || ((($date_now['year'] - $year) == 18) && ($date_now['mon'] > $month) || ((($date_now['year'] - $year) == 18) && ($date_now['mon'] == $month) && ($date_now['mday'] > $day)))) { tep_redirect(tep_href_link(FILENAME_CONDITIONS)); } } } Replace 27 with the actual categories_id of your restricted category. Note: this is actually overly restrictive for places where the age is 18, mainly because I didn't know how to determine the time zone. Therefore, I pushed it a day late to make sure. You could drop the date of birth stuff and use a new field in the database to get much the same effect. This would simplify the code somewhat. Hth, Matt Link to comment Share on other sites More sharing options...
fiat707 Posted December 23, 2003 Share Posted December 23, 2003 How do you verify the real age of the buyer if he/she intentionally give you a fake DOB? Link to comment Share on other sites More sharing options...
Guest Posted December 23, 2003 Share Posted December 23, 2003 If you have a real cc processor that will auth and not capture a card, like paymentech where you have a batch function you can retain age verification if you force them to submit cc info to sign up. Did that for a couple of people and it worked beutifully, I know its a little off the subject, and you have to force a transaction on them even if they are not charged. but it is a great way to keep your viewers/customers legal. One client I put the cc payment module on the signup form and tweeked it to just run the cards algorythems, but that you just get they have a card not actual verification of there age. Link to comment Share on other sites More sharing options...
Guest Posted December 23, 2003 Share Posted December 23, 2003 How do you verify the real age of the buyer if he/she intentionally give you a fake DOB?Given a motivated enough liar, you don't. The credit card trick is good (improves your legal standing), but it's not an absolute. What if they give you a parent's name, credit card, and date of birth? In some cases, it is enough to make them state their age. Check with a local lawyer on the laws and requirements that apply to you. As I said, you can drop the dob code and use a different database column instead if more verification is needed. Hth, Matt Link to comment Share on other sites More sharing options...
azer Posted January 3, 2004 Share Posted January 3, 2004 that is a good info thanks MS2 Link to comment Share on other sites More sharing options...
Virtual1 Posted February 16, 2004 Share Posted February 16, 2004 matt, this is excellent stuff.... Suppose tho i just want to set the category as restricted until you agree to terms? ie - send them to a warning page - must be over 18 click here to proceed or here to leave.... Any thots? Link to comment Share on other sites More sharing options...
Virtual1 Posted February 17, 2004 Share Posted February 17, 2004 should include that this site does what i describe: http://www.animeglore.com/index.php Link to comment Share on other sites More sharing options...
♥ecartz Posted February 18, 2004 Share Posted February 18, 2004 At the top of the page add if ($cPath_array[0] == '27') { if (!tep_session_is_registered('agreed_to_terms') || ($agreed_to_terms != 'yes')) { tep_redirect(tep_href_link(FILENAME_AGREE_TO_TERMS)); } } instead. You will also need to add a basic form page and put its name in the includes/filenames.php file. In the basic form page, if they agree to terms (click the checkbox or whatever), do a tep_session_register of agreed_to_terms and set it to 'yes'. Note: this is slightly different than the way that they do it. They use something like the above code to check if the page should be restricted and if the terms have not been read. If both conditions hold, they show the page that you see on first click. Otherwise they show the normal product page. Hth, Matt Always back up before making changes. Link to comment Share on other sites More sharing options...
Virtual1 Posted February 18, 2004 Share Posted February 18, 2004 okay so help a slower person out for a sec... At the top of what page do I add this code and how exactly do I "do a tep_session_register of agreed_to_terms and set it to 'yes'." Thanx for the help :D Link to comment Share on other sites More sharing options...
♥ecartz Posted February 18, 2004 Share Posted February 18, 2004 how exactly do I "do a tep_session_register of agreed_to_terms and set it to 'yes'." tep_session_register('agreed_to_terms'); $agreed_to_terms = 'yes'; Hth, Matt Always back up before making changes. Link to comment Share on other sites More sharing options...
Virtual1 Posted February 19, 2004 Share Posted February 19, 2004 LOL, Maybe i'm being unclear... I REALLY dont know how to do this with a form. Is there a chance you could be a bit more elaborative? I really appreciate your help on this. Thanx Link to comment Share on other sites More sharing options...
Virtual1 Posted March 8, 2004 Share Posted March 8, 2004 Hello? Link to comment Share on other sites More sharing options...
Virtual1 Posted March 9, 2004 Share Posted March 9, 2004 Is there anybody here that can help me with this - I have been trying for a month to get this to work and am working in the dark. Any help is appreciated. Link to comment Share on other sites More sharing options...
Virtual1 Posted March 13, 2004 Share Posted March 13, 2004 btw - i tried the orginal code verbatim - it doesnt work - parse errors out the wazoo. Parse error: parse error in /home/httpd/vhosts/inncasinos.com/httpdocs/includes/application_top.php on line 497 Warning: main(DIR_WS_LANGUAGES/FILENAME_DEFAULT): failed to open stream: No such file or directory in /home/httpd/vhosts/inncasinos.com/httpdocs/index.php on line 24 Fatal error: main(): Failed opening required 'DIR_WS_LANGUAGES/FILENAME_DEFAULT' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/inncasinos.com/httpdocs/index.php on line 24 Please note that the line # differences are do to mods and contributions installed - not my inability to read. Link to comment Share on other sites More sharing options...
♥ecartz Posted March 13, 2004 Share Posted March 13, 2004 Which line is 497 in your install? Hth, Matt Always back up before making changes. Link to comment Share on other sites More sharing options...
Guest Posted January 9, 2007 Share Posted January 9, 2007 How would you age restrict a sub category only? Rich Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.