Sales Report 2.0 (Version 3.2.0) PHP 7.x
The following changes are required as a minimum. My line numbers are higher than for the original files due to inserted comments for all changes I make.
file: YOUR_ADMIN\includes\classes\sales_report.php
where: at the top of the file approx line 29
file: YOUR_ADMIN\includes\classes\sales_report.phpCode:define('DATE_FORMAT', 'd/m/Y'); // this is used for date() // BMH addition PHP 7
where: at approx lines 266, 270 CHANGE
TOCode:if (count($this->timeframe[$id]['orders']) == 0) { $this->timeframe[$id]['orders'] = false;
file: YOUR_ADMIN\includes\classes\sales_report.phpCode:if (empty($this->timeframe[$id]['products'])) { $this->timeframe[$id]['orders'] = false;
where: at approx line 411 CHANGE
TOCode:if (!in_array($pID, $this->timeframe[$id]['total']['diff_products'])) { $this->timeframe[$id]['total']['diff_products'][] = $pID; }
file: YOUR_ADMIN\includes\classes\sales_report.phpCode:if (!empty($this->timeframe[$id]['orders'][$oID]['diff_products']) ) { if (!in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) { $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID; } }
where: at approx line 417 CHANGE
TOCode:if (!in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) { $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID; }
Perform these changes in a test environment making only one change at a time and review your log files after each test of the report. Add comments to your code.Code:if (!empty($this->timeframe[$id]['orders'][$oID]['diff_products']) ) { if (!in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) { $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID; } }


Reply With Quote

