Post by aarontay » Mon Jul 24, 2017 11:33 pm

Hi Can anyone help or point me in the right direction. I am trying to add the store name in the order list on OpenCart. Im using Version 2.0.3.1.

Here is my code:

Code: Select all

<modification>
  <id><![CDATA[Show Store Name]]></id>
    <version>1</version>
    <vqmver>2.X</vqmver>
<author>author</author>

<file name="admin/view/template/sale/order_list.tpl">

    <operation>
        <search position="after"><![CDATA[
        <a href="<?php echo $sort_order; ?>"><?php echo $column_order_id; ?></a>
        ]]></search>
        <add><![CDATA[
        <!-- custom -->
                <td class="text-left">
                    <?php echo $text_store_name; ?></a>
                </td>

        <!-- custom -->
        ]]></add>
    </operation>
    <operation>
        <search position="after"><![CDATA[
        <td class="text-right"><?php echo $order['order_id']; ?></td>
        ]]></search>
        <add><![CDATA[
        <td class="text-left"><?php if(!empty($order['column_store'])){echo "CU".$order['column_store'];} else{echo "  ";} ?></td>
        ]]></add>
    </operation>

</file>

</modification>
Thanks in advance

Newbie

Posts

Joined
Wed Oct 05, 2011 10:10 pm

Post by Reptile » Tue Jul 25, 2017 2:26 am

I've got an extension for this:
https://www.opencart.com/index.php?rout ... n_id=25587

It also adds the store name to the dashboard order view.
And you can sort and filter on store.

All my extensions: Click here or Click here


User avatar
Active Member

Posts

Joined
Mon Jan 30, 2012 7:23 pm
Location - The Netherlands

Post by i.am.retailer » Sat Jul 25, 2020 1:48 pm

Language file : admin>>language>>english>>sales>>order.php

Code: Select all

$_['text_store_name']     =  'Store Name';
Model : admin>>model>>sales>>order.php

Within the getOrders() function add filed ‘o.store_name’ on select

Controller : admin>>controller>>sales>>order.php Add store name in order array

Code: Select all

$data['orders'][] = array(
				'order_id'      => $result['order_id'],
                                'column_store'      => $result['store_name'],
				'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'])),
				'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)
			);

And now these column title and the store name will be ready to use in your tpl with the parameter text_store_name for column title and column_store for store name display in order rows. Hoping this would help you

User avatar
New member

Posts

Joined
Thu Jun 04, 2020 2:10 pm
Who is online

Users browsing this forum: Semrush [Bot] and 414 guests