Post by sazpurua » Sat Jan 13, 2018 12:16 pm

in v3.0.2.0 how can I find out all the commissions that have to be paid to the Affiliates?
The report is not in Modules...

New member

Posts

Joined
Mon Aug 14, 2017 6:50 am

Post by straightlight » Sat Jan 13, 2018 10:46 pm

in v3.0.2.0 how can I find out all the commissions that have to be paid to the Affiliates?
The report is not in Modules...
There are two distinction on using the term all in this case. Either you are talking about all the commissions of each regrouped orders to find out all commissions or you are looking for all totals of each affiliates that needs to be owned within the reports. Assuming you are talking about the first one,

In your admin/model/extension/report/sale.php file, in the getOrders() method,

find:

Code: Select all

SUM(o.total) AS `total`
on the same line, right after, add:

Code: Select all

, SUM(`o`.`commission`) AS `commission`
In your admin/controller/extension/report/sale_order.php file,

find:

Code: Select all

'products'   => $result['products'],
add below:

Code: Select all

'commission' => $this->currency->format($result['commission'], $this->config->get('config_currency')),
In admin/language/<your_language_code>/extension/report/sale_order.php file,

add at the bottom of the file:

Code: Select all

$_['column_commission'] = 'Commission';
In your admin/view/template/extension/report/sale_order_info.twig file,

find:

Code: Select all

<td class="text-right">{{ column_products }}</td>
add below:

Code: Select all

<td class="text-right">{{ column_commission }}</td>
Then, find:

Code: Select all

<td class="text-right">{{ order.products }}</td>
add below:

Code: Select all

<td class="text-right">{{ order.commission }}</td>

Code: Select all

<td class="text-center" colspan="X">{{ text_no_results }}</td>
Where X would be your highest value. Increment it by one.

This should show you the total commissions of all related orders of the same products for each rows.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Guru Member

Posts

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

Post by sazpurua » Wed Jan 17, 2018 8:45 am

straightlight wrote:
Sat Jan 13, 2018 10:46 pm
in v3.0.2.0 how can I find out all the commissions that have to be paid to the Affiliates?
The report is not in Modules...
There are two distinction on using the term all in this case. Either you are talking about all the commissions of each regrouped orders to find out all commissions or you are looking for all totals of each affiliates that needs to be owned within the reports. Assuming you are talking about the first one,
Thanks for your reply!
Actually what I need is a report that shows me (for a given time period) the list of the affiliates that have earned commissions, and the amount owed to each of them.
However, the info you supply before is quite useful as well.

Thanks

New member

Posts

Joined
Mon Aug 14, 2017 6:50 am
Who is online

Users browsing this forum: No registered users and 14 guests