PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 16, 2022

[FIXED] How to add column to OpenCart customer list?

 October 16, 2022     opencart     No comments   

Issue

I use OpenCart 1.5.6.4 and 2.3

In admin panel and in customer list there is no column for Customer Id

between this place:
between this place


Solution

For Opencart 2: You need to edit this file:

admin/view/template/customer/customer_list.tpl

1) Find:

<td class="text-left"><?php if ($sort == 'name') { ?>

Add before it:

<td class="text-left">Customer ID</td>

2) Find:

<td class="text-left"><?php echo $customer['name']; ?></td>

Add before it:

<td class="text-left"><?php echo $customer['customer_id']; ?></td>

For Opencart 1: This file:

admin/view/template/sale/customer_list.tpl

1) Find:

<td class="left"><?php if ($sort == 'name') { ?>

Add before it:

<td class="left">Customer ID</td>

2) Find:

<td class="left"><?php echo $customer['name']; ?></td>

Add before it:

<td class="left"><?php echo $customer['customer_id']; ?></td>

For sort customers by their id for Opencart 2 in step 1 add this code:

<td class="text-left">
    <?php if ($sort == 'customer_id') { ?>
        <a href="<?php echo $sort_customer_id; ?>" class="<?php echo strtolower($order); ?>">Customer ID</a>
    <?php } else { ?>
        <a href="<?php echo $sort_customer_id; ?>">Customer ID</a>
    <?php } ?>
</td>

instead of:

<td class="text-left">Customer ID</td>

Then open this file:

admin/controller/customer/customer.php

Find:

$data['sort_name'] = $this->url->link('customer/customer', 'token=' . $this->session->data['token'] . '&sort=name' . $url, true);

Add before it:

$data['sort_customer_id'] = $this->url->link('customer/customer', 'token=' . $this->session->data['token'] . '&sort=customer_id' . $url, true);


Answered By - DigitCart
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing