Is it possible to add a partner to an order?

  • Posts: 98
  • Thank you received: 3
11 years 2 weeks ago #131166

Most people who buy my products visit the site a couple of times before making their mind up and they often hear about it through word of mouth. So although I hear from partners that they made a referral the actual order doesn't necessarily come from a link with the partner id. What I'd like to be able to do is add the partner details to the order in these cases so that their monthly payout is handled automatically by the system.

That doesn't seem to be possible at the moment - or am I missing something?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #131218

Hi,

Actually for the affiliate the system is to have a specific url, then we get the id of this partner and keep it in session.
When the customer buy something, if there is a partner id in session, we add it to the order.

If you want that the user enter the partner id in a fied in the checkout, it can be possible with custom code.
The columns to fill in database are:

- order_partner_id
- order_partner_price
- order_partner_paid
- order_partner_currency_id


So create a custom field in the table order, name it as you want and then create a plugin based on the function "onBeforeOrderCreate(&$order,&$do)" which will get the content of the created custom field and add the needed partner informations in the order.
It require good php level.

Here is some documentation:
www.hikashop.com/support/documentation/6...mentation.html#order

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

  • Posts: 98
  • Thank you received: 3
11 years 2 weeks ago #131310

Hi Xavier,

Thanks for your reply. Perhaps I didn't make it clear. What I would like to do is add a partner ID to an order after it has been confirmed from the BACKEND. Sometimes referrals arise that are not flagged by the system automatically because the customer Googled us instead of using the partner link. But we know from our partner that they had a contact with the customer so we need to add this info manually to reward the partner.

Regarding the session, how long does the partner id stay stored? Is this done with a cookie on the customers computer?

Thanks in advance

Conrad

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 weeks ago #131349

Hi,

So if it's in the backend, you can still add a custom field in the table order, but display it only for the backend, and then in the plugin use the function "onBeforeOrderUpdate(&$order,&$do)" and you have to do the same thing as explained before.

Get the value of the custom field which should be stored in the variable "$order->field_name" and just fill the vars:
$order->order_partner_id = ($order->field_name)?$order->field_name:'';
$order->order_partner_price = 'xx'; // where xx is the desired price value
$order->order_partner_paid = 0;
$order->order_partner_currency_id = yy; //where yy is the desired currency id.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum