Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer must be logged in to see catalog


dlyxzen

Recommended Posts

Hi,

 

i have had a search through the forums but couldnt fine exactly what i was after.

 

Basically i dont want the catalog viewable at all without the user being logged in, i had thought about making a new file with just the login.php include however this is all connected the other includes etc: and is hard to seperate from the rest of the page (im not that php savvy)

 

i had a look through contributions also but could not find exactly what i need, which is when a customer enters the url mydomain/catalog , the new user or existing customer login is displayed,

 

any help would be really appreciated, main reason for this is that we dont want our competitors to be able to check out prices so easily !! :) :)

 

 

cheers

 

barry

Link to comment
Share on other sites

Depending on what you want you will want to put this code in the index.php and product_info.php:

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

Other great Open Source (Free) programs: (Free as in free speech not free beer)

The Gimp - An image program. | Firefox - All you have to do is add the Web Developer add-on to make this web browser complete. | FileZilla - An ftp program. | Inkscape - A good program to create images with. | Thunderbird - An email program. | Openoffice.org - An office suite that is compatible with MS Office. | Abiword - Another office suite. | Audacity - A sound recording tool. | ddp's Picks | Wordpress - An easy to use blogging software. | Joomla - An easy to use CMS that has ecommerce plug-ins. | Drupal - Another CMS

How do I find these programs? Google Search!

Link to comment
Share on other sites

Depending on what you want you will want to put this code in the index.php and product_info.php:

 

hi natewlew, so pasting this code in the index.php and product info page will straght away direct them to the login page, which is exactly what i want however this page still displays pricing information in the left and right columns, im just wondering if there is a way to direct them to that login without it being embedded with the rest of the catalog (if that makes sense haha)

 

cheers

Link to comment
Share on other sites

If you don't want the whats_new,specials etc.. to show up. Here is an example that would remove the whats new from your catalog if someone wasn't logged in. In the /includes/column_left.php I have:

require(DIR_WS_BOXES . 'whats_new.php');

If you don't want anyone to see that until they login add:

if (tep_session_is_registered('customer_id')) {

require(DIR_WS_BOXES . 'whats_new.php');

}

 

Notice that it's the same as my last post exept I left out the "!". You will also have to edit the /includes/column_right.php.

Other great Open Source (Free) programs: (Free as in free speech not free beer)

The Gimp - An image program. | Firefox - All you have to do is add the Web Developer add-on to make this web browser complete. | FileZilla - An ftp program. | Inkscape - A good program to create images with. | Thunderbird - An email program. | Openoffice.org - An office suite that is compatible with MS Office. | Abiword - Another office suite. | Audacity - A sound recording tool. | ddp's Picks | Wordpress - An easy to use blogging software. | Joomla - An easy to use CMS that has ecommerce plug-ins. | Drupal - Another CMS

How do I find these programs? Google Search!

Link to comment
Share on other sites

If you don't want the whats_new,specials etc.. to show up. Here is an example that would remove the whats new from your catalog if someone wasn't logged in. In the /includes/column_left.php I have:

 

If you don't want anyone to see that until they login add:

Notice that it's the same as my last post exept I left out the "!". You will also have to edit the /includes/column_right.php.

 

thanks natewlew, i will give this a go, thanks for your help !

Link to comment
Share on other sites

  • 4 months later...

I wanted the same thing. For no one to view prices unless they were logged on.

I didn't care about the prices on specials, or what's new showing on the log in page, cause I can control them and it is a little tease for the customer.

I added this code

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

after the first line, ie:

<?php

/*

$Id: privacy.php,v 1.3 2003/09/30 16:22:42 serg Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

in

catalog/privacy.php

catalog/shopping_cart.php

catalog/shipping.php

catalog/advanced_search_result.php

catalog/product_info.php

catalog/product_reviews_info.php

catalog/advanced_search.php

and

catalog/index.php

 

This closes the whole site from being accessed unless the user is loged on.

Except Contact us, and Conditions of Use.

If you wanted to block those just add code to

catalog/conditions.php

and

catalog/contact_us.php

Thanks

Worldpar

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...