- Posts: 4
- Thank you received: 0
Restricting affiliate option by access level
- johnward10
-
Topic Author
- Offline
Less
More
14 years 6 months ago #43682
by johnward10
Restricting affiliate option by access level was created by johnward10
Hi, I know from reading previous threads that it is not possible to suppress certain elements of the client account menu, however, I wonder if it is possible to restrict the display to certain access levels?
My client would like to offer the affiliate programme only to a specific clients who have a custom access level, but not to registered users. I tried restricted the access level on the affiliate plugin, however, this stops it from tracking altogether.
Is there a way of hard coding this into the view for the client account menu?
My client would like to offer the affiliate programme only to a specific clients who have a custom access level, but not to registered users. I tried restricted the access level on the affiliate plugin, however, this stops it from tracking altogether.
Is there a way of hard coding this into the view for the client account menu?
Please Log in or Create an account to join the conversation.
14 years 6 months ago #43803
by nicolas
Replied by nicolas on topic Re: Restricting affiliate option by access level
Hi,
The simplest would be to duplicate that plugin. Remove the onUserAccountDisplay function definition from the copy plugin file.
Then, restrict the access level of the original plugin and don't restrict the access level of the copy.
That way, it should still track the users while displaying that button only for the people allowed.
The simplest would be to duplicate that plugin. Remove the onUserAccountDisplay function definition from the copy plugin file.
Then, restrict the access level of the original plugin and don't restrict the access level of the copy.
That way, it should still track the users while displaying that button only for the people allowed.
Please Log in or Create an account to join the conversation.
- johnward10
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
14 years 6 months ago #43815
by johnward10
Replied by johnward10 on topic Re: Restricting affiliate option by access level
Thanks for this. I had a play around last night and managed to work around it by removing the menu link to the control panel from the user menu and just having individual links to the other account options, but your way will probably be cleaner, so i'll give this a try.
I have one other question though, as the percentage commission option calculates a percentage of the total order value. Is there a way to exclude the shipping costs from the commission calculation, as my client doesn't make any margin on shipping, so can't pay commission on this portion of the order?
I have one other question though, as the percentage commission option calculates a percentage of the total order value. Is there a way to exclude the shipping costs from the commission calculation, as my client doesn't make any margin on shipping, so can't pay commission on this portion of the order?
Please Log in or Create an account to join the conversation.
14 years 6 months ago #43998
by nicolas
Replied by nicolas on topic Re: Restricting affiliate option by access level
There is no option for that, so you will have to modify the code:
In the file plugins/system/hikashopaffiliate.php you will find that code:
$order_price=$order->order_full_price*$user->user_params->partner_percent_fee/100;
That you can replace by:
$order_price=($order->order_full_price-$order->order_shipping_price)*$user->user_params->partner_percent_fee/100;
In the file plugins/system/hikashopaffiliate.php you will find that code:
$order_price=$order->order_full_price*$user->user_params->partner_percent_fee/100;
That you can replace by:
$order_price=($order->order_full_price-$order->order_shipping_price)*$user->user_params->partner_percent_fee/100;
Please Log in or Create an account to join the conversation.
- johnward10
-
Topic Author
- Offline
Less
More
- Posts: 4
- Thank you received: 0
14 years 6 months ago #44007
by johnward10
Replied by johnward10 on topic Re: Restricting affiliate option by access level
Thanks Nicolas, just tried it and works perfectly.
Please Log in or Create an account to join the conversation.
Time to create page: 0.149 seconds