Most of my customers order under a company or club name,
and finding back a company or clubs order history is a massive PITA..
Is there a way to expand the field filters a little bit?
Anyone wanna make a quick tenner?
No OC version posted. However, on the latest release, in your admin/controller/extension/report/sale_order.php file,
find:
add above:
Then, find:
add above:
Then, find:
add above:
Then, find:
add above:
In admin/model/extension/report/sale.php file,
find all instances of:
look at the date_added field below. If it contains: o. at the front, then above the instances of $data['filter_date_end'] from the above code statement, add it like this:
If no o. is found at the front, add it like this:
In admin/language/<your_language_code>/extension/report/sale_order.php file,
add at the bottom:
In your admin/view/template/extension/report/sale_order_info.twig file,
find:
add above:
(You can also place its position the way you like)
Then, find:
add above:
This should do it.
find:
Code: Select all
if (isset($this->request->get['filter_group'])) {
$filter_group = $this->request->get['filter_group'];
} else {
$filter_group = 'week';
}
Code: Select all
if (isset($this->request->get['filter_company'])) {
$filter_company = $this->request->get['filter_company'];
} else {
$filter_company = '';
}
Code: Select all
'filter_group' => $filter_group,
Code: Select all
'filter_company' => $filter_company,
Code: Select all
if (isset($this->request->get['filter_group'])) {
$url .= '&filter_group=' . $this->request->get['filter_group'];
}
Code: Select all
if (isset($this->request->get['filter_company'])) {
$url .= '&filter_company=' . $this->request->get['filter_company'];
}
Code: Select all
$data['filter_group'] = $filter_group;
Code: Select all
$data['filter_company'] = $filter_company;
find all instances of:
Code: Select all
if (!empty($data['filter_date_end'])) {
Code: Select all
if (!empty($data['filter_company'])) {
$sql .= " AND DATE(o.company) <= '" . $this->db->escape((string)$data['filter_company']) . "'";
}
Code: Select all
if (!empty($data['filter_company'])) {
$sql .= " AND DATE(company) <= '" . $this->db->escape((string)$data['filter_company']) . "'";
}
add at the bottom:
Code: Select all
$_['entry_company'] = 'Company';
find:
Code: Select all
<div class="form-group">
<label class="control-label" for="input-group">{{ entry_group }}</label>
Code: Select all
<div class="form-group">
<label class="col-sm-2 control-label" for="input-company">{{ entry_company }</label>
<div class="col-sm-10">
<input type="text" name="filter_company" value="{{ filter_company ? filter_company }}" placeholder="{{ entry_company }}" id="input-company" class="form-control"/>
</div>
</div>
Then, find:
Code: Select all
var filter_group = $('select[name=\'filter_group\']').val();
Code: Select all
var filter_company = $('input[name=\'filter_company\']').val();
if (filter_company) {
url += '&filter_company=' + encodeURIComponent(filter_company);
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
To filter the orders by brand check this extension
https://www.opencart.com/index.php?rout ... n_id=44832
https://www.opencart.com/index.php?rout ... n_id=44832
Opencart Extensions | Professional opencart support | Support Ticket | support@cartbinder.com
Who is online
Users browsing this forum: Semrush [Bot] and 8 guests