Hide Menu & Items from Wholesale User Group

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
8 years 7 months ago #236943

-- HikaShop version -- : 2.6.2
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : n/a
-- Error-message(debug-mod must be tuned on) -- : n/a

I have created a new Access level and User group called "Wholesale". The group is a child of "Registered".
The members of this user group have access to wholesale products at Wholesale quantities and Prices.
These Wholesale registered members are created manually and as far as Hikashop is concerned, so far everything seems to work OK.

I would like the wholesale customers to see only the wholesale category, the wholesale products and the wholesale Menus links (as well as a couple of wholesale only pages and modules, but if I can figure out the menu links, the articles should be easy).
I do not want the Wholesale Customers to see any link to non-wholesale products or categories.

To explain better, let's say that I have this category structure:

  • Retail Category 1 (Visibility: public, Registered - Access: Public, Registered )
  • Retail Category 2 (Visibility: public, Registered - Access: Public, Registered )
  • Wholesale Category (Visibility: Wholesale - Access: Wholesaled )

In the menu they look like this for both Public and regular registered users:

Home | RetailCat1 | RetailCat2 |

After the Wholesale Customer logs in, I would like the menu to display like this:

Home | WholesaleCat

Whereas the Wholesale customer cannot see the menu links for the regular retail customers (Registered User) after they login.

So far I have had little luck. I created a Customer access level and User Group, making it the child of various existing groups, but that doesn't work. I have no issues assigning menus and products, articles, etc. to registered users, the issue is how to hide the menu, pages, etc. for Wholesale Users.

I think either I am going about this all wrong and it is not possible without a radical reshuffling of the user group and existing customers, or I am having the biggest mental freeze of the century.

Is there a way to accomplish what I need to do?

Unfortunately, this is a topic that I found very hard to search for because apparently it's not something a lot of people need, but the search terms for it are similar to other unrelated topics having to do with the Joomla ACL. I must have read over 30 threads that *almost* gave me an answer, but no cigar.

I would really appreciate some guidance in this regard. Thank you.

Last edit: 8 years 7 months ago by conticreative.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #236975

Hi,

It's normal that you didn't find much help on that topic on this forum because your problem is not related to HikaShop.
It's purely related to setting menu items restricted to some user groups. So you would have a lot more results on forum.joomla.org
For example:
forum.joomla.org/viewtopic.php?f=673&t=811772
And here is a big tutorial on ACLs and restrictions for Joomla 3:
docs.joomla.org/J3.x:Access_Control_List_Tutorial
It also talks about restricting menu items to user groups.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
8 years 7 months ago #237057

Thank you for the reply. I asked here because there was a better chance that my question would not be misinterpreted. I figure that Hikashop users had a better chance than the average bear to be conversant with ACL in regard to using it for a wholesale purpose.

I actually already read those help pages you posted, and I did not see the issue I am having covered. I could have missed it, so I'll go over it again.
Most of all, I was hoping someone would be able to tell me if it was possible or not, because to me it appears as it is not possible with the current Joomla ACL to do what I want it to do and maybe I should look at more advanced, third party ACL.

Thank you again.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #237077

Hi,

Well, I actually don't see any problem with doing what you're talking about and don't see why it wouldn't work with the normal ACL system of Joomla, but maybe I missed something in your explanations ?

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
8 years 7 months ago #237238

I know it can be a bit confusing, but essentially what I want to do is to hide menu links to a specific user group.

For instance, menu links for the "Wholesale" group I created are visible only to Wholesale group members.

But public links, specifically links to Hikashop categories, are visible to everyone, regardless of their user level. That makes sense, but I wanted those links to disappear for wholesale customers.

Basically, I want to wholesale customers to log in and only see links and pages that contain wholesale products to make it less confusing and avoid that they buy retail products with their Wholesale account or that they end up browsing retail priducts by mistake and get confused.

Does that make more sense?

EDIT: Maybe this will be clearer:

When I create a menu link I can only assign it to 1 user access level.
Since I want the menu to be visible to both the Public and to regular Registered users, I have to give the link an access level of "Public".
That way, after a registered user logs in they will be able to see it and it is visible to the public so they can choose the products they want to buy.

The "Wholesale" Group/Access level I created can see their own link called "Wholesale Products" but ideally I don't want them to see or have access to the retail products.
Therefore, I would like to hide the menu links to the retail categories, as with my example above:

Here is another way to display the example:
Menu for Public and Registered users

