akmac
-
Posts
447 -
Joined
-
Last visited
Posts posted by akmac
-
-
Jack,
OK-I jumped in and installed the new version(3.2.3) and as you've noted in the docs, I have some issue with my modified admin/categories.php. Namely, I get this error when I try to load it:
Parse error: syntax error, unexpected '}' in /blablah/admin/categories.php on line 1374
The referenced line is the third line in this portion of the code:
<?php /*** Begin Header Tags SEO ***/ ?> <?php } elseif ($action == 'new_product_preview') { if (tep_not_null($HTTP_POST_VARS)) { $pInfo = new objectInfo($HTTP_POST_VARS); $products_name = $HTTP_POST_VARS['products_name']; $products_description = $HTTP_POST_VARS['products_description']; $products_head_title_tag = $HTTP_POST_VARS['products_head_title_tag']; $products_head_desc_tag = $HTTP_POST_VARS['products_head_desc_tag']; $products_head_keywords_tag = $HTTP_POST_VARS['products_head_keywords_tag']; $products_url = $HTTP_POST_VARS['products_url']; } else { $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_bimage, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'"); $product = tep_db_fetch_array($product_query); /*** End Header Tags SEO ***/ $pInfo = new objectInfo($product); $products_image_name = $pInfo->products_image; $products_bimage_name = $pInfo->products_bimage; }
Note that this portion of code was also previously modified by Big Images Modification v1.25 for osCommerce 2.2 MS2 -only
-
Jack,
First of all, thanks for your tireless work on this useful contribution! I have a very old version installed on my site (2.3.7) and it has been working fine for years. Except, for some reason it adds an extra that bumps the site design down, creating extra white space at the top of the site. I installed the newest version on my dev server, which corrected the space issue, but would give me mysql errors for unrecognized db categories. Rather than fight all that to fix this one small issue, is there a simpler fix?
Thanks for your time!
-
I am having the same issue as Claudia, though I am running PHP 4.3.10-22. If anyone has solved this problem-please enlighten us!
-
Hello All!
I have this contribution installed:
http://addons.oscommerce.com/info/390
And it's been working great for years. A few weeks ago, my host moved me to a new server, and since then, the second column (that allows you to enter the price changes) has disappeared. It may be due to some change in the version of PHP, or something else-but I can't seem to find it. If any of you php experts could point me in the right direction-I'd appreciate it!
Here is the code:
<body bgcolor="#FFFFFF"> <table> <tr> <td colspan="2"><? echo TEXT_CHOOSE_CATEGORY ?></td> </tr> <tr> <td valign="top"> <?php if(mysql_num_rows($sql3)) { while($row = mysql_fetch_row($sql3)) { print("<a href=\"".$_SERVER["PHP_SELF"]."?action=category&option={$row[0]}\">$row[1]</a><br>"); } } ?> </td> <td align="right" valign="top"> <?php if ($action == "category") { echo "<form name=\"update\" method=\"post\" action=\"".$_SERVER["PHP_SELF"]."?action=update_prices\">"; echo "<table>"; echo "<tr><th>"; echo TEXT_PRODUCTS_MODEL; echo "</th><th>"; echo TEXT_PRODUCTS; echo "</th><th>";echo TEXT_PRODUCTS_PRICE_INFO; echo"</th></tr><tr>"; $result = mysql_query("SELECT * FROM products, products_description, products_to_categories WHERE products_to_categories.categories_id = $option AND products_to_categories.products_id = products.products_id AND products.products_id = products_description.products_id"); if ($row = mysql_fetch_array($result)) { do { echo "<td align=\"center\">".$row["products_id"]."</td>\n"; echo "<td>".$row["products_name"]."</td>\n"; echo "<td align=\"center\"><input type=\"text\" name=\"product_new_price[".$row['products_id']."]\" value={$row['products_price']}></td>\n"; echo "</tr>\n"; } while($row = mysql_fetch_array($result)); } echo "</table>\n"; echo "<br><input type=\"submit\" value="; echo TEXT_UPDATE_PRICES; echo ">"; echo "</form>"; } ?> </td> </tr> </table> </form><br>
First section of PHP is where I believe the error may be, as this part shows-but the next column doesn't show at all. So, I guess the problem could be in the second column code too-I just don't know. Thanks in advance for any help!
-
Same problem as many-my files in the root directory are not being overwritten, but the xml files are being created with the "googlesitemap" directory name added. I tried the adding backslash trick and that fixed the name, but moved the xml files inisde the "googlesitemap" directory. I'm sure it's a simple problem-just not as simple as I.
Any help?
-
This is the actual code I want to change (speicifically "><b>Gift Vouchers/Discount Coupons</b></). I just don't know where it's located:
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr><td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td>
<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >
<td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td> <td class="main"><b>Gift Vouchers/Discount Coupons</b></td><td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td> </tr>
<tr>
Can anyone help?
In includes/languages/english/modules/order_total/ot_coupon.php edit:
define('MODULE_ORDER_TOTAL_COUPON_HEADER', 'Gift Certificates/Discount Coupons');
-
Nevermind-found the missing closing bracket on line 304. If you get any ideas on why the header always wants to show the my account and log off links I'd love to hear. Seems like it's not recognizing the createaccount=N or some such thing...
-
Hi Frank, I'm trying to get the How-did-you-hear-about-us contribution to display correctly, but I'm getting a parse error:
Parse error: parse error, unexpected $ in /data/www/data/k2152/html/create_account_referrer.php on line 680
And can't find where it's at in the page you sent me, but I know it's in the sections that were originally commented out by you because I only get the parse error when I uncomment them. I've put these lines in red comment tags (that don't work inside the code tags = ):
<?php /* $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); /////////////////////////////////////// //configuration $show_account_box = 1; //IF you want to give the option to create an account with random password choose to 0 if not $create_password = 0;// set to 1 to create an account with random password $show_login=1;// set to 1 to show login box //////////////////////////////////////////// require(DIR_WS_LANGUAGES . $language . '/' . 'fast_account.php'); if ((tep_session_is_registered('customer_id'))&&(tep_session_is_registered('createaccount'))) { tep_redirect(tep_href_link('account_password_new.php', '', 'SSL')); } if (tep_session_is_registered('customer_id')) { tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL')); } // needs to be included earlier to set the success message in the messageStack require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT); $process = false; if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) { //START REGISTRATION CODE $formlogin = tep_db_prepare_input($HTTP_POST_VARS['form_login']); //next two lines gives you a temporary fixed password you can change to what you like $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); //start type one create assount //FORMLOGIN=1 WHEN CREATE ACCOUNT IS MANDATORY if($fromlogin==1){ $createaccount='Y'; $password = tep_db_prepare_input($HTTP_POST_VARS['password']); $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']); } //THIS IS WHEN A CHECK BOX INVITES TO HAVE AN ACCOUNT if ($create_password == 1) { $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); if ($createaccount!='Y')$createaccount='N'; $password = tep_create_random_value(15); $confirmation = $password; } //THIS IS WHEN CUSTOMER CHOOSES WITH PASSWORD //start type two create account if ($show_account_box == 1) { $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); if ($createaccount=='Y') { $password = tep_db_prepare_input($HTTP_POST_VARS['password']); $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']); }else{ $createaccount='N'; $password = tep_create_random_value(15); $confirmation = $password; } } $process = true; // $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); // if ($createaccount== '') $createaccount='Y'; if (ACCOUNT_GENDER == 'true') { if (isset($HTTP_POST_VARS['gender'])) { $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); } else { $gender = false; } } $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']); $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); $city = tep_db_prepare_input($HTTP_POST_VARS['city']); if (ACCOUNT_STATE == 'true') { $state = tep_db_prepare_input($HTTP_POST_VARS['state']); if (isset($HTTP_POST_VARS['zone_id'])) { $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); } else { $zone_id = false; } } $country = tep_db_prepare_input($HTTP_POST_VARS['country']); $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']); $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']); if (isset($HTTP_POST_VARS['newsletter'])) { $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']); } else { $newsletter = false; } [color=#FF0000]//fec referral begin $source = tep_db_prepare_input($HTTP_POST_VARS['source']); if (isset($HTTP_POST_VARS['source_other'])) $source_other = tep_db_prepare_input($HTTP_POST_VARS['source_other']); //fec referral end[/color] $error = false; if (ACCOUNT_GENDER == 'true') { if ( ($gender != 'm') && ($gender != 'f') ) { $error = true; $messageStack->add('create_account', ENTRY_GENDER_ERROR); } } if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR); } if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR); } if (ACCOUNT_DOB == 'true') { if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) { $error = true; $messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR); } } if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR); } elseif (tep_validate_email($email_address) == false) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } else { $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); $check_email = tep_db_fetch_array($check_email_query); /* if ($check_email['total'] > 0) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); }*/ if ($check_email['total'] > 0) { //PWA delete account $get_customer_info = tep_db_query("select customers_id, customers_email_address, createaccount from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); $customer_info = tep_db_fetch_array($get_customer_info); $customer_id = $customer_info['customers_id']; $customer_email_address = $customer_info['customers_email_address']; $customer_pwa = $customer_info['createaccount']; if ($customer_pwa =='Y') { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); } else { if (tep_session_is_registered('createaccount')) tep_session_unregister('createaccount'); if (tep_session_is_registered('registered_now')) tep_session_unregister('registered_now'); tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'"); } } // END } if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR); } [color=#FF0000]//fec referral begin if ((tep_not_null(tep_get_sources())) && (REFERRAL_REQUIRED == 'true') && (is_numeric($source) == false)) { $error = true; $messageStack->add('create_account', ENTRY_SOURCE_ERROR); } if ((REFERRAL_REQUIRED == 'true') && (DISPLAY_REFERRAL_OTHER == 'true') &&($source == '9999') && (!tep_not_null($source_other)) ) { $error = true; $messageStack->add('create_account', ENTRY_SOURCE_OTHER_ERROR); } //fec referral end [/color] if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_POST_CODE_ERROR); } if (strlen($city) < ENTRY_CITY_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_CITY_ERROR); } if (is_numeric($country) == false) { $error = true; $messageStack->add('create_account', ENTRY_COUNTRY_ERROR); } if (ACCOUNT_STATE == 'true') { $zone_id = 0; $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'"); $check = tep_db_fetch_array($check_query); $entry_state_has_zones = ($check['total'] > 0); if ($entry_state_has_zones == true) { $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')"); if (tep_db_num_rows($zone_query) == 1) { $zone = tep_db_fetch_array($zone_query); $zone_id = $zone['zone_id']; } else { $error = true; $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT); } } else { if (strlen($state) < ENTRY_STATE_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_STATE_ERROR); } } } if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR); } if ($createaccount == 'Y') { if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_PASSWORD_ERROR); } elseif ($password != $confirmation) { $error = true; $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING); } } if ($error == false) { $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'confirmation_key' => $confirmation, 'createaccount' => $createaccount, 'customers_password' => tep_encrypt_password($password)); if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob); tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); $customer_id = tep_db_insert_id(); $sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country); if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender; if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company; if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb; if (ACCOUNT_STATE == 'true') { if ($zone_id > 0) { $sql_data_array['entry_zone_id'] = $zone_id; $sql_data_array['entry_state'] = ''; } else { $sql_data_array['entry_zone_id'] = '0'; $sql_data_array['entry_state'] = $state; } } tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); $address_id = tep_db_insert_id(); tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); [color=#FF0000]//fec referral begin //fec multi-stores edited next line tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('" . (int)$customer_id . "', '0', now(), '". (int)$source . "')"); if ($source == '9999') { tep_db_query("insert into " . TABLE_SOURCES_OTHER . " (customers_id, sources_other_name) values ('" . (int)$customer_id . "', '". tep_db_input($source_other) . "')"); // fec IF YOU WANT TO INCLUDE THE WHERE DID YOU HEAR FROM US YOU HAVE COMMENT OUT THE NEXT LINE ALSO //fec referral end [/color] //tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); $shipping_address_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'"); $shipping_address = tep_db_fetch_array($shipping_address_query); $billto = $shipping_address['address_book_id']; $sendto = $shipping_address['address_book_id']; tep_session_register('billto'); tep_session_register('sendto'); $billto = $shipping_address['address_book_id']; $sendto = $shipping_address['address_book_id']; if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $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'); tep_session_unregister('createaccount'); if ($createaccount == 'N') tep_session_register('createaccount'); // restore cart contents $cart->restore_contents(); // build the message content $name = $firstname . ' ' . $lastname; if (ACCOUNT_GENDER == 'true') { if ($gender == 'm') { $email_text = sprintf(EMAIL_GREET_MR, $lastname); } else { $email_text = sprintf(EMAIL_GREET_MS, $lastname); } } else { $email_text = sprintf(EMAIL_GREET_NONE, $firstname); } $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; if ($createaccount == 'Y') tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); if ($createaccount == 'Y') { if ($cart->count_contents() > 0) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } else { tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); } } else { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <?php require('includes/form_check.js.php'); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"> <table width="64" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="175"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table> </td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr height="26"> <td valign="top" height="26"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> </tr> </table></td> </tr> <?php if($fromlogin!=1){ ?> <tr> <td><?php if ($show_login ==1) { require('includes/fec/login_box.php');}else{echo PRIMARY_ADDRESS_DESCRIPTION; } ?></td> </tr> <?php } ?> <td width="100%" valign="top"><?php echo tep_draw_form(FILENAME_CREATE_ACCOUNT, tep_href_link('create_account.php', '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?> <tr> <td class="smallText"></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($messageStack->size('create_account') > 0) { ?> <tr> <td><?php echo $messageStack->output('create_account'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td height="18" class="headerNavigation"><?php echo LOGINBOX_NEW_CUSTOMER ?></td> <td class="headerNavigation" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td> </tr> </table> </td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <?php if (ACCOUNT_GENDER == 'true') { ?> <tr> <td class="main"><?php echo ENTRY_GENDER; ?></td> <td class="main"><?php echo tep_draw_radio_field('gender', 'm') . ' ' . MALE . ' ' . tep_draw_radio_field('gender', 'f') . ' ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td> </tr> <?php } ?> <tr> <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('firstname') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_LAST_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('lastname') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td> </tr> <?php if (ACCOUNT_DOB == 'true') { ?> <tr> <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td> <td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td> </tr> <?php } ?> <tr> <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td> <td class="main"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td> <td class="main"><?php echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td> <td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CITY; ?></td> <td class="main"><?php echo tep_draw_input_field('city') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_STATE; ?></td> <td class="main"><?php if ($process == true) { if ($entry_state_has_zones == true) { $zones_array = array(); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo tep_draw_pull_down_menu('state', $zones_array); } else { echo tep_draw_input_field('state'); } } else { echo tep_draw_input_field('state'); } if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_POST_CODE; ?></td> <td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?></td> <td class="main"><?php echo tep_get_country_list('country', STORE_COUNTRY) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> <?php if (ACCOUNT_COMPANY == 'true') { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="main"><?php echo ENTRY_COMPANY; ?></td> <td class="main"><?php echo tep_draw_input_field('company') . ' ' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td> <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td> </tr> <?php if ($create_password == 1) { if($fromlogin!=1){ ?> <tr> <td class="main"><?php echo YES_ACCOUNT; ?></td> <td class="main"><?php echo tep_draw_checkbox_field('createaccount', 'Y') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': '');?></td> </tr> <?php } } ?> </table> </td> </tr> </table> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php //fec referral begin ?><?php if (tep_not_null(tep_get_sources())) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php// echo CATEGORY_SOURCE; ?></b></td> </tr> <tr> <td><?php if (DISPLAY_REFERRAL_OTHER == 'true') { ?> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="main"><?php echo ENTRY_SOURCE; ?></td> <td class="main"><?php echo tep_get_source_list('source', (DISPLAY_REFERRAL_OTHER == 'true' ? true : false)) . ' ' . (tep_not_null(ENTRY_SOURCE_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_SOURCE_OTHER; ?></td> <td class="main"><?php echo tep_draw_input_field('source_other') . ' ' . (tep_not_null(ENTRY_SOURCE_OTHER_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_OTHER_TEXT . '</span>': ''); ?></td> </tr> </table> <?php } ?></td> </tr> </table> </td> </tr> <?php } ?><?php //rmh M-S_referral end ?><?php if ($show_account_box == 1) require('includes/fec/account_box.php'); ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php // $fromlogin=1000; echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE).tep_draw_hidden_field('form_login',$fromlogin); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"> <table width="64" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="175"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table> </td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php include(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
I'm currently running the commented version on the site, and it works except for actually inserting the selected value into the db (understandably). I just need help finding the parse error that is caused when the code is uncommented. -Thanks!
-
Hi frank,
Do you think the issue with my header could be related to having master password installed?
-
No, that gives me the same. weird.
-
I tried that-it's still showing both Log Off and My account...
-
Ah, just noticed- when a customer elects to proceed without creating an account, the "Log Off | My Account" still shows in the header. Here is my applicable header code:
<tr> <td align="right" bgcolor="#cccccc"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <a href="<?php if (!tep_session_is_registered('createaccount')) {echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; } else {echo tep_href_link('account_password_new.php', '', 'SSL'); ?>" class="headerNavigation"> <?php echo 'Create Account'; } ?></a> <?php } else { ?><a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a> <?php } ?><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?><?php echo $currencies->format($cart->show_total());?></a> <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> </tr>
-
This is what I have there currently:
// build the message content $name = $firstname . ' ' . $lastname; if (ACCOUNT_GENDER == 'true') { if ($gender == 'm') { $email_text = sprintf(EMAIL_GREET_MR, $lastname); } else { $email_text = sprintf(EMAIL_GREET_MS, $lastname); } } else { $email_text = sprintf(EMAIL_GREET_NONE, $firstname); } $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; if ($createaccount == 'Y') tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); if ($createaccount == 'Y') { if ($cart->count_contents() > 0) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } else { tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); } } else { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } }
Also, for anyone who has the Email Subject Contribution installed, this is the code I hacked together in order to get it to work for the second FEC code change in admin/orders.php:
// start no account changes & Email Subject Contribution $noaccount_check_query= tep_db_query("select createaccount from " . TABLE_CUSTOMERS . " where customers_id = '" . $cust_id . "'"); $noaccount_check= tep_db_fetch_array($noaccount_check_query); if ($noaccount_check['createaccount'] == 'Y'){ $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } else {$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT_1. $oID . EMAIL_TEXT_SUBJECT_2 . $order_status_array[$status], $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $customer_notified = '1'; } // end FEC & replacement section for Email Subject contribution
I think it works...
-
thanks stacey
cleve i was wondering if you have changed the define in the includes/filename.php from create_account.php to create_account2.php
as of now when you are using this file you submit the form to FILENAME_CREATE_ACCOUNT so your changes to this file does not get reflected to your erroe habdelingyou have to either change the define or change FILENAME_CREATE_ACCOUNT to 'create_account2.php' in line 379
this migh resolve your error issue if not then i have o look again
You were right! My glorious new checkout process is complete! Thank YOU!
I was referring earlier to admin/orders.php having a parse error-I'll see if I can't add the fixes without a closing bracket or something. As an aside, I noticed that when I elect to create an account-I no longer receive the welcome email. Not a big deal, but if you know a fix it would be handy as I use that email to notify customers of some member promotions.
THANKS!
-
cleve
you have to make the changes to create_account2.php that you made for the hide password to create_account3.php.
did you try the box that i sent you this would give the two addresses and comment in one box
what is order.php?
david he is correct i also have this pointed out in the contribution section and probably in a couple of post after the original question i f i remember
Nana,
I just tried those-same error. Here is my create_account2.php:
<?php /* $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ /////////////////////////////////////// //configuration $show_account_box = 1; //IF you want to give the option to create an account with random password choose to 0 if not $create_password = 0;// set to 1 to create an account with random password $show_login=1;// set to 1 to show login box //////////////////////////////////////////// require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . 'fast_account.php'); if ((tep_session_is_registered('customer_id'))&&(tep_session_is_registered('createaccount'))) { tep_redirect(tep_href_link('account_password_new.php', '', 'SSL')); } if (tep_session_is_registered('customer_id')) { tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL')); } // needs to be included earlier to set the success message in the messageStack require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT); $process = false; if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) { //START REGISTRATION CODE $formlogin = tep_db_prepare_input($HTTP_POST_VARS['form_login']); //next two lines gives you a temporary fixed password you can change to what you like $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); //start type one create account //FORMLOGIN=1 WHEN CREATE ACCOUNT IS MANDATORY if($fromlogin==1){ $createaccount='Y'; $password = tep_db_prepare_input($HTTP_POST_VARS['password']); $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']); } //THIS IS WHEN A CHECK BOX INVITES TO HAVE AN ACCOUNT if ($create_password == 1) { $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); if ($createaccount!='Y')$createaccount='N'; $password = tep_create_random_value(15); $confirmation = $password; } //THIS IS WHEN CUSTOMER CHOOSES WITH PASSWORD //start type two create account if ($show_account_box == 1) { $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); if ($createaccount!='Y')$createaccount='N'; if ($createaccount=='Y') { $password = tep_db_prepare_input($HTTP_POST_VARS['password']); $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']); }else{ $password = tep_create_random_value(15); $confirmation = $password; } } $process = true; // $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); // if ($createaccount== '') $createaccount='Y'; if (ACCOUNT_GENDER == 'true') { if (isset($HTTP_POST_VARS['gender'])) { $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']); } else { $gender = false; } } $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']); $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']); if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']); $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']); if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']); $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']); $city = tep_db_prepare_input($HTTP_POST_VARS['city']); if (ACCOUNT_STATE == 'true') { $state = tep_db_prepare_input($HTTP_POST_VARS['state']); if (isset($HTTP_POST_VARS['zone_id'])) { $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']); } else { $zone_id = false; } } $country = tep_db_prepare_input($HTTP_POST_VARS['country']); $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']); $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']); if (isset($HTTP_POST_VARS['newsletter'])) { $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']); } else { $newsletter = false; } $error = false; if (ACCOUNT_GENDER == 'true') { if ( ($gender != 'm') && ($gender != 'f') ) { $error = true; $messageStack->add('create_account', ENTRY_GENDER_ERROR); } } if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR); } if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR); } if (ACCOUNT_DOB == 'true') { if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) { $error = true; $messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR); } } if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR); } elseif (tep_validate_email($email_address) == false) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } else { $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); $check_email = tep_db_fetch_array($check_email_query); /* if ($check_email['total'] > 0) { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); }*/ if ($check_email['total'] > 0) { //PWA delete account $get_customer_info = tep_db_query("select customers_id, customers_email_address, createaccount from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'"); $customer_info = tep_db_fetch_array($get_customer_info); $customer_id = $customer_info['customers_id']; $customer_email_address = $customer_info['customers_email_address']; $customer_pwa = $customer_info['createaccount']; if ($customer_pwa =='Y') { $error = true; $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS); } else { if (tep_session_is_registered('createaccount')) tep_session_unregister('createaccount'); if (tep_session_is_registered('registered_now')) tep_session_unregister('registered_now'); tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'"); tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'"); } } // END } if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR); } if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_POST_CODE_ERROR); } if (strlen($city) < ENTRY_CITY_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_CITY_ERROR); } if (is_numeric($country) == false) { $error = true; $messageStack->add('create_account', ENTRY_COUNTRY_ERROR); } if (ACCOUNT_STATE == 'true') { $zone_id = 0; $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'"); $check = tep_db_fetch_array($check_query); $entry_state_has_zones = ($check['total'] > 0); if ($entry_state_has_zones == true) { $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')"); if (tep_db_num_rows($zone_query) == 1) { $zone = tep_db_fetch_array($zone_query); $zone_id = $zone['zone_id']; } else { $error = true; $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT); } } else { if (strlen($state) < ENTRY_STATE_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_STATE_ERROR); } } } if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR); } if ($createaccount == 'Y') { if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) { $error = true; $messageStack->add('create_account', ENTRY_PASSWORD_ERROR); } elseif ($password != $confirmation) { $error = true; $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING); } } if ($error == false) { $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'confirmation_key' => $confirmation, 'createaccount' => $createaccount, 'customers_password' => tep_encrypt_password($password)); if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender; if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob); tep_db_perform(TABLE_CUSTOMERS, $sql_data_array); $customer_id = tep_db_insert_id(); $sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country); if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender; if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company; if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb; if (ACCOUNT_STATE == 'true') { if ($zone_id > 0) { $sql_data_array['entry_zone_id'] = $zone_id; $sql_data_array['entry_state'] = ''; } else { $sql_data_array['entry_zone_id'] = '0'; $sql_data_array['entry_state'] = $state; } } tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array); $address_id = tep_db_insert_id(); tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'"); tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())"); $shipping_address_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'"); $shipping_address = tep_db_fetch_array($shipping_address_query); $billto = $shipping_address['address_book_id']; $sendto = $shipping_address['address_book_id']; tep_session_register('billto'); tep_session_register('sendto'); $billto = $shipping_address['address_book_id']; $sendto = $shipping_address['address_book_id']; if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $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'); tep_session_unregister('createaccount'); if ($createaccount == 'N') tep_session_register('createaccount'); // restore cart contents $cart->restore_contents(); // build the message content $name = $firstname . ' ' . $lastname; if (ACCOUNT_GENDER == 'true') { if ($gender == 'm') { $email_text = sprintf(EMAIL_GREET_MR, $lastname); } else { $email_text = sprintf(EMAIL_GREET_MS, $lastname); } } else { $email_text = sprintf(EMAIL_GREET_NONE, $firstname); } $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; if ($createaccount == 'Y') tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); if ($createaccount == 'Y') { if ($cart->count_contents() > 0) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } else { tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL')); } } else { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <?php require('includes/form_check.js.php'); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"> <table width="64" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="175"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table> </td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr height="26"> <td valign="top" height="26"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> </tr> </table></td> </tr> <?php if($fromlogin!=1){ ?> <tr> <td><?php if ($show_login ==1) { require('includes/fec/login_box.php');}else{echo PRIMARY_ADDRESS_DESCRIPTION; } ?></td> </tr> <?php } ?> <td width="100%" valign="top"><?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?> <tr> <td class="smallText"></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($messageStack->size('create_account') > 0) { ?> <tr> <td><?php echo $messageStack->output('create_account'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td height="18" class="headerNavigation"> <?php echo LOGINBOX_NEW_CUSTOMER ?></td> <td class="headerNavigation" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td> </tr> </table> </td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <?php if (ACCOUNT_GENDER == 'true') { ?> <tr> <td class="main"><?php echo ENTRY_GENDER; ?></td> <td class="main"><?php echo tep_draw_radio_field('gender', 'm') . ' ' . MALE . ' ' . tep_draw_radio_field('gender', 'f') . ' ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td> </tr> <?php } ?> <tr> <td class="main"><?php echo ENTRY_FIRST_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('firstname') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_LAST_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('lastname') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td> </tr> <?php if (ACCOUNT_DOB == 'true') { ?> <tr> <td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td> <td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td> </tr> <?php } ?> <tr> <td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td> <td class="main"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td> <td class="main"><?php echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td> <td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CITY; ?></td> <td class="main"><?php echo tep_draw_input_field('city') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_STATE; ?></td> <td class="main"><?php if ($process == true) { if ($entry_state_has_zones == true) { $zones_array = array(); $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name"); while ($zones_values = tep_db_fetch_array($zones_query)) { $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']); } echo tep_draw_pull_down_menu('state', $zones_array); } else { echo tep_draw_input_field('state'); } } else { echo tep_draw_input_field('state'); } if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_POST_CODE; ?></td> <td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_COUNTRY; ?></td> <td class="main"><?php echo tep_get_country_list('country', STORE_COUNTRY) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> <?php if (ACCOUNT_COMPANY == 'true') { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="main"><?php echo ENTRY_COMPANY; ?></td> <td class="main"><?php echo tep_draw_input_field('company') . ' ' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td> <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td> </tr> <?php if ($create_password == 1) { if($fromlogin!=1){ ?> <tr> <td class="main"><?php echo YES_ACCOUNT; ?></td> <td class="main"><?php echo tep_draw_checkbox_field('createaccount', 'Y') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': '');?></td> </tr> <?php } } ?> </table> </td> </tr> </table> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($show_account_box == 1) require('includes/fec/account_box.php'); ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php // $fromlogin=1000; echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE).tep_draw_hidden_field('form_login',$fromlogin); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"> <table width="64" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="175"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table> </td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php include(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
I haven't tried the box yet-which box is it meant to replace?
-
Thanks akmac, worked as it should now. Only one question though what about calls to the other *_box.php files in the /fec directory, don't their paths have to be updated in other files also?
Thanks
David C
It would seem so, but that is the only fix mentioned. My fingers are crossed too.
-
David,
Upload the fec folder, and all it's contents to the catalog/includes directory. You'll then need to change the paths in the create_account pages from:
{ require('login_box.php
to
{ require('includes/fec/login_box.php
You'll need to change this in two places on each page :create_account.php and create_account3.php (or in whichever one you plan to use)
Nana,
Thanks for the PM-the checkout_process.php works perfectly-thanks! I made the changes to the form_check.js.php and I can now use create_account3.php without entering passwords, but it still gives me the "password must contain 5 characters etc" error in create_account2.php (your create_account.php).
One thing that is different, is that instead of giving me the error in a pop up box like it did previously, it now redirects me from create_account2.php to create_account.php and gives me the error on the page with highlighting.
I tried replacing my create_account2.php with the stock create_account.php supplied in the contribution, but got the same result.
So, what is it in create_account3.php that allows it to function without a password, that isn't included in create_account.php?
This and the orders.php are the last two things I'll bug you with-promise!
-
akmac i will take a look at both your issues when i get home
i have a few questions
1- by requiring password do you mean you have the popup shows that you need password or is it an error message in the page
and is your checkout_process.php the same you have posted before?
Nana,
Yes, it gives me the "password must contain 5 characters etc" error message-even though the password fields aren't there.
Yes, I posted the working checkout_process.php earlier-I can again if you need.
-
Understandable-can you help my diagnose why both create_account.php and create_account3.php (in the contribution) are requiring passwords?
Could that be caused by me still using my (working) checkout_process.php?
I understand that you are donating your time, and I appreciate it. Will appreciate it more when/if I get it to work. I'm sure it's my own error, or a conflict with one of many installed mods/hacks, but I need help fixing it.
-
Here's what I'd like to use, with the password fields being hidden until the user checks "Yes, please create an account for me.
Also, I'd like to add the "How did you hear about us". If you can do this, I'm sure lots of us would use it.
-
Frank,
I'm wondering if the need for me to enter a password is related to:
//THIS IS WHEN A CHECK BOX INVITES TO HAVE AN ACCOUNT if ($create_password == 1) { $createaccount = tep_db_prepare_input($HTTP_POST_VARS['createaccount']); if ($createaccount!='Y')$createaccount='N'; $password = tep_create_random_value(15); $confirmation = $password; }
But I'm really quite clueless. Please take a look at my create_account2.php and let me know why it's requiring a password. Seems like there should be an else statement that would determine that if the box isn't checked, it means the customer doesn't want to create an account, like in create_account3.php (I think)
-
i thought you had the checkout_process working i erased one that i made when i saw your post
i will take a look again
in orders we are just trying to remove the part that shop sends an email if customer does not have an account
it first looks if this customer has an account and then sends the email
just slowly read the file where you are making changes and ignore tep you will get a much better understanding of what is happenning
I have my old checkout_process.php going now.
Also-I'm trying to get create_account2.php to work on my site, but it's still requiring me to enter a password. Any ideas?
-
Nana,
The show/hide feature was for create_account.php, not create_account3.php. Currently, I have my functioning create_account.php live. Then I have create_account2.php (your create-account.php), and create_account3.php. I'm interested in using create_account2.php once it's working with the show/hide feature. Currently, it won't allow me to check "no thanks"-it requires that I enter passwords. On the demo you had on your site for awhile, it just had one option, with one checkbox. If you didn't want to create an account, you just didn't check the box. But if you did, you checked the box-and then the password entry and confirm fields would show. This is what I want.
I'm using my old checkout_process.php because yours returns an error-same with admin/orders.php. I don't need the modifications on checkout success.php because I've already removed the features that fec changes.
Nana-apologies-I was mislead by the insructions to modify create_account3.php and not create_account.php (which the mod affects) My mistake! Looks great so far. Now if only I can get checkout_process and admin/orders.php to work...
-
i just added the show hide feature and instalation steps to the contribution section
Nana,
The show/hide feature was for create_account.php, not create_account3.php. Currently, I have my functioning create_account.php live. Then I have create_account2.php (your create-account.php), and create_account3.php. I'm interested in using create_account2.php once it's working with the show/hide feature. Currently, it won't allow me to check "no thanks"-it requires that I enter passwords. On the demo you had on your site for awhile, it just had one option, with one checkbox. If you didn't want to create an account, you just didn't check the box. But if you did, you checked the box-and then the password entry and confirm fields would show. This is what I want.
I'm using my old checkout_process.php because yours returns an error-same with admin/orders.php. I don't need the modifications on checkout success.php because I've already removed the features that fec changes.
Header Tags SEO
in General Add-Ons Support
Posted
Comparing the two files, the section of code referenced by the error is identical to the functioning file-that's why I posted here. The only difference is that the newer version is commented while the version I have running on the live site is not commented. Is it possible that the line counts are not accurate with error messages? I have chemos ultimate seo urls installed in that file, as well as Category Descriptions V 1.9.