PDA

View Full Version : Hide site to all but registered customers (wholesale site)



rc2user
05-05-2011, 10:03 AM
Hello,

I'm working on a new site using ocsmax 2.5 rc1 that will be for wholesale customers only.

I've got a mod working so the prices aren't shown unless the customer is in the wholesale group (ie, default retail customers get ASK FOR PRICE)

But what I really want is to also have the whole store hidden from all customers unless they are registered.

I don't mind search engines not finding the products, in fact I'd prefer that really as I do't want it to conflict with retail sites. Wholesale customers will find us anyway without the products being indexed.

So I'd have a home page, intro text, and a way to log in or register. That's more or less it, until they log in.

Is there a simple way to do this?

Thanks In advance
RC2User (although not any more - can I change my name?!)

tcshadow
05-05-2011, 07:10 PM
to stop search engines indexing the site simply deny all in robots.txt

To restrict the site to people who should know only, don't advertise it and stick it in a subfolder

ie
www.yourdomain.com/mysecretwholesaleonlywebsiteforspecialcustomerstha tidontadvertisetojustanybodybecauseitssospecial

rc2user
05-05-2011, 11:28 PM
to stop search engines indexing the site simply deny all in robots.txt

To restrict the site to people who should know only, don't advertise it and stick it in a subfolder

ie
www.yourdomain.com/mysecretwholesaleonlywebsiteforspecialcustomerstha tidontadvertisetojustanybodybecauseitssospecial

thanks, but I was hoping for some way to integrate it into the site properly so people could view the static pages and the login/register pages, without viewing the categories/products.

Guess I'll have to write it myself.

Thanks anyway

pgmarshall
05-06-2011, 12:36 AM
This has been asked before a few times ... if you have a quick browse through oscommerce or google you will find a couple of options.

This one is the easiet and best: osCommerce Community Add-Ons (http://addons.oscommerce.com/info/4856)

3 line install


find \Includes\application_top.php

Add this code before the last "?>" symbol

if (strpos($PHP_SELF, "login.php") == 0 && strpos($PHP_SELF, "logoff.php") == 0 && strpos($PHP_SELF, "create_account.php") == 0 && strpos($PHP_SELF, "create_account_success.php") == 0 && strpos($PHP_SELF, "privacy.php") == 0 && strpos($PHP_SELF, "conditions.php") == 0 && strpos($PHP_SELF, "password_forgotten.php") == 0)
{
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
}Just change the filenames to the ones you want to let them access - job done!

Regards,

rc2user
05-06-2011, 12:49 AM
Great, thanks. I did do a search of both the forum and oscommerce contributions before posting but didn't find a solution.