Post by straightlight » Sun Apr 12, 2020 4:29 am

If no extensions suits your needs on the Marketplace based on your specific request, you could always create a new Service Request in the Commercial Support section of the forum or contact me directly to get this done as a custom job.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nightwing » Sun Apr 12, 2020 5:00 am

OK I will check the marketplace again.
straightlight wrote:
Sun Apr 12, 2020 4:29 am
If no extensions suits your needs on the Marketplace based on your specific request, you could always create a new Service Request in the Commercial Support section of the forum or contact me directly to get this done as a custom job.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by straightlight » Sun Apr 12, 2020 6:12 am

Communicated with the user to provide alternate Marketing solutions with affiliates by using extensions on the Marketplace. The first post from seanstorm100 will now be set to solved.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nightwing » Sun Apr 12, 2020 9:28 pm

That's correct, thanks
straightlight wrote:
Sun Apr 12, 2020 6:12 am
Communicated with the user to provide alternate Marketing solutions with affiliates by using extensions on the Marketplace. The first post from seanstorm100 will now be set to solved.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by head_dunce » Mon Apr 13, 2020 9:56 pm

Wait, so I have to manually approve something on the order for the affiliate commission to happen?

Jim
https://www.carguygarage.com
Yahoo Store since 2006 moved to OpenCart on January 24, 2020


Active Member

Posts

Joined
Thu Apr 04, 2019 11:50 pm

Post by straightlight » Mon Apr 13, 2020 10:02 pm

head_dunce wrote:
Mon Apr 13, 2020 9:56 pm
Wait, so I have to manually approve something on the order for the affiliate commission to happen?
Always has been the case from the core, yes. Otherwise, you either require an extension for automated tasks or by using a service.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nightwing » Tue Apr 14, 2020 1:20 am

head_dunce,
In OCv3.0.3.2, I see an option in System>Settings(Edit)>Options Tab>Scroll Down to Affiliates Section>Automatic Commission: [Yes or No]
Image
https://pasteboard.co/J3E7swQ.png

If "No" is selected you would have to go to each order (Under Sales) and Press the eye icon to view then to the top right you will see "Affiliate" with a plus button, hitting that plus button would add their commission if this order was made using an Affiliate Link. You will also see how much this affiliate will earn from this order beside the plus icon.
Image
https://pasteboard.co/J3E6wTG.png

However, if this is set to "Yes", the store will add it for you (Affiliate will receive an email).
head_dunce wrote:
Mon Apr 13, 2020 9:56 pm
Wait, so I have to manually approve something on the order for the affiliate commission to happen?

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by head_dunce » Tue Apr 14, 2020 2:02 am

Uh, so one guy says I have to manually approve them -- and the other says it's automatic... :laugh: ... :crazy: --so helpful....

Jim
https://www.carguygarage.com
Yahoo Store since 2006 moved to OpenCart on January 24, 2020


Active Member

Posts

Joined
Thu Apr 04, 2019 11:50 pm

Post by straightlight » Tue Apr 14, 2020 2:17 am

head_dunce wrote:
Tue Apr 14, 2020 2:02 am
Uh, so one guy says I have to manually approve them -- and the other says it's automatic... :laugh: ... :crazy: --so helpful....
Yes, it can be automated this way but you'd also have to know the defined amount for each customer groups where the affiliates are being placed to as opposed to manual approval. Where one-to-other users could have different versions strategically, if there are adjustments that needs to be made, order modifications would need to be made twice instead of once where the first would be automatic and the second one would be manual on anyhow instead of defining the commission value on first sight.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by head_dunce » Tue Apr 14, 2020 10:03 am

straightlight wrote:
Tue Apr 14, 2020 2:17 am
Yes, it can be automated this way but you'd also have to know the defined amount for each customer groups where the affiliates are being placed to as opposed to manual approval. Where one-to-other users could have different versions strategically, if there are adjustments that needs to be made, order modifications would need to be made twice instead of once where the first would be automatic and the second one would be manual on anyhow instead of defining the commission value on first sight.
Uhhh... << profanity removed >>?!?! I assume you know what you mean, but just know that I don't know what you know you mean. :laugh: I'm gonna guess that everything is fine, and let more affiliates sign up. Hopefully nothing backfires.
Last edited by straightlight on Tue Apr 14, 2020 10:28 am, edited 1 time in total.
Reason: Removed profanity.

Jim
https://www.carguygarage.com
Yahoo Store since 2006 moved to OpenCart on January 24, 2020


Active Member

Posts

Joined
Thu Apr 04, 2019 11:50 pm

Post by straightlight » Tue Apr 14, 2020 10:30 am

head_dunce wrote:
Tue Apr 14, 2020 10:03 am
straightlight wrote:
Tue Apr 14, 2020 2:17 am
Yes, it can be automated this way but you'd also have to know the defined amount for each customer groups where the affiliates are being placed to as opposed to manual approval. Where one-to-other users could have different versions strategically, if there are adjustments that needs to be made, order modifications would need to be made twice instead of once where the first would be automatic and the second one would be manual on anyhow instead of defining the commission value on first sight.
Uhhh... << profanity removed >>?!?! I assume you know what you mean, but just know that I don't know what you know you mean. :laugh: I'm gonna guess that everything is fine, and let more affiliates sign up. Hopefully nothing backfires.
Yup, same here. Topic now set to solved.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by tingwing » Wed May 13, 2020 2:01 pm

