Affiliate Mail

  • Posts: 83
  • Thank you received: 1
12 years 2 days ago #76331

Hi,

How can I send the Affiliate Partner a mail with the detail of the commision he has received plus the total unpaid amount when a successful order has been placed by a user?

Thanks & Regards,
Manjesh.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
12 years 1 day ago #76553

Hi,

This feature is not implemented in HikaShop but it could be implemented using a custom plugin or by modifying the current affiliate plugin.
HikaShop have a lot of triggers and the trigger "onAfterOrderUpdate" is called when an order is update.
You can create a plugin which would receive this trigger and which would send an email to the affiliate partner if the order is confirmed.
The first parameter of the function is the order object which would contains a lot of useful information.
You can retrieve the user_id of the order, get the affiliate (if there), retrieve affiliate information and send him an email.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: manjeshmohan

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

  • Posts: 83
  • Thank you received: 1
11 years 11 months ago #77704

Is this the path and file of the affiliate plugin where we need to change? Do we need to change in any other files?

\components\com_hikashop\controllers\affiliate.php

Thanks & Regards,
Manjesh.

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

  • Posts: 83
  • Thank you received: 1
11 years 11 months ago #77730

It would be very helpful for me if could you please get me some sample code for testing the same? Let it be a simple one to check how the mail is send and received at the recipient's end.

I've tried so many ways but could not get the mail.

Thanks.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77819

Hi,

The affiliate system is a plugin so you can find it in the plugin folder : /plugins/system/hikashopaffiliate/

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: manjeshmohan

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

  • Posts: 83
  • Thank you received: 1
11 years 11 months ago #78154

Thanks for mentioning the path of the affiliate plugin code.
I've tried to test by adding the OnAfterOrderUpdate function and setting the true for sending the mail but I'm not getting any mail. I've checked the documentation and tried so many experiemtns also but no result was found.
Could you please show some sample working model of this function so as to test the sending of the mail?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #78192

Hi,

			$mailClass = hikashop_get('class.mail');
			$mail = new stdClass();
			$mail->content = "content";
			$mail->subject = $subject;
			$mail->from_email = $config->get('from_email');
			$mail->from_name = $config->get('from_name');
			$mail->reply_email = $element->email;
			$mail->dst_email = 'email1, email2;
			$status = $mailClass->sendMail($mail);

Or you can find a demonstration in the file: "components/com_hikashop/controllers/product.php"

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

Time to create page: 0.075 seconds
Powered by Kunena Forum