Post by burley » Wed Oct 09, 2019 9:11 pm

I have a custom report to which I want to add an additional value. The value needs to be calculated, which (as it is php) should be pretty easy. But for some reason the value is not calculated when the report is generated. Below is the original code from the reports controller file and the modified code.

What am I doing wrong?

Original code

Code: Select all

$net_sales = $agent_order['total'] - ($agent_order['shipping'] + $agent_order['tax'] + $agent_order['other_fees'] + -$agent_order['coupon']);
Modified code

Code: Select all

$net_sales = ($agent_order['total'] - ($agent_order['shipping'] + $agent_order['tax'] + $agent_order['other_fees'] + -$agent_order['coupon'])) * $commission;
$commission is set to the value of 0.15

User avatar
Active Member

Posts

Joined
Sun Oct 09, 2011 3:30 pm

Post by burley » Tue Oct 22, 2019 11:05 pm

No body has any clue?

User avatar
Active Member

Posts

Joined
Sun Oct 09, 2011 3:30 pm

Post by grgr » Wed Oct 23, 2019 2:38 pm

The code is correct.

You won't get any further answer I don't suppose at it is not opencart code.

You probably have a zero in there somewhere, who knows. Print out the variables to check.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by burley » Wed Oct 23, 2019 5:29 pm

Thank you for your reply!

Well I set the $commission variable to 0.15, so perhaps that is the issue.

User avatar
Active Member

Posts

Joined
Sun Oct 09, 2011 3:30 pm
Who is online

Users browsing this forum: No registered users and 81 guests