Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Purchase Without Account Updated & Admin Functionality


Guest

Recommended Posts

Anyone have any input on osCommerce v2.2rc2a - Purchase Without Account v2.0a by marquinho? I have had PWA installed for a couple of years and now I am doing updates.....should I update? is this going to be the new supported version or not?

 

Thanks for any input,

 

lildog

If it aint broke, don't fix it.

Link to comment
Share on other sites

Sorry a newbie question...

 

I get the following error in the last step of my checkout process :

 

1364 - Field 'shipdate' doesn't have a default value

 

After this i get the sql command is performed :

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, customers_dummy_account, 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, currency_value) values ('5', 'Cha ...................................

 

Any ideas how to fix this ? I am using RC2a

 

Thank you

Link to comment
Share on other sites

Sorry a newbie question...

 

I get the following error in the last step of my checkout process :

 

1364 - Field 'shipdate' doesn't have a default value

 

After this i get the sql command is performed :

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, customers_dummy_account, 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, currency_value) values ('5', 'Cha ...................................

 

Any ideas how to fix this ? I am using RC2a

 

Thank you

 

 

 

ignore the last post fixed just added a null deafult value to the shipdate

Link to comment
Share on other sites

The contribution works great when someone which doesn't have an account buys a product but when a registered customer tries to buy something he gets the following error message

 

1366 - Incorrect integer value: '' for column 'customers_dummy_account' at row 1

 

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, customers_dummy_account, 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, shipping_module, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, currency_value) values ('5', 'Antonis Jacovides', '', 'Millenium', '', 'Guildford', 'GU2 7JN', 'Alabama', 'United Kingdom', '07738016190', '[email protected]', '1', '', 'Antonis Jacovides', '', 'Millenium', '', 'Guildford', 'GU2 7JN', 'Alabama', 'United Kingdom', '1', 'Antonis Jacovides', '', 'Millenium', '', 'Guildford', 'GU2 7JN', 'Alabama', 'United Kingdom', '1', 'Cash on Delivery', 'flat_flat', '', '', '', '', now(), '1', 'USD', '1.00000000')

 

[TEP STOP]

Link to comment
Share on other sites

  • 2 weeks later...

Hello i'm trying to install thisd contribution to my online shop www.brewrecords.net/shop

 

http://www.oscommerce.com/community/contributions,355/

 

The text file states that i need to 1) Execute the "common.sql" with PHPMyAdmin or another MySQL-Client, as well as "english.sql"

 

how do i do this? I dont know what it means.

 

cheers,

 

tom

Link to comment
Share on other sites

Google PHPMyAdmin....I am sure you will find help there. there is also a way to run an sql file via http...maybe someone can help you. PHPmyadmin should probably be on your server. You might be able to call your server also to find out where. PHP my admin lets you manipulate/edit your stores database.

 

lildog

Link to comment
Share on other sites

Hi

 

hope there's someone with a better knowledge of PHP than me! I am trying to combine PWA with SPPC (with price breaks) but have run into a bit of a problem. I am using winmerge to make the changes.

 

The file I have a problems with is catalog/admin/order.php

 

The PWA file has the following code:

 

if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
}

 

The SPPC file has this on the same line numbers:

if (isset($HTTP_GET_VARS['cID'])) {
	// BOF Separate Pricing Per Customer
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
  // EOF Separate Pricing Per Customer
}

 

Can anyone tell me how I can combine the 2 successfully? I think I need to check whether its a PWA order or a SPPC group order and run the correct "$orders_query_raw =" call, but how do I do that?

 

I know its asking a lot but if anyone can help I would really appreciate it. I have also posted a copy of this on the SPPC thread.

 

Thanks

 

Chris

Link to comment
Share on other sites

Hi

 

hope there's someone with a better knowledge of PHP than me! I am trying to combine PWA with SPPC (with price breaks) but have run into a bit of a problem. I am using winmerge to make the changes.

 

The file I have a problems with is catalog/admin/order.php

 

The PWA file has the following code:

 

if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
}

 

The SPPC file has this on the same line numbers:

