Magento – Certain parts of the Hide shops for unregistered users

Die Frage, how to Prices for non-registered and logged in or not. pending the shop visitors fades is pretty old, However, it has lost none of its relevance.

There are always certain task Hide areas, when Not logged in users is.

PictureTo e.g.. Hide products and categories for non-logged in users, there are also great and free extensions such as. from Power workers Vinai Kopp, the various already recommended Magento Extensions has brought to the market. One that there is to be mentioned here, is the extension

Login only catalog

that exist in the free MagentoConnect (or on GitHub). It can be set comfortably, whether, in addition to Articles (in the categories) the complete Hidden category navigation should be as long as the user is not logged in.. Furthermore, certain components can be eliminated, which are then displayed his despite not logged in..

For all standard functions this also works fantastically. A beautiful Possibility, this extension provides the, is that the “Home” Can be hide side of the extension, if only a product like e.g.. with a “New Products” Fades widget to this. The extension therefore provides, Products that are on the page and automatically locks the page, so you have to be logged in, to see them.

As just said, The extension works great when it comes to standard features of Magento.

But if one has e.g.. a Mega Menu which comes with the theme, this is not hidden by the extension, so that it is visible to everyone. The categories and products you can although still not but look at an overview of the categories it has nevertheless.

So, to prevent this, helps a little bit code, UM which is placed the excluded area.

And these are the lines

<?php if(Magus::getSingleton('Customer / session')->isLoggedIn()): ?>

and

<?php endif; ?>

So if e.g.. a megamenu the code

   <?php echo $this->getLayout()->createBlock("tabs / navigation")->setTemplate("ip_tabs / navigation.phtml")->toHtml(); ?>

has, then everything looks like together:

<?php if(Magus::getSingleton('Customer / session')->isLoggedIn()): ?>
   <?php echo $this->getLayout()->createBlock("tabs / navigation")->setTemplate("ip_tabs / navigation.phtml")->toHtml(); ?>
<?php endif; ?>

Then the mega menu is not displayed, if the user is not logged in..

This code can of course also to pretty much put all other items of the shop.

Used in Magento Version 1.7. Ask, Comments, Proposals? Us directly or as a comment.

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

2 comments on “Magento – Certain parts of the Hide shops for unregistered users”

  1. Hallo ,
    I have the great extensions Login only catalog instaled. Unfortunately it does not work with my theme. I've been doing, which one must add the following line..
    getLayout()->createBlock(“tabs / navigation”)->setTemplate(“ip_tabs / navigation.phtml”)->toHtml(); ?>..
    Only I do not know, where to add this line..
    A tip I would be very grateful.. Greeting Hansjörg

Leave a Reply

Your email address will not be published. Required fields are marked *