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

straightlight wrote:
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.
Could you please clarify your answer?
Thanks

New member

Posts

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

Post by straightlight » Thu Apr 15, 2021 9:01 pm

haxcop wrote:
Thu Apr 15, 2021 8:54 pm
straightlight wrote:
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.
Could you please clarify your answer?
Thanks

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by straightlight » Thu Apr 15, 2021 9:01 pm

haxcop wrote:
Thu Apr 15, 2021 8:54 pm
straightlight wrote:
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.
Could you please clarify your answer?
Thanks

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by haxcop » Thu Apr 15, 2021 9:55 pm

straightlight wrote:
Thu Apr 15, 2021 9:01 pm
haxcop wrote:
Thu Apr 15, 2021 8:54 pm
straightlight wrote:
Thu Apr 15, 2021 8:06 pm


Username referred, no commits pointed to. Forum rules.
Could you please clarify your answer?
Thanks

Still... ???

New member

Posts

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

Post by straightlight » Thu Apr 15, 2021 9:57 pm

haxcop wrote:
Thu Apr 15, 2021 9:55 pm
straightlight wrote:
Thu Apr 15, 2021 9:01 pm
haxcop wrote:
Thu Apr 15, 2021 8:54 pm


Could you please clarify your answer?
Thanks

Still... ???
Please post the URL of the source of information when addressing somebody else in the loop!

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by haxcop » Thu Apr 15, 2021 10:09 pm

haxcop wrote:
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
So tell me where I didn't publish the URL? you can see the reference of the module I tried and commented Plus mentioned you in this reply, which You statued committed some changes in GitHub, which you did not point to any URL so I don't know what actually are you referring to?

straightlight wrote:
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.
Anyway I tried your code but still allowed me to place an order twice with the same referral affiliate link and allowed me to apply the credit to the affiliate user
straightlight wrote:
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.
Thanks

New member

Posts

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

Post by straightlight » Thu Apr 15, 2021 10:14 pm

Ok, now I see the source of information. Have you also seen this one on the topic: viewtopic.php?t=202911#p783110 and applied it ?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by haxcop » Thu Apr 15, 2021 10:25 pm

Yes I read it but there's no specified solution on it, it remains open for anyone to solve and that's when if i'm not mistaken you mentioned you finished to apply some commits on GitHub.
and this is when I asked you where is it? as I could not find it on your Github repros - only one commit of affiliate emails is that I could see in November 8

New member

Posts

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

Post by straightlight » Thu Apr 15, 2021 11:02 pm

haxcop wrote:
Thu Apr 15, 2021 10:25 pm
Yes I read it but there's no specified solution on it, it remains open for anyone to solve and that's when if i'm not mistaken you mentioned you finished to apply some commits on GitHub.
and this is when I asked you where is it? as I could not find it on your Github repros - only one commit of affiliate emails is that I could see in November 8
For now, I would suggest you'd contact the extension developer of the Marketplace link you addressed above to have this feature integrated as there are massive change on the Master Branch going on right now.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by haxcop » Thu Apr 15, 2021 11:24 pm

straightlight wrote:
Thu Apr 15, 2021 11:02 pm
haxcop wrote:
Thu Apr 15, 2021 10:25 pm
Yes I read it but there's no specified solution on it, it remains open for anyone to solve and that's when if i'm not mistaken you mentioned you finished to apply some commits on GitHub.
and this is when I asked you where is it? as I could not find it on your Github repros - only one commit of affiliate emails is that I could see in November 8
For now, I would suggest you'd contact the extension developer of the Marketplace link you addressed above to have this feature integrated as there are massive change on the Master Branch going on right now.
Sorry But I think you miss interpreter my question.

I said I used an extension that does something similar and has an issue and I'm trying to solve... ( I know the best way is to ask the developer who developed the extension), he gave this module for free and mentioned on the extension comments he's not longer providing support so I dropped the suggestion to use/try and see such extension in case of somebody interested into and then we can share suggestions or mods to make it work correctly...

Now @straightlight

What I have been asking you is about your commits in regards to the affiliate marketing features and enhancements you provide and mentioned << This is my real question here for you as the developer of the code in question.

regards,

New member

Posts

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

Post by straightlight » Thu Apr 15, 2021 11:29 pm

haxcop wrote:
Thu Apr 15, 2021 11:24 pm
straightlight wrote:
Thu Apr 15, 2021 11:02 pm
haxcop wrote:
Thu Apr 15, 2021 10:25 pm
Yes I read it but there's no specified solution on it, it remains open for anyone to solve and that's when if i'm not mistaken you mentioned you finished to apply some commits on GitHub.
and this is when I asked you where is it? as I could not find it on your Github repros - only one commit of affiliate emails is that I could see in November 8
For now, I would suggest you'd contact the extension developer of the Marketplace link you addressed above to have this feature integrated as there are massive change on the Master Branch going on right now.
Sorry But I think you miss interpreter my question.

I said I used an extension that does something similar and has an issue and I'm trying to solve... ( I know the best way is to ask the developer who developed the extension), he gave this module for free and mentioned on the extension comments he's not longer providing support so I dropped the suggestion to use/try and see such extension in case of somebody interested into and then we can share suggestions or mods to make it work correctly...

Now @straightlight

What I have been asking you is about your commits in regards to the affiliate marketing features and enhancements you provide and mentioned << This is my real question here for you as the developer of the code in question.

regards,
The commit is still on-hold due to the mass development change currently occurring on Github. As I mentioned on my previous reply, simply contact the developer of that extension to have the desired feature integrated. As an alternative, you could also create a new service request in the Commercial Support section of the forum to get this done as a custom job.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by haxcop » Thu Apr 15, 2021 11:37 pm

straightlight wrote:
Thu Apr 15, 2021 11:29 pm
haxcop wrote:
Thu Apr 15, 2021 11:24 pm
straightlight wrote:
Thu Apr 15, 2021 11:02 pm


For now, I would suggest you'd contact the extension developer of the Marketplace link you addressed above to have this feature integrated as there are massive change on the Master Branch going on right now.
Sorry But I think you miss interpreter my question.

I said I used an extension that does something similar and has an issue and I'm trying to solve... ( I know the best way is to ask the developer who developed the extension), he gave this module for free and mentioned on the extension comments he's not longer providing support so I dropped the suggestion to use/try and see such extension in case of somebody interested into and then we can share suggestions or mods to make it work correctly...

Now @straightlight

What I have been asking you is about your commits in regards to the affiliate marketing features and enhancements you provide and mentioned << This is my real question here for you as the developer of the code in question.

regards,
The commit is still on-hold due to the mass development change currently occurring on Github. As I mentioned on my previous reply, simply contact the developer of that extension to have the desired feature integrated. As an alternative, you could also create a new service request in the Commercial Support section of the forum to get this done as a custom job.

Thanks...

New member

Posts

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

Users browsing this forum: No registered users and 22 guests