Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Site won't work without cookies.


rs2k

Recommended Posts

When I try to go to create account from the shopping cart and cookies are not enabled the session ID stays the same but does not pass on.

 

Force cookies is disabled.

 

 

 

When I change the url from:

https://www.mystore.com/create_account.php?...LONG-SESSION-ID

to:

https://www.mystore.com/create_account.php?...LONG-SESSION-ID

 

then everything works like it should.

 

 

Is there any way to prevent "fromcart=true&" from showing up?

Link to comment
Share on other sites

FIXED IT!

 

 

 

I had modified checkout_shipping.php to redirrect people from to create_account.php instead of the login page.

 

I changed

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
//tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'fromcart=true', 'SSL'));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 

to

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
//tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
//tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'fromcart=true', 'SSL'));
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 

I think this may have been an expensive bug.

Link to comment
Share on other sites

FIXED IT!

I had modified checkout_shipping.php to redirrect people from to create_account.php instead of the login page.

 

I changed

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
//tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'fromcart=true', 'SSL'));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 

to

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
//tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
//tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, 'fromcart=true', 'SSL'));
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 

I think this may have been an expensive bug.

 

It wasn't a bug .. at least not an oscommerce bug. you probably have an SEO url contrib installed, probably ULTIMATE SEO URLS with w3C settings ON. Works great but it also adds & to redirects

 

So firstly take out your hacks.

 

If you have the aforementioned URL contrib.

 

Find (catalog/includes/classes/seo.class.php)..

 

			case ($this->attributes['USE_SEO_REDIRECT'] == 'true'):
			header("HTTP/1.0 301 Moved Permanently");
			header("Location: $url"); // redirect...bye bye

 

and adjust to ..

 

			case ($this->attributes['USE_SEO_REDIRECT'] == 'true'):
							$url = str_replace('&', '&', $url);
			header("HTTP/1.0 301 Moved Permanently");
			header("Location: $url"); // redirect...bye bye

 

For good measure find (catalog/includes/functions/general.php) ..

 

	header('Location: ' . $url);

 

Add directly above ..

 

	$url = str_replace('&', '&', $url);

 

Report back how you get on.

Link to comment
Share on other sites

Thanks!!

 

I followed your instructions and now the sites work as they should.

 

What the the fromcart=true statement do? I'm not able to find any information about it in the forums.

Link to comment
Share on other sites

  • 2 weeks later...

Just wanted to confirm that this fixed a number of issues with my installation:

 

(for the benefit of others searching for this..)

 

The string replace code successfully fixed & in URL issues I had that were affecting:

 

*search

*advanced search

*errors on checkout_payment.php not showing - in particular with Protx Direct.

 

This particular issue, I presume, would have a detrimental affect on any part of Oscommerce that needed to take values from a GET string that had been generated by a redirect.

 

Hope others find their solution on this page.

 

R. :thumbsup:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...