Menu for Public and registered users:

Home | Retail Cat1 | Retail Cat2 | Retail Cat3 | Retail Cat4

What the menu for wholesale customers should look like after they login
Home | Wholesale Category

Instead, this is what it looks like now:
Home | Retail Cat1 | Retail Cat2 | Retail Cat3 | Retail Cat4 | Wholesale Category

The issue is this: In the Joomla menu system, I can only assign each individual link to a single User access level.
In order for this to work, I should be able to assign a link to more than one access level at the time so that the ACL for each menu should look like this:

Access Level for links to Wholesale category

Public
Guest
Registered
Wholesale X


Access level for retail links (links to retail categories)

Public X
Guest X
Registered X
Wholesale


Incidentally, Hikashop uses a system just like this one. For each product or category, I can customize the access level by selecting which groups can see that product and which groups cannot.

In Joomla however I only have the ability to assign a link (or any other item) to only a single access level at a time.

I tried to delve deeper into the Joomla ACL, but it seemed to be geared toward which group can edit, create and delete, but there is nothing that tells me which group can view. At least, I have not found it.

Last edit: 8 years 7 months ago by conticreative. Reason: Better explanation of the issue.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #237396

Hi,

Joomla has a two levels ACL system:
You have user groups and these user groups can be in one or several access levels.
And then, in your menu item, you can restrict the menu item to one access level.
So if you don't have an access level which encompass the user groups you want, just create a new one with the user groups you want attached to it. And then, you can select that access level in the menu item and only users in the user groups of that access level would see the menu item.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
8 years 7 months ago #237429

Indeed, that's what I am doing with the "Wholesale" Group and Access level. That one works just fine. It is only visible to the "Wholesale" group.

Unfortunately, I am trying to do the opposite: prevent the "Wholesale" group from seeing links that are visible to public and Registered users. That's why it is so hard to explain and so difficult to find information on how to do that.

I can selectively display menu links to each custom group I create all day. But if I want this same group to NOT see a certain link that has to be visible to the public and to another group, I can't unless I can find an ACL for the menu that works like the one in Hikashop.

In other words, I can only set a menu link with one access level. No matter how many access levels I have, I can only pick one.
In hikashop I can select as many access levels as I like . Here are some screeshots I hope can shed some light:

This is what my menu system looks like:






This is what one of the "retail Links looks like. I would like this link to NOT be visible to the wholesale group
As you can see I don't have the ability to exclude a Access group. I only have the ability to select a single group as the one authorized to view the link.








Compare the previous ACL with the one native to Hikashop:

Here I can select any access level for an individual product, therefore I can have a product that is visible to a group and not another. In Hikashop I can do what I would like to be able to do in the menu system easily, but in order to do that, I would need an ACL system like the hikashop one. Joomla doesn't have it.










Is it more clear now? Basically, I need to find a way to give Joomla menu links the same granular ACL that is available to Hikashop products.

I can't be the only one needing this, and I have a feeling that there is already an ACL system that can accomplish it. I have to find it or find a different way to approach the problem.

I think I found a way to handle it, but it would mean rebuilding the shop's structure and changing every existing customer access level. Something I'd rather not do if a simpler solution is available.

Attachments:
Last edit: 8 years 7 months ago by conticreative.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 7 months ago #237434

Hi,

I think that your problem is that your mixing "public" and "guest".
"public" means available for everyone.
"guest" means only to logged out users.
So you don't want to restrict your menu items to "public". You want to restrict them only to the guest and registered user groups.
So you need to create an access level for these two user groups and use that access level in your menu items.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
8 years 7 months ago #237595

Yes, I am aware of how Guest and Public interact and their roles. The problem is that I already have many customers registered in the shop all with the "registered" group.

To do what you suggest, I would need to change the user group for all the existing customers. In fact, I already mapped that out, I am just not comfortable doing this on a live shop, so probably I'll create a clone and test it there.

The major impediment to the Joomla ACL is that unlike Hikashop, the ACL of a menu link can only be associated to a single user group. If Joomla worked like Hikashop I would not even be posting at all. It would have been a piece of cake.

I am not against elevating the current customers to a different user level, in fact, I already created it and it does work, but I feel very uneasy about changing the user group of existing customers. I don't want to find out too late that it may mess things up for those registered users.

I actually have an idea, but before I proceed I am going to clone the store so if I screw up is not going to affect the live store.

Please Log in or Create an account to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum