Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by mkp007 » Sat Jan 23, 2016 8:42 am

When the new affiliate is emailed a link to log in, he is emailed a link to the default store. I need it to be the store which he signed in with. Otherwise, he will be creating links with the default store and not the correct store.

Also, having trouble with step 7. It says to place it right after the function name but this doesn't make sense.

Code: Select all

public function addAffiliate($data)         
        mail('mark@web-site.com', 'New affiliate', 'New affiliate account is pending', 'From: ' . $this->config->get('config_email'));

	
should it be after the "{" like this?

Code: Select all

public function addAffiliate($data) {      
        mail('mark@web-site.com', 'New affiliate', 'New affiliate account is pending', 'From: ' . $this->config->get('config_email'));
$this->db->query("INSERT INTO " . DB_PREFIX......

	

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by ocmta » Sat Jan 23, 2016 10:11 pm

mkp007 wrote: should it be after the "{" like this?
Yes, of course.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by mkp007 » Tue Jan 26, 2016 6:02 am

Thank you ocmta.

In regards to the new affiliate approval email, the problem is they receive a link to the default store affiliate login which leads them to link creator for the default store. A better email would be links to the desired stores with directions that explain how to create the site specific links. So I need to edit this approval email, but I can’t find the file that sends the email.

I can only find the file that contains the text: admin/language/english/mail/affiliate.php

Can you help me locate the file that sends the affiliate approval confirmation email??

As an example:
This file contains to the text for the registration confirmation email: catalog/language/english/mail/affiliate.php
And this file that sends the registration confirmation email: catalog/model/affiliate/affiliate.php (this is the same file you add the email code to notify you if you have a new affiliate that requires approval)

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by mkp007 » Tue Jan 26, 2016 8:09 am

That's it!! Don't know how you found it, but much appreciated.

So, I think the best thing is to remove the following line of code in: admin/model/sale/affiliate.php

Code: Select all

$message .= HTTP_CATALOG . 'index.php?route=affiliate/login' . "\n\n";
And then add what ever text and links that make sense to this file: admin/language/english/mail/affiliate.php

Do you know how to add hyperlinks and new line commands within the "text_approve_login" variable? My goal would be to add the different store links here in a format that looks professional.

Code: Select all

$_['text_approve_login']        = 'Your account has now been created and you can log in by using your email address and password by visiting our website or at the following URL:';
Thanks again.

Mark

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by ocmta » Tue Jan 26, 2016 10:27 pm

Not sure what you mean by different links. If you mean the link for the store which affiliate used to register, this is not easy, because affiliate accounts are global, information about the store used to register is not even saved anywhere. So you'll have to modify the database and registration code to save it, etc. This is too complicated for the forum.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by mkp007 » Tue Jan 26, 2016 10:33 pm

No, I plan on just hard coding the message with links. The easy way. Just not sure what I can code in there to make the email look decent.

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am

Post by ocmta » Tue Jan 26, 2016 10:41 pm

Approval email is plain text, so it doesn't need html tags. For links you just enter URLs, email clients usually recognize them and make them clickable.

For new lines you put \n in double quotes like this: "\n"

Or you can use some openCart email extension, one that provides better templates etc.

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by mkp007 » Wed Jan 27, 2016 7:48 am

Got it to work. Note, I had to use double quotes for the variable and no quotes around the \n.

Here is the contents of admin/language/english/mail/affiliate.php

Code: Select all

<?php
// Text
$_['text_approve_subject']      = '%s - Your Affiliate Account has been activated!';
$_['text_approve_welcome']      = 'Welcome and thank you for registering at %s!';
$_['text_approve_login']        = "Your account has now been created and you can log in by using your email address and password by visiting one of our shops: \n\n     Bag Toss - https://www.bagtoss.com/affiliate/login \n\n     Corn Hole 2 - https://www.cornhole2.com/affiliate/login \n";
$_['text_approve_services']     = 'Upon logging in, you will be able to generate tracking codes, track commission payments and edit your account information.';
$_['text_approve_thanks']       = "Thank You for Your Support! \n\nKind Regards, \n\nTeam Vorticy";
$_['text_transaction_subject']  = '%s - Affiliate Commission';
$_['text_transaction_received'] = 'You have received %s commission!';
$_['text_transaction_total']    = 'Your total amount of commission is now %s.';
?>
And the Resulting Email:

Code: Select all

Welcome and thank you for registering at Vorticy!

Your account has now been created and you can log in by using your email address and password by visiting one of our shops:

     Bag Toss - https://www.bagtoss.com/affiliate/login

     Corn Hole 2 - https://www.cornhole2.com/affiliate/login

Upon logging in, you will be able to generate tracking codes, track commission payments and edit your account information.

Thank You for Your Support!

Kind Regards,

Team Vorticy
Also, since you will probably want to test the email several times, I recommend setting up an affiliate account and approve it through the admin panel sales -> affiliates. Once you approve it, you can reset it back to unapproved by logging into phpmyadmin and setting the approved value of the oc_affiliate from 1 back to 0. This will allow you to approve it and receive the email again. Also, don't forget to edit the admin/model/sale/affiliate.php file (see a couple posts back) to get the default store link out of there.

Vorticy, Inc.
Opencart 1.5.6.4, MySQL 5.1.73-5, PHP 5.3.3-46, Plesk v12.0.18, OS CentOS 6


New member

Posts

Joined
Fri May 10, 2013 12:56 am
Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 13 guests