if (isset($HTTP_GET_VARS['cID'])) {
	// BOF Separate Pricing Per Customer
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, cg.customers_group_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) left join " . TABLE_CUSTOMERS . " c on c.customers_id = o.customers_id left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
  // EOF Separate Pricing Per Customer
}

 

Can anyone tell me how I can combine the 2 successfully? I think I need to check whether its a PWA order or a SPPC group order and run the correct "$orders_query_raw =" call, but how do I do that?

 

I know its asking a lot but if anyone can help I would really appreciate it. I have also posted a copy of this on the SPPC thread.

 

Thanks

 

Chris

 

Fixed it...well Jan on the SPPC thread did.

Link to comment
Share on other sites

  • 2 weeks later...

I've uploaded the files for the PWA contribution and I've run the common.sql and english.sql on myphpadmin.

 

When I log into the admin section under cusomer details I see the pay without account line and it is selected to yes.

 

Here is the thing. When I go to my site: www.bobostinytreasures.com and click on checkout when I add a product to cart it

 

still shows the same page features i.e. log in or create account. I'm trying to get the third feature of payingwithout account

 

to work. Can you add your input to my situation as to what I may be doing incorrectly.

 

Thank you kindly

 

Steward Dondi

Link to comment
Share on other sites

Someone know how to manage this contrubution to work with STS ?

All i get is this:

Fatal error: Call to a member function restart_capture() on a non-object in C:\wamp\www\lampor\includes\header.php on line 14

 

and the line in 14 is this:

$sts->restart_capture ('applicationtop2header');

 

Anyone?

 

/Tony

Link to comment
Share on other sites

As of this writing the first two PWA downloads are upgrade guides, the next one just contains one file... yeesh!

 

Where do I go to get a comprehensive release, the whole shebang, for this contribution? If one doesn't exist, then do I just download the last complete package (I'm not sure which one it is) and then apply the changes described in "PWA 1.25 to PWA2A update guide" (which, as of this writing, is the latest release)?

Edited by IcedDante
Link to comment
Share on other sites

As of this writing the first two PWA downloads are upgrade guides, the next one just contains one file... yeesh!

Okay- forgive my "newbness" here: obviously that 1.25 to 2a was just for people upgrading (although I think a little more in the documentation regarding this would be helpful).

 

I downloaded pwa_2_0a.zip (does the 'a' stand for alpha?) and am in the process of installing it. Firstly- is this the right version? I am using OSCommerce rc2a. As I go through the process of merging the files in this release I hit upon a change in includes/classes/order.php:

 

line 69 (!) of the file in the PWA version omits the inclusion of

'id' => $order['customers_id']

in the customer array.

 

Also line 147 includes c.customers_login which doesn't exist in the original.

 

I am thinking these changes are probably intended, but I wasn't sure because these changes seem to be unmarked while other changes are surrounded with PWA BOF and PWA EOF comments.

 

BTW- I wouldn't have been able to use OSCommerce for my client if this feature was not available so a big Thanks to all the people that helped develop it and made it what it is.

 

Randeep

Edited by IcedDante
Link to comment
Share on other sites

Found another glitch. If a customer purchases first without an account and then makes an account. There are 2 entries in the database. When he/she will request a new password the password will change based on the first entry found with the customers_email_address and not with the customers_login.

 

To solve this you need to make one small change in the password_forgotten.php

 

Change this :

 

$check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

 

to this :

 

$check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id from " . TABLE_CUSTOMERS . " where customers_login = '" . tep_db_input($email_address) . "'");

Link to comment
Share on other sites

As of this writing the first two PWA downloads are upgrade guides, the next one just contains one file... yeesh!

 

Where do I go to get a comprehensive release, the whole shebang, for this contribution? If one doesn't exist, then do I just download the last complete package (I'm not sure which one it is) and then apply the changes described in "PWA 1.25 to PWA2A update guide" (which, as of this writing, is the latest release)?

PWA_0.910 still works.

Link to comment
Share on other sites

  • 2 weeks later...

hi all

 

i installed the latest PWA on 2.2rc2..

 

catalog side all works fine and on admin side ia m getting this error..

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in public_html/admin/customers.php on line 765

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /public_html/admin/customers.php on line 767

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /public_html/admin/includes/classes/object_info.php on line 18

 

