PDA

View Full Version : Purchase Without Account



michael_s
09-30-2010, 11:50 AM
PWA creates a temporary account and deletes it at checkout.

If a PWA customer creates a 2nd order without first logging out, then the session variable will refer to the deleted customer. This produces an order without billing information.

If you unregister the customer_id session variable too soon, then that will break checkout_success.php.

One workaround is to check for a deleted account when the customer adds an item to their shopping cart, and then unregister the session variable that contains the defunct customer id.

Edit catalog/includes/application_top.php.

Find the following line.

// Shopping cart actions

Above this line insert the following code.

// PWA - Begin
if (tep_session_is_registered('customer_id') && (isset($HTTP_GET_VARS['products_id']) || isset($HTTP_POST_VARS['products_id']))) {
$query = tep_db_query("select customers_id from " . TABLE_CUSTOMERS . " where customers_id = " . (int)$customer_id);
if (tep_db_num_rows($query) == 0) {
tep_session_unregister('customer_id');
}
}
// PWA - End

More... (http://addons.oscommerce.com/info/355)