- Posts: 44
- Thank you received: 0
Affiliate fee not registered
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thank you. We were able to reproduce the problem.
Please download and install that new version of the affiliate plugin and it should work with your settings.
We'll add the modifications for next release.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
And make sure that the ordering of your plugin is bigger than the one of the affiliate plugin so that the affiliate plugin does not overwrite your value with the one it calculates.
Please Log in or Create an account to join the conversation.
Also how exactly do you change the partner fees in the order?
Please Log in or Create an account to join the conversation.
Having it or not doesn't change anything for the plugin.
You can do the same as in our code...
$order->order_partner_price = $fees;
Please Log in or Create an account to join the conversation.
$order->order_partner_price = SomeMethodWhichReturnsANumber();
I checked and the method does return the correct number and that this line is in fact executed.
My plugin has ordering 1 and your default plugin has ordering 0 which I assume means that my plugin works after yours so it should be ok.
Should I use the order class to save the order or what exactly
Please Log in or Create an account to join the conversation.
Make sure that you also defined the onBeforeOrderUpdate event as I said and that you have the & before the $order in the function parameters, otherwise, the modification might not be taken into account.
Please Log in or Create an account to join the conversation.
//some checks here
$userClass = hikashop_get('class.user');
$user = $userClass->get($order->order_partner_id);
if(!empty($user->user_partner_activated)) {
$this->report(print_r($this->get_partner_fee($order->order_partner_id, $group, $order->order_id),true)); //this method runs and gives me visible output
$order->order_partner_price = $this->get_partner_fee($order->order_partner_id, $group, $order->order_id);
}
return true;
}
Please Log in or Create an account to join the conversation.
That's why I told you to also implement it.
You should check on that.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Of course, the order is saved between the onBeforeOrderUpdate and the onAfterOrderUpdate triggers.
So if you change the $order variable in the onAfterOrderUpdate trigger, it won't do anything. That's normal.
I had actually told you in a previous post to use onBeforeOrderUpdate, that's why I got confused as I thought that you would be using it.
Please Log in or Create an account to join the conversation.
Thanks for your help
Please Log in or Create an account to join the conversation.