Post by jthrongard » Fri Nov 17, 2017 12:14 am

When we turn Automatic Commissions to Yes, we are not having them go through. Each affiliate's transaction page shows no new orders once the Automatic Commissions is set to Yes.

I know that's not much info, but I'm not sure what else I can provide to help get an answer.

OC Version 2.1.0.1

Small Business Joomla! Website Design - Simple CMS Design
http://www.simplecmsdesign.com


User avatar
New member

Posts

Joined
Fri Jun 08, 2012 12:22 am
Location - Boise, ID

Post by straightlight » Fri Nov 17, 2017 12:49 am

How about the exact and detailed steps that you did in order to be able to reproduce this problem?

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 jthrongard » Fri Nov 17, 2017 12:54 am

Login to admin - Go to System - Settings - Edit Store - Option Tab - Change Automatic Commission radio to Yes - Save
Wait a couple days for sales to build
Login to admin - Got to Reports - Marketing - Affiliates - Set Filter for Dates that Automatic Commissions was set to yes
Have Zero results
Log into specific order from specific affiliate user - See that sale had affiliate code used

I have a theory - I can also see within the database that the affiliate_transaction table has a bunch of transactions for the same date range but the affiliate_id is 0. There is no affiliate with the ID of 0.

Small Business Joomla! Website Design - Simple CMS Design
http://www.simplecmsdesign.com


User avatar
New member

Posts

Joined
Fri Jun 08, 2012 12:22 am
Location - Boise, ID

Post by straightlight » Fri Nov 17, 2017 12:58 am

Regarding the affiliate ID of 0, you are indeed using an old version of Opencart. It is definitely possible that this issue may have been fixed over more recent versions.

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 jthrongard » Sat Nov 18, 2017 8:05 am

I can find nothing in the files that would cause this. I'm attaching screenshots that show the problem within the database itself. The proper affiliate is listed within the oc_order table but NOT within the affiliate_transaction table.

Attachments

oc_order.png

oc_order.png (116.31 KiB) Viewed 862 times

affiliate_transaction.jpg

affiliate_transaction.jpg (202.78 KiB) Viewed 862 times


Small Business Joomla! Website Design - Simple CMS Design
http://www.simplecmsdesign.com


User avatar
New member

Posts

Joined
Fri Jun 08, 2012 12:22 am
Location - Boise, ID

Post by straightlight » Sat Nov 18, 2017 8:29 am

My last reply was not about debating the fact that you did found a clue. It was rather indicated that it was a past encountered issue and simply by upgrading your Opencart version to the latest v2.x releases, if not over the latest v3.x releases simply to remain on the v2.x releases, then this issue will most likely be 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 jthrongard » Sat Nov 18, 2017 11:19 am

My problem with that (I would gladly if possible) is that I have payment plugins that are built for 2.1.0.1 and will cease to work if updated. Is there anything I can look for in the code to fix myself and keep 2.1.0.1 for now?

Small Business Joomla! Website Design - Simple CMS Design
http://www.simplecmsdesign.com


User avatar
New member

Posts

Joined
Fri Jun 08, 2012 12:22 am
Location - Boise, ID

Post by straightlight » Sat Nov 18, 2017 11:27 am

A simplistic fix would be to add indexed keys to the affiliate_id and the order_id in your affiliate_transaction table in your Opencart database.

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 jthrongard » Tue Nov 21, 2017 12:57 am

Ok, I set both of those tables with index. I also ran this script to update the table to the correct values.
UPDATE oc_affiliate_transaction
JOIN oc_order
ON oc_affiliate_transaction.order_id = oc_order.order_id
SET oc_affiliate_transaction.affiliate_id = oc_order.affiliate_id;

That's a temp fix to get the wrong affiliate_id in the transactions table, in case anyone else has this problem.

Small Business Joomla! Website Design - Simple CMS Design
http://www.simplecmsdesign.com


User avatar
New member

Posts

Joined
Fri Jun 08, 2012 12:22 am
Location - Boise, ID

Post by straightlight » Tue Nov 21, 2017 2:59 am

General note: Take note that the modification code above with the database table prefix name of: oc_ may be only specific for this example. Ensure to rename the database table prefix name in the query to your personalized database table prefix name if applied.

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: No registered users and 318 guests