I have a drupal 7 commerce install. I have made the views only accessible to authenticated users, but when I am not authenticated, and type in "mysite.com/cart" I still can see the cart (even though it has nothing in it).

I am using the content access module to prevent non authenticated users from viewing my produces, but I don't want anyone who is not logged in, to even know the website doubles as a store. How do I hide the cart page?

1 Answer 1


A quick fix might be to write a tiny custom module that overrides the access callback for the cart page:

function MYMODULE_menu_alter(&$items) {
  $items['cart']['access callback'] = 'MYMODULE_cart_access';

function MYMODULE_cart_access() {
  if (user_is_logged_in()) {
    return user_access('access content');

  return FALSE;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.