User Access / Display of control panel

  • Posts: 132
  • Thank you received: 2
9 years 10 months ago #185588

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.10

Hi!

I have two groups of users, resellers and affiliates, each have their own Joomla group, my issue is that I don't want resellers to be able to "activate" the affiliate program, i.e I want to disable the "Affiliate Program" view in the User control panel for any user logged in as a "Reseller"

I have tried to disable access through HikaShop configuration -> Access Level. but this doesn't seem to do anything.

This is purely front-end where I don't want users/customers from the Reseller group to see the Affiliate Program

Last edit: 9 years 10 months ago by earmaster. Reason: Updated subject

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #185591

Hi,

You can potentially manage the Affiliate access on frontend by editing the settings of the plugin "HikaShop Affiliate".
Select a specific group.

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

  • Posts: 132
  • Thank you received: 2
9 years 10 months ago #185685

But would that not affect the affiliate system regarding the customers buying with a affiliate cookie?

I have properly not explained myself well enough, what I mean is that we have 2 user groups (Affiliate and Reseller) and then we have the REGULAR (non-registered) customers, what we want is to disable the access to the affiliate program for the user group resellers and still allow normal function / use of the Affiliate program for our regular customers and the Affiliate group

Update:
Would it be possible to load user details into the cpanel view?

Last edit: 9 years 10 months ago by earmaster. Reason: Clarification and secondary question

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #185717

Hi,

Indeed changing the group in the plugin settings, is not a good solution.
The easiest way to restrict this feature will be to edit the view "affiliate / show" and add a PHP condition on the user group.

Something like:

$user = JFactory::getUser();
if(in_array('2',$user->groups)){ // replace '2' by the id of the reseller group.
	echo "Not allowed to reach this part </div>";
	return;
}

The following user(s) said Thank You: earmaster

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

  • Posts: 132
  • Thank you received: 2
9 years 10 months ago #185822

Xavier wrote: Hi,
The easiest way to restrict this feature will be to edit the view "affiliate / show" and add a PHP condition on the user group.

Something like:

$user = JFactory::getUser();
if(in_array('2',$user->groups)){ // replace '2' by the id of the reseller group.
	echo "Not allowed to reach this part </div>";
	return;
}


This was also what I had in mind, of course I didn't realise I could've just load Joomla to load these instead of trying to find a Hikashop class to do this :)

Thanks for your help :)

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

  • Posts: 23
  • Thank you received: 0
9 years 7 months ago #199839

Hallo
I have a similar problem. I don´t want that a regular customer is able to see the affiliate button in the cpanel. I thought it would be done by activating "no selfafiliation" in the administration. But this does not work.
For this I have comment out the function "onUserAccountDisplay(&$buttons)" in the hikashopaffiliate.php.
But this is not the best way to do this.

Could you help me please.

Best regards Carlos

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 6 months ago #199854

Hi,

You could add the line:

if($oneButton['image']=="affiliate") continue;
after the line:
foreach($this->buttons as $oneButton){
in the file "cpanel" of the view "user" via the menu Display>Views.

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

  • Posts: 23
  • Thank you received: 0
9 years 6 months ago #201838

Thanks,

works perfect.

Best regards Carlos

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

Time to create page: 0.095 seconds
Powered by Kunena Forum