Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fast easy checkout


nana

Recommended Posts

Interesting...  It creates accounts and new accounts can log in just fine.

But if i recreate the original test account with same email, it will not let it in.  Maybe something wrong with my eye's  :'(

Also, found one more problem.

 

In the check out phase, I enter credit info, choose shipping method, etc.  When I click on Continue, it kicks me to login page.

 

Also, it does not load shipping/billing adress from the user account data into the check out window.  When trying to enter it manually, it doesnt give any error just doesnt input it.  Actually, it doesnt set it as primary adress automatically.  Have to set it manually.

 

 

Forgot to add. When set to primary, it only automatically chooses the adress for Billing, have to enter Shipping one manually. :-"

Link to comment
Share on other sites

  • Replies 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

Interesting...  It creates accounts and new accounts can log in just fine.

But if i recreate the original test account with same email, it will not let it in.  Maybe something wrong with my eye's  :'(

it is supposed to let you create a new account if you have chosen to not create an account originally

in another words no_accounts can buy again which at this stage it removes the original non accounts

BUT if you create an account it will not let you reuse that email address again and it will not erase registered accounts"{ account with password}

In the check out phase, I enter credit info, choose shipping method, etc.  When I click on Continue, it kicks me to login page.

you are losing the session and login here i do not know why

i would comment out the part of the code in checkout_confirmation.php that redirects you to login if not regiser and see what you get but first add

  if ($session_started == false) {
   tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
 }

to create_account.php right after

 require('includes/application_top.php');

and see if the issue is resolved

are you forcing cookies

Also, it does not load shipping/billing adress from the user account data into the check out window.  When trying to enter it manually, it doesnt give any error just doesnt input it.  Actually, it doesnt set it as primary adress automatically.  Have to set it manually.

which create _account you are using

my last suggestion might resolve this issue also

if not i will try to recreate this and see if i can figure it out

Link to comment
Share on other sites

Hi. I get this error everytime at checkout_process.php:

 

1054 - Unknown column 'createaccount' in 'field list'

insert into orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, createaccount, currency_value)

 

Can anyone please help???

Thanks in advance.

Link to comment
Share on other sites

Hi. I get this error everytime at checkout_process.php:

 

1054 - Unknown column 'createaccount' in 'field list'

insert into orders (customers_id, customers_name, customers_company, customers_street_address,

 

And by the way, I've already done

ALTER TABLE `customers` ADD `createaccount` CHAR( 1 ) NOT NULL;

 

Why is the error saying insert the column 'createaccount' to the 'orders' table? That enables the account registration page which defeats the purpose of this contribution, right?

Edited by Otto
Link to comment
Share on other sites

i thought i have remove the line that causes this error

the reason is that when you update the order in the admin section an email is sent to the customer and now we do not want the email sent to non_account customers.

originaly i had the field added to the orders but i thought i changed that and have a query to check if the customer is a non+account.

any how i will post a new version with the bugsthat are found removed.

Link to comment
Share on other sites

i thought i have remove the line that causes this error

the reason is that when you update the order in the admin section an email is sent to the customer and now we do not want the email sent to non_account customers.

originaly i had the field added to the orders but i thought i changed that and have a query to  check if the customer is a non+account.

any how i will post a new version with the bugsthat are found removed.

 

Thanks for such a quick response, frank. That's awesome that you'll post a new version. Any idea when you'll be doing that? If it'll be for a little while, could you at least let me know what to do at least for the problem I'm having? I'm trying to get oscommerce working for someone else and they really want your contribution to work.

Anyway, thanks so much for your effort!

Link to comment
Share on other sites

Ok. Here's my next obstacle and I'm hoping that you could help. I have just installed BTS templating system and carefully edited the conflicting files so that both BTS and 'fast easy checkout' can co-exist. My edit of these files appears to be working except for create_account3.php. I really like the way create_account3.php is set up but BTS takes away this feature in create_account3.php.

 

I'm not a coder... and I figured this might make more sense to you... Below example is the entire code for the create_account.php page for BTS. This was what I was using (pretty much the last 4 lines) as the basis to edit create_account3.php to work with BTS and fast easy checkout:

<?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');

// 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')) {
   $process = true;

   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;
   }
   $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
   $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

   $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 (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 (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,
                             '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())");

     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');

// 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;
     tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

     tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
   }
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

 $content = CONTENT_CREATE_ACCOUNT;
 $javascript = 'form_check.js.php';
 include (bts_select('main', $content_template)); // BTSv1.5

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Thanks in advance.

Link to comment
Share on other sites

Hmmm... Ok, so it's not as simple as I thought it was going to be. I just realized that BTS has pretty much disabled 'fast easy checkout'. Now when I test the checkout procedure, an account is created and the customer is logged in automatically, which is not what I want at all.

 

[rant]

osCommerce giving me a lot of unnecessary headaches... I would be using CubeCart or even Zen-cart instead... but the only reason I came back to trying osCommerce is precisely because of this 'fast easy checkout' contribution. But while CubeCart has an elegant, built-in templating system that xhtml and css compliant, osCommerce is a nightmare to custom design for a non-coder. That's why I thought BTS would come to the rescue, but it has only resulted in disabling the only reason why I decided to use osCommerce in the first place.

[/rant]

 

I guess I'll have to uninstall BTS and try to design the osCommerce using the default way.

 

But if anyone here has a solution for 'fast easy checkout' contribution to co-exist harmoniously with BTS, then by all means, I'm all ears!

Link to comment
Share on other sites

i have not used either bts or sts.

zencart is a fork of oscommerce with some builtin modules

as far as the code you supplied i will take a look at it when i get to work but i do not think it should be such a big problem.

as far as the checkout procedure logging you auto have not really added anyhing to this part of the code that involves loggin can you please elaborate what exactly is happening

Link to comment
Share on other sites

by just looking at the bts code it seems that it is just the code part of the file

so i have to assume that there must be another part that is the html part

and i have to assune that you also have to change that part to have both forms in it

if i had to make a file similar to what you posted for create_account3.php it would be this keep in mind that i have not tested this and you also have to change the html part without these changes you will not see the changes in the form itself but i think it should not stop it from working either

to keep a simpler aproach you might want to try to stay with create_account.php since in this there is only one address and easier to make the modifications

<?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');

// 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')) {
  $process = true;

  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;
  }
  $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
  $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

  $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 (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 (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,
                            '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())");

    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');

// restore cart contents
    $cart->restore_contents();
     $billto = tep_db_insert_id();
    tep_session_unregister('billto');
    tep_session_register('billto');
    $billto = tep_db_insert_id();
   //START DIFFERENT SHIPPING CODE

  if (tep_not_null($HTTP_POST_VARS['ShipFirstName']) && tep_not_null($HTTP_POST_VARS['ShipLastName']) && tep_not_null($HTTP_POST_VARS['ShipAddress'])) {
     $process = true;

     $firstname = tep_db_prepare_input($HTTP_POST_VARS['ShipFirstName']);
     $lastname = tep_db_prepare_input($HTTP_POST_VARS['ShipLastName']);
     $street_address = tep_db_prepare_input($HTTP_POST_VARS['ShipAddress']);
     if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['shipsuburb']);
     $postcode = tep_db_prepare_input($HTTP_POST_VARS['shippostcode']);
     $city = tep_db_prepare_input($HTTP_POST_VARS['ShipCity']);
     $shipcountry = tep_db_prepare_input($HTTP_POST_VARS['shipcountry']);
     if (ACCOUNT_STATE == 'true') {
       if (isset($HTTP_POST_VARS['zone_id'])) {
         $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
       } else {
         $zone_id = false;
       }
      $state = tep_db_prepare_input($HTTP_POST_VARS['shippingstate']);
     }

     if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
       $error = true;

       $messageStack->add('checkout_address', ENTRY_FIRST_NAME_ERROR);
     }

     if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
       $error = true;

       $messageStack->add('checkout_address', ENTRY_LAST_NAME_ERROR);
     }

     if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
       $error = true;

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

     if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
       $error = true;

       $messageStack->add('checkout_address', ENTRY_POST_CODE_ERROR);
     }

     if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
       $error = true;

       $messageStack->add('checkout_address', ENTRY_CITY_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)$shipcountry . "'");
       $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)$shipcountry . "' and (zone_name like '" . tep_db_input($shipstate) . "%' or zone_code like '%" . tep_db_input($shipstate) . "%')");
         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('checkout_address', ENTRY_STATE_ERROR_SELECT);
         }
       } else {
         if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
           $error = true;

           $messageStack->add('checkout_address', ENTRY_STATE_ERROR);
         }
       }
     }*/

     if ( (is_numeric($country) == false) || ($country < 1) ) {
       $error = true;

       $messageStack->add('checkout_address', ENTRY_COUNTRY_ERROR);
     }
