Discussions

Product VIEWS display not showing up for Anonymous users

I'm a bit stumped by what seems like a simple Permissions issue, however, I can not find the solution in the Permissions or any access control settings.

(I'm a Commerce noob, but relatively experienced with Drupal)

I created a Product listing view with Add to Cart Buttons. The view displays perfectly for the Super User, but I can not for the LIFE of me get it to display for Anonymous or Authenticated users. (I have it set to display in a block on a specific page) Again, it works for Super User, but not for anyone else.

What am I doing wrong?

Posted: Aug 15, 2012

Comments

crooker on August 15, 2012

No bites...? Ok. So let me clarify, 'cuz I REALLY need to know what's going on here (and it seems too obvious an answer (like, "Check the permissions") to miss... and I'm racking my brain. (Yes, I did check the permissions by the way).

I'm using the Commerce Product view type. For the record, product nodes, shopping carts, checkout panes, etc... all seem to be working properly. However, the View is not visible.

I am displaying the view in a Block in the content region. The block is properly set to unrestricted access. The View has access restriction of none.

Everything SEEMS right. Yet I still can not seem to enable the Commerce Product view block or view page for anonymous or registered users.

crooker on August 15, 2012

Ok. (I feel a bit like I"m talking to myself) but I think I know what I did. IT comes from me being a noob to Commerce, and not quite understanding (yet) the relationship between products, and product display nodes... (and which information needs to go where). I created the view with just commerce product fields, and wasn't referencing the display fields, so it wasn't displaying (because there wasn't anything to display). Very confusing. ;) Hopefully someone else can make use of my mistake, and not make the same one.

chanella on September 24, 2012

I do have a relationship "referenced product" but it is still not working for anonymous users. Wat am I doing wrong?

medievp on January 17, 2013

This might be a little late, but this is for everybody else looking for the solution who doesn't want to spend hours on figuring it out like me ;-)

It's a permissions problem. You're creating a relation which requires the user to have the permission to view, but by default, doesn't. As an admin you didn't notice.

What I did to solve the problem is to go to the permissions page and give everybody the "view all products" permission. This works. BUT: It might open up a security issue, so think about it before you apply this. There might be other ways to give view permissions to anonymous users. But that's the problem here.

Cheers

Victor

timdiacon on March 21, 2013

I've also run into a similar problem. I've created a view which contains an add to cart button along with the price so I can place this in my second sidebar. It seems for anonymous users to be able to see the view I have to enable the "View any Product product" permission.

The permission problem only occurs if the view contains a relationship to the product reference. Is there any other way to override this permission issue as exposing all products to the user is potential a security issue?

chrisp on April 18, 2013

You can Disable SQL rewriting for the view, find it under Advanced -> Query Settings on the edit page. I preferred this option over setting the View any Product product permission for anonymous.

Francois P on May 21, 2013

Worked for me to. Just wondering about the Warning message. Should I worry about it? And what does the SQL rewriting really do compare with permissions control ?

millionleaves David Parrott on May 28, 2013

From the look of it, you're turning off access checks for that view only, not opening up access to all products to anonymous users. Feels less bad to me. I'm sure there's a better technical explanation, though :)

JosRuiz on June 12, 2014

Is there a solution other than giving permissions to anonymous users ("view all products") or disabling SQL Rewriting in the view? Are these solutions technically/security wise correct?

mark bannister on October 17, 2015

I just found this very obscure issue and it is also a problem in the cart checkout panes. If you display product information in your "product in cart" display type it will not display for anonymous users.
Huge issue in my opinion!