Post by olimax » Thu Jun 14, 2012 9:07 pm

I have made a vqmod to fix this issue
http://forum.opencart.com/viewtopic.php?f=131&t=67738

User avatar
New member

Posts

Joined
Thu Dec 22, 2011 5:08 pm
Location - Barcelona & London

Post by mvj2002 » Wed Jul 25, 2012 2:19 am

Running the following SQL script directly from phpMyAdmin gives exactly what I'm expecting.
<------------ code ------------>
SELECT op.name, op.model, SUM( op.quantity ) AS quantity, SUM( op.total + op.total * op.tax /100 ) AS total
FROM oc_order_product op
LEFT JOIN oc_order o ON ( op.order_id = o.order_id )
WHERE o.order_status_id > '0'
GROUP BY op.model
ORDER BY total DESC
<------------ code ------------>

Looking into php code, it turns out that there is a bug in admin/controller/report/product_purchased.php and/or admin/model/report/product.php. After the code block

<------------ code ------------>
if (isset($this->request->get['filter_order_status_id'])) {

$filter_order_status_id = $this->request->get['filter_order_status_id'];

} else {

$filter_order_status_id = 0;

}
<------------ code ------------>

in controller product_purchased.php has been executed, $filter_order_status_id can't be null. However, in model product.php, there is the following block:

<------------ code ------------>
if (!is_null($data['filter_order_status_id'])) {

$sql .= " WHERE o.order_status_id = '" . (int)$data['filter_order_status_id'] . "'";

} else {

$sql .= " WHERE o.order_status_id > '0'";

}
<------------ code ------------>

This means that we never branch into the else branch. I wrote a simple vQmod fix for that.

Newbie

Posts

Joined
Wed Jul 25, 2012 1:39 am

Post by HATEPOLICY » Fri Aug 24, 2012 3:13 pm

Didn't know if I should revive this thread of not, but here goes,

We migrated from OSC to OC, using an official extension here,
I noticed the Reports/Products/Purchased made no sense, the total moneys did but not the actual items/quantity sold,
I put it down to the migration/bug, we cleared history and tallied up all accounts.

So, we just upgraded to 154.1 from 153.1, orders have been processed since and we are faced with the same issue.

Will the vQmod fix mentioned here work for my situation?

Many thanks.

Skills: Ripp, copy, paste.


New member

Posts

Joined
Tue Nov 22, 2011 5:46 pm
Location - Boosting 30-80hz ranges.

Post by i2Paq » Fri Aug 24, 2012 3:25 pm

I know that in the past the report showed the total of all orders-statuses.

In my 1.4.9.x I have a modified code so it will only show the total of a certain order-status: Shipped

I have no idea if the code in the 1.5.4.x version is still the same as it was in 1.4.9.x?

Edit: Found the related topic: Order Status "Cancelled/Refund"

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by HATEPOLICY » Fri Aug 24, 2012 11:32 pm

I think we are experiencing something different.

I will explain:
We are a distribution and online shop for 17 labels, so we sell CDs, Vinyl, Merch & Digital media.
So downloadable and tangible.

In Reports/Products/Purchased,
For example, 50 sales in a few hours, more or less an even spread between our latest products,
But in the Purchased totals, it states 40 sales of the same Mp3, where in fact it was really 10 CD's and 35 other products and maybe 5 of the bloated mp3's sales.

Our products are set to completed.
This is a clean install of 154.1 with our db from 153.1, upgraded and live.

This is a big issue for us, in essence we can't get a total online, nor can we see what's sold the most, basic functions that we had implemented on OSC from 2002.

Skills: Ripp, copy, paste.


New member

Posts

Joined
Tue Nov 22, 2011 5:46 pm
Location - Boosting 30-80hz ranges.

Post by azhararmar » Wed Aug 29, 2012 7:53 pm

for all those facing the problem, i fixed it by modifying some amount of code, and i can confirm it is working for me. i am posting it here with the intention of helping someone with the same problem.

thanks for solution provided by @aurevilly.

navigate to /admin/model/report , this are the files which handles reports. you need slight modification here. in my case i was having the problem in customer, product and sale for all statuses it was not showing the record. so what i did was.

open up the corresponding file in /admin/model/report directory. for example in

customer.php line 6:

Code: Select all

if (!is_null($data['filter_order_status_id']))
change it to

Code: Select all

if (!empty($data['filter_order_status_id']))
find the code

Code: Select all

if (!is_null($data['filter_order_status_id']))
in all of the files in the directory and change it to

Code: Select all

if (!empty($data['filter_order_status_id']))
. this will solve the problem.

Newbie

Posts

Joined
Wed Aug 29, 2012 7:42 pm

Post by HATEPOLICY » Wed Aug 29, 2012 10:05 pm

It seems the problem we were experiencing was due to OC reporting totals by model ID and not Product ID.
We only have a few models, ie; !2", MP3, WAV, 10", 7", LP, EP, but lots of different products,

So reporting by product ID solved our issues.

Skills: Ripp, copy, paste.


New member

Posts

Joined
Tue Nov 22, 2011 5:46 pm
Location - Boosting 30-80hz ranges.

Post by i2Paq » Wed Aug 29, 2012 10:23 pm

Who fixt it, the seller of the migration tool?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Acetech » Thu May 29, 2014 9:58 am

HATEPOLICY wrote:It seems the problem we were experiencing was due to OC reporting totals by model ID and not Product ID.
We only have a few models, ie; !2", MP3, WAV, 10", 7", LP, EP, but lots of different products,

So reporting by product ID solved our issues.
I know this is an old thread but I just wanted to say thanks!

I had the same issue on a relatively new installation of 1.5.6.4 and changing this solved it

Newbie

Posts

Joined
Wed Aug 08, 2012 10:47 pm
Who is online

Users browsing this forum: No registered users and 15 guests