$error = false;
     if ($error == false) {
      $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' => $shipcountry);

     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();
     $sendto =$address_id;
     tep_session_unregister('sendto');
    // tep_session_unregister('billto');
     tep_session_register('sendto');
    // tep_session_register('billto');
    // $billto = tep_db_insert_id();
    $sendto = $address_id;
   }
 }
 $customer_billto_address_id = $billto;
     tep_session_register('customer_billto_address_id'); //rmh M-S_addr_enhancer
     tep_db_query("update " . TABLE_CUSTOMERS . " set customers_billto_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

// 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;
    tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

    tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
  }
}

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

$content = CONTENT_CREATE_ACCOUNT;
$javascript = 'form_check.js.php';
include (bts_select('main', $content_template)); // BTSv1.5

require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

i am sorry but i forgot to change the bit for email verification in the code above

if ($check_email['total'] > 0) {
     $error = true;

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

has to be changed to

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

by the way how are you doing oriondw

Edited by nana
Link to comment
Share on other sites

by the way how are you doing oriondw

 

 

I pretty much got everything working in regard with logins

 

In regard to post 102:

Im using create_account3.php for both create account pages.

 

Gonna test adress thing in a moment and post if that helped.

 

 

As long as I do not try to modify customer information in admin everything works.

 

Awaiting next release B)