any ideas any one.. had a read read through privious post and non one seems to have posted ad answer,

 

regards

 

nafri

Link to comment
Share on other sites

Has anyone had this problem....

 

I am installing PWA in a store with SPPC, Member approval, hide categories. The problem is when I go from the shopping cart to checkout, it directs me to the login page...so far so good.....I then select to checkout without an account and it directs me to the modified create_account page...still so far so good......I fill out the form and click the continue button and I am redirected to the login page again. I have tried several versions of this mod and always the same problem.

 

If it helps, here is my create_account.php page:

 

<?php
/*
 $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $
 adapted for Separate Pricing Per Customer 2007/08/04

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

// PWA EOF
 if (isset($HTTP_GET_VARS['guest']) && $cart->count_contents() < 1) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
// PWA BOF

// 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']);
// BOF Separate Pricing Per Customer, added: field for tax id number
if (ACCOUNT_COMPANY == 'true') {
$company = tep_db_prepare_input($_POST['company']);
$company_tax_id = tep_db_prepare_input($_POST['company_tax_id']);
}
// EOF Separate Pricing Per Customer, added: field for tax id number
$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 = '" . tep_db_input($state) . "' or zone_code = '" . 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);
}

// PWA BOF
if (!isset($HTTP_GET_VARS['guest']) && !isset($HTTP_POST_VARS['guest'])) {
// PWA EOF

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);
}
// PWA BOF
} 
// PWA EOF

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),
							   'customers_language_id' => $languages_id);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);
  // BOF Separate Pricing Per Customer
  // if you would like to have an alert in the admin section when either a company name has been entered in
  // the appropriate field or a tax id number, or both then uncomment the next line and comment the default
  // setting: only alert when a tax_id number has been given
  if ( (ACCOUNT_COMPANY == 'true' && tep_not_null($company) ) || (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) ) ) { 
 // if ( ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id)  ) { 
  $sql_data_array['customers_group_ra'] = '1';
// entry_company_tax_id moved from table address_book to table customers in version 4.2.0
  $sql_data_array['entry_company_tax_id'] = $company_tax_id; 
}
// EOF Separate Pricing Per Customer

// PWA BOF
  if ((isset($HTTP_GET_VARS['guest'])) or (isset($HTTP_POST_VARS['guest'])) && (defined('PURCHASE_WITHOUT_ACCOUNT') && (PURCHASE_WITHOUT_ACCOUNT == 'ja' || PURCHASE_WITHOUT_ACCOUNT == 'yes'))) {
	$pwa_array_customer = $sql_data_array;
	$customer_id = 0;
	tep_session_register('pwa_array_customer');
  } else {
// PWA EOF
  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

  $customer_id = tep_db_insert_id();

// PWA BOF
} 
// PWA EOF

  $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') { // BOF adapted for Separate Pricing Per Customer
  $sql_data_array['entry_company'] = $company;
  $sql_data_array['entry_company_tax_id'] = $company_tax_id;
  } // EOF adapted for Separate Pricing Per Customer
  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;
	}
  }

// PWA BOF
 if (isset($HTTP_GET_VARS['guest']) or isset($HTTP_POST_VARS['guest'])) {
   $pwa_array_address = $sql_data_array;
   tep_session_register('pwa_array_address');
   $address_id = 0;
 } else {
// PWA EOF

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

// PWA BOF
} 
// PWA EOF

  if (SESSION_RECREATE == 'True') {
	tep_session_recreate();
  }
// BOF Separate Pricing Per Customer
// register SPPC session variables for the new customer
// if there is code above that puts new customers directly into another customer group (default is retail)
// then the below code need not be changed, it uses the newly inserted customer group
  $check_customer_group_info = tep_db_query("select c.customers_group_id, cg.customers_group_show_tax, cg.customers_group_tax_exempt, cg.group_specific_taxes_exempt from " . TABLE_CUSTOMERS . " c left join " . TABLE_CUSTOMERS_GROUPS . " cg using(customers_group_id) where c.customers_id = '" . $customer_id . "'");
  $customer_group_info = tep_db_fetch_array($check_customer_group_info);
  $sppc_customer_group_id = $customer_group_info['customers_group_id'];
  $sppc_customer_group_show_tax = (int)$customer_group_info['customers_group_show_tax'];
  $sppc_customer_group_tax_exempt = (int)$customer_group_info['customers_group_tax_exempt'];
  $sppc_customer_specific_taxes_exempt = '';
  if (tep_not_null($customer_group_info['group_specific_taxes_exempt'])) {
	$sppc_customer_specific_taxes_exempt = $customer_group_info['group_specific_taxes_exempt'];
  }
// EOF Separate Pricing Per Customer

  $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');
// BOF Separate Pricing Per Customer
  tep_session_register('sppc_customer_group_id');
  tep_session_register('sppc_customer_group_show_tax');
  tep_session_register('sppc_customer_group_tax_exempt');
  tep_session_register('sppc_customer_specific_taxes_exempt');
// EOF Separate Pricing Per Customer
// PWA BOF
  if (isset($HTTP_GET_VARS['guest']) or isset($HTTP_POST_VARS['guest'])) tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING));
// PWA EOF

// 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);
}
 //}
// customer email notification 
$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);



// BOF Separate Pricing Per Customer: alert shop owner of account created by a company
// if you would like to have an email when either a company name has been entered in
// the appropriate field or a tax id number, or both then uncomment the next line and comment the default
// setting: only email when a tax_id number has been given
if ( (ACCOUNT_COMPANY == 'true' && tep_not_null($company) ) || (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) ) ) {
 // if ( ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) ) {
  $alert_email_text = "Please note that " . $firstname . " " . $lastname . " of the company: " . $company . " has created an account.";
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Company account created', $alert_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  }
// EOF Separate Pricing Per Customer: alert shop owner of account created by a company

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

// PWA BOF
 if (tep_session_is_registered('pwa_array_customer') && tep_session_is_registered('pwa_array_address')) {
$gender = isset($pwa_array_customer['customers_gender'])?$pwa_array_customer['customers_gender']:'';
$company = isset($pwa_array_address['entry_company'])? $pwa_array_address['entry_company']:'';
$firstname = isset($pwa_array_customer['customers_firstname'])? $pwa_array_customer['customers_firstname']:'';
$lastname = isset($pwa_array_customer['customers_lastname'])? $pwa_array_customer['customers_lastname']:'';
$dob = isset($pwa_array_customer['customers_dob'])? substr($pwa_array_customer['customers_dob'],-2).'.'.substr($pwa_array_customer['customers_dob'],4,2).'.'.substr($pwa_array_customer['customers_dob'],0,4):'';
$email_address = isset($pwa_array_customer['customers_email_address'])? $pwa_array_customer['customers_email_address']:'';
$street_address = isset($pwa_array_address['entry_street_address'])? $pwa_array_address['entry_street_address']:'';
$suburb = isset($pwa_array_address['entry_suburb'])? $pwa_array_address['entry_suburb']:'';
$postcode = isset($pwa_array_address['entry_postcode'])? $pwa_array_address['entry_postcode']:'';
$city = isset($pwa_array_address['entry_city'])? $pwa_array_address['entry_city']:'';
$state = isset($pwa_array_address['entry_state'])? $pwa_array_address['entry_state']:'0';
$country = isset($pwa_array_address['entry_country_id'])? $pwa_array_address['entry_country_id']:'';
$telephone = isset($pwa_array_customer['customers_telephone'])? $pwa_array_customer['customers_telephone']:'';
$fax = isset($pwa_array_customer['customers_fax'])? $pwa_array_customer['customers_fax']:'';
 }
// PWA EOF

 $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; ?>">
<?php require(DIR_WS_INCLUDES . 'meta_tags.php'); ?>
<title><?php echo META_TAG_TITLE; ?></title>
<meta name="description" content="<?php echo META_TAG_DESCRIPTION; ?>">
<meta name="keywords" content="<?php echo META_TAG_KEYWORDS; ?>">
<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="0" cellpadding="0">
 <tr>
<!-- body_text //-->
<!-- PWA BOF -->
<td width="100%" valign="top"><?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, (isset($HTTP_GET_VARS['guest'])? 'guest=guest':''), 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<!-- PWA EOF -->
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></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 class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>
	   <td class="inputRequirement" 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>
		</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>
<!-- BOF Separate Pricing Per Customer: field for tax id number -->
		  <tr>
			<td class="main"><?php echo ENTRY_COMPANY_TAX_ID; ?></td>
			<td class="main"><?php echo tep_draw_input_field('company_tax_id') . ' ' . (tep_not_null(ENTRY_COMPANY_TAX_ID_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TAX_ID_TEXT . '</span>': ''); ?></td>
		  </tr>
<!-- EOF Separate Pricing Per Customer: field for tax id number -->
		</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_ADDRESS; ?></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_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>
<?php
 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_SUBURB; ?></td>
			<td class="main"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <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_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>
<?php
 if (ACCOUNT_STATE == 'true') {
?>
		  <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>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_CONTACT; ?></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_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_FAX_NUMBER; ?></td>
			<td class="main"><?php echo tep_draw_input_field('fax') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
// PWA BOF
 if (!isset($HTTP_GET_VARS['guest']) && !isset($HTTP_POST_VARS['guest'])) {
// PWA EOF
?>
  <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 ENTRY_NEWSLETTER; ?></td>
			<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>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_PASSWORD; ?></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_PASSWORD; ?></td>
			<td class="main"><?php echo tep_draw_password_field('password') . ' ' . (tep_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
			<td class="main"><?php echo tep_draw_password_field('confirmation') . ' ' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 // PWA BOF
 }
 else
 { // Ingo PWA Ende
?>
<tr>
  <td><?php echo tep_draw_hidden_field('guest', 'guest'); ?></td>
</tr>
<?php } 
// PWA EOF
?>
  <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 echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></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 //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

  • 1 month later...

I just updated to v2.0 and was wondering if the dummy account gets deleted automatically? Everything works, orders go through, but an account is created and marked inactive in admin. So it is not PWa? it is PWithAccount? the upgrade was rough but incorporating with other contribs seems like it is going to be a breeze since technically an account is created.

 

lildog

Link to comment
Share on other sites

  • 2 weeks later...

Hi 'Lildog :D

 

I have a question re: version 2.0b that I have installed. You did a GREAT job with this contribution! I love it, but just have this small problem (I have some php programming knowledge, but have spent hours trying to solve this :rolleyes:

 

I get the process as it roughly works:

 

1) Add to basket

2) Click checkout

3) It then directs you to login.php, you can create an account or go straight to checkout

4) After clicking "Checkout" (to not create an account), it send you over to create_account.php?guest=guest

 

My question is this - how can I skip out step 3 - I tried to change and redirect the button link on the shopping_cart.php to go straight to create_account.php?guest=guest instead of login.php, but it seems I get an error that the E-Mail address already exists if I do that and create an account with an e-mail address created in the past ?

 

It works fine when I put it back to go via the login.php and it then doesn't give the "E-Mail address" exists :ph34r: ?

 

My question is, how can I skip out step 3 and always assume "Straight to Checkout" without prompting if they want to create an account or not ? I guess you did some programming magic in the login.php which is needed to "remember" it is a one-time only "dummy account" which then doesn't give the "E-Mail exists" error ? :blink:

 

Any help appreciated before my brain gets major meltdown, cheers 'Lildawg :-D

 

Regards,

Paul

Link to comment
Share on other sites

I am actually working on something like this right now.....stay tuned. I will let you know. I didn't do all the programming though, most of it was done by the guy that put the first 2.0 version up.

 

lildog

Edited by lildog
Link to comment
Share on other sites

Paul try commenting out this in create_account.php: let me know if this works for you.....

 

 

// PWA BOF 2b

$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and guest_account != '1'");

// PWA EOF 2b

// PWA EOF 2

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

}

Link to comment
Share on other sites

you could also try this instead:

 

in create account:

 

change:

$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and guest_account != '1'");

 

to:

$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and guest_account = '0'");

Edited by lildog
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.

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...