Jump to content

Assigning a Product Group to a User Group


sadi

Recommended Posts

On 30/09/2019 at 11:50, sadi said:

is this possible that clients in a group can only access a certain group of product?

not from the configuration settings - there used to be a couple of addons that could do things with client groups & products... by default, everyone sees all non-hidden product & product groups.

ServerPing had a "Show Hidden Product Groups based on Client Group" module, but I don't know if it still works with the latest WHMCS release.

ultimately, if there isn't a commercial solution available, what you want can be done via hooks.

Link to comment
Share on other sites

Thanks Brian

in fact, I wasn't looking for a commercial solution

but I didn't find the hooks to solve the problem

In this link :

https://whmcs.community/topic/292651-whmcs-hide-certain-product-from-public-visitor/

you wrote a hook that hide some products for clients who are not logged in

I want to change this hook so that the client group id  is checked and if it was in a certain group ,hide certain product for it.but i dont know how to do it

is that a right or best solution? can you help me?

 

 

Link to comment
Share on other sites

On 02/10/2019 at 10:42, sadi said:

In this link :

https://whmcs.community/topic/292651-whmcs-hide-certain-product-from-public-visitor/

you wrote a hook that hide some products for clients who are not logged in

i'd forgotten about that...

On 02/10/2019 at 10:42, sadi said:

I want to change this hook so that the client group id  is checked and if it was in a certain group ,hide certain product for it.but i dont know how to do it

then...

if (!$client) {

becomes...

if (!$client && !$client->groupid == '1') {

where 1 is the group ID value of your client group... you can get the client group ID value from the URL in the browser when you edit a client group in the admin area...

this change will make products specified in the removed array invisible to everyone, unless they are a logged in client assigned to the client group id=1

On 02/10/2019 at 10:42, sadi said:

is that a right or best solution? can you help me?

if all the products you only wanted client group x to see where in the same product group, then I suppose you could use a sidebar hook to hide that group from the sidebar... but whether that's any better than the above hook, I don't know.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated