Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Logs Customer Out When Wrong Coupon Code Entered


Hade

Recommended Posts

Hi,

 

This problem only occurs on my XP testing server with Apache 2.0.59 & PHP 5.

It does not occur on my live linux server, which I think is PHP4

 

When the customer enters an incorrect coupon code or referral email (points & rewards contrib) they are asked to login, even though they are already logged in.

 

So the problem seems to be that when order total modules should be stopping the checkout process and asking to re-enter the values, the user is just getting logged out.

 

Thanks for any help.

Read the forum rules...

Link to comment
Share on other sites

I've narrowed it down.

 

checkout_confirmation.php has the following code:

 

if (isset($HTTP_POST_VARS['customer_referred']) && tep_not_null($HTTP_POST_VARS['customer_referred'])) {
$valid_referral_query = tep_db_query("SELECT customers_id FROM " . TABLE_CUSTOMERS . " WHERE customers_email_address = '" . $HTTP_POST_VARS['customer_referred'] . "'");
$valid_referral = tep_db_fetch_array($valid_referral_query);
if (!tep_db_num_rows($valid_referral_query)) {
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_NOT_FOUND), 'SSL'));
}
if ($HTTP_POST_VARS['customer_referred'] == $order->customer['email_address']) {
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_SELF), 'SSL'));
} else {
  $customer_referral = $valid_referral['customers_id'];
  if (!tep_session_is_registered('customer_referral')) tep_session_register('customer_referral');
}

 

So I'm thinking there is a problem with the redirect.

Does anyone know what this problem could be? is there an issue with PHP5? Windows?

Read the forum rules...

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