Ubercart: control of access!

Posts: 24
Joined: 10/16/2007

Is it possible to disconnect in Ubercart an opportunity to order for anonymous users? Looked in the control of access - anything similar has not found = (

Posts: 203
Joined: 09/06/2007

get the node access module and then say what role can actually display the very node of a product, hence the guest cannot shop.

Or you can make an hook_nodeapi and check there if the user going from your site into you shop is a guest and then you tell him, his orders will not be processed all the way thru. on hook_order you somewhere also get the user id and there you want it to be unequal to nill got guests...

Posts: 2244
Joined: 08/07/2007
AdministratoreLiTe!

I think what you're looking for is in Checkout settings. There is a checkbox that enables and disables anonymous checkout.

Posts: 24
Joined: 10/16/2007

Thanks you both =)

Posts: 203
Joined: 09/06/2007

my way would be more selective for certain products... but yours is faster Eye-wink

Posts: 20
Joined: 08/07/2007
Uber Donor

I would like to disable anonymous cart access altogether - not just checkout ability. How is that possible other than to disable access to each node individually. I will have a large site with several hundred products.

-Steve

Posts: 2244
Joined: 08/07/2007
AdministratoreLiTe!

The easiest thing is probably to use TAC Lite to restrict access to the catalog terms.

To allow anonymous users to see your products, but not purchase them, is a little harder. I would modify the product theme, either through Contemplate, or overriding theme_uc_product_add_to_cart(). Just put

<?php
 
global $user;
  if (
$user->uid){

  }
?>

around the cart form, and only authenticated users will see the output.

Posts: 203
Joined: 09/06/2007

@Lyle, that is a great approach to simply hide the add to cart button!! Cool Do not forget tough to replace it with some text that the user does not falsely assume he is not finding it ...

Posts: 203
Joined: 09/06/2007

what also is a good thing, to alter the display of options by role. I did that sort of for my college courses Eye-wink

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Steve, you're gonna have to specify if you mean you don't want people to ever see your products without first logging in or if you just don't want them adding anything to the cart without logging in. Seeing "anonymous cart" doesn't make me think of restricting access to product nodes, but if that's what you're wanting then go for a system like Lyle mentioned. Another simple thing to do is simply don't display the block leading to the catalog categories for anonymous users.

Posts: 20
Joined: 08/07/2007
Uber Donor

Hey TAC Lite worked perfectly! Thanks, Lyle!

Posts: 6
Joined: 10/25/2007

I too would like to see a simple permission line-item in the "Administer >> User management >> Access control", that will allow/not-allow access to the whole ubercart for the different user roles. Same way as Gallery2 has "access gallery" line.

Removing permission to anonymous user, for example, hide all menus, blocks, and any other access to the gallery2, like it does not exist at all. I don't have to go and edit each part separately.

Somewhere else you suggested not to require users to create accounts etc, so their shopping experience will be as easy and open as possible. BUT, right now I am trying to learn how to set up ubercart, and would like to hide my experiments from most of the users, and allow only one user-role see it.

I am not yet at a level of playing with php, hooks, taxonomy, etc; just clicking check boxes Smiling

Maybe we can accomplish this by other modules (TAC Lite?), but this basic access control to the whole package should be included in ubercart (see Gallery2).

.... Did I say thank you for making this wonderful Ubercart available?? ... THANKS.

Posts: 108
Joined: 10/31/2007
Getting busy with the Ubercode.

In fact it has a lot of sense on having a permision to see the products and another to be able to buy.

If you only think on flat-e-shopping it may look weird, who would build an e-shop with ubercart for not allowing the shopping process?, but from companies point-of-view exhibiting the catalog to general audiences (and thus displaying their products and making appealing to final buyers) but then only allowing buy out to resellers on a drupal restricted ordering area.

If you would allow something like this, which in fact is only a question of placing new drupal-perms here and there, you would extend the spectrum of ubercart uses very easily. Manufacturers would love drupal-ubercart because they will exhibit their catalog and then have an ordering systems for resellers and you would be targetting a new market niche.

As a consultor I will need this sooner or later.

Posts: 108
Joined: 10/31/2007
Getting busy with the Ubercode.

Now I realize that I added the permission (on perm_hook) to view catalog on the new uc_catalog.module version but I haven't restrited any part of the code to that persmission. I've faced a project where the promoters didn't want everybody to see the catalog. It would be interesting to implement, because in fact when you work with final customers there are so many possible scenarios that is good to have all them considered for not forcing admins to hack the code. On that sense drupal's way to restrict access with persmissions on the code is so easy that I think it's worth to use it Smiling

Posts: 2
Joined: 02/20/2008

I agree with cartguy above. I need a system which I can restrict all access to product for most roles. We already have pages up that just explain the product (they would link to the product page, if applicable), but I want our US Customers (role) to be able to see prices and buy it. But, since we have reps from around the world that sell to other places, we cannot show our prices as they will be different than our reps around the world.

So, I am wondering if there a solution out there that will restrict access to all ubercart modules (especially prices) if they are not a US customer?

Posts: 301
Joined: 11/19/2007
Bug FinderGetting busy with the Ubercode.

http://www.ubercart.org/contrib/4790 might do the trick if all you need to do is hide prices and add to cart based on role.