Edited by oriondw
Link to comment
Share on other sites

I pretty much got everything working in regard with logins

 

In regard to post 102:

Im using create_account3.php for both create account pages.

 

Gonna test adress thing in a moment and post if that helped.

As long as I do not try to modify customer information in admin everything works.

 

Awaiting next release  B)

 

 

 

Nope, it still doesnt set the adress from account creation page as billing/shipping adress. It actually doesnt even remember adress which you enter at account creation. When going to edit account in customer menu, it shows as if you had no adress at all.

 

When adding adress manually to adress book, you have to add it twice, then both show.

 

If you add once, then the adress does not show.

 

 

After I did the fix you posted in post 102, instead of throwing me into logon screen it just refreshes payment screen.

 

Not forcing cookies, should I?

Edited by oriondw
Link to comment
Share on other sites

Nope, it still doesnt set the adress from account creation page as billing/shipping adress.  It actually doesnt even remember adress which you enter at account creation.  When going to edit account in customer menu, it shows as if you had no adress at all.

 

When adding adress manually to adress book, you have to add it twice, then both show.

 

If you add once, then the adress does not show.

After I did the fix you posted in post 102, instead of throwing me into logon screen it just refreshes payment screen. 

 

Not forcing cookies, should I?

 

 

Ugh, never mind on the throwing back to payment screen.

 

I just tried it again and it keeps throwing meback to login. Im pretty lost as to why its doing that.

Link to comment
Share on other sites

Could some pls help, i have added this contribution and on paypal it works great but when i choose check or c/c i get the error below, i have this problem last week so i reloaded it again but im stll getting the same error.

 

1054 - Unknown column 'createaccount' in 'field list'

 

insert into orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, createaccount, currency_value) values ('8', 'test test', '', 'test0000', '', 'test000000', 'test000000', 'test000000', 'United Kingdom', '00000000000', '[email protected]', '1', 'test test', '', 'test0000', '', 'test000000', 'test000000', 'test000000', 'United Kingdom', '1', 'test test', '', 'test0000', '', 'test000000', 'test000000', 'test000000', 'United Kingdom', '1', 'Check/Money Order', '', '', '', '', now(), '2', 'GBP', 'N', '1.00000000')

 

[TEP STOP]

 

 

Any ideas ??

 

kind regards

Link to comment
Share on other sites

i just changed my checkout_confirmation.php and create_account3.php and checkout_shipping.php to the 3 files in the contribution in the catalog section and it seems to work .

atleast i am not getting the problem that you are having.although you should not be able to go to my account link if you do not have an account , mine has the same problem and i will fix it in the next version.

 

it seems to me that you are somewhere loosing your login and maybe session.

 

but this is not causing the problem with the address for me and i can not reproduce either one of the problems you are talking about.

do you have made any other changes to these files?

why don't you try to just load the three pages again and see what happends.

let me know what the result is . ofcourse save your files first

Link to comment
Share on other sites

i just changed  my checkout_confirmation.php and create_account3.php and checkout_shipping.php to the 3 files in the contribution  in the catalog section and it seems to work .

atleast i am not getting the problem that you are having.although you should not be able to go to my account link if you do not have an account , mine has the same problem and i will fix it in the next version.

 

it seems to me that you are somewhere loosing your login and maybe session.

 

but this is not causing the problem with the address for me and i can not reproduce either one of the problems you are talking about.

do you have made any other changes to these files?

why don't you try to just load the three pages again and see what happends.

let me know what the result is . ofcourse save your files first

 

 

Just replaced the files with the one's you mentioned. Still same problem with adress where have to enter it twice.

 

Still throws back to login screen. At that screen, login, when I try to login, it keeps refreshing the login screen.

 

If i go to catalog and login from there, it works.

 

I have Chemo's SEO urls installed, if that matters, nothing else.

Link to comment
Share on other sites

Just replaced the files with the one's you mentioned.  Still same problem with adress where have to enter it twice. 

 

Still throws back to login screen.  At that screen, login, when I try to login, it keeps refreshing the login screen.

 

If i go to catalog and login from there, it works.

 

I have Chemo's SEO urls installed, if that matters, nothing else.

 

 

Found a new bug.

 

When trying to create account from main page ( i.e the one where you can buy product without creating account) it gives following error: While giving the error, it still adds the account to the database, and account can log in by just clicking backbutton and doing login procedure.

 

0 -

 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('0', '0', now())

 

[TEP STOP]

 

 

I had this error before and i thought I fixed what was causing it.

 

Now when creating account normally, from log yourself in page, or any other page. It seems to work.

 

 

And no matte what I do, it doesnt save adress from creating account, have to enter it manually, twice for it to save. After that it saves it for good no problem.

 

Tried to play with session settings, i.e. recreate session, still same problem. Kicks me to login.

Edited by oriondw
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...