having a problem(error after adding additional data(need to display comment(using for track number) and commission(to see affiliate orders)) to be displayed in order list(Opencart 2.3) Was trying google, doing same-getting error, trying free modification(adding phone number to list) - getting error in log, getting nothing in order list.
Common task is to display in order list two more data from oc_order db - comment and commission
in admin\controller\sale\order.php was added code for comment and commission
foreach ($results as $result) {
$data['orders'][] = array(
'order_id' => $result['order_id'],
'customer' => $result['customer'],
'order_status' => $result['order_status'] ? $result['order_status'] : $this->language->get('text_missing'),
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])),
'comment' => $result['comment'],
'commission' => $result['commission'],
'shipping_code' => $result['shipping_code'],
'view' => $this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, true),
'edit' => $this->url->link('sale/order/edit', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, true)
);
}
in admin\model\sale\order.php was added code o.comment, o.commission in db request
public function getOrders($data = array()) {
$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS order_status, o.shipping_code, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified, o.comment, o.commission FROM `" . DB_PREFIX . "order` o";
in admin\view\template\sale\order_list.tpl added code
<tbody>
<?php if ($orders) { ?>
<?php foreach ($orders as $order) { ?>
<tr>
<td class="text-center"><?php if (in_array($order['order_id'], $selected)) { ?>
<input type="checkbox" name="selected[]" value="<?php echo $order['order_id']; ?>" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="selected[]" value="<?php echo $order['order_id']; ?>" />
<?php } ?>
<input type="hidden" name="shipping_code[]" value="<?php echo $order['shipping_code']; ?>" /></td>
<td class="text-right"><?php echo $order['order_id']; ?></td>
<td class="text-left"><?php echo $order['customer']; ?></td>
<td class="text-left"><?php echo $order['order_status']; ?></td>
<td class="text-right"><?php echo $order['total']; ?></td>
<td class="text-left"><?php echo $order['date_added']; ?></td>
<td class="text-left"><?php echo $order['date_modified']; ?></td>
<td class="text-left"><?php echo $order['comment']; ?></td>
<td class="text-left"><?php echo $order['commission']; ?></td>
<td class="text-right"><a href="<?php echo $order['view']; ?>" data-toggle="tooltip" title="<?php echo $button_view; ?>" class="btn btn-info"><i class="fa fa-eye"></i></a> <a href="<?php echo $order['edit']; ?>" data-toggle="tooltip" title="<?php echo $button_edit; ?>" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
</tr>
<?php } ?>
<?php } else { ?>
<tr>
<td class="text-center" colspan="8"><?php echo $text_no_results; ?></td>
</tr>
<?php } ?>
</tbody>
after refreshing mod cash even with deleting cash getting same error
Notice: Undefined property: Proxy::getTotalOrdersBySearchExtended in public_html/vqmod/vqcache/vq2-system_storage_modification_admin_controller_sale_order.php on line 28
Have no more ideas what the hell wrong and where, maybe someone have solved similar problem, really need help.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
HTML (English "hyper text markup language" - hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
https://www.w3.org/html/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.