Answer the question
In order to leave comments, you need to log in
Sort by time in opencart?
In the product table, there are two columns departure_time and arrival_time, the type is set to time, it is not possible to sort. It records the time of departure and the time of arrival of the bus.
if the sorting is sorted, but it’s strange ... let’s say the bus leaves at 10:40 there are five such applications, and after five there is a time of 09:30, but this time is at the bottom of
controller/product/category.php
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.departure_time';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC';
}
$data['sorts'][] = array(
'text' => $this->language->get('text_departure_time'),
'value' => 'p.departure_time-ASC',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=departure_time&order=ASC' . $url)
);
Answer the question
In order to leave comments, you need to log in
Describe in a little more detail what happens, and I will help, I just don’t quite understand what exactly you get after what is displayed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question