you need to go to system-setting-option-account-Customer Groups,click "affiliate" group for sign up page. and then at affiliate signup page ,customer will auto-select affiliate group.
head_dunce wrote:
Sat Apr 11, 2020 9:13 am
I'm starting to get affiliates as of this week too. Oddly I set up a user group called "Affiliates" and associated it to anyone signing up as an affiliate, but they still get dumped into the default group so I have to manually change them before I approve them.

my extension:https://www.opencart.com/index.php?rout ... estshop24h
email :support@bestshop24h.com
site:http://www.bestshop24h.com


Active Member

Posts

Joined
Tue Aug 02, 2016 9:01 pm

Post by straightlight » Sat Nov 07, 2020 8:09 am

Let's try this with Events.

In catalog/controller/checkout folder, create a new file called: affiliate.php .

Then, add the following:

Code: Select all

<?php
class ControllerCheckoutAffiliate extends Controller {
	// catalog/model/checkout/order/addOrderHistory/after
	public function index(&$route, &$args, &$output) {
		if (isset($this->session->data['order_id']) && isset($this->request->cookie['tracking'])) {
			$this->load->model('checkout/order');
			
			$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
			
			// The affiliate will only earn from the first purchase made by the customer.
			// Source: https://forum.opencart.com/viewtopic.php?t=202911#p783086 .
			// If above the first order, we cancel the commission amount on the affiliate.
			if ($order_info && $order_info['affiliate_id'] && $order_info['customer_id'] == $this->customer->getId()) {
				$query = $this->db->query("SELECT DISTINCT(COUNT(`order_id`)) AS total FROM `" . DB_PREFIX . "order` WHERE `affiliate_id` = '" . (int)$order_info['affiliate_id'] . "' AND `customer_id` = '" . (int)$order_info['customer_id'] . "' AND `commission` = '" . (float)$order_info['commission'] . "' AND `tracking` = '" . $this->db->escape($this->request->cookie['tracking']) . "'");
				
				if ($query->num_rows) {
					$total_orders = $query->row['total'];				
					
					if ($total_orders > 1 || $this->cart->hasRecurringProducts()) {
						$this->db->query("UPDATE `" . DB_PREFIX . "order` SET `commission` = '0' WHERE `order_id` = '" . (int)$order_info['order_id'] . "'");						
					}
				}
			}
		}
	}
}
Then, in your PHPMyAdmin > << Your OC database >> > SQL tab, add the following:

Code: Select all

INSERT INTO `oc_event` (`code`, `trigger`, `action`, `status`, `sort_order`) VALUES ('checkout_affiliate', 'catalog/model/checkout/order/addOrderHistory/after', 'checkout/affiliate', 1, 0);
Note: Replace oc_ with your actual database table prefix name (if using a different one).

This should resolved the issue.
Last edited by straightlight on Sun Nov 08, 2020 12:06 am, edited 2 times in total.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sat Nov 07, 2020 10:29 pm

I modified the route to: catalog/model/checkout/order/addOrderHistory/after since it is more convenient for the $this->session->data['order_id'] to be validated into than the old route.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sat Nov 07, 2020 11:58 pm

I modified the event constructor to only remove the commission earnings if there are more than 1 identical tracking, affiliate, commission and customer but also if there are recurring products. Affiliates should not be re-provided commission earnings due to periodic events of the same products via the same customers. Those events normally becomes stores-proprietary assets.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Sun Nov 08, 2020 11:38 am

I just finished working on the pull requests for the affiliate reports, and more, on Github which allows store owners to handle their affiliates in much better flexibilities with the orders.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by scottypetelawson » Thu Dec 31, 2020 2:17 pm

I'm also having issues. I tried to send a pm straightlight, however I am too new to be allowed to send one


Posts

Joined
Thu Jul 16, 2020 2:03 am

Post by tomeda » Fri Mar 19, 2021 9:56 pm

In which OC 3 version affiliate should work just fine?

OpenCart SEO Services
http://tomeda.bg


User avatar
New member

Posts

Joined
Thu Mar 19, 2015 4:48 am


Post by haxcop » Thu Apr 15, 2021 6:54 pm

HI guys,
This forum rocks, the affiliate marketing is something we all must work on to get it better and drive more sales to our store.
I have been also looking into this feature and coincide with all of you with the lack of functions needed in OC 3.xx - although I looked into a free extension from https://www.opencart.com/index.php?rout ... _license=0 in this regards and have some really cool functionalities as well but I can't find why the affiliate select menu it's not showing in the Coupons area when creating a new one...

But I will be also interested to try out the improvements @straightlight is doing, I looked into your Github but the last commits was on Nov 2020, do you have it on a private repro maybe?

Let me know,
Cheers

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by straightlight » Thu Apr 15, 2021 8:06 pm

But I will be also interested to try out the improvements @straightlight is doing, I looked into your Github but the last commits was on Nov 2020, do you have it on a private repro maybe?
Username referred, no commits pointed to. Forum rules.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: jagall, SohBH and 260 guests