News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

VM show cart ONLY for logged in users and only admin can sign new users up

Started by welrachid, October 03, 2016, 13:16:53 PM

Previous topic - Next topic

welrachid

Hi
Im using VM to make a shopping site for regular customers.
I need a plugin that can help me REQUIRE people to signin IF they press add-to-cart btn and i DONT want people to be able to sign up. ONLY admin should be able to sign new accounts up.
This is a "CLOSED SHOP" only for pre-registered regular users.
Do you know of a plugin, free or paid, i would really appreciate it.

Thanks
Wel
Best regards,
Wel

Studio 42

I think that a tempalte overide can solve this.
Check for user logged in and add a login button to replace add to cart button, if user is not logged in.
And disable display for anonymous the Joomla cart module, menu links, order ... TO make all private.

welrachid

So far i've solved it using this:
   $not_allowed_views = array("cart","registration");

   if ($user->guest && in_array($app->input->get('view'),$not_allowed_views)) {
      $login_url = 'index.php?option=com_users&view=login';
      $app = JFactory::getApplication();
      $url = JRoute::_($login_url);
      $app->redirect($url);
   }
This should eliminate most users.. Not sure if one calls directly to the controllers and how to avoid that..
I'm using custom script to create new users directly from e-conomic debtors.
Best regards,
Wel

Studio 42

To eliminate a view, add a filter for the menu for cart and exclude anonymous user.
Registration menu link cannot completly disable else user cannot login. But you can add a position with this links and check for anonymous user too to not display it in this case or simply disable Joomla registration.