Author Topic: How do I make it so that only registered people can see my products?  (Read 13762 times)

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #15 on: February 25, 2010, 22:16:35 pm »
I got your PM, and between this post and your other, I'm not sure if you have resolved your issue or not. Do you need help, and if so with what exactly. I'm away from my computer for a few days and only habe cell access, so not sure I can help immediately.

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #16 on: February 26, 2010, 01:41:36 am »
I got your PM, and between this post and your other, I'm not sure if you have resolved your issue or not. Do you need help, and if so with what exactly. I'm away from my computer for a few days and only habe cell access, so not sure I can help immediately.


I need help with allowing people to register using the virtuemart registration form, without being redirected back to the front page.  It's great that people can no longer see my product catalog unless they're registered, but now they can't register either, which is something I need them to be able to do.  I don't want to use the joomla registration form because it doesn't give me as much information about the user as I'd like.  Is there a way to keep my settings so that I can keep people from viewing my product catalog unless they're registered, while still allowing people to see the virtuemart registration page?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #17 on: February 26, 2010, 17:28:26 pm »
Yes, keep what I did in the file (my->id) but also add additional checks in php statement to see what page visitor is trying to access. If page is shop.registration (or any other pages used for registration) then allow script to continue, else redirect.

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #18 on: February 26, 2010, 22:24:17 pm »
Yes, keep what I did in the file (my->id) but also add additional checks in php statement to see what page visitor is trying to access. If page is shop.registration (or any other pages used for registration) then allow script to continue, else redirect.


How would I do that?  I understand you're away from your home computer, so if you can't make a code right now that's fine.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #19 on: March 02, 2010, 00:46:26 am »
Here is the revised file allowing access to the VM registration only. Please read my note inside the file about creating a custom redirect page that informs non registered/validated/logged-in users on what to do.

[attachment cleanup by admin]

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: How do I make it so that only registered people can see my products?
« Reply #20 on: March 02, 2010, 01:00:10 am »
Here's another method for allowing only registered users to see products:
http://forum.virtuemart.net/index.php?topic=62476.0

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #21 on: March 02, 2010, 03:07:45 am »
I can access the registration page now, however for some reason I can't log in as a user.  It gives this error message on a blank page when a user tries to log in:

Invalid Token

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #22 on: March 02, 2010, 08:34:15 am »
I don't think this is a VM issue. What are you using to login? A joomla module? VM is just a component of Joomla of which we are tweaking the VM component, and isn't altering the Joomla login system.

1. Try clearing your cache.
2. Try replacing my new file with the old one and see if the problem goes away. If it does, then I guess I am not thinking about something right.

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #23 on: March 02, 2010, 21:35:54 pm »
I don't think this is a VM issue. What are you using to login? A joomla module? VM is just a component of Joomla of which we are tweaking the VM component, and isn't altering the Joomla login system.

1. Try clearing your cache.
2. Try replacing my new file with the old one and see if the problem goes away. If it does, then I guess I am not thinking about something right.


I was using a virtuemart module to log in.  The joomla module works fine.  If someone registers using the virtuemart registration page, can they log in using the joomla login module or do they have to login using the virtuemart login module? 

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #24 on: March 02, 2010, 21:44:21 pm »
Ok for some reason the login is working now; that's weird because it wasn't working when I tried it last night.  However, there's one last problem left.  After I log in, if I click the home button, as in I want to go back to the home page, it shows me as not being logged in, and if i try to log in a second time it shows that error, "Invalid Token". Do you know what the problem might be?

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #25 on: March 02, 2010, 21:46:20 pm »
Ah yes, I can see where there could be a problem using the VM module to login, as it is restricting code for the Module since they are not logged in yet!

The quick solution and answer is yes, you can use the Joomla user login (either mod or component) to have VM store users login. It's one in the same. The difference is registration, to which we have solved.

If you still want to show the VM module once users are logged in (using Joomla login mod) you can set the VM mod to show to only REGISTERED users. This way the mod only shows once users have logged in through the J! login mod.

The problem with this is, you might now have 2 "Users" modules showing when a user is logged in, and frankly, you might not want to show the Joolma login/out module once they have logged in. You can use METAMOD (a free module, search the JED) to disable any modules once a user IS LOGGED IN.

In other words, this cool mod does something Joomla doesn't inherently do. Joomla only allows you to disable mods to UNREGISTERED. This mod will allow you to disable mods to REGISTERED users.

I have used this many times to change out the main menu of a website depending on whether they are a registered or non-registered user.

Best.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #26 on: March 02, 2010, 21:47:09 pm »
Oooops, my last response was to your previous post, not the one you just posted.

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #27 on: March 02, 2010, 21:51:59 pm »
Oooops, my last response was to your previous post, not the one you just posted.


No problem.  I'll make some more links and see if the problem is clicking just the homepage link or if the problem is bigger than that.  If it's just the homepage link then what I'll do is remove that, since there will be no real need for people to access the home page once they're logged in; and if they log out it'll take them to the homepage anyways.  So, I'll get back to you in a bit.

Forrest

  • Full Member
  • ***
  • Posts: 1972
  • Me and my baby
    • Web Developer
Re: How do I make it so that only registered people can see my products?
« Reply #28 on: March 02, 2010, 21:57:06 pm »
It likely has nothing to do with that. I am assuming you have CACHING on, and your login module is being CACHED! So it is serving old information.

There should be a setting in the module to turn off caching for it. Set it to "Never" or "No Caching" this way the module is able to refresh the info to the user once they have logged in.

You can test this out first by just clearing your cache AFTER you login. Then just click the home page for the 1st time after clearing cache and I bet your login mod will look right.

You can search the forum for more info on this as well. Some modules won't clear the cache no matter what, depending on what caching system you are using for Joomla (config vs plugin cache settings). There is a hack and I thinK a plugin that will prevent caching only when users are logged in... which might help with refreshing cart data in the mini-cart module, your login issue seen here, menus, etc.

berserker

  • Beginner
  • *
  • Posts: 38
Re: How do I make it so that only registered people can see my products?
« Reply #29 on: March 02, 2010, 22:19:10 pm »
It likely has nothing to do with that. I am assuming you have CACHING on, and your login module is being CACHED! So it is serving old information.

There should be a setting in the module to turn off caching for it. Set it to "Never" or "No Caching" this way the module is able to refresh the info to the user once they have logged in.

You can test this out first by just clearing your cache AFTER you login. Then just click the home page for the 1st time after clearing cache and I bet your login mod will look right.

You can search the forum for more info on this as well. Some modules won't clear the cache no matter what, depending on what caching system you are using for Joomla (config vs plugin cache settings). There is a hack and I thin a plugin that will prevent caching only when users are logged in... which might help with refreshing cart data in the mini-cart module, your login issue seen here, menus, etc.


Yes, you were correct.  The virtuemart login module doesn't allow me to turn caching off, but the joomla one does, and when I try to click the home page while logged into the joomla login module, it works just fine.  What I'll do is just change the "create an account" link of the joomla login module to the registration page of the virtuemart module, and that way people would be registering in virtuemart but logging in with joomla.