lat9 / sales_report

Sales report for Zen Cart
GNU General Public License v3.0
0 stars 4 forks source link

Attributed products' sales are incorrectly aggregated #31

Closed lat9 closed 1 year ago

lat9 commented 2 years ago

... as reported in this Zen Cart support-thread posting.

It's unclear as to when that feature 'broke'.

dennisns7d commented 2 years ago

Having used this add-on, I was curious about this. I've narrowed it down to a change in admin/includes/classes/sales_report.php. This change happened during the Re-factoring commit on Oct 16, 2017.

3.1.1 function build_li_products($product) { $id = $this->timeframe_id; $pID = $product['uprid'];

3.2.0 and later function build_li_products($product) { $id = $this->timeframe_id; $pID = $product['id'];

Reversing this change appears to fix the problem.

I suspect that the call to zen_get_products_manufacturers_name should be using $product['id'] for its argument instead of $pID.

lat9 commented 2 years ago

Thanks, @dennisns7d, that points me in the correct direction. I appreciate the help.

dennisns7d commented 2 years ago

I'm not seeing anything in this morning's commit #31 that addresses this issue.

lat9 commented 2 years ago

Arggh. Thanks, @dennisns7d. I was in too much of a hurry.