Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

preventing guest adding to cart


ollym

Recommended Posts

Posted

If a user comes to my sight, but doesnt log on, they can still add things to a cart.

 

Is it possible to make osCommerce work so that when a guest clicks the Add to basket button, they are prompted to log on ??

 

Thanks

 

Olly

Posted

I put this at the top of shopping_cart.php and any other pages I didn't want non logged in users.

 

  if (!tep_session_is_registered('customer_id')) {
  $navigation->set_snapshot();
  tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}

I think thats all I did.

 

Ryan

If I was crafty, this would be a funny signature.

Posted

Thanks Ryan,

 

When i use that code, i get the following error;

 

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\catalog\templates\compost\main_page.tpl.php:2) in c:\inetpub\wwwroot\catalog\includes\functions\general.php on line 33

 

 

Now, im guessing that this is because I am using a BTS template, which means that, although i have put the code at the top of my shopping cart page, this is actually being called after the headers for the main template page have been sent. I know that, using IIS (as i am) you can turn on/off buffering to fix this kind of issue in ASP, but it doesnt seem to have an effect in PHP.

 

Any ideas ?

 

Olly

Archived

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

×
×
  